@bryanhu/codexly 0.11.1 → 0.12.0

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 (302) hide show
  1. package/CHANGELOG.md +34 -1
  2. package/README.md +5 -3
  3. package/README.zh-CN.md +4 -2
  4. package/dist/{chunk-HHEP4NNE.js → chunk-7C6JMXNO.js} +16870 -3650
  5. package/dist/{chunk-YMFGL4ZR.js → chunk-LZVKMW5Y.js} +422 -130
  6. package/dist/{chunk-GUHYAMAQ.js → chunk-PBPNBQQH.js} +1 -1
  7. package/dist/{chunk-2NJ4CTQP.js → chunk-RGRRUTMD.js} +974 -756
  8. package/dist/cli.js +7 -5
  9. package/dist/client/index.js +113 -4
  10. package/dist/protocol/index.js +1 -1
  11. package/dist/providers/codex/index.js +2 -2
  12. package/dist/server/index.js +4 -4
  13. package/dist/sqlite-state-worker.js +66 -0
  14. package/dist/web/.vite/manifest.json +392 -280
  15. package/dist/web/.vite/manifest.json.br +0 -0
  16. package/dist/web/.vite/manifest.json.gz +0 -0
  17. package/dist/web/assets/button-group-C4BuwxSd.js +1 -0
  18. package/dist/web/assets/button-group-C4BuwxSd.js.br +0 -0
  19. package/dist/web/assets/button-group-C4BuwxSd.js.gz +0 -0
  20. package/dist/web/assets/{chunk-BO2N2NFS-ng4dbem1.js → chunk-BO2N2NFS-CiutqNGv.js} +7 -7
  21. package/dist/web/assets/chunk-BO2N2NFS-CiutqNGv.js.br +0 -0
  22. package/dist/web/assets/chunk-BO2N2NFS-CiutqNGv.js.gz +0 -0
  23. package/dist/web/assets/{code-highlighter-BMwFeSBd.js → code-highlighter-Bp23lvQ1.js} +1 -1
  24. package/dist/web/assets/code-highlighter-Bp23lvQ1.js.br +0 -0
  25. package/dist/web/assets/code-highlighter-Bp23lvQ1.js.gz +0 -0
  26. package/dist/web/assets/code-languages-DVcuYjhn.js +2 -0
  27. package/dist/web/assets/code-languages-DVcuYjhn.js.br +0 -0
  28. package/dist/web/assets/code-languages-DVcuYjhn.js.gz +0 -0
  29. package/dist/web/assets/context-menu-DBdIkdO8.js +1 -0
  30. package/dist/web/assets/context-menu-DBdIkdO8.js.br +0 -0
  31. package/dist/web/assets/context-menu-DBdIkdO8.js.gz +0 -0
  32. package/dist/web/assets/dist-B5i0uBCy.js +1 -0
  33. package/dist/web/assets/dist-B5i0uBCy.js.br +0 -0
  34. package/dist/web/assets/dist-B5i0uBCy.js.gz +0 -0
  35. package/dist/web/assets/download-iHkzQYEd.js +1 -0
  36. package/dist/web/assets/download-iHkzQYEd.js.br +0 -0
  37. package/dist/web/assets/download-iHkzQYEd.js.gz +0 -0
  38. package/dist/web/assets/{engine-compile-Bqjaa_8Z.js → engine-compile-DcaAFSGO.js} +1 -1
  39. package/dist/web/assets/engine-compile-DcaAFSGO.js.br +0 -0
  40. package/dist/web/assets/engine-compile-DcaAFSGO.js.gz +0 -0
  41. package/dist/web/assets/external-link-xbPJFZkP.js +1 -0
  42. package/dist/web/assets/external-link-xbPJFZkP.js.br +0 -0
  43. package/dist/web/assets/external-link-xbPJFZkP.js.gz +0 -0
  44. package/dist/web/assets/file-code-corner-CYF-BidF.js +1 -0
  45. package/dist/web/assets/file-code-corner-CYF-BidF.js.br +0 -0
  46. package/dist/web/assets/file-code-corner-CYF-BidF.js.gz +0 -0
  47. package/dist/web/assets/file-navigation-view-preference-BRWa_l_a.js +1 -0
  48. package/dist/web/assets/file-navigation-view-preference-BRWa_l_a.js.br +0 -0
  49. package/dist/web/assets/file-navigation-view-preference-BRWa_l_a.js.gz +0 -0
  50. package/dist/web/assets/file-pen-line-B05lVjWh.js +1 -0
  51. package/dist/web/assets/file-pen-line-B05lVjWh.js.br +0 -0
  52. package/dist/web/assets/file-pen-line-B05lVjWh.js.gz +0 -0
  53. package/dist/web/assets/file-review-dialog-CfW8qcnH.js +2 -0
  54. package/dist/web/assets/file-review-dialog-CfW8qcnH.js.br +0 -0
  55. package/dist/web/assets/file-review-dialog-CfW8qcnH.js.gz +0 -0
  56. package/dist/web/assets/git-commit-horizontal-CV-KjCHw.js +1 -0
  57. package/dist/web/assets/git-commit-horizontal-CV-KjCHw.js.br +0 -0
  58. package/dist/web/assets/git-commit-horizontal-CV-KjCHw.js.gz +0 -0
  59. package/dist/web/assets/git-history-panel-DDCwLZ_v.js +2 -0
  60. package/dist/web/assets/git-history-panel-DDCwLZ_v.js.br +0 -0
  61. package/dist/web/assets/git-history-panel-DDCwLZ_v.js.gz +0 -0
  62. package/dist/web/assets/global-settings-dialog-Cw-2IvEc.js +1 -0
  63. package/dist/web/assets/global-settings-dialog-Cw-2IvEc.js.br +0 -0
  64. package/dist/web/assets/global-settings-dialog-Cw-2IvEc.js.gz +0 -0
  65. package/dist/web/assets/{highlighted-body-OFNGDK62-UIjGvJpu.js → highlighted-body-OFNGDK62-jfqTT7Zz.js} +1 -1
  66. package/dist/web/assets/highlighted-body-OFNGDK62-jfqTT7Zz.js.br +0 -0
  67. package/dist/web/assets/highlighted-body-OFNGDK62-jfqTT7Zz.js.gz +0 -0
  68. package/dist/web/assets/index-DZEhkOZz.js +4 -0
  69. package/dist/web/assets/index-DZEhkOZz.js.br +0 -0
  70. package/dist/web/assets/index-DZEhkOZz.js.gz +0 -0
  71. package/dist/web/assets/index-mb9dY6_F.css +2 -0
  72. package/dist/web/assets/index-mb9dY6_F.css.br +0 -0
  73. package/dist/web/assets/index-mb9dY6_F.css.gz +0 -0
  74. package/dist/web/assets/initial-deps-BsEyuMB0.js +1 -0
  75. package/dist/web/assets/initial-deps-BsEyuMB0.js.br +0 -0
  76. package/dist/web/assets/initial-deps-BsEyuMB0.js.gz +0 -0
  77. package/dist/web/assets/initial-deps-Bx4af_YG.js +1 -0
  78. package/dist/web/assets/initial-deps-Bx4af_YG.js.br +0 -0
  79. package/dist/web/assets/initial-deps-Bx4af_YG.js.gz +0 -0
  80. package/dist/web/assets/initial-deps-CNK9MBOP.js +1 -0
  81. package/dist/web/assets/initial-deps-CNK9MBOP.js.br +0 -0
  82. package/dist/web/assets/initial-deps-CNK9MBOP.js.gz +0 -0
  83. package/dist/web/assets/initial-deps-CTprc_pY.js +1 -0
  84. package/dist/web/assets/initial-deps-CTprc_pY.js.br +0 -0
  85. package/dist/web/assets/initial-deps-CTprc_pY.js.gz +0 -0
  86. package/dist/web/assets/initial-deps-Ccn2HMTB.js +1 -0
  87. package/dist/web/assets/initial-deps-Ccn2HMTB.js.br +0 -0
  88. package/dist/web/assets/initial-deps-Ccn2HMTB.js.gz +0 -0
  89. package/dist/web/assets/initial-deps-Cq4pSOi-.js +1 -0
  90. package/dist/web/assets/initial-deps-Cq4pSOi-.js.br +0 -0
  91. package/dist/web/assets/initial-deps-Cq4pSOi-.js.gz +0 -0
  92. package/dist/web/assets/initial-deps-D1tR2tqv.js +1 -0
  93. package/dist/web/assets/initial-deps-D1tR2tqv.js.br +0 -0
  94. package/dist/web/assets/initial-deps-D1tR2tqv.js.gz +0 -0
  95. package/dist/web/assets/initial-deps-DqJTHr9A.js +41 -0
  96. package/dist/web/assets/initial-deps-DqJTHr9A.js.br +0 -0
  97. package/dist/web/assets/initial-deps-DqJTHr9A.js.gz +0 -0
  98. package/dist/web/assets/lazy-message-response-SxI8Oz6v.js +2 -0
  99. package/dist/web/assets/lazy-message-response-SxI8Oz6v.js.br +0 -0
  100. package/dist/web/assets/lazy-message-response-SxI8Oz6v.js.gz +0 -0
  101. package/dist/web/assets/{lib-DrPFkMXk.js → lib-DE0ZEvGM.js} +1 -1
  102. package/dist/web/assets/lib-DE0ZEvGM.js.br +0 -0
  103. package/dist/web/assets/lib-DE0ZEvGM.js.gz +0 -0
  104. package/dist/web/assets/mermaid-GHXKKRXX-BNLLThfI.js +1 -0
  105. package/dist/web/assets/mermaid-GHXKKRXX-BNLLThfI.js.br +0 -0
  106. package/dist/web/assets/mermaid-GHXKKRXX-BNLLThfI.js.gz +0 -0
  107. package/dist/web/assets/message-response-CTSQq8Ae.js +7 -0
  108. package/dist/web/assets/message-response-CTSQq8Ae.js.br +0 -0
  109. package/dist/web/assets/message-response-CTSQq8Ae.js.gz +0 -0
  110. package/dist/web/assets/{patch-diff-viewer-BnoOysqK.js → patch-diff-viewer-CwDRm5oN.js} +3 -3
  111. package/dist/web/assets/patch-diff-viewer-CwDRm5oN.js.br +0 -0
  112. package/dist/web/assets/patch-diff-viewer-CwDRm5oN.js.gz +0 -0
  113. package/dist/web/assets/{project-file-popup-page-C5dOvxw_.js → project-file-popup-page-DX-AlvxF.js} +1 -1
  114. package/dist/web/assets/project-file-popup-page-DX-AlvxF.js.br +0 -0
  115. package/dist/web/assets/project-file-popup-page-DX-AlvxF.js.gz +0 -0
  116. package/dist/web/assets/project-source-panel-i4xpffAa.js +3 -0
  117. package/dist/web/assets/project-source-panel-i4xpffAa.js.br +0 -0
  118. package/dist/web/assets/project-source-panel-i4xpffAa.js.gz +0 -0
  119. package/dist/web/assets/prompt-input-CL1AA6_U.js +1 -0
  120. package/dist/web/assets/prompt-input-CL1AA6_U.js.br +0 -0
  121. package/dist/web/assets/prompt-input-CL1AA6_U.js.gz +0 -0
  122. package/dist/web/assets/prompt-input-controls-Qsp2rk3i.js +1 -0
  123. package/dist/web/assets/prompt-input-controls-Qsp2rk3i.js.br +0 -0
  124. package/dist/web/assets/prompt-input-controls-Qsp2rk3i.js.gz +0 -0
  125. package/dist/web/assets/prompt-reference-token-Cxx6C-IR.js +1 -0
  126. package/dist/web/assets/prompt-reference-token-Cxx6C-IR.js.br +0 -0
  127. package/dist/web/assets/prompt-reference-token-Cxx6C-IR.js.gz +0 -0
  128. package/dist/web/assets/{react-runtime-CVaUQXZF.js → react-runtime-DaCTDC27.js} +1 -1
  129. package/dist/web/assets/react-runtime-DaCTDC27.js.br +0 -0
  130. package/dist/web/assets/react-runtime-DaCTDC27.js.gz +0 -0
  131. package/dist/web/assets/rolldown-runtime-CNC7AqOf.js +1 -0
  132. package/dist/web/assets/rolldown-runtime-CNC7AqOf.js.br +0 -0
  133. package/dist/web/assets/rolldown-runtime-CNC7AqOf.js.gz +0 -0
  134. package/dist/web/assets/scheduled-task-date-time-picker-B2_XJQa7.js +1 -0
  135. package/dist/web/assets/scheduled-task-date-time-picker-B2_XJQa7.js.br +0 -0
  136. package/dist/web/assets/scheduled-task-date-time-picker-B2_XJQa7.js.gz +0 -0
  137. package/dist/web/assets/scheduled-task-date-time-picker-Wk3Ob2xl.css +1 -0
  138. package/dist/web/assets/scheduled-task-date-time-picker-Wk3Ob2xl.css.br +0 -0
  139. package/dist/web/assets/scheduled-task-date-time-picker-Wk3Ob2xl.css.gz +0 -0
  140. package/dist/web/assets/scheduled-task-floating-ui~index~workbench-shell~skills-market-container~workbench-inspecto~y5cwo2qi-DAfditVv.js +1 -0
  141. package/dist/web/assets/scheduled-task-floating-ui~index~workbench-shell~skills-market-container~workbench-inspecto~y5cwo2qi-DAfditVv.js.br +0 -0
  142. package/dist/web/assets/scheduled-task-floating-ui~index~workbench-shell~skills-market-container~workbench-inspecto~y5cwo2qi-DAfditVv.js.gz +0 -0
  143. package/dist/web/assets/scheduled-task-floating-ui~scheduled-task-date-time-picker-BQ-Lfxrf.js +1 -0
  144. package/dist/web/assets/scheduled-task-floating-ui~scheduled-task-date-time-picker-BQ-Lfxrf.js.br +0 -0
  145. package/dist/web/assets/scheduled-task-floating-ui~scheduled-task-date-time-picker-BQ-Lfxrf.js.gz +0 -0
  146. package/dist/web/assets/scheduled-task-schedule-DVyf2brf.js +1 -0
  147. package/dist/web/assets/scheduled-task-schedule-DVyf2brf.js.br +0 -0
  148. package/dist/web/assets/scheduled-task-schedule-DVyf2brf.js.gz +0 -0
  149. package/dist/web/assets/scheduled-tasks-container-DWk8eU-x.js +2 -0
  150. package/dist/web/assets/scheduled-tasks-container-DWk8eU-x.js.br +0 -0
  151. package/dist/web/assets/scheduled-tasks-container-DWk8eU-x.js.gz +0 -0
  152. package/dist/web/assets/scheduled-tasks-container-xtJWjMjU.css +1 -0
  153. package/dist/web/assets/scheduled-tasks-container-xtJWjMjU.css.br +0 -0
  154. package/dist/web/assets/scheduled-tasks-container-xtJWjMjU.css.gz +0 -0
  155. package/dist/web/assets/{shiki-bundle-CGkIRfLa.js → shiki-bundle-DdeD2OLK.js} +1 -1
  156. package/dist/web/assets/shiki-bundle-DdeD2OLK.js.br +0 -0
  157. package/dist/web/assets/shiki-bundle-DdeD2OLK.js.gz +0 -0
  158. package/dist/web/assets/skills-market-container-C9djEXQt.css +1 -0
  159. package/dist/web/assets/skills-market-container-C9djEXQt.css.br +0 -0
  160. package/dist/web/assets/skills-market-container-C9djEXQt.css.gz +0 -0
  161. package/dist/web/assets/skills-market-container-DGLB9mLM.js +1 -0
  162. package/dist/web/assets/skills-market-container-DGLB9mLM.js.br +0 -0
  163. package/dist/web/assets/skills-market-container-DGLB9mLM.js.gz +0 -0
  164. package/dist/web/assets/sparkles-BLY9rqMO.js +1 -0
  165. package/dist/web/assets/sparkles-BLY9rqMO.js.br +0 -0
  166. package/dist/web/assets/sparkles-BLY9rqMO.js.gz +0 -0
  167. package/dist/web/assets/upload-D_8Uk8f-.js +1 -0
  168. package/dist/web/assets/upload-D_8Uk8f-.js.br +0 -0
  169. package/dist/web/assets/upload-D_8Uk8f-.js.gz +0 -0
  170. package/dist/web/assets/workbench-composer-BD9Ki4HB.js +10 -0
  171. package/dist/web/assets/workbench-composer-BD9Ki4HB.js.br +0 -0
  172. package/dist/web/assets/workbench-composer-BD9Ki4HB.js.gz +0 -0
  173. package/dist/web/assets/workbench-inspector-changes-DAh6jOqk.js +2 -0
  174. package/dist/web/assets/workbench-inspector-changes-DAh6jOqk.js.br +0 -0
  175. package/dist/web/assets/workbench-inspector-changes-DAh6jOqk.js.gz +0 -0
  176. package/dist/web/assets/workbench-pet-canvas-BDehkHlv.js +1 -0
  177. package/dist/web/assets/workbench-pet-canvas-BDehkHlv.js.br +0 -0
  178. package/dist/web/assets/workbench-pet-canvas-BDehkHlv.js.gz +0 -0
  179. package/dist/web/assets/workbench-shell-3eEtoMzo.js +8 -0
  180. package/dist/web/assets/workbench-shell-3eEtoMzo.js.br +0 -0
  181. package/dist/web/assets/workbench-shell-3eEtoMzo.js.gz +0 -0
  182. package/dist/web/index.html +13 -15
  183. package/dist/web/index.html.br +0 -0
  184. package/dist/web/index.html.gz +0 -0
  185. package/package.json +2 -2
  186. package/dist/web/assets/bundle-mjs-rHxsej31.js +0 -1
  187. package/dist/web/assets/bundle-mjs-rHxsej31.js.br +0 -0
  188. package/dist/web/assets/bundle-mjs-rHxsej31.js.gz +0 -0
  189. package/dist/web/assets/button-group-Bt_Rr9-f.js +0 -1
  190. package/dist/web/assets/button-group-Bt_Rr9-f.js.br +0 -0
  191. package/dist/web/assets/button-group-Bt_Rr9-f.js.gz +0 -0
  192. package/dist/web/assets/check-C92ZHwwX.js +0 -1
  193. package/dist/web/assets/check-C92ZHwwX.js.br +0 -0
  194. package/dist/web/assets/check-C92ZHwwX.js.gz +0 -0
  195. package/dist/web/assets/checkbox-BBHD70U-.js +0 -1
  196. package/dist/web/assets/checkbox-BBHD70U-.js.br +0 -0
  197. package/dist/web/assets/checkbox-BBHD70U-.js.gz +0 -0
  198. package/dist/web/assets/chunk-BO2N2NFS-ng4dbem1.js.br +0 -0
  199. package/dist/web/assets/chunk-BO2N2NFS-ng4dbem1.js.gz +0 -0
  200. package/dist/web/assets/code-highlighter-BMwFeSBd.js.br +0 -0
  201. package/dist/web/assets/code-highlighter-BMwFeSBd.js.gz +0 -0
  202. package/dist/web/assets/code-languages-rKSHZYzu.js +0 -2
  203. package/dist/web/assets/code-languages-rKSHZYzu.js.br +0 -0
  204. package/dist/web/assets/code-languages-rKSHZYzu.js.gz +0 -0
  205. package/dist/web/assets/context-menu-03SuSeWI.js +0 -1
  206. package/dist/web/assets/context-menu-03SuSeWI.js.br +0 -0
  207. package/dist/web/assets/context-menu-03SuSeWI.js.gz +0 -0
  208. package/dist/web/assets/dist-B_DB3jSu.js +0 -1
  209. package/dist/web/assets/dist-B_DB3jSu.js.br +0 -0
  210. package/dist/web/assets/dist-B_DB3jSu.js.gz +0 -0
  211. package/dist/web/assets/dist-DBbCRukl.js +0 -1
  212. package/dist/web/assets/dist-DBbCRukl.js.br +0 -0
  213. package/dist/web/assets/dist-DBbCRukl.js.gz +0 -0
  214. package/dist/web/assets/engine-compile-Bqjaa_8Z.js.br +0 -0
  215. package/dist/web/assets/engine-compile-Bqjaa_8Z.js.gz +0 -0
  216. package/dist/web/assets/es2015-BUwabepB.js +0 -41
  217. package/dist/web/assets/es2015-BUwabepB.js.br +0 -0
  218. package/dist/web/assets/es2015-BUwabepB.js.gz +0 -0
  219. package/dist/web/assets/file-code-corner-CJDhFrYy.js +0 -1
  220. package/dist/web/assets/file-code-corner-CJDhFrYy.js.br +0 -3
  221. package/dist/web/assets/file-code-corner-CJDhFrYy.js.gz +0 -0
  222. package/dist/web/assets/file-navigation-view-preference-DeIXQ8c4.js +0 -1
  223. package/dist/web/assets/file-navigation-view-preference-DeIXQ8c4.js.br +0 -0
  224. package/dist/web/assets/file-navigation-view-preference-DeIXQ8c4.js.gz +0 -0
  225. package/dist/web/assets/file-review-dialog-L7snJJP8.js +0 -2
  226. package/dist/web/assets/file-review-dialog-L7snJJP8.js.br +0 -0
  227. package/dist/web/assets/file-review-dialog-L7snJJP8.js.gz +0 -0
  228. package/dist/web/assets/file-tree-DvTv0Re2.js +0 -1
  229. package/dist/web/assets/file-tree-DvTv0Re2.js.br +0 -0
  230. package/dist/web/assets/file-tree-DvTv0Re2.js.gz +0 -0
  231. package/dist/web/assets/git-commit-horizontal-hgIO8zJZ.js +0 -1
  232. package/dist/web/assets/git-commit-horizontal-hgIO8zJZ.js.br +0 -0
  233. package/dist/web/assets/git-commit-horizontal-hgIO8zJZ.js.gz +0 -0
  234. package/dist/web/assets/git-history-panel-DZY20FzY.js +0 -2
  235. package/dist/web/assets/git-history-panel-DZY20FzY.js.br +0 -0
  236. package/dist/web/assets/git-history-panel-DZY20FzY.js.gz +0 -0
  237. package/dist/web/assets/global-settings-dialog-cA1SWDdi.js +0 -1
  238. package/dist/web/assets/global-settings-dialog-cA1SWDdi.js.br +0 -0
  239. package/dist/web/assets/global-settings-dialog-cA1SWDdi.js.gz +0 -0
  240. package/dist/web/assets/highlighted-body-OFNGDK62-UIjGvJpu.js.br +0 -0
  241. package/dist/web/assets/highlighted-body-OFNGDK62-UIjGvJpu.js.gz +0 -0
  242. package/dist/web/assets/index-CldcNq0q.css +0 -2
  243. package/dist/web/assets/index-CldcNq0q.css.br +0 -0
  244. package/dist/web/assets/index-CldcNq0q.css.gz +0 -0
  245. package/dist/web/assets/index-WZ8-8oYp.js +0 -4
  246. package/dist/web/assets/index-WZ8-8oYp.js.br +0 -0
  247. package/dist/web/assets/index-WZ8-8oYp.js.gz +0 -0
  248. package/dist/web/assets/lazy-message-response-SjU6ZsaR.js +0 -2
  249. package/dist/web/assets/lazy-message-response-SjU6ZsaR.js.br +0 -0
  250. package/dist/web/assets/lazy-message-response-SjU6ZsaR.js.gz +0 -0
  251. package/dist/web/assets/lib-DrPFkMXk.js.br +0 -0
  252. package/dist/web/assets/lib-DrPFkMXk.js.gz +0 -0
  253. package/dist/web/assets/loader-circle-CJOhkEC8.js +0 -1
  254. package/dist/web/assets/loader-circle-CJOhkEC8.js.br +0 -0
  255. package/dist/web/assets/loader-circle-CJOhkEC8.js.gz +0 -0
  256. package/dist/web/assets/mermaid-GHXKKRXX-CDYc39nv.js +0 -1
  257. package/dist/web/assets/mermaid-GHXKKRXX-CDYc39nv.js.br +0 -0
  258. package/dist/web/assets/mermaid-GHXKKRXX-CDYc39nv.js.gz +0 -0
  259. package/dist/web/assets/message-response-BXln58hx.js +0 -7
  260. package/dist/web/assets/message-response-BXln58hx.js.br +0 -0
  261. package/dist/web/assets/message-response-BXln58hx.js.gz +0 -0
  262. package/dist/web/assets/patch-diff-viewer-BnoOysqK.js.br +0 -0
  263. package/dist/web/assets/patch-diff-viewer-BnoOysqK.js.gz +0 -0
  264. package/dist/web/assets/project-file-popup-page-C5dOvxw_.js.br +0 -0
  265. package/dist/web/assets/project-file-popup-page-C5dOvxw_.js.gz +0 -0
  266. package/dist/web/assets/project-source-panel-CDrU5_qN.js +0 -3
  267. package/dist/web/assets/project-source-panel-CDrU5_qN.js.br +0 -0
  268. package/dist/web/assets/project-source-panel-CDrU5_qN.js.gz +0 -0
  269. package/dist/web/assets/prompt-input-controls-C_Zm2pL8.js +0 -1
  270. package/dist/web/assets/prompt-input-controls-C_Zm2pL8.js.br +0 -0
  271. package/dist/web/assets/prompt-input-controls-C_Zm2pL8.js.gz +0 -0
  272. package/dist/web/assets/prompt-reference-token-XDhhAENk.js +0 -1
  273. package/dist/web/assets/prompt-reference-token-XDhhAENk.js.br +0 -0
  274. package/dist/web/assets/prompt-reference-token-XDhhAENk.js.gz +0 -0
  275. package/dist/web/assets/provider-connection-queries-BBs1XjP6.js +0 -1
  276. package/dist/web/assets/provider-connection-queries-BBs1XjP6.js.br +0 -0
  277. package/dist/web/assets/provider-connection-queries-BBs1XjP6.js.gz +0 -0
  278. package/dist/web/assets/react-runtime-CVaUQXZF.js.br +0 -0
  279. package/dist/web/assets/react-runtime-CVaUQXZF.js.gz +0 -0
  280. package/dist/web/assets/rolldown-runtime-QTnfLwEv.js +0 -1
  281. package/dist/web/assets/rolldown-runtime-QTnfLwEv.js.br +0 -0
  282. package/dist/web/assets/rolldown-runtime-QTnfLwEv.js.gz +0 -0
  283. package/dist/web/assets/shiki-bundle-CGkIRfLa.js.br +0 -0
  284. package/dist/web/assets/shiki-bundle-CGkIRfLa.js.gz +0 -0
  285. package/dist/web/assets/tooltip-BPVbHVEF.js +0 -1
  286. package/dist/web/assets/tooltip-BPVbHVEF.js.br +0 -0
  287. package/dist/web/assets/tooltip-BPVbHVEF.js.gz +0 -0
  288. package/dist/web/assets/upload-Bz26q2Ar.js +0 -1
  289. package/dist/web/assets/upload-Bz26q2Ar.js.br +0 -0
  290. package/dist/web/assets/upload-Bz26q2Ar.js.gz +0 -0
  291. package/dist/web/assets/useInfiniteQuery-DJg78OO5.js +0 -1
  292. package/dist/web/assets/useInfiniteQuery-DJg78OO5.js.br +0 -0
  293. package/dist/web/assets/useInfiniteQuery-DJg78OO5.js.gz +0 -0
  294. package/dist/web/assets/workbench-inspector-changes-B4eOJNJh.js +0 -2
  295. package/dist/web/assets/workbench-inspector-changes-B4eOJNJh.js.br +0 -0
  296. package/dist/web/assets/workbench-inspector-changes-B4eOJNJh.js.gz +0 -0
  297. package/dist/web/assets/workbench-pet-canvas-C_XAi7ez.js +0 -1
  298. package/dist/web/assets/workbench-pet-canvas-C_XAi7ez.js.br +0 -0
  299. package/dist/web/assets/workbench-pet-canvas-C_XAi7ez.js.gz +0 -0
  300. package/dist/web/assets/workbench-shell-DQbj_ooS.js +0 -15
  301. package/dist/web/assets/workbench-shell-DQbj_ooS.js.br +0 -0
  302. package/dist/web/assets/workbench-shell-DQbj_ooS.js.gz +0 -0
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,r as n,t as r}from"./react-runtime-DaCTDC27.js";import{a as i,o as a}from"./initial-deps-CNK9MBOP.js";import{n as o,t as s}from"./initial-deps-Cq4pSOi-.js";import{u as c}from"./initial-deps-BsEyuMB0.js";var l=e(t(),1),u=typeof window<`u`?l.useLayoutEffect:l.useEffect;function d(e){let t=l.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function f(e,t,n={},r={}){l.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function p(e){let t=l.useRef(null);return l.useImperativeHandle(e,()=>t.current,[]),t}function m(e){return e[e.length-1]}function h(e){return typeof e==`function`}function g(e,t){return h(e)?e(t):e}var _=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;function y(e){for(let t in e)if(_.call(e,t))return!0;return!1}var b=()=>Object.create(null),x=(e,t)=>S(e,t,b);function S(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=E(e)&&E(i);if(!a&&!(w(e)&&w(i)))return i;let o=a?e:C(e);if(!o)return i;let s=a?i:C(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:_.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=S(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function C(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!v.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!v.call(e,t))return!1;r.push(t)}return r}function w(e){if(!T(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!T(n)||!n.hasOwnProperty(`isPrototypeOf`))}function T(e){return Object.prototype.toString.call(e)===`[object Object]`}function E(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function D(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!D(e[r],t[r],n))return!1;return!0}if(w(e)&&w(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!D(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!D(e[o],t[o],n)))return!1;return i===a}return!1}function O(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function k(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}var ee=/[\x00-\x1f\x7f"<>`{}]/g;function te(e){return e.replace(ee,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ne(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return te(t)}var re=[`http:`,`https:`,`mailto:`,`tel:`];function ie(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ae(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ne(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ne(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function oe(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function se(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function A(){throw Error(`Invariant failed`)}function ce(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var j=4,le=5;function ue(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function de(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ue(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function M(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=de(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=F(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=F(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=fe(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=fe(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=fe(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=F(n.fullPath??n.from);e.kind=le,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=F(n.fullPath??n.from);e.kind=j,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)M(e,t,r,s,i,a,o)}function N(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function P(e){if(e.pathless)for(let t of e.pathless)P(t);if(e.static)for(let t of e.static.values())P(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())P(t);if(e.dynamic?.length){e.dynamic.sort(N);for(let t of e.dynamic)P(t)}if(e.optional?.length){e.optional.sort(N);for(let t of e.optional)P(t)}if(e.wildcard?.length){e.wildcard.sort(N);for(let t of e.wildcard)P(t)}}function F(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function fe(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function pe(e,t){let n=F(`/`),r=new Uint16Array(6);for(let t of e)M(!1,r,t,1,n,0);P(n),t.masksTree=n,t.flatCache=ce(1e3)}function me(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=ye(e,t.masksTree);return t.flatCache.set(e,r),r}function he(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=F(`/`),M(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),ye(r,o,n)}function ge(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=ye(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=xe(a.route)),t.matchCache.set(r,a),a}function _e(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function ve(e,t=!1,n){let r=F(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return M(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&A(),a[e.id]=e,s!==0&&e.path){let t=_e(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),P(r),{processedTree:{segmentTree:r,singleCache:ce(1e3),matchCache:ce(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function ye(e,t,n=!1){let r=e.split(`/`),i=Ce(e,r,t,n);if(!i)return null;let[a]=be(e,r,i);return{route:i.node.route,rawParams:a}}function be(e,t,n){let r=Se(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===j)break;if(u.kind===le){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function xe(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Se(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ce(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!m(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!Te(l,n))continue;if(i.parse){if(!L(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==j&&Te(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===j||i.kind===2)&&Te(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(L(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&we(p,o))return n;Te(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+I(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+I(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+I(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+I(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function I(e,t){return 2**(e-t-1)}function we(e,t){return e===2**(t-1)-1}function L(e,t,n){let r,i;try{[r,i]=be(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Te(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===j)>(e.node.kind===j)||t.node.kind===j==(e.node.kind===j)&&t.depth>e.depth)))}function Ee(e){return De(e.filter(e=>e!==void 0).join(`/`))}function De(e){return e.replace(/\/{2,}/g,`/`)}function Oe(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function R(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function ke(e){return R(Oe(e))}function Ae(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function je(e,t,n){return Ae(e,n)===Ae(t,n)}function Me({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&m(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(m(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=De(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Ne(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Pe(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ie(e,n)).join(`/`):Ie(r,n):r}function Fe({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=de(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Pe(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Pe(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Pe(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ie(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function z(e){return e?.isNotFound===!0}function Le(){try{return sessionStorage}catch{return}}var Re=`tsr-scroll-restoration-v1_3`,ze=Le();function Be(){try{return JSON.parse(ze?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ve(){try{ze?.setItem(Re,JSON.stringify(He))}catch{}}var He=Be(),Ue=`data-scroll-restoration-id`,We=e=>e.state.__TSR_key||e.href;function Ge(e){let t=e.getAttribute(Ue);if(t)return`[${Ue}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Ke=!1,qe=`window`;function Je(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ye(e){let t=new Set;for(let n of e){if(n===qe)continue;let e=Je(n);e&&t.add(e)}return t}function Xe(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||We,a=new Set,o=e=>{let t=He[e]||={};for(let e of a)e===document?t[qe]={scrollX,scrollY}:e.isConnected&&(t[Ge(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Ke=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Ke||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Ve()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=He[d];if(e){let t=He[u];for(let n in e){if(n===qe){if(s)continue}else{let e=Je(n);if(!e||s&&o&&(l??=Ye(o),l.has(e)))continue}t||=He[u]={},t[n]??=e[n]}}}Ke=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Ye(o));let t=e&&i&&c,s=r.restoring?He[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===qe){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Je(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Ke=!1}}))}function Ze(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Qe(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function $e(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Qe(r):Array.isArray(t)?t.push(Qe(r)):n[e]=[t,Qe(r)]}return n}var et=nt(JSON.parse),tt=rt(JSON.stringify,JSON.parse);function nt(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=$e(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function rt(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Ze(e,r);return t?`?${t}`:``}}var it=`__root__`;function at(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function B(e){return e instanceof Response&&!!e.options}function ot(e){return{input:({url:t})=>{for(let n of e)t=ct(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=lt(e[n],t);return t}}}function st(e){let t=ke(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ee([`/`,t,e.pathname]),e)}}function ct(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function lt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ut(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>dt(o,_.get())),x=r(()=>dt(s,v.get())),S=r(()=>dt(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=ce(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:ee,setPending:te,setCached:ne};ee(e.matches),a?.(k);function ee(e){ft(e,o,_,n,i)}function te(e){ft(e,s,v,n,i)}function ne(e){ft(e,c,y,n,i)}return k}function dt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function ft(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}se(n.get(),a)||n.set(a)})}var pt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},mt=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),ht=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),V=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},gt=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},H=(e,t,n)=>{if(!(!B(n)&&!z(n)))throw B(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:B(n)?`redirected`:z(n)?`notFound`:r.status===`pending`?`success`:r.status,context:V(e,t.index),isFetching:!1,error:n})),z(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),B(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},_t=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},vt=(e,t,n)=>{let r=V(e,n);e.updateMatch(t,e=>({...e,context:r}))},yt=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,H(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,H(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!B(n)&&!z(n)&&(e.serialError??=n)},bt=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!ht(e,t)&&(n.options.loader||n.options.beforeLoad||jt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{pt(e)},i);r._nonReactive.pendingTimeout=t}},xt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;bt(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&H(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},St=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=O(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&yt(e,n,o),s&&yt(e,n,s),bt(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=O();let f={...V(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=ht(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(B(r)||z(r))&&(u(),yt(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),k(y))return u(),y.catch(t=>{yt(e,n,t)}).then(v)}catch(t){u(),yt(e,n,t)}v(y)},Ct=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>St(e,n,t,i),s=()=>{if(_t(e,n))return;let t=xt(e,n,i);return k(t)?t.then(o):o()};return a()},wt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Tt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=V(e,r),d=ht(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Et=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{At(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Tt(e,t,n,r,i)),l=!!s&&k(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;H(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:V(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:V(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,z(t)&&await i.options.notFoundComponent?.preload?.(),H(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,H(e,e.router.getMatch(n),t)}!B(o)&&!z(o)&&await At(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:V(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),H(e,r,t)}},Dt=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Tt(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Et(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){B(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Et(e,t,i,n,d):vt(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(_t(e,i)){if(!e.router.getMatch(i))return e.matches[n];vt(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=ht(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&H(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=O(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function Ot(e){let t=e,n=[];mt(t.router)&&pt(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Ct(t,e);k(n)&&await n}catch(e){if(B(e))throw e;if(z(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?gt(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Dt(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(B(e))throw e;z(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=gt(t,l);e===void 0&&A();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await At(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await At(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=wt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=pt(t);if(k(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function kt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function At(e,t=Mt){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Mt?(()=>{if(e._componentsPromise===void 0){let t=kt(e,Mt);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():kt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function jt(e){for(let t of Mt)if(e.options[t]?.preload)return!0;return!1}var Mt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Nt(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Pt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,a=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ne(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=i()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=ce(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ut(Lt(this.latestLocation),e),Xe(this)}let o=!1,s=this.options.basepath??`/`,c=this.options.rewrite;if(r||n!==s||a!==c){this.basepath=s;let e=[],t=ke(s);t&&t!==`/`&&e.push(st({basepath:s})),c&&e.push(c),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ot(e),this.history&&this.updateLatestLocation(),o=!0}o&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ve(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&pe(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:ae(e).path,external:!1,searchStr:o,search:x(t?.search,i),hash:ae(r.slice(1)).path,state:S(t?.state,a)}}let o=new URL(i,this.origin),s=ct(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:ae(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:x(t?.search,c),hash:ae(s.hash.slice(1)).path,state:S(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Me({base:e,to:t.includes(`//`)?De(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>zt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,g(t.params,s)),d=this.routesByPath[R(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&y(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:ae(Fe({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Rt(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=Bt({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=x(o,m);let h=this.options.stringifySearch(m),_=t.hash===!0?n.hash:t.hash?g(t.hash,n.hash):void 0,v=_?`#${_}`:``,b=t.state===!0?n.state:t.state?g(t.state,n.state):{};b=S(n.state,b);let C=`${p}${h}${v}`,w,T,E=!1;if(this.rewrite){let e=new URL(C,this.origin),t=lt(this.rewrite,e);w=e.href.replace(e.origin,``),t.origin===this.origin?T=t.pathname+t.search+t.hash:(T=t.href,E=!0)}else w=oe(C),T=w;return{publicHref:T,href:w,pathname:p,search:m,searchStr:h,state:b,hash:_??``,external:E,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=me(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,g(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=D(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=R(this.latestLocation.href)===R(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=O(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:o,...s}={})=>{if(o){let t=this.history.location.state.__TSR_index,n=a(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=ct(this.rewrite,r).pathname,s.search=this.options.parseSearch(n.search),s.hash=n.hash.slice(1)}let c=this.buildLocation({...s,_includeValidateSearch:!0});this.pendingBuiltLocation=c;let l=this.commitLocation({...c,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),l},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ie(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t&&(this._scroll.hash=t===`PUSH`||t===`REPLACE`);let n=this.latestLocation,r=Nt(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await Ot({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){B(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):z(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Nt(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&ie(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`||e-t.updatedAt>=r}})},this.loadRouteChunk=At,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await Ot({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(B(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});z(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=he(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!D(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?D(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??tt,parseSearch:e.parseSearch??et,protocolAllowlist:e.protocolAllowlist??re}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=xe(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:R(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Ht(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Rt(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof Ft||(r=new Ft(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=Fe({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,C;if(!v)try{Ut(r,b)}catch(e){if(C=z(e)||B(e)?e:new It(e.message,{cause:e}),t?.throwOnError)throw C}Object.assign(i,b);let w=y?`stay`:`enter`,T;if(v)T={...v,cause:w,params:y?.params??i,_strictParams:b,search:x(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||jt(r)?`pending`:`success`;T={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?x(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:C,__routeContext:void 0,_nonReactive:{loadPromise:O()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:w,loaderDeps:y?S(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(T.globalNotFound=s===r.id),T.searchError=f;let E=this.getParentContext(o);T.context={...E,...T.__routeContext,...T.__beforeLoadContext},c[n]=T}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?x(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let t=m(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];let{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),a=m(r),o={...e.search};for(let e of r)try{Object.assign(o,Rt(e.options.validateSearch,o))}catch{}let s=t&&this.stores.matchStores.get(t)?.get(),c=s&&s.routeId===a.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),i);for(let t of r)try{Ut(t,e)}catch{}l=e}let u={matchedRoutes:r,fullPath:a.fullPath,search:o,params:l};return this.lightweightCache.set(e,[t,u]),u}},Ft=class extends Error{},It=class extends Error{};function Lt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Rt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Ft(`Async validation not supported`);if(n.issues)throw new Ft(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function zt({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=R(e),a,o=ge(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Bt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Vt(n)(e,t,r??!1)}function Vt(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Rt(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=g(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function Ht(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return it}function Ut(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var Wt=`Error preloading route! ☝️`,Gt=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=it:this.parentRoute||A();let r=n?it:t?.path;r&&r!==`/`&&(r=Oe(r));let i=t?.id||r,a=n?it:Ee([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ee([`/`,a]));let o=a===`__root__`?`/`:Ee([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=R(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>at({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Kt=class extends Gt{constructor(e){super(e)}},qt=e(n(),1),U=r();function Jt(e){let t=e.errorComponent??Xt;return(0,U.jsx)(Yt,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?l.createElement(t,{error:n,reset:r}):e.children})}var Yt=class extends l.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Xt({error:e}){let[t,n]=l.useState(!1);return(0,U.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,U.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,U.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,U.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,U.jsx)(`div`,{children:(0,U.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,U.jsx)(`code`,{children:e.message}):null})}):null]})}function Zt({children:e,fallback:t=null}){return Qt()?(0,U.jsx)(l.Fragment,{children:e}):(0,U.jsx)(l.Fragment,{children:t})}function Qt(){return l.useSyncExternalStore($t,()=>!0,()=>!1)}function $t(){return()=>{}}var en=l.createContext(null);function W(e){return l.useContext(en)}var tn=l.createContext(void 0),nn=l.createContext(void 0),rn=c();function an(e,t){return e===t}function G(e,t,n=an){let r=(0,l.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,l.useCallback)(()=>e?.get(),[e]);return(0,rn.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var on={get(){},subscribe(){return{unsubscribe(){}}}};function sn(e,t){let n=l.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=S(n.current,i):i}}function K(e){let t=W(),n=l.useContext(e.from?nn:tn),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=sn(e,t),a=G(r??on,e=>e?i(e):on);if(a!==on)return a;(e.shouldThrow??!0)&&A()}function cn(e){return K({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ln(e){let{select:t,...n}=e;return K({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function un(e){return K({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function dn(e){return K({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function fn(e){let t=W();return l.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function pn(e){return K({...e,select:t=>e.select?e.select(t.context):t.context})}function mn(e,t){let n=W(),r=p(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:u,preloadIntentProximity:d,hashScrollIntoView:m,replace:h,startTransition:_,resetScroll:v,viewTransition:y,children:b,target:x,disabled:S,style:C,className:w,onClick:T,onBlur:E,onFocus:O,onMouseEnter:k,onMouseLeave:ee,onTouchStart:te,ignoreBlocker:ne,params:re,search:ae,hash:oe,state:se,mask:A,reloadDocument:ce,unsafeRelative:j,from:le,_fromLocation:ue,...de}=e,M=Qt(),N=l.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),P=G(n.stores.location,e=>e,(e,t)=>e.href===t.href),F=l.useMemo(()=>{let e={_fromLocation:P,...N};return n.buildLocation(e)},[n,P,N]),fe=F.maskedLocation?F.maskedLocation.publicHref:F.publicHref,pe=F.maskedLocation?F.maskedLocation.external:F.external,me=l.useMemo(()=>Cn(fe,pe,n.history,S),[S,pe,fe,n.history]),he=l.useMemo(()=>{if(me?.external)return ie(me.href,n.protocolAllowlist)?void 0:me.href;if(!wn(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),ie(s,n.protocolAllowlist)?void 0:s}catch{}},[s,me,n.protocolAllowlist]),ge=l.useMemo(()=>{if(he)return!1;if(o?.exact){if(!je(P.pathname,F.pathname,n.basepath))return!1}else{let e=Ae(P.pathname,n.basepath),t=Ae(F.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!D(P.search,F.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:!o?.includeHash||M&&P.hash===F.hash},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,P,he,M,F.hash,F.pathname,F.search,n.basepath]),_e=ge?g(i,{})??gn:hn,ve=ge?hn:g(a,{})??hn,ye=[w,_e.className,ve.className].filter(Boolean).join(` `),be=(C||_e.style||ve.style)&&{...C,..._e.style,...ve.style},[xe,Se]=l.useState(!1),Ce=l.useRef(!1),I=e.reloadDocument||he?!1:c??n.options.defaultPreload,we=u??n.options.defaultPreloadDelay??0,L=l.useCallback(()=>{n.preloadRoute({...N,_builtLocation:F}).catch(e=>{console.warn(e),console.warn(Wt)})},[n,N,F]);f(r,l.useCallback(e=>{e?.isIntersecting&&L()},[L]),xn,{disabled:!!S||I!==`viewport`}),l.useEffect(()=>{Ce.current||!S&&I===`render`&&(L(),Ce.current=!0)},[S,L,I]);let Te=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!En(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,qt.flushSync)(()=>{Se(!0)});let t=n.subscribe(`onResolved`,()=>{t(),Se(!1)});n.navigate({...N,replace:h,resetScroll:v,hashScrollIntoView:m,startTransition:_,viewTransition:y,ignoreBlocker:ne})}};if(he)return{...de,ref:r,href:he,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...w&&{className:w},...T&&{onClick:T},...E&&{onBlur:E},...O&&{onFocus:O},...k&&{onMouseEnter:k},...ee&&{onMouseLeave:ee},...te&&{onTouchStart:te}};let Ee=e=>{if(S||I!==`intent`)return;if(!we){L();return}let t=e.currentTarget;if(bn.has(t))return;let n=setTimeout(()=>{bn.delete(t),L()},we);bn.set(t,n)},De=e=>{S||I!==`intent`||L()},Oe=e=>{if(S||!I||!we)return;let t=e.currentTarget,n=bn.get(t);n&&(clearTimeout(n),bn.delete(t))};return{...de,..._e,...ve,href:me?.href,ref:r,onClick:Sn([T,Te]),onBlur:Sn([E,Oe]),onFocus:Sn([O,Ee]),onMouseEnter:Sn([k,Ee]),onMouseLeave:Sn([ee,Oe]),onTouchStart:Sn([te,De]),disabled:!!S,target:x,...be&&{style:be},...ye&&{className:ye},...S&&_n,...ge&&vn,...M&&xe&&yn}}var hn={},gn={className:`active`},_n={role:`link`,"aria-disabled":!0},vn={"data-status":`active`,"aria-current":`page`},yn={"data-transitioning":`transitioning`},bn=new WeakMap,xn={rootMargin:`100px`},Sn=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Cn(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function wn(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Tn=l.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=mn(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return l.createElement(`a`,t,o)}return l.createElement(n,a,o)});function En(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Dn=class extends Gt{constructor(e){super(e),this.useMatch=e=>K({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>pn({...e,from:this.id}),this.useSearch=e=>dn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>un({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ln({...e,from:this.id}),this.useLoaderData=e=>cn({...e,from:this.id}),this.useNavigate=()=>fn({from:this.fullPath}),this.Link=l.forwardRef((e,t)=>(0,U.jsx)(Tn,{ref:t,from:this.fullPath,...e}))}};function On(e){return new Dn(e)}var kn=class extends Kt{constructor(e){super(e),this.useMatch=e=>K({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>pn({...e,from:this.id}),this.useSearch=e=>dn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>un({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ln({...e,from:this.id}),this.useLoaderData=e=>cn({...e,from:this.id}),this.useNavigate=()=>fn({from:this.fullPath}),this.Link=l.forwardRef((e,t)=>(0,U.jsx)(Tn,{ref:t,from:this.fullPath,...e}))}};function An(e){return new kn(e)}function jn(e){let t=W(),n=`not-found-${G(t.stores.location,e=>e.pathname)}-${G(t.stores.status,e=>e)}`;return(0,U.jsx)(Jt,{getResetKey:()=>n,onCatch:(t,n)=>{if(z(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(z(t))return e.fallback?.(t);throw t},children:e.children})}function Mn(){return(0,U.jsx)(`p`,{children:`Not Found`})}function Nn(e){return(0,U.jsx)(U.Fragment,{children:e.children})}function Pn(e,t,n){return t.options.notFoundComponent?(0,U.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,U.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,U.jsx)(Mn,{})}var Fn=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,In=(e,t)=>e[0]===t[0]&&e[1]===t[1],Ln=l.memo(function({matchId:e}){let t=W(),n=t.stores.matchStores.get(e);n||A();let r=G(t.stores.loadedAt,e=>e),i=G(n,e=>e,Fn);return(0,U.jsx)(Rn,{router:t,matchId:e,resetKey:r,matchState:l.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Rn({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,U.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,u=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,d=r.ssr===!1||r.ssr===`data-only`,f=(!i.isRoot||i.options.wrapInSuspense||d)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||d))?l.Suspense:Nn,p=s?Jt:Nn,m=u?jn:Nn;return(0,U.jsxs)(i.isRoot?i.options.shellComponent??Nn:Nn,{children:[(0,U.jsx)(tn.Provider,{value:t,children:(0,U.jsx)(f,{fallback:o,children:(0,U.jsx)(p,{getResetKey:()=>n,errorComponent:s||Xt,onCatch:(e,t)=>{if(z(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,U.jsx)(m,{fallback:e=>{if(e.routeId??=r.routeId,!u||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return l.createElement(u,e)},children:d||r._displayPending?(0,U.jsx)(Zt,{fallback:o,children:(0,U.jsx)(Bn,{matchId:t})}):(0,U.jsx)(Bn,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(zn,{}),(e.options.scrollRestoration,null)]}):null]})}function zn(){let e=W(),t=l.useRef();return u(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...Nt(e.stores.location.get(),r??n)}),t.current=n},[G(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Bn=l.memo(function({matchId:e}){let t=W(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||A();let i=G(r,e=>e),a=i.routeId,o=t.routesById[a],s=l.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=l.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,U.jsx)(e,{},s):(0,U.jsx)(Vn,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=O();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return z(i.error)||A(),Pn(t,o,i.error);if(i.status===`redirected`)throw B(i.error)||A(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),Vn=l.memo(function(){let e=W(),t=l.useContext(tn),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=G(a,e=>[e?.routeId,e?.globalNotFound??!1],In),i=G(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,U.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||A(),Pn(e,a,void 0);if(!i)return null;let s=(0,U.jsx)(Ln,{matchId:i});return n===`__root__`?(0,U.jsx)(l.Suspense,{fallback:o,children:s}):s});function Hn(){let e=W(),t=l.useRef({router:e,mounted:!1}),[n,r]=l.useState(!1),i=G(e.stores.isLoading,e=>e),a=G(e.stores.hasPending,e=>e),o=d(i),c=i||n||a,f=d(c),p=i||a,m=d(p);return e.startTransition=e=>{r(!0),l.startTransition(()=>{e(),r(!1)})},l.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return R(e.latestLocation.publicHref)!==R(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),u(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),u(()=>{o&&!i&&e.emit({type:`onLoad`,...Nt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),u(()=>{m&&!p&&e.emit({type:`onBeforeRouteMount`,...Nt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[p,m,e]),u(()=>{if(f&&!c){let t=Nt(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),s(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[c,f,e]),null}function Un(){let e=W(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,U.jsx)(t,{}):null,r=(0,U.jsxs)(typeof document<`u`&&e.ssr?Nn:l.Suspense,{fallback:n,children:[(0,U.jsx)(Hn,{}),(0,U.jsx)(Wn,{})]});return e.options.InnerWrap?(0,U.jsx)(e.options.InnerWrap,{children:r}):r}function Wn(){let e=W(),t=G(e.stores.firstId,e=>e),n=G(e.stores.loadedAt,e=>e),r=t?(0,U.jsx)(Ln,{matchId:t}):null;return(0,U.jsx)(tn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,U.jsx)(Jt,{getResetKey:()=>n,errorComponent:Xt,onCatch:void 0,children:r})})}var Gn=e=>({createMutableStore:o,createReadonlyStore:o,batch:s}),Kn=e=>new qn(e),qn=class extends Pt{constructor(e){super(e,Gn)}};function Jn({router:e,children:t,...n}){y(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,U.jsx)(en.Provider,{value:e,children:t});return e.options.Wrap?(0,U.jsx)(e.options.Wrap,{children:r}):r}function Yn({router:e,...t}){return(0,U.jsx)(Jn,{router:e,...t,children:(0,U.jsx)(Un,{})})}function Xn(e){let t=W({warn:e?.router===void 0}),n=e?.router||t;return G(n.stores.__store,sn(e,n))}var q=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(){}},Zn=new class extends q{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let 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(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Qn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},J=new class{#e=Qn;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)}};function $n(e){setTimeout(e,0)}var er=typeof window>`u`||`Deno`in globalThis;function Y(){}function tr(e,t){return typeof e==`function`?e(t):e}function nr(e){return typeof e==`number`&&e>=0&&e!==1/0}function rr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function X(e,t){return typeof e==`function`?e(t):e}function Z(e,t){return typeof e==`function`?e(t):e}function ir(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==or(o,t.options))return!1}else if(!sr(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function ar(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Q(t.options.mutationKey)!==Q(a))return!1}else if(!sr(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function or(e,t){return(t?.queryKeyHashFn||Q)(e)}function Q(e){return JSON.stringify(e,(e,t)=>fr(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function sr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!sr(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!sr(e[r],t[r]))return!1;return!0}return!1}var cr=Object.prototype.hasOwnProperty;function lr(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=dr(e)&&dr(t);if(!r&&!(fr(e)&&fr(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:cr.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=lr(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ur(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function dr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fr(e){if(!pr(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!pr(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function pr(e){return Object.prototype.toString.call(e)===`[object Object]`}function mr(e){return new Promise(t=>{J.setTimeout(t,e)})}function hr(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:lr(e,t)}function gr(e){return e}function _r(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function vr(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var yr=Symbol();function br(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===yr?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xr(e,t){return typeof e==`function`?e(...t):!!e}function Sr(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Cr=(()=>{let e=()=>er;return{isServer(){return e()},setIsServer(t){e=t}}})();function wr(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Tr=$n;function Er(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Tr,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var $=Er(),Dr=new class extends q{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let 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(t=>{t(e)}))}isOnline(){return this.#e}};function Or(e){return Math.min(1e3*2**e,3e4)}function kr(e){return(e??`online`)!==`online`||Dr.isOnline()}var Ar=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function jr(e){let t=!1,n=0,r,i=wr(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Ar(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Zn.isFocused()&&(e.networkMode===`always`||Dr.isOnline())&&e.canRun(),u=()=>kr(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Cr.isServer()?0:3),o=e.retryDelay??Or,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),mr(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Mr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nr(this.gcTime)&&(this.#e=J.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cr.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(J.clearTimeout(this.#e),this.#e=void 0)}};function Nr(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Sr(e,()=>t.signal,()=>n=!0)},u=br(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?vr:_r;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Fr:Pr,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Pr(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Pr(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Fr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ir(e,t){return t?Pr(e,t)!=null:!1}function Lr(e,t){return!t||!e.getPreviousPageParam?!1:Fr(e,t)!=null}var Rr=class extends Mr{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Vr(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.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Vr(this.options);e.data!==void 0&&(this.setState(Br(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=hr(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Y).catch(Y):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=>Z(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>X(e.options.staleTime,this)===`static`)}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:!rr(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.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.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.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.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=br(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Nr(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=jr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ar&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ar){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...zr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Br(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),$.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function zr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Br(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Vr(e){let 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 Hr=class extends q{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=wr(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Wr(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gr(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Z(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ur(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Kr(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Z(this.options.enabled,this.#t)!==Z(t.enabled,this.#t)||X(this.options.staleTime,this.#t)!==X(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Z(this.options.enabled,this.#t)!==Z(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Jr(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Y)),t}#g(){this.#b();let e=X(this.options.staleTime,this.#t);if(Cr.isServer()||this.#r.isStale||!nr(e))return;let t=rr(this.#r.dataUpdatedAt,e)+1;this.#d=J.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Cr.isServer()||Z(this.options.enabled,this.#t)===!1||!nr(this.#p)||this.#p===0)&&(this.#f=J.setInterval(()=>{(this.options.refetchIntervalInBackground||Zn.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(J.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(J.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Wr(e,t),o=i&&Kr(e,n,t,r);(a||o)&&(l={...l,...zr(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=hr(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=hr(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:qr(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Z(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=wr();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!ur(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){$.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ur(e,t){return Z(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&Z(t.retryOnMount,e)===!1)}function Wr(e,t){return Ur(e,t)||e.state.data!==void 0&&Gr(e,t,t.refetchOnMount)}function Gr(e,t,n){if(Z(t.enabled,e)!==!1&&X(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&qr(e,t)}return!1}function Kr(e,t,n,r){return(e!==t||Z(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&qr(e,n)}function qr(e,t){return Z(t.enabled,e)!==!1&&e.isStaleByTime(X(t.staleTime,e))}function Jr(e,t){return!ur(e.getCurrentResult(),t)}var Yr=class extends Hr{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ir(t,n.data),hasPreviousPage:Lr(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Xr=class extends Mr{#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||Zr(),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){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=jr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,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{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),$.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Zr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Qr=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Xr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=$r(e);if(typeof t==`string`){let 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)){let t=$r(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=$r(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=$r(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){$.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){let t={exact:!0,...e};return this.getAll().find(e=>ar(t,e))}findAll(e={}){return this.getAll().filter(t=>ar(e,t))}notify(e){$.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return $.batch(()=>Promise.all(e.map(e=>e.continue().catch(Y))))}};function $r(e){return e.options.scope?.id}var ei=class extends q{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ur(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Q(t.mutationKey)!==Q(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Zr();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){$.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function ti(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function ni(e,t,n){let r=e.slice(0);return r[t]=n,r}var ri=class extends q{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,$.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!ur(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(ti(e,n).forEach(e=>{e.destroy()}),ti(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=lr(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Hr(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=ni(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&$.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},ii=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??or(r,t),a=this.get(i);return a||(a=new Rr({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){$.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ir(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ir(e,t)):t}notify(e){$.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){$.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){$.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ai=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ii,this.#t=e.mutationCache||new Qr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Zn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Dr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let 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(X(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=tr(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return $.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;$.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return $.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=$.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Y).catch(Y)}invalidateQueries(e,t={}){return $.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=$.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Y)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Y)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(X(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Y).catch(Y)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Y).catch(Y)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Dr.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(Q(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{sr(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Q(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{sr(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=or(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===yr&&(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()}},oi=l.createContext(void 0),si=e=>{let t=l.useContext(oi);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ci=({client:e,children:t})=>(l.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,U.jsx)(oi.Provider,{value:e,children:t})),li=l.createContext(!1),ui=()=>l.useContext(li);li.Provider;function di(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var fi=l.createContext(di()),pi=()=>l.useContext(fi),mi=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?xr(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},hi=e=>{l.useEffect(()=>{e.clearReset()},[e])},gi=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||xr(n,[e.error,r])),_i=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},vi=(e,t)=>e.isLoading&&e.isFetching&&!t,yi=(e,t)=>e?.suspense&&t.isPending,bi=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function xi({queries:e,...t},n){let r=si(n),i=ui(),a=pi(),o=l.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{_i(e);let t=r.getQueryCache().get(e.queryHash);mi(e,a,t)}),hi(a);let[s]=l.useState(()=>new ri(r,o,t)),[c,u,d]=s.getOptimisticResult(o,t.combine),f=!i&&t.subscribed!==!1;l.useSyncExternalStore(l.useCallback(e=>f?s.subscribe($.batchCalls(e)):Y,[s,f]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),l.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let p=c.some((e,t)=>yi(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&yi(n,e)?bi(n,new Hr(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=c.find((e,t)=>{let n=o[t];return n&&gi({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m?.error)throw m.error;return u(d())}function Si(e,t,n){let r=ui(),i=pi(),a=si(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,_i(o),mi(o,i,s),hi(i);let u=!a.getQueryCache().get(o.queryHash),[d]=l.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),p=!r&&c;if(l.useSyncExternalStore(l.useCallback(e=>{let t=p?d.subscribe($.batchCalls(e)):Y;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),l.useEffect(()=>{d.setOptions(o)},[o,d]),yi(o,f))throw bi(o,d,i);if(gi({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!Cr.isServer()&&vi(f,r)&&(u?bi(o,d,i):s?.promise)?.catch(Y).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.trackResult(f)}function Ci(e,t){return Si(e,Hr,t)}function wi(e){return e}function Ti(e){return e}function Ei(e,t){let n=si(t),[r]=l.useState(()=>new ei(n,e));l.useEffect(()=>{r.setOptions(e)},[r,e]);let i=l.useSyncExternalStore(l.useCallback(e=>r.subscribe($.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=l.useCallback((e,t)=>{r.mutate(e,t).catch(Y)},[r]);if(i.error&&xr(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Di(e){return e}function Oi(e,t){return Si(e,Yr,t)}export{An as _,wi as a,fn as b,ci as c,Qr as d,gr as f,Vn as g,Kn as h,Ti as i,si as l,Yn as m,Di as n,Ci as o,Xn as p,Ei as r,xi as s,Oi as t,ai as u,On as v,Tn as y};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,r as n,t as r}from"./react-runtime-DaCTDC27.js";import{n as i,t as a}from"./initial-deps-DqJTHr9A.js";import{a as o,c as s,i as c,l,n as u,o as d,r as f,s as p,t as m}from"./scheduled-task-floating-ui~index~workbench-shell~skills-market-container~workbench-inspecto~y5cwo2qi-DAfditVv.js";var h=e(t(),1),g=Object.defineProperty,_=(e,t)=>g(e,`name`,{value:t,configurable:!0});function v(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}_(v,`setRef`);function y(...e){return t=>{let n=!1,r=e.map(e=>{let r=v(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():v(e[t],null)}}}}_(y,`composeRefs`);function b(...e){return h.useCallback(y(...e),e)}_(b,`useComposedRefs`);var x=e(n(),1),S=r(),C=Object.defineProperty,w=(e,t)=>C(e,`name`,{value:t,configurable:!0});function T(e){let t=h.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];M(r)&&typeof N==`function`&&(r=N(r._payload)),h.Children.forEach(r,e=>{if(j(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;M(n)&&typeof N==`function`&&(n=N(n._payload)),a=k(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=h.cloneElement(a,void 0,s):!o&&h.Children.count(r)===1&&h.isValidElement(r)&&(a=r);let c=a?ee(a):void 0,l=b(n,c);if(!a){if(r||r===0)throw Error(o?ie(e):re(e));return r}let u=A(i,a.props??{});return a.type!==h.Fragment&&(u.ref=n?l:c),h.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}w(T,`createSlot`);var E=T(`Slot`),D=Symbol.for(`radix.slottable`);function O(e){let t=w(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=D,t}w(O,`createSlottable`);var k=w((e,t)=>{if(`child`in e.props){let t=e.props.child;return h.isValidElement(t)?h.cloneElement(t,void 0,e.props.children(t.props.children)):null}return h.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function A(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}w(A,`mergeProps`);function ee(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)}w(ee,`getElementRef`);function j(e){return h.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===D}w(j,`isSlottable`);var te=Symbol.for(`react.lazy`);function M(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===te&&`_payload`in e&&ne(e._payload)}w(M,`isLazyComponent`);function ne(e){return typeof e==`object`&&!!e&&`then`in e}w(ne,`isPromiseLike`);var re=w(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ie=w(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),N=h.use,ae=Object.defineProperty,P=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),oe=!!(typeof window<`u`&&window.document&&window.document.createElement);function F(e,t,{checkForDefaultPrevented:n=!0}={}){return P(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}P(F,`composeEventHandlers`);function se(e){if(!oe)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}P(se,`getOwnerWindow`);function ce(e){if(!oe)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}P(ce,`getOwnerDocument`);function le(e,t=!1){let{activeElement:n}=ce(e);if(!n?.nodeName)return null;if(ue(n)&&n.contentDocument)return le(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ce(n).getElementById(e);if(t)return t}}return n}P(le,`getActiveElement`);function ue(e){return e.tagName===`IFRAME`}P(ue,`isFrame`);var de=Object.defineProperty,I=(e,t)=>de(e,`name`,{value:t,configurable:!0});function fe(e,t){let n=h.createContext(t);n.displayName=e+`Context`;let r=I(e=>{let{children:t,...r}=e,i=h.useMemo(()=>r,Object.values(r));return(0,S.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=h.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return I(i,`useContext`),[r,i]}I(fe,`createContext`);function L(e,t=[]){let n=[];function r(t,r){let i=h.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=I(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=h.useMemo(()=>o,Object.values(o));return(0,S.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=h.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return I(s,`useContext`),[o,s]}I(r,`createContext`);let i=I(()=>{let t=n.map(e=>h.createContext(e));return I(function(n){let r=n?.[e]||t;return h.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,pe(i,...t)]}I(L,`createContextScope`);function pe(...e){let t=e[0];if(e.length===1)return t;let n=I(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return I(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}I(pe,`composeContextScopes`);var me=Object.defineProperty,he=(e,t)=>me(e,`name`,{value:t,configurable:!0}),R=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=T(`Primitive.${t}`),r=h.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,S.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ge(e,t){e&&x.flushSync(()=>e.dispatchEvent(t))}he(ge,`dispatchDiscreteCustomEvent`);var _e=Object.defineProperty,ve=(e,t)=>_e(e,`name`,{value:t,configurable:!0});function z(e){let t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>((...e)=>t.current?.(...e)),[])}ve(z,`useCallbackRef`);var ye=Object.defineProperty,B=(e,t)=>ye(e,`name`,{value:t,configurable:!0}),be=`dismissableLayer.update`,xe=`dismissableLayer.pointerDownOutside`,Se=`dismissableLayer.focusOutside`,Ce,we=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Te=h.forwardRef(B(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=h.useContext(we),[d,f]=h.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=h.useState({}),g=b(t,f),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,x=d?_.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,w=x>=y,T=h.useRef(!1),E=Oe(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return w&&!t},[u.branches,w])}),D=ke(e=>{if(r&&T.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),O=d?x===_.length-1:!1,k=z(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return h.useEffect(()=>{if(O)return p.addEventListener(`keydown`,k,{capture:!0}),()=>p.removeEventListener(`keydown`,k,{capture:!0})},[p,O,k]),h.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ce=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ae(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Ce))}},[d,p,n,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ae())},[d,u]),h.useEffect(()=>{let e=B(()=>m({}),`handleUpdate`);return document.addEventListener(be,e),()=>document.removeEventListener(be,e)},[]),(0,S.jsx)(R.div,{...l,ref:g,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:F(e.onFocusCapture,D.onFocusCapture),onBlurCapture:F(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:F(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function Ee(){let e=h.useContext(we),[t,n]=h.useState(null);return h.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}B(Ee,`useDismissableLayerSurface`);var De=B(()=>!0,`IS_TRUE`);function Oe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=De}=t,s=z(e),c=h.useRef(!1),l=h.useRef(!1),u=h.useRef(new Map),d=h.useRef(()=>{});return h.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}B(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}B(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}B(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}B(p,`handleInteractionBubble`);let m=B(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||je(xe,s,p,{discrete:!0})};if(B(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:B(()=>c.current=!0,`onPointerDownCapture`)}}B(Oe,`usePointerDownOutside`);function ke(e,t=globalThis?.document){let n=z(e),r=h.useRef(!1);return h.useEffect(()=>{let e=B(e=>{e.target&&!r.current&&je(Se,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:B(()=>r.current=!0,`onFocusCapture`),onBlurCapture:B(()=>r.current=!1,`onBlurCapture`)}}B(ke,`useFocusOutside`);function Ae(){let e=new CustomEvent(be);document.dispatchEvent(e)}B(Ae,`dispatchUpdate`);function je(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ge(i,a):i.dispatchEvent(a)}B(je,`handleAndDispatchCustomEvent`);var V=globalThis?.document?h.useLayoutEffect:()=>{},Me=Object.defineProperty,Ne=(e,t)=>Me(e,`name`,{value:t,configurable:!0}),Pe=h.useId||(()=>void 0),Fe=0;function H(e){let[t,n]=h.useState(Pe());return V(()=>{e||n(e=>e??String(Fe++))},[e]),e||(t?`radix-${t}`:``)}Ne(H,`useId`);var Ie=Object.defineProperty,Le=(e,t)=>Ie(e,`name`,{value:t,configurable:!0});function Re(e){let[t,n]=h.useState(void 0);return V(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}Le(Re,`useSize`);var ze=Object.defineProperty,Be=(e,t)=>ze(e,`name`,{value:t,configurable:!0}),Ve=`Popper`,[He,Ue]=L(Ve),[We,Ge]=He(Ve),Ke=Be(e=>{let{__scopePopper:t,children:n}=e,[r,i]=h.useState(null),[a,o]=h.useState(void 0);return(0,S.jsx)(We,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),qe=`PopperAnchor`,Je=h.forwardRef(Be(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ge(qe,n),o=h.useRef(null),s=a.onAnchorChange,c=b(t,h.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=h.useRef(null);h.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&tt(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,S.jsx)(R.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Ye=`PopperContent`,[Xe,Ze]=He(Ye),Qe=h.forwardRef(Be(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:g=0,arrowPadding:_=0,avoidCollisions:v=!0,collisionBoundary:y=[],collisionPadding:x=0,sticky:C=`partial`,hideWhenDetached:w=!1,updatePositionStrategy:T=`optimized`,onPlaced:E,...D}=e,O=Ge(Ye,n),[k,A]=h.useState(null),ee=b(t,A),[j,te]=h.useState(null),M=Re(j),ne=M?.width??0,re=M?.height??0,ie=r+(a===`center`?``:`-`+a),N=typeof x==`number`?x:{top:0,right:0,bottom:0,left:0,...x},ae=Array.isArray(y)?y:[y],P=ae.length>0,oe={padding:N,boundary:ae.filter($e),altBoundary:P},{refs:F,floatingStyles:se,placement:ce,isPositioned:le,middlewareData:ue}=s({strategy:`fixed`,placement:ie,whileElementsMounted:Be((...e)=>l(...e,{animationFrame:T===`always`}),`whileElementsMounted`),elements:{reference:O.anchor},middleware:[o({mainAxis:i+re,alignmentAxis:g}),v&&d({mainAxis:!0,crossAxis:!1,limiter:C===`partial`?c():void 0,...oe}),v&&u({...oe}),p({...oe,apply:Be(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),j&&m({element:j,padding:_}),et({arrowWidth:ne,arrowHeight:re}),w&&f({strategy:`referenceHidden`,...oe,boundary:P?oe.boundary:void 0})]}),de=O.setPlacementState;V(()=>(de(ce),()=>{de(void 0)}),[ce,de]);let[I,fe]=tt(ce),L=z(E);V(()=>{le&&L?.()},[le,L]);let pe=ue.arrow?.x,me=ue.arrow?.y,he=ue.arrow?.centerOffset!==0,[ge,_e]=h.useState();return V(()=>{k&&_e(window.getComputedStyle(k).zIndex)},[k]),(0,S.jsx)(`div`,{ref:F.setFloating,"data-radix-popper-content-wrapper":``,style:{...se,transform:le?se.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ge,"--radix-popper-transform-origin":[ue.transformOrigin?.x,ue.transformOrigin?.y].join(` `),...ue.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,S.jsx)(Xe,{scope:n,placedSide:I,placedAlign:fe,onArrowChange:te,arrowX:pe,arrowY:me,shouldHideArrow:he,children:(0,S.jsx)(R.div,{"data-side":I,"data-align":fe,...D,ref:ee,style:{...D.style,animation:le?D.style?.animation:`none`}})})})},`PopperContent`));function $e(e){return e!==null}Be($e,`isNotNull`);var et=Be(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=tt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function tt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Be(tt,`getSideAndAlignFromPlacement`);var nt=Ke,rt=Je,it=Qe,at=Object.defineProperty,ot=h.forwardRef(((e,t)=>at(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=h.useState(!1);V(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?x.createPortal((0,S.jsx)(R.div,{...r,ref:t}),o):null},`Portal`)),st=Object.defineProperty,ct=(e,t)=>st(e,`name`,{value:t,configurable:!0});function lt(e,t){return h.useReducer((e,n)=>t[e][n]??e,e)}ct(lt,`useStateMachine`);var U=ct(e=>{let{present:t,children:n}=e,r=ut(t),i=typeof n==`function`?n({present:r.isPresent}):h.Children.only(n),a=ft(r.ref,mt(i));return typeof n==`function`||r.isPresent?h.cloneElement(i,{ref:a}):null},`Presence`);function ut(e){let[t,n]=h.useState(),r=h.useRef(null),i=h.useRef(e),a=h.useRef(`none`),o=h.useRef(void 0),[s,c]=lt(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return h.useEffect(()=>{s===`mounted`?(a.current=o.current??pt(r.current),o.current=void 0):a.current=`none`},[s]),V(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=pt(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),V(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=ct(a=>{let o=pt(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=ct(e=>{e.target===t&&(a.current=pt(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:h.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=pt(t)}else r.current=null;n(e)},[])}}ct(ut,`usePresence`);function dt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ct(dt,`setRef`);function ft(...e){let t=h.useRef(e);return t.current=e,h.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=dt(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():dt(n[e],null)}}},[])}ct(ft,`useStableComposedRefs`);function pt(e){return e?.animationName||`none`}ct(pt,`getAnimationName`);function mt(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)}ct(mt,`getElementRef`);var ht=Object.defineProperty,gt=(e,t)=>ht(e,`name`,{value:t,configurable:!0}),_t=h.useEffectEvent,vt=h.useInsertionEffect;function yt(e){if(typeof _t==`function`)return _t(e);let t=h.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof vt==`function`?vt(()=>{t.current=e}):V(()=>{t.current=e}),h.useMemo(()=>((...e)=>t.current?.(...e)),[])}gt(yt,`useEffectEvent`);var bt=Object.defineProperty,xt=(e,t)=>bt(e,`name`,{value:t,configurable:!0}),St=h.useInsertionEffect||V;function Ct({prop:e,defaultProp:t,onChange:n=xt(()=>{},`onChange`),caller:r}){let[i,a,o]=wt({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,h.useCallback(t=>{if(s){let n=Tt(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}xt(Ct,`useControllableState`);function wt({defaultProp:e,onChange:t}){let[n,r]=h.useState(e),i=h.useRef(n),a=h.useRef(t);return St(()=>{a.current=t},[t]),h.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}xt(wt,`useUncontrolledState`);function Tt(e){return typeof e==`function`}xt(Tt,`isFunction`);var Et=Symbol(`RADIX:SYNC_STATE`);function Dt(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=yt(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=h.useReducer((t,n)=>{if(n.type===Et)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=h.useRef(p);h.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let g=h.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return h.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Et,state:i})},[i,d.state,c]),[g,f]}xt(Dt,`useControllableStateReducer`);var Ot=Object.defineProperty,kt=(e,t)=>Ot(e,`name`,{value:t,configurable:!0}),At=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`}),jt=h.forwardRef(kt(function(e,t){return(0,S.jsx)(R.span,{...e,ref:t,style:{...At,...e.style}})},`VisuallyHidden`)),Mt=Object.defineProperty,W=(e,t)=>Mt(e,`name`,{value:t,configurable:!0}),[Nt,Pt]=L(`Tooltip`,[Ue]),Ft=Ue(),It=`TooltipProvider`,Lt=700,Rt=`tooltip.open`,[zt,Bt]=Nt(It),Vt=W(e=>{let{__scopeTooltip:t,delayDuration:n=Lt,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=h.useRef(!0),s=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,S.jsx)(zt,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:h.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Ht=`Tooltip`,[Ut,Wt]=Nt(Ht),Gt=W(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Bt(Ht,e.__scopeTooltip),l=Ft(t),[u,d]=h.useState(null),[f,p]=h.useState(void 0),m=H(),g=h.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=h.useRef(!1),[b,x]=Ct({prop:r,defaultProp:i??!1,onChange:W(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Rt))):c.onClose(),a?.(e)},`onChange`),caller:Ht}),C=h.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),w=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),T=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),E=h.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);h.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let D=f??m;return(0,S.jsx)(nt,{...l,children:(0,S.jsx)(Ut,{scope:t,contentId:D,setContentId:p,open:b,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?E():w()},[c.isOpenDelayedRef,E,w]),onTriggerLeave:h.useCallback(()=>{_?T():(window.clearTimeout(g.current),g.current=0)},[T,_]),onOpen:w,onClose:T,disableHoverableContent:_,children:n})})},`Tooltip`),Kt=`TooltipTrigger`,qt=h.forwardRef(W(function(e,t){let{__scopeTooltip:n,...r}=e,i=Wt(Kt,n),a=Bt(Kt,n),o=Ft(n),s=b(t,h.useRef(null),i.onTriggerChange),c=h.useRef(!1),l=h.useRef(!1),u=h.useCallback(()=>c.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,S.jsx)(rt,{asChild:!0,...o,children:(0,S.jsx)(R.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:F(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:F(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:F(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:F(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:F(e.onBlur,i.onClose),onClick:F(e.onClick,i.onClose)})})},`TooltipTrigger`)),Jt=`TooltipPortal`,[Yt,Xt]=Nt(Jt,{forceMount:void 0}),Zt=W(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Wt(Jt,t);return(0,S.jsx)(Yt,{scope:t,forceMount:n,children:(0,S.jsx)(U,{present:n||a.open,children:(0,S.jsx)(ot,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Qt=`TooltipContent`,$t=h.forwardRef(W(function(e,t){let n=Xt(Qt,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Wt(Qt,e.__scopeTooltip);return(0,S.jsx)(U,{present:r||o.open,children:o.disableHoverableContent?(0,S.jsx)(nn,{side:i,...a,ref:t}):(0,S.jsx)(en,{side:i,...a,ref:t})})},`TooltipContent`)),en=h.forwardRef(W(function(e,t){let n=Wt(Qt,e.__scopeTooltip),r=Bt(Qt,e.__scopeTooltip),i=h.useRef(null),a=b(t,i),[o,s]=h.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=h.useCallback(()=>{s(null),d(!1)},[d]),p=h.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=an(r,rn(r,n.getBoundingClientRect())),a=on(t.getBoundingClientRect()),o=cn([...i,...a]);s(o),d(!0)},[d]);return h.useEffect(()=>()=>f(),[f]),h.useEffect(()=>{if(c&&u){let e=W(e=>p(e,u),`handleTriggerLeave`),t=W(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),h.useEffect(()=>{if(o){let e=W(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!sn(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,S.jsx)(nn,{...e,ref:a})},`TooltipContentHoverable`)),tn=O(`TooltipContent`),nn=h.forwardRef(W(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Wt(Qt,n),u=Ft(n),{onClose:d}=l;h.useEffect(()=>(document.addEventListener(Rt,d),()=>document.removeEventListener(Rt,d)),[d]),h.useEffect(()=>{if(l.trigger){let e=W(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return V(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,S.jsx)(Te,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,S.jsxs)(it,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.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:[(0,S.jsx)(tn,{children:r}),i?(0,S.jsx)(jt,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function rn(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}W(rn,`getExitSideFromRect`);function an(e,t,n=5){let 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}W(an,`getPaddedExitPoints`);function on(e){let{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}]}W(on,`getPointsFromRect`);function sn(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}W(sn,`isPointInPolygon`);function cn(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ln(t)}W(cn,`getHull`);function ln(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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)}W(ln,`getHullPresorted`);var un=Vt,dn=Gt,fn=qt,pn=Zt,mn=$t,hn=Object.defineProperty,G=(e,t)=>hn(e,`name`,{value:t,configurable:!0});function gn(e){let t=e+`CollectionProvider`,[n,r]=L(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=G(e=>{let{scope:t,children:n}=e,r=h.useRef(null),a=h.useRef(new Map).current;return(0,S.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=T(s),l=h.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=b(t,a(s,n).collectionRef);return(0,S.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=T(u),p=h.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=h.useRef(null),s=b(t,o),c=a(u,n);return h.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,S.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return h.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return G(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}G(gn,`createCollection`);var _n=new WeakMap,vn=class e extends Map{static{G(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],_n.set(this,!0)}set(e,t){return _n.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=xn(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=yn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=yn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return yn(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function yn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=bn(e,t);return n===-1?void 0:e[n]}G(yn,`at`);function bn(e,t){let n=e.length,r=xn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}G(bn,`toSafeIndex`);function xn(e){return e!==e||e===0?0:Math.trunc(e)}G(xn,`toSafeInteger`);function Sn(e){let t=e+`CollectionProvider`,[n,r]=L(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new vn,setItemMap:G(()=>void 0,`setItemMap`)}),o=G(({state:e,...t})=>e?(0,S.jsx)(c,{...t,state:e}):(0,S.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=G(e=>{let t=g();return(0,S.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=G(e=>{let{scope:t,children:n,state:r}=e,a=h.useRef(null),[o,s]=h.useState(null),c=b(a,s),[l,u]=r;return h.useEffect(()=>{if(!o)return;let e=En(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,S.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=T(l),d=h.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=b(t,a(l,n).collectionRef);return(0,S.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=T(f),m=h.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=h.useRef(null),[s,c]=h.useState(null),l=b(t,o,c),{setItemMap:u}=a(f,n),d=h.useRef(i);Cn(d.current,i)||(d.current=i);let m=d.current;return h.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Tn):(t.set(s,{...e,element:s}),t.toSorted(Tn)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new vn(e)))}},[s,m,u]),(0,S.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function g(){return h.useState(new vn)}G(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return G(_,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}G(Sn,`createCollection`);function Cn(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}G(Cn,`shallowEqual`);function wn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}G(wn,`isElementPreceding`);function Tn(e,t){return!e[1].element||!t[1].element?0:wn(e[1].element,t[1].element)?-1:1}G(Tn,`sortByDocumentPosition`);function En(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}G(En,`getChildListObserver`);var Dn=Object.defineProperty,On=(e,t)=>Dn(e,`name`,{value:t,configurable:!0}),kn=h.createContext(void 0);function An(e){let t=h.useContext(kn);return e||t||`ltr`}On(An,`useDirection`);var jn=Object.defineProperty,K=(e,t)=>jn(e,`name`,{value:t,configurable:!0}),Mn=`focusScope.autoFocusOnMount`,Nn=`focusScope.autoFocusOnUnmount`,Pn={bubbles:!1,cancelable:!0},Fn=h.forwardRef(K(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=h.useState(null),l=z(i),u=z(a),d=h.useRef(null),f=b(t,c),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Hn(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Hn(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Hn(s)};K(e,`handleFocusIn`),K(t,`handleFocusOut`),K(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),h.useEffect(()=>{if(s){Un.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Mn,Pn);s.addEventListener(Mn,l),s.dispatchEvent(t),t.defaultPrevented||(In(Kn(Rn(s)),{select:!0}),document.activeElement===e&&Hn(s))}return()=>{s.removeEventListener(Mn,l),setTimeout(()=>{let t=new CustomEvent(Nn,Pn);s.addEventListener(Nn,u),s.dispatchEvent(t),t.defaultPrevented||Hn(e??document.body,{select:!0}),s.removeEventListener(Nn,u),Un.remove(p)},0)}}},[s,l,u,p]);let m=h.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ln(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Hn(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Hn(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,S.jsx)(R.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function In(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Hn(r,{select:t}),document.activeElement!==n)return}K(In,`focusFirst`);function Ln(e){let t=Rn(e);return[zn(t,e),zn(t.reverse(),e)]}K(Ln,`getTabbableEdges`);function Rn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:K(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}K(Rn,`getTabbableCandidates`);function zn(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Bn(r,{upTo:t})))return r}K(zn,`findVisible`);function Bn(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}K(Bn,`isHidden`);function Vn(e){return e instanceof HTMLInputElement&&`select`in e}K(Vn,`isSelectableInput`);function Hn(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Vn(e)&&t&&e.select()}}K(Hn,`focus`);var Un=Wn();function Wn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Gn(e,t),e.unshift(t)},remove(t){e=Gn(e,t),e[0]?.resume()}}}K(Wn,`createFocusScopesStack`);function Gn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}K(Gn,`arrayRemove`);function Kn(e){return e.filter(e=>e.tagName!==`A`)}K(Kn,`removeLinks`);var qn=Object.defineProperty,Jn=(e,t)=>qn(e,`name`,{value:t,configurable:!0}),Yn=0,Xn=null;function Zn(e){return Qn(),e.children}Jn(Zn,`FocusGuards`);function Qn(){h.useEffect(()=>{Xn||={start:$n(),end:$n()};let{start:e,end:t}=Xn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Yn++,()=>{Yn===1&&(Xn?.start.remove(),Xn?.end.remove(),Xn=null),Yn=Math.max(0,Yn-1)}},[])}Jn(Qn,`useFocusGuards`);function $n(){let 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}Jn($n,`createFocusGuard`);var er=Object.defineProperty,q=(e,t)=>er(e,`name`,{value:t,configurable:!0}),tr=`Dialog`,[nr,rr]=L(tr),[ir,ar]=nr(tr),or=q(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=h.useRef(null),c=h.useRef(null),[l,u]=Ct({prop:r,defaultProp:i??!1,onChange:a,caller:tr}),[d,f]=h.useState(0),[p,m]=h.useState(0);return(0,S.jsx)(ir,{scope:t,triggerRef:s,contentRef:c,contentId:H(),titleId:H(),descriptionId:H(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),sr=`DialogTrigger`,cr=h.forwardRef(q(function(e,t){let{__scopeDialog:n,...r}=e,i=ar(sr,n),a=b(t,i.triggerRef);return(0,S.jsx)(R.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Er(i.open),...r,ref:a,onClick:F(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),lr=`DialogPortal`,[ur,dr]=nr(lr,{forceMount:void 0}),fr=q(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ar(lr,t);return(0,S.jsx)(ur,{scope:t,forceMount:n,children:h.Children.map(r,e=>(0,S.jsx)(U,{present:n||a.open,children:(0,S.jsx)(ot,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),pr=`DialogOverlay`,mr=h.forwardRef(q(function(e,t){let n=dr(pr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ar(pr,e.__scopeDialog);return a.modal?(0,S.jsx)(U,{present:r||a.open,children:(0,S.jsx)(gr,{...i,ref:t})}):null},`DialogOverlay`)),hr=T(`DialogOverlay.RemoveScroll`),gr=h.forwardRef(q(function(e,t){let{__scopeDialog:n,...r}=e,a=ar(pr,n),o=b(t,Ee());return(0,S.jsx)(i,{as:hr,allowPinchZoom:!0,shards:[a.contentRef],children:(0,S.jsx)(R.div,{"data-state":Er(a.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),_r=`DialogContent`,vr=h.forwardRef(q(function(e,t){let n=dr(_r,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ar(_r,e.__scopeDialog);return(0,S.jsx)(U,{present:r||a.open,children:a.modal?(0,S.jsx)(yr,{...i,ref:t}):(0,S.jsx)(br,{...i,ref:t})})},`DialogContent`)),yr=h.forwardRef(q(function(e,t){let n=ar(_r,e.__scopeDialog),r=h.useRef(null),i=b(t,n.contentRef,r);return h.useEffect(()=>{let e=r.current;if(e)return a(e)},[]),(0,S.jsx)(xr,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:F(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),br=h.forwardRef(q(function(e,t){let n=ar(_r,e.__scopeDialog),r=h.useRef(!1),i=h.useRef(!1);return(0,S.jsx)(xr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),xr=h.forwardRef(q(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ar(_r,n);return Qn(),(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(Fn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,S.jsx)(Te,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Er(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Sr=`DialogTitle`,Cr=h.forwardRef(q(function(e,t){let{__scopeDialog:n,...r}=e,i=ar(Sr,n),{setTitleCount:a}=i;return V(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,S.jsx)(R.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),wr=`DialogDescription`,Tr=h.forwardRef(q(function(e,t){let{__scopeDialog:n,...r}=e,i=ar(wr,n),{setDescriptionCount:a}=i;return V(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,S.jsx)(R.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`));function Er(e){return e?`open`:`closed`}q(Er,`getState`);var Dr=Object.defineProperty,Or=(e,t)=>Dr(e,`name`,{value:t,configurable:!0}),kr=`Checkbox`,[Ar,jr]=L(kr),[Mr,Nr]=Ar(kr);function Pr(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Ct({prop:n,defaultProp:i??!1,onChange:c,caller:kr}),[m,g]=h.useState(null),[_,v]=h.useState(null),y=h.useRef(!1),[b,x]=h.useReducer(e=>e+1,0),C=!m||!!o||!!m.closest(`form`),w={checked:f,disabled:a,setChecked:p,control:m,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!Ur(i)&&i,isFormControl:C,bubbleInput:_,setBubbleInput:v};return(0,S.jsx)(Mr,{scope:t,...w,children:Hr(d)?d(w):r})}Or(Pr,`CheckboxProvider`);var Fr=`CheckboxTrigger`,Ir=h.forwardRef(Or(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:g}=Nr(Fr,e),_=b(i,u),v=h.useRef(c);return h.useEffect(()=>{let e=a?.form;if(e){let t=Or(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,S.jsx)(R.button,{type:`button`,role:`checkbox`,"aria-checked":Ur(c)?`mixed`:c,"aria-required":l,"data-state":Wr(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:F(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:F(n,e=>{p(),d(e=>Ur(e)?!0:!e),g&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),Lr=h.forwardRef(Or(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,S.jsx)(Pr,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Ir,{...d,ref:t,__scopeCheckbox:n}),e&&(0,S.jsx)(Vr,{__scopeCheckbox:n})]})})},`Checkbox`)),Rr=`CheckboxIndicator`,zr=h.forwardRef(Or(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Nr(Rr,n);return(0,S.jsx)(U,{present:r||Ur(a.checked)||a.checked===!0,children:(0,S.jsx)(R.span,{"data-state":Wr(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Br=`CheckboxBubbleInput`,Vr=h.forwardRef(Or(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:g}=Nr(Br,e),_=b(r,g),v=Re(i),y=h.useRef(!1),x=h.useRef(s),C=h.useRef(o);h.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==C.current;C.current=o;let i=x.current!==s;x.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=Ur(s),n.call(e,!Ur(s)&&s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let w=h.useRef(!Ur(s)&&s);return(0,S.jsx)(R.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??w.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:F(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Hr(e){return typeof e==`function`}Or(Hr,`isFunction`);function Ur(e){return e===`indeterminate`}Or(Ur,`isIndeterminate`);function Wr(e){return Ur(e)?`indeterminate`:e?`checked`:`unchecked`}Or(Wr,`getState`);var Gr=Object.defineProperty,Kr=(e,t)=>Gr(e,`name`,{value:t,configurable:!0}),qr=!1;function Jr(){let[e,t]=h.useState(qr);return h.useEffect(()=>{qr||(qr=!0,t(!0))},[]),e}Kr(Jr,`useIsHydrated`);var Yr=h.useSyncExternalStore;function Xr(){return()=>{}}Kr(Xr,`subscribe`);function Zr(){return Yr(Xr,()=>!0,()=>!1)}Kr(Zr,`useIsHydratedModern`);var Qr=typeof Yr==`function`?Zr:Jr,$r=Object.defineProperty,ei=(e,t)=>$r(e,`name`,{value:t,configurable:!0}),ti=`rovingFocusGroup.onEntryFocus`,ni={bubbles:!1,cancelable:!0},ri=`RovingFocusGroup`,[ii,ai,oi]=gn(ri),[si,ci]=L(ri,[oi]),[li,ui]=si(ri),di=h.forwardRef(ei(function(e,t){return(0,S.jsx)(ii.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,S.jsx)(ii.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,S.jsx)(fi,{...e,ref:t})})})},`RovingFocusGroup`)),fi=h.forwardRef(ei(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=h.useRef(null),p=b(t,f),m=An(a),[g,_]=Ct({prop:o,defaultProp:s??null,onChange:c,caller:ri}),[v,y]=h.useState(!1),x=z(l),C=ai(n),w=h.useRef(!1),[T,E]=h.useState(0);return h.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(ti,x),()=>e.removeEventListener(ti,x)},[x]),(0,S.jsx)(li,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:h.useCallback(e=>_(e),[_]),onItemShiftTab:h.useCallback(()=>y(!0),[]),onFocusableItemAdd:h.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:h.useCallback(()=>E(e=>e-1),[]),children:(0,S.jsx)(R.div,{tabIndex:v||T===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:F(e.onMouseDown,()=>{w.current=!0}),onFocus:F(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(ti,ni);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);vi([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}w.current=!1}),onBlur:F(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),pi=`RovingFocusGroupItem`,mi=h.forwardRef(ei(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=H(),l=a||c,u=ui(pi,n),d=u.currentTabStopId===l,f=ai(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:g}=u,_=Qr();return V(()=>{if(!(!_||!r))return p(),()=>m()},[_,r,p,m]),h.useEffect(()=>{if(!(_||!r))return p(),()=>m()},[_,r,p,m]),(0,S.jsx)(ii.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,S.jsx)(R.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:F(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:F(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:F(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=_i(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?yi(n,r+1):n.slice(r+1)}setTimeout(()=>vi(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),hi={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function gi(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}ei(gi,`getDirectionAwareKey`);function _i(e,t,n){let r=gi(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return hi[r]}ei(_i,`getFocusIntent`);function vi(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}ei(vi,`focusFirst`);function yi(e,t){return e.map((n,r)=>e[(t+r)%e.length])}ei(yi,`wrapArray`);var bi=di,xi=mi,Si=Object.defineProperty,J=(e,t)=>Si(e,`name`,{value:t,configurable:!0}),Ci=[`Enter`,` `],wi=[`ArrowDown`,`PageUp`,`Home`],Ti=[`ArrowUp`,`PageDown`,`End`],Ei=[...wi,...Ti],Di={ltr:[...Ci,`ArrowRight`],rtl:[...Ci,`ArrowLeft`]},Oi={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},ki=`Menu`,[Ai,ji,Mi]=gn(ki),[Ni,Pi]=L(ki,[Mi,Ue,ci]),Fi=Ue(),Ii=ci(),[Li,Ri]=Ni(ki),[zi,Bi]=Ni(ki),Vi=J(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Fi(t),[c,l]=h.useState(null),u=h.useRef(!1),d=z(a),f=An(i);return h.useEffect(()=>{let e=J(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=J(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;let e=J(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,S.jsx)(nt,{...s,children:(0,S.jsx)(Li,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,S.jsx)(zi,{scope:t,onClose:h.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),Hi=h.forwardRef(J(function(e,t){let{__scopeMenu:n,...r}=e,i=Fi(n);return(0,S.jsx)(rt,{...i,...r,ref:t})},`MenuAnchor`)),Ui=`MenuPortal`,[Wi,Gi]=Ni(Ui,{forceMount:void 0}),Ki=J(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ri(Ui,t);return(0,S.jsx)(Wi,{scope:t,forceMount:n,children:(0,S.jsx)(U,{present:n||a.open,children:(0,S.jsx)(ot,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Y=`MenuContent`,[qi,Ji]=Ni(Y),Yi=h.forwardRef(J(function(e,t){let n=Gi(Y,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ri(Y,e.__scopeMenu),o=Bi(Y,e.__scopeMenu);return(0,S.jsx)(Ai.Provider,{scope:e.__scopeMenu,children:(0,S.jsx)(U,{present:r||a.open,children:(0,S.jsx)(Ai.Slot,{scope:e.__scopeMenu,children:o.modal?(0,S.jsx)(Xi,{...i,ref:t}):(0,S.jsx)(Zi,{...i,ref:t})})})})},`MenuContent`)),Xi=h.forwardRef(J(function(e,t){let n=Ri(Y,e.__scopeMenu),r=h.useRef(null),i=b(t,r);return h.useEffect(()=>{let e=r.current;if(e)return a(e)},[]),(0,S.jsx)($i,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Zi=h.forwardRef(J(function(e,t){let n=Ri(Y,e.__scopeMenu);return(0,S.jsx)($i,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Qi=T(`MenuContent.ScrollLock`),$i=h.forwardRef(J(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,..._}=e,v=Ri(Y,n),y=Bi(Y,n),x=Fi(n),C=Ii(n),w=ji(n),[T,E]=h.useState(null),D=h.useRef(null),O=b(t,D,v.onContentChange),k=h.useRef(0),A=h.useRef(``),ee=h.useRef(0),j=h.useRef(null),te=h.useRef(`right`),M=h.useRef(0),ne=g?i:h.Fragment,re=g?{as:Qi,allowPinchZoom:!0}:void 0,ie=J(e=>{let t=A.current+e,n=w().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ka(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;J((function e(t){A.current=t,window.clearTimeout(k.current),t!==``&&(k.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);h.useEffect(()=>()=>window.clearTimeout(k.current),[]),Qn();let N=h.useCallback(e=>te.current===j.current?.side&&ja(e,j.current?.area),[]);return(0,S.jsx)(qi,{scope:n,searchRef:A,onItemEnter:h.useCallback(e=>{N(e)&&e.preventDefault()},[N]),onItemLeave:h.useCallback(e=>{N(e)||(D.current?.focus(),E(null))},[N]),onTriggerLeave:h.useCallback(e=>{N(e)&&e.preventDefault()},[N]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:h.useCallback(e=>{j.current=e},[]),children:(0,S.jsx)(ne,{...re,children:(0,S.jsx)(Fn,{asChild:!0,trapped:a,onMountAutoFocus:F(o,e=>{e.preventDefault(),D.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,S.jsx)(Te,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:(0,S.jsx)(bi,{asChild:!0,...C,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:T,onCurrentTabStopIdChange:E,onEntryFocus:F(l,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,S.jsx)(it,{role:`menu`,"aria-orientation":`vertical`,"data-state":wa(v.open),"data-radix-menu-content":``,dir:y.dir,...x,..._,ref:O,style:{outline:`none`,..._.style},onKeyDown:F(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ie(e.key));let i=D.current;if(e.target!==i||!Ei.includes(e.key))return;e.preventDefault();let a=w().filter(e=>!e.disabled).map(e=>e.ref.current);Ti.includes(e.key)&&a.reverse(),Da(a)}),onBlur:F(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(k.current),A.current=``)}),onPointerMove:F(e.onPointerMove,Ma(e=>{let t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>M.current?`right`:`left`;te.current=t,M.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),ea=h.forwardRef(J(function(e,t){let{__scopeMenu:n,...r}=e;return(0,S.jsx)(R.div,{role:`group`,...r,ref:t})},`MenuGroup`)),ta=h.forwardRef(J(function(e,t){let{__scopeMenu:n,...r}=e;return(0,S.jsx)(R.div,{...r,ref:t})},`MenuLabel`)),na=`MenuItem`,ra=`menu.itemSelect`,ia=h.forwardRef(J(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=h.useRef(null),o=Bi(na,e.__scopeMenu),s=Ji(na,e.__scopeMenu),c=b(t,a),l=h.useRef(!1),u=J(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(ra,{bubbles:!0,cancelable:!0});e.addEventListener(ra,e=>r?.(e),{once:!0}),ge(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,S.jsx)(aa,{...i,ref:c,disabled:n,onClick:F(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:F(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:F(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||Ci.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),aa=h.forwardRef(J(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Ji(na,n),s=Ii(n),c=h.useRef(null),l=b(t,c),[u,d]=h.useState(!1),[f,p]=h.useState(``);return h.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,S.jsx)(Ai.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,S.jsx)(xi,{asChild:!0,...s,focusable:!r,children:(0,S.jsx)(R.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:F(e.onPointerMove,Ma(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:F(e.onPointerLeave,Ma(e=>o.onItemLeave(e))),onFocus:F(e.onFocus,()=>d(!0)),onBlur:F(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[oa,sa]=Ni(`MenuRadioGroup`,{value:void 0,onValueChange:J(()=>{},`onValueChange`)}),ca=h.forwardRef(J(function(e,t){let{value:n,onValueChange:r,...i}=e,a=z(r);return(0,S.jsx)(oa,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,S.jsx)(ea,{...i,ref:t})})},`MenuRadioGroup`)),la=`MenuRadioItem`,ua=h.forwardRef(J(function(e,t){let{value:n,...r}=e,i=sa(la,e.__scopeMenu),a=n===i.value;return(0,S.jsx)(fa,{scope:e.__scopeMenu,checked:a,children:(0,S.jsx)(ia,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Ea(a),onSelect:F(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),da=`MenuItemIndicator`,[fa,pa]=Ni(da,{checked:!1}),ma=h.forwardRef(J(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=pa(da,n);return(0,S.jsx)(U,{present:r||Ta(a.checked)||a.checked===!0,children:(0,S.jsx)(R.span,{...i,ref:t,"data-state":Ea(a.checked)})})},`MenuItemIndicator`)),ha=h.forwardRef(J(function(e,t){let{__scopeMenu:n,...r}=e;return(0,S.jsx)(R.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),ga=`MenuSub`,[_a,va]=Ni(ga),ya=J(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ri(ga,t),o=Fi(t),[s,c]=h.useState(null),[l,u]=h.useState(null),d=z(i);return h.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,S.jsx)(nt,{...o,children:(0,S.jsx)(Li,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,S.jsx)(_a,{scope:t,contentId:H(),triggerId:H(),trigger:s,onTriggerChange:c,children:n})})})},`MenuSub`),ba=`MenuSubTrigger`,xa=h.forwardRef(J(function(e,t){let n=Ri(ba,e.__scopeMenu),r=Bi(ba,e.__scopeMenu),i=va(ba,e.__scopeMenu),a=Ji(ba,e.__scopeMenu),o=h.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=h.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);h.useEffect(()=>u,[u]),h.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=b(t,i.onTriggerChange);return(0,S.jsx)(Hi,{asChild:!0,...l,children:(0,S.jsx)(aa,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":wa(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:F(e.onPointerMove,Ma(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:F(e.onPointerLeave,Ma(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:F(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||Di[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Sa=`MenuSubContent`,Ca=h.forwardRef(J(function(e,t){let n=Gi(Y,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Ri(Y,e.__scopeMenu),s=Bi(Y,e.__scopeMenu),c=va(Sa,e.__scopeMenu),l=h.useRef(null),u=b(t,l);return(0,S.jsx)(Ai.Provider,{scope:e.__scopeMenu,children:(0,S.jsx)(U,{present:r||o.open,children:(0,S.jsx)(Ai.Slot,{scope:e.__scopeMenu,children:(0,S.jsx)($i,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:F(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:F(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:F(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Oi[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function wa(e){return e?`open`:`closed`}J(wa,`getOpenState`);function Ta(e){return e===`indeterminate`}J(Ta,`isIndeterminate`);function Ea(e){return Ta(e)?`indeterminate`:e?`checked`:`unchecked`}J(Ea,`getCheckedState`);function Da(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}J(Da,`focusFirst`);function Oa(e,t){return e.map((n,r)=>e[(t+r)%e.length])}J(Oa,`wrapArray`);function ka(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Oa(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}J(ka,`getNextMatch`);function Aa(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}J(Aa,`isPointInPolygon`);function ja(e,t){return t?Aa({x:e.clientX,y:e.clientY},t):!1}J(ja,`isPointerInGraceArea`);function Ma(e){return t=>t.pointerType===`mouse`?e(t):void 0}J(Ma,`whenMouse`);var Na=Vi,Pa=Hi,Fa=Ki,Ia=Yi,La=ea,Ra=ta,za=ia,Ba=ca,Va=ua,Ha=ma,Ua=ha,Wa=ya,Ga=xa,Ka=Ca,qa=Object.defineProperty,X=(e,t)=>qa(e,`name`,{value:t,configurable:!0}),Ja=`DropdownMenu`,[Ya,Xa]=L(Ja,[Pi]),Z=Pi(),[Za,Qa]=Ya(Ja),$a=X(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Z(t),l=h.useRef(null),[u,d]=Ct({prop:i,defaultProp:a??!1,onChange:o,caller:Ja});return(0,S.jsx)(Za,{scope:t,triggerId:H(),triggerRef:l,contentId:H(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,S.jsx)(Na,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),eo=`DropdownMenuTrigger`,to=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Qa(eo,n),o=Z(n),s=b(t,a.triggerRef);return(0,S.jsx)(Pa,{asChild:!0,...o,children:(0,S.jsx)(R.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:F(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:F(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),no=X(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Z(t);return(0,S.jsx)(Fa,{...r,...n})},`DropdownMenuPortal`),ro=`DropdownMenuContent`,io=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Qa(ro,n),a=Z(n),o=h.useRef(!1);return(0,S.jsx)(Ia,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:F(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),ao=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,S.jsx)(La,{...i,...r,ref:t})},`DropdownMenuGroup`)),oo=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,S.jsx)(Ra,{...i,...r,ref:t})},`DropdownMenuLabel`)),so=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,S.jsx)(za,{...i,...r,ref:t})},`DropdownMenuItem`)),co=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,S.jsx)(Ba,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),lo=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,S.jsx)(Va,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),uo=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,S.jsx)(Ha,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),fo=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,S.jsx)(Ua,{...i,...r,ref:t})},`DropdownMenuSeparator`)),po=X(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Z(t),[s,c]=Ct({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,S.jsx)(Wa,{...o,open:s,onOpenChange:c,children:n})},`DropdownMenuSub`),mo=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,S.jsx)(Ga,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),ho=h.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,S.jsx)(Ka,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),go=$a,_o=to,vo=no,yo=io,bo=ao,xo=oo,So=so,Co=co,wo=lo,To=uo,Eo=fo,Do=po,Oo=mo,ko=ho,Ao=Object.defineProperty,jo=(e,t)=>Ao(e,`name`,{value:t,configurable:!0});function Mo(e){let t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}jo(Mo,`usePrevious`);var No=Object.defineProperty,Po=(e,t)=>No(e,`name`,{value:t,configurable:!0});function Fo(e,[t,n]){return Math.min(n,Math.max(t,e))}Po(Fo,`clamp`);var Io=Object.defineProperty,Q=(e,t)=>Io(e,`name`,{value:t,configurable:!0}),Lo=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Ro=[` `,`Enter`],zo=`Select`,[Bo,Vo,Ho]=gn(zo),[Uo,Wo]=L(zo,[Ho,Ue]),Go=Ue(),[Ko,qo]=Uo(zo),[Jo,Yo]=Uo(zo);function Xo(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:g}=e,_=Go(t),[v,y]=h.useState(null),[b,x]=h.useState(null),[C,w]=h.useState(!1),T=An(l),[E,D]=Ct({prop:r,defaultProp:i??!1,onChange:a,caller:zo}),[O,k]=Ct({prop:o,defaultProp:s,onChange:c,caller:zo}),A=h.useRef(null),ee=h.useRef(O);h.useEffect(()=>{let e=m?v?.ownerDocument.getElementById(m):v?.form;if(e instanceof HTMLFormElement){let t=Q(()=>k(ee.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,v,k]);let j=!v||!!m||!!v.closest(`form`),[te,M]=h.useState(new Set),ne=H(),re=Array.from(te).map(e=>e.props.value).join(`;`),ie=h.useCallback(e=>{M(t=>new Set(t).add(e))},[]),N=h.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),ae={required:p,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:ne,value:O,onValueChange:k,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:te,nativeSelectKey:re,isFormControl:j};return(0,S.jsx)(nt,{..._,children:(0,S.jsx)(Ko,{scope:t,...ae,children:(0,S.jsx)(Bo.Provider,{scope:t,children:(0,S.jsx)(Jo,{scope:t,onNativeOptionAdd:ie,onNativeOptionRemove:N,children:Ls(g)?g(ae):n})})})})}Q(Xo,`SelectProvider`);var Zo=Q(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,S.jsx)(Xo,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,S.jsxs)(S.Fragment,{children:[n,e?(0,S.jsx)(Is,{__scopeSelect:t}):null]})})},`Select`),Qo=`SelectTrigger`,$o=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Go(n),o=qo(Qo,n),s=o.disabled||r,c=b(t,o.onTriggerChange),l=Vo(n),u=h.useRef(`touch`),[d,f,p]=zs(e=>{let t=l().filter(e=>!e.disabled),n=Bs(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=Q(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,S.jsx)(rt,{asChild:!0,...a,children:(0,S.jsx)(R.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Rs(o.value)?``:void 0,...i,ref:c,onClick:F(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:F(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:F(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Lo.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),es=`SelectValue`,ts=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=qo(es,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=b(t,c.onValueNodeChange);V(()=>{l(u)},[l,u]);let f=Rs(c.value);return(0,S.jsx)(R.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,S.jsx)(h.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),ns=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,S.jsx)(R.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[rs,is]=Uo(`SelectPortal`,{forceMount:void 0}),as=Q(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,S.jsx)(rs,{scope:e.__scopeSelect,forceMount:n,children:(0,S.jsx)(ot,{asChild:!0,...r})})},`SelectPortal`),os=`SelectContent`,ss=h.forwardRef(Q(function(e,t){let n=is(os,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=qo(os,e.__scopeSelect),[o,s]=h.useState();return V(()=>{s(new DocumentFragment)},[]),(0,S.jsx)(U,{present:r||a.open,children:({present:e})=>e?(0,S.jsx)(fs,{...i,ref:t}):(0,S.jsx)(cs,{...i,fragment:o})})},`SelectContent`)),cs=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?x.createPortal((0,S.jsx)(ls,{scope:n,children:(0,S.jsx)(Bo.Slot,{scope:n,children:(0,S.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),$=10,[ls,us]=Uo(os),ds=T(`SelectContent.RemoveScroll`),fs=h.forwardRef(Q(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:_,hideWhenDetached:v,avoidCollisions:y,...x}=e,C=qo(os,n),[w,T]=h.useState(null),[E,D]=h.useState(null),O=b(t,T),[k,A]=h.useState(null),[ee,j]=h.useState(null),te=Vo(n),[M,ne]=h.useState(!1),re=h.useRef(!1);h.useEffect(()=>{if(w)return a(w)},[w]),Qn();let ie=h.useCallback(e=>{let[t,...n]=te().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&E&&(E.scrollTop=0),n===r&&E&&(E.scrollTop=E.scrollHeight),n?.focus(),document.activeElement!==i))return},[te,E]),N=h.useCallback(()=>ie([k,w]),[ie,k,w]);h.useEffect(()=>{M&&N()},[M,N]);let{onOpenChange:ae,triggerPointerDownPosRef:P}=C;h.useEffect(()=>{if(w){let e={x:0,y:0},t=Q(t=>{e={x:Math.abs(Math.round(t.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(P.current?.y??0))}},`handlePointerMove`),n=Q(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||ae(!1),document.removeEventListener(`pointermove`,t),P.current=null},`handlePointerUp`);return P.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[w,ae,P]),h.useEffect(()=>{let e=Q(()=>ae(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ae]);let[oe,se]=zs(e=>{let t=te().filter(e=>!e.disabled),n=Bs(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ce=h.useCallback((e,t,n)=>{let r=!re.current&&!n;(C.value!==void 0&&C.value===t||r)&&(A(e),r&&(re.current=!0))},[C.value]),le=h.useCallback(()=>w?.focus(),[w]),ue=h.useCallback((e,t,n)=>{let r=!re.current&&!n;(C.value!==void 0&&C.value===t||r)&&j(e)},[C.value]),de=r===`popper`?ms:ps,I=de===ms?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:_,hideWhenDetached:v,avoidCollisions:y}:{};return(0,S.jsx)(ls,{scope:n,content:w,viewport:E,onViewportChange:D,itemRefCallback:ce,selectedItem:k,onItemLeave:le,itemTextRefCallback:ue,focusSelectedItem:N,selectedItemText:ee,position:r,isPositioned:M,searchRef:oe,children:(0,S.jsx)(i,{as:ds,allowPinchZoom:!0,children:(0,S.jsx)(Fn,{asChild:!0,trapped:C.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:F(o,e=>{C.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,S.jsx)(Te,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:(0,S.jsx)(de,{role:`listbox`,id:C.contentId,"data-state":C.open?`open`:`closed`,dir:C.dir,onContextMenu:e=>e.preventDefault(),...x,...I,onPlaced:()=>ne(!0),ref:O,style:{display:`flex`,flexDirection:`column`,outline:`none`,...x.style},onKeyDown:F(x.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&se(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=te().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ie(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),ps=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=qo(os,n),o=us(os,n),[s,c]=h.useState(null),[l,u]=h.useState(null),d=b(t,u),f=Vo(n),p=h.useRef(!1),m=h.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=o,x=h.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&g&&_&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-$,d=Fo(a,[$,Math.max($,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-$,d=Fo(a,[$,Math.max($,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-$*2,u=g.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+h+u+b+y,S=Math.min(_.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-$,D=c-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=m+h+k,ee=x-A;if(A<=E){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+g.offsetTop+(e?w:0)+O)+ee;s.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}s.style.margin=`${$}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,g,_,v,a.dir,r]);V(()=>x(),[x]);let[C,w]=h.useState();return V(()=>{l&&w(window.getComputedStyle(l).zIndex)},[l]),(0,S.jsx)(hs,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:h.useCallback(e=>{e&&m.current===!0&&(x(),y?.(),m.current=!1)},[x,y]),children:(0,S.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,S.jsx)(R.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),ms=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=$,...a}=e,o=Go(n);return(0,S.jsx)(it,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})},`SelectPopperPosition`)),[hs,gs]=Uo(os,{}),_s=`SelectViewport`,vs=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=us(_s,n),o=gs(_s,n),s=b(t,a.onViewportChange),c=h.useRef(0);return(0,S.jsxs)(S.Fragment,{children:[(0,S.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}),(0,S.jsx)(Bo.Slot,{scope:n,children:(0,S.jsx)(R.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:F(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-$*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[ys,bs]=Uo(`SelectGroup`),xs=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,...r}=e,i=H();return(0,S.jsx)(ys,{scope:n,id:i,children:(0,S.jsx)(R.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})},`SelectGroup`)),Ss=`SelectItem`,[Cs,ws]=Uo(Ss),Ts=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=qo(Ss,n),c=us(Ss,n),l=s.value===r,[u,d]=h.useState(a??``),[f,p]=h.useState(!1),m=b(t,z(e=>c.itemRefCallback?.(e,r,i))),g=H(),_=h.useRef(`touch`),v=Q(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,S.jsx)(Cs,{scope:n,value:r,disabled:i,textId:g,isSelected:l,onItemTextChange:h.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,S.jsx)(Bo.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,S.jsx)(R.div,{role:`option`,"aria-labelledby":g,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:F(o.onFocus,()=>p(!0)),onBlur:F(o.onBlur,()=>p(!1)),onClick:F(o.onClick,()=>{_.current!==`mouse`&&v()}),onPointerUp:F(o.onPointerUp,()=>{_.current===`mouse`&&v()}),onPointerDown:F(o.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:F(o.onPointerMove,e=>{_.current=e.pointerType,i?c.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:F(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:F(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(Ro.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Es=`SelectItemText`,Ds=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=qo(Es,n),s=us(Es,n),c=ws(Es,n),l=Yo(Es,n),[u,d]=h.useState(null),f=z(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=b(t,d,c.onItemTextChange,f),m=u?.textContent,g=h.useMemo(()=>(0,S.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=l;return V(()=>(_(g),()=>v(g)),[_,v,g]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(R.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Rs(o.value)?x.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Os=`SelectItemIndicator`,ks=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,...r}=e;return ws(Os,n).isSelected?(0,S.jsx)(R.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),As=`SelectScrollUpButton`,js=h.forwardRef(Q(function(e,t){let n=us(As,e.__scopeSelect),r=gs(As,e.__scopeSelect),[i,a]=h.useState(!1),o=b(t,r.onScrollButtonChange);return V(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,S.jsx)(Ps,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Ms=`SelectScrollDownButton`,Ns=h.forwardRef(Q(function(e,t){let n=us(Ms,e.__scopeSelect),r=gs(Ms,e.__scopeSelect),[i,a]=h.useState(!1),o=b(t,r.onScrollButtonChange);return V(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,S.jsx)(Ps,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Ps=h.forwardRef(Q(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=us(`SelectScrollButton`,n),o=h.useRef(null),s=Vo(n),c=h.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),V(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,S.jsx)(R.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:F(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:F(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:F(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Fs=`SelectBubbleInput`,Is=h.forwardRef(Q(function({__scopeSelect:e,...t},n){let r=qo(Fs,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=h.useRef(null),m=b(n,p),g=i??``,_=Mo(g),v=Array.from(d).some(e=>(e.props.value??``)===``);return h.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,S.jsxs)(R.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...At,...t.style},ref:m,defaultValue:g,children:[Rs(i)&&!v?(0,S.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Ls(e){return typeof e==`function`}Q(Ls,`isFunction`);function Rs(e){return e===``||e===void 0}Q(Rs,`shouldShowPlaceholder`);function zs(e){let t=z(e),n=h.useRef(``),r=h.useRef(0),i=h.useCallback(e=>{let i=n.current+e;t(i),Q((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=h.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Q(zs,`useTypeaheadSearch`);function Bs(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Vs(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Q(Bs,`findNextItem`);function Vs(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Q(Vs,`wrapArray`);export{fn as $,za as A,or as B,Eo as C,_o as D,Oo as E,Ka as F,Cr as G,Tr as H,Ga as I,Fn as J,cr as K,Pi as L,Na as M,Ua as N,Pa as O,Wa as P,dn as Q,Lr as R,go as S,ko as T,mr as U,vr as V,fr as W,pn as X,mn as Y,un as Z,To as _,Ts as a,nt as at,Co as b,as as c,H as ct,$o as d,L as dt,Ct as et,ts as f,F as ft,So as g,bo as h,b as ht,ns as i,it,Fa as j,Ia as k,Ns as l,Te as lt,yo as m,T as mt,ss as n,ot as nt,ks as o,Ue as ot,vs as p,E as pt,Qn as q,xs as r,rt,Ds as s,Re as st,Zo as t,U as tt,js as u,R as ut,xo as v,Do as w,wo as x,vo as y,zr as z};
@@ -0,0 +1 @@
1
+ var e=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(e||{});function t({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function n(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var r=[],i=0,{link:a,unlink:o,propagate:s,checkDirty:c,shallowPropagate:l}=t({update(e){return e._update()},notify(t){r[d++]=t,t.flags&=~e.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=e.Mutable|e.Dirty,h(t))}}),u=0,d=0,f,p=0;function m(e){try{++p,e()}finally{--p||g()}}function h(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=o(n,e)}function g(){if(!(p>0)){for(;u<d;){let e=r[u];r[u++]=void 0,e.notify()}u=0,d=0}}function _(t,r){let o=typeof t==`function`,u=t,d={_snapshot:o?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:o?e.None:e.Mutable,get(){return f!==void 0&&a(d,f,i),d._snapshot},subscribe(e){let t=n(e),r={current:!1},i=v(()=>{d.get(),r.current?t.next?.(d._snapshot):r.current=!0});return{unsubscribe:()=>{i.stop()}}},_update(t){let n=f,a=r?.compare??Object.is;if(o)f=d,++i,d.depsTail=void 0;else if(t===void 0)return!1;o&&(d.flags=e.Mutable|e.RecursedCheck);try{let e=d._snapshot,n=typeof t==`function`?t(e):t===void 0&&o?u(e):t;return e===void 0||!a(e,n)?(d._snapshot=n,!0):!1}finally{f=n,o&&(d.flags&=~e.RecursedCheck),h(d)}}};return o?(d.flags=e.Mutable|e.Dirty,d.get=function(){let t=d.flags;if(t&e.Dirty||t&e.Pending&&c(d.deps,d)){if(d._update()){let e=d.subs;e!==void 0&&l(e)}}else t&e.Pending&&(d.flags=t&~e.Pending);return f!==void 0&&a(d,f,i),d._snapshot}):d.set=function(e){if(d._update(e)){let e=d.subs;e!==void 0&&(s(e),l(e),g())}},d}function v(t){let n=()=>{let n=f;f=r,++i,r.depsTail=void 0,r.flags=e.Watching|e.RecursedCheck;try{return t()}finally{f=n,r.flags&=~e.RecursedCheck,h(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:e.Watching|e.RecursedCheck,notify(){let t=this.flags;t&e.Dirty||t&e.Pending&&c(this.deps,this)?n():this.flags=e.Watching},stop(){this.flags=e.None,this.depsTail=void 0,h(this)}};return n(),r}export{_ as n,m as t};