@baochunli/flakes 0.0.3 → 0.0.5

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 (295) hide show
  1. package/dist/commands/auth.d.ts.map +1 -1
  2. package/dist/commands/auth.js +133 -13
  3. package/dist/commands/auth.js.map +1 -1
  4. package/dist/commands/host.d.ts.map +1 -1
  5. package/dist/commands/host.js +77 -2
  6. package/dist/commands/host.js.map +1 -1
  7. package/dist/commands/projects.d.ts +4 -0
  8. package/dist/commands/projects.d.ts.map +1 -0
  9. package/dist/commands/projects.js +133 -0
  10. package/dist/commands/projects.js.map +1 -0
  11. package/dist/commands/runs.d.ts.map +1 -1
  12. package/dist/commands/runs.js +5 -1
  13. package/dist/commands/runs.js.map +1 -1
  14. package/dist/commands/runtime.d.ts +0 -1
  15. package/dist/commands/runtime.d.ts.map +1 -1
  16. package/dist/commands/runtime.js +2 -280
  17. package/dist/commands/runtime.js.map +1 -1
  18. package/dist/commands/server.d.ts.map +1 -1
  19. package/dist/commands/server.js +0 -6
  20. package/dist/commands/server.js.map +1 -1
  21. package/dist/commands/tasks.js +3 -0
  22. package/dist/commands/tasks.js.map +1 -1
  23. package/dist/config-example.js +1 -1
  24. package/dist/config-example.js.map +1 -1
  25. package/dist/host-config.d.ts +1 -6
  26. package/dist/host-config.d.ts.map +1 -1
  27. package/dist/host-config.js +10 -28
  28. package/dist/host-config.js.map +1 -1
  29. package/dist/host-runner.d.ts +3 -0
  30. package/dist/host-runner.d.ts.map +1 -1
  31. package/dist/host-runner.js +18 -6
  32. package/dist/host-runner.js.map +1 -1
  33. package/dist/host-runtime.d.ts.map +1 -1
  34. package/dist/host-runtime.js +92 -2
  35. package/dist/host-runtime.js.map +1 -1
  36. package/dist/host-transport.js +2 -5
  37. package/dist/host-transport.js.map +1 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +46 -42
  40. package/dist/index.js.map +1 -1
  41. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.d.ts +10 -0
  42. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.d.ts.map +1 -0
  43. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.js +16 -0
  44. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.js.map +1 -0
  45. package/dist/node_modules/@flakes/auth/package.json +1 -1
  46. package/dist/node_modules/@flakes/console/.output/nitro.json +1 -1
  47. package/dist/node_modules/@flakes/console/.output/public/assets/DocumentationPage-CNPk8RVl.js +1 -0
  48. package/dist/node_modules/@flakes/console/.output/public/assets/ProjectsPage-CKPR1nnu.js +1 -0
  49. package/dist/node_modules/@flakes/console/.output/public/assets/RunPage-BdugbnA3.js +3 -0
  50. package/dist/node_modules/@flakes/console/.output/public/assets/RunsPage-CJbycrqM.js +1 -0
  51. package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesLens-BoLM52PY.js +1 -0
  52. package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesPage-6KHjMeaR.js +1 -0
  53. package/dist/node_modules/@flakes/console/.output/public/assets/TranscriptPage-CHSq0_qN.js +1 -0
  54. package/dist/node_modules/@flakes/console/.output/public/assets/_-CD1Voz9h.js +1 -0
  55. package/dist/node_modules/@flakes/console/.output/public/assets/_runId-_0VPmGYe.js +2 -0
  56. package/dist/node_modules/@flakes/console/.output/public/assets/_taskId-CPAKAp4X.js +2 -0
  57. package/dist/node_modules/@flakes/console/.output/public/assets/account-BoRurhrq.js +1 -0
  58. package/dist/node_modules/@flakes/console/.output/public/assets/account-forms-D4eVqOhW.js +1 -0
  59. package/dist/node_modules/@flakes/console/.output/public/assets/arrow-right-QzVbRzF_.js +1 -0
  60. package/dist/node_modules/@flakes/console/.output/public/assets/auth-layout-DBnq_eif.js +1 -0
  61. package/dist/node_modules/@flakes/console/.output/public/assets/bits-BOMPEHvv.js +1 -0
  62. package/dist/node_modules/@flakes/console/.output/public/assets/card-37qs8AAd.js +1 -0
  63. package/dist/node_modules/@flakes/console/.output/public/assets/circle-alert-CM0SVfzc.js +1 -0
  64. package/dist/node_modules/@flakes/console/.output/public/assets/circle-check-CzwcEElH.js +1 -0
  65. package/dist/node_modules/@flakes/console/.output/public/assets/circle-x-C_sOQVNQ.js +1 -0
  66. package/dist/node_modules/@flakes/console/.output/public/assets/device-FqII-S41.js +1 -0
  67. package/dist/node_modules/@flakes/console/.output/public/assets/dist-BEfdrJTS.js +1 -0
  68. package/dist/node_modules/@flakes/console/.output/public/assets/documentation-2C3ncAuV.js +1 -0
  69. package/dist/node_modules/@flakes/console/.output/public/assets/{external-link-BW8lpiMR.js → external-link-BWhbbPgy.js} +1 -1
  70. package/dist/node_modules/@flakes/console/.output/public/assets/{file-text-DMdy8OfN.js → file-text-DLxLJ7P1.js} +1 -1
  71. package/dist/node_modules/@flakes/console/.output/public/assets/forgot-password-BSQ4TWpA.js +1 -0
  72. package/dist/node_modules/@flakes/console/.output/public/assets/inbox-BVu38EN6.js +1 -0
  73. package/dist/node_modules/@flakes/console/.output/public/assets/{lib-DtfURcG3.js → lib-COfgMmRR.js} +3 -3
  74. package/dist/node_modules/@flakes/console/.output/public/assets/link-ll3nLBSM.js +1 -0
  75. package/dist/node_modules/@flakes/console/.output/public/assets/{lock-D4OhqEPW.js → lock-Ck2SfQA2.js} +1 -1
  76. package/dist/node_modules/@flakes/console/.output/public/assets/main-LpSDdT-S.js +1215 -0
  77. package/dist/node_modules/@flakes/console/.output/public/assets/matchContext-puEkI9BI.js +1 -0
  78. package/dist/node_modules/@flakes/console/.output/public/assets/otp-verification-CussJQT1.js +20 -0
  79. package/dist/node_modules/@flakes/console/.output/public/assets/projects-CLgKBrCe.js +2 -0
  80. package/dist/node_modules/@flakes/console/.output/public/assets/react-B8IZ02wI.js +1 -0
  81. package/dist/node_modules/@flakes/console/.output/public/assets/react-dom-ki7NpxV4.js +1 -0
  82. package/dist/node_modules/@flakes/console/.output/public/assets/redirect-Cu9zBy04.js +1 -0
  83. package/dist/node_modules/@flakes/console/.output/public/assets/reset-password-DwWhVkEh.js +1 -0
  84. package/dist/node_modules/@flakes/console/.output/public/assets/runs-CFYk2iRh.js +2 -0
  85. package/dist/node_modules/@flakes/console/.output/public/assets/sandboxes-mGsOcVFL.js +2 -0
  86. package/dist/node_modules/@flakes/console/.output/public/assets/{save-1uf5fQff.js → save-Bte_1tnN.js} +1 -1
  87. package/dist/node_modules/@flakes/console/.output/public/assets/security-MjM55vIw.js +1 -0
  88. package/dist/node_modules/@flakes/console/.output/public/assets/signin-KbA1cD6o.js +1 -0
  89. package/dist/node_modules/@flakes/console/.output/public/assets/signin-form-CBF-d8iK.js +1 -0
  90. package/dist/node_modules/@flakes/console/.output/public/assets/signup-CbHsThKr.js +1 -0
  91. package/dist/node_modules/@flakes/console/.output/public/assets/styles-DtA2wbW8.css +2 -0
  92. package/dist/node_modules/@flakes/console/.output/public/assets/table-WMIs2m3R.js +1 -0
  93. package/dist/node_modules/@flakes/console/.output/public/assets/tiny-invariant-CO5X59di.js +1 -0
  94. package/dist/node_modules/@flakes/console/.output/public/assets/user-Bt9z7sSI.js +1 -0
  95. package/dist/node_modules/@flakes/console/.output/public/assets/utils-CBxvVKOM.js +1 -0
  96. package/dist/node_modules/@flakes/console/.output/public/assets/x-Bdsfqbi3.js +1 -0
  97. package/dist/node_modules/@flakes/console/.output/server/{_-CjpSIsvB.mjs → _-BULJ6utw.mjs} +3 -3
  98. package/dist/node_modules/@flakes/console/.output/server/{_-8ZDVkA1O.mjs → _-_ST9QYWn.mjs} +3 -3
  99. package/dist/node_modules/@flakes/console/.output/server/_chunks/ProjectsPage.mjs +589 -0
  100. package/dist/node_modules/@flakes/console/.output/server/_chunks/RunPage.mjs +13 -6
  101. package/dist/node_modules/@flakes/console/.output/server/_chunks/RunsPage.mjs +43 -12
  102. package/dist/node_modules/@flakes/console/.output/server/_chunks/SandboxesPage.mjs +2 -2
  103. package/dist/node_modules/@flakes/console/.output/server/_chunks/TranscriptPage.mjs +2 -2
  104. package/dist/node_modules/@flakes/console/.output/server/_chunks/project-navigation.mjs +79 -0
  105. package/dist/node_modules/@flakes/console/.output/server/_chunks/router.mjs +195 -112
  106. package/dist/node_modules/@flakes/console/.output/server/_chunks/utils.mjs +111 -3
  107. package/dist/node_modules/@flakes/console/.output/server/_libs/lucide-react.mjs +178 -1
  108. package/dist/node_modules/@flakes/console/.output/server/{_runId-CJ5_8uS8.mjs → _runId-CmYWNL8A.mjs} +3 -3
  109. package/dist/node_modules/@flakes/console/.output/server/{_runId-Cag5UaYU.mjs → _runId-WZmbo654.mjs} +2 -2
  110. package/dist/node_modules/@flakes/console/.output/server/_ssr/{App-CwFtUgAz.mjs → App-CUx8Ftit.mjs} +118 -64
  111. package/dist/node_modules/@flakes/console/.output/server/_ssr/{DocumentationPage-D85Budiq.mjs → DocumentationPage-0I9oWWJT.mjs} +5 -5
  112. package/dist/node_modules/@flakes/console/.output/server/_ssr/ProjectsPage-CGj9V2Of.mjs +590 -0
  113. package/dist/node_modules/@flakes/console/.output/server/_ssr/{RunPage-CatpnkFy.mjs → RunPage-B2vhVaj6.mjs} +14 -7
  114. package/dist/node_modules/@flakes/console/.output/server/_ssr/{RunsPage-BmLTih8Z.mjs → RunsPage-BifKogQE.mjs} +44 -13
  115. package/dist/node_modules/@flakes/console/.output/server/_ssr/{SandboxesPage-Dlq0Ga24.mjs → SandboxesPage-DGji_OdB.mjs} +3 -3
  116. package/dist/node_modules/@flakes/console/.output/server/_ssr/{TranscriptPage-DaSIDCKk.mjs → TranscriptPage-deSxVZaQ.mjs} +3 -3
  117. package/dist/node_modules/@flakes/console/.output/server/_ssr/{account-DzluYS58.mjs → account-D5y9vkAc.mjs} +2 -2
  118. package/dist/node_modules/@flakes/console/.output/server/_ssr/account-forms-CsothyLo.mjs +1 -1
  119. package/dist/node_modules/@flakes/console/.output/server/_ssr/device-CRZl7dGv.mjs +1 -1
  120. package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-4BCES--X.mjs → documentation-C69e9_eF.mjs} +3 -3
  121. package/dist/node_modules/@flakes/console/.output/server/_ssr/documentation-C91gfyy0.mjs +210 -0
  122. package/dist/node_modules/@flakes/console/.output/server/_ssr/{hooks-COIYuQzf.mjs → hooks-DrgN35zn.mjs} +110 -4
  123. package/dist/node_modules/@flakes/console/.output/server/_ssr/project-navigation-DI77TL9a.mjs +79 -0
  124. package/dist/node_modules/@flakes/console/.output/server/_ssr/projects-lJ2tIIPj.mjs +5 -0
  125. package/dist/node_modules/@flakes/console/.output/server/_ssr/reset-password-SmmTixcr.mjs +1 -1
  126. package/dist/node_modules/@flakes/console/.output/server/_ssr/{router-B3vKkNtv.mjs → router-DHxFQ03L.mjs} +49 -41
  127. package/dist/node_modules/@flakes/console/.output/server/_ssr/{runs-CBkO-RO8.mjs → runs-BWxEGKO_.mjs} +17 -5
  128. package/dist/node_modules/@flakes/console/.output/server/_ssr/runs-dnPfp9dt.mjs +19 -0
  129. package/dist/node_modules/@flakes/console/.output/server/_ssr/{sandboxes-BIAgn8pu2.mjs → sandboxes-hxFINxDS.mjs} +3 -3
  130. package/dist/node_modules/@flakes/console/.output/server/_ssr/{sandboxes-qSX_pfUJ.mjs → sandboxes-v28LJQM3.mjs} +2 -2
  131. package/dist/node_modules/@flakes/console/.output/server/_ssr/signin-form-CQDi-0A5.mjs +1 -1
  132. package/dist/node_modules/@flakes/console/.output/server/_ssr/ssr.mjs +2 -2
  133. package/dist/node_modules/@flakes/console/.output/server/{_tanstack-start-manifest_v-llXRWxjT.mjs → _tanstack-start-manifest_v-DfwuEzTr.mjs} +54 -46
  134. package/dist/node_modules/@flakes/console/.output/server/{_taskId-BaezvY0w.mjs → _taskId-CBo95z-s.mjs} +2 -2
  135. package/dist/node_modules/@flakes/console/.output/server/{_taskId-Da7kHKj9.mjs → _taskId-Sil3-PKh.mjs} +3 -3
  136. package/dist/node_modules/@flakes/console/package.json +1 -1
  137. package/dist/node_modules/@flakes/control-plane/dist/client-access.d.ts +17 -0
  138. package/dist/node_modules/@flakes/control-plane/dist/client-access.d.ts.map +1 -1
  139. package/dist/node_modules/@flakes/control-plane/dist/client-access.js +12 -0
  140. package/dist/node_modules/@flakes/control-plane/dist/client-access.js.map +1 -1
  141. package/dist/node_modules/@flakes/control-plane/dist/host-credentials.d.ts +1 -1
  142. package/dist/node_modules/@flakes/control-plane/dist/host-credentials.d.ts.map +1 -1
  143. package/dist/node_modules/@flakes/control-plane/dist/host-pool-matching.d.ts +24 -1
  144. package/dist/node_modules/@flakes/control-plane/dist/host-pool-matching.d.ts.map +1 -1
  145. package/dist/node_modules/@flakes/control-plane/dist/host-pool-matching.js +87 -3
  146. package/dist/node_modules/@flakes/control-plane/dist/host-pool-matching.js.map +1 -1
  147. package/dist/node_modules/@flakes/control-plane/dist/host-stream.d.ts.map +1 -1
  148. package/dist/node_modules/@flakes/control-plane/dist/host-stream.js +150 -40
  149. package/dist/node_modules/@flakes/control-plane/dist/host-stream.js.map +1 -1
  150. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.d.ts +71 -0
  151. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.d.ts.map +1 -0
  152. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.js +243 -0
  153. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.js.map +1 -0
  154. package/dist/node_modules/@flakes/control-plane/dist/routes/hosts.d.ts.map +1 -1
  155. package/dist/node_modules/@flakes/control-plane/dist/routes/hosts.js +219 -0
  156. package/dist/node_modules/@flakes/control-plane/dist/routes/hosts.js.map +1 -1
  157. package/dist/node_modules/@flakes/control-plane/dist/routes/projects.d.ts +3 -0
  158. package/dist/node_modules/@flakes/control-plane/dist/routes/projects.d.ts.map +1 -0
  159. package/dist/node_modules/@flakes/control-plane/dist/routes/projects.js +226 -0
  160. package/dist/node_modules/@flakes/control-plane/dist/routes/projects.js.map +1 -0
  161. package/dist/node_modules/@flakes/control-plane/dist/routes/runs.d.ts.map +1 -1
  162. package/dist/node_modules/@flakes/control-plane/dist/routes/runs.js +93 -6
  163. package/dist/node_modules/@flakes/control-plane/dist/routes/runs.js.map +1 -1
  164. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.d.ts +3 -0
  165. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.d.ts.map +1 -0
  166. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.js +153 -0
  167. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.js.map +1 -0
  168. package/dist/node_modules/@flakes/control-plane/dist/routes/tasks.js +2 -2
  169. package/dist/node_modules/@flakes/control-plane/dist/routes/tasks.js.map +1 -1
  170. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.d.ts +19 -0
  171. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.d.ts.map +1 -0
  172. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.js +46 -0
  173. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.js.map +1 -0
  174. package/dist/node_modules/@flakes/control-plane/dist/scheduler.d.ts +2 -0
  175. package/dist/node_modules/@flakes/control-plane/dist/scheduler.d.ts.map +1 -1
  176. package/dist/node_modules/@flakes/control-plane/dist/scheduler.js +53 -21
  177. package/dist/node_modules/@flakes/control-plane/dist/scheduler.js.map +1 -1
  178. package/dist/node_modules/@flakes/control-plane/dist/server.d.ts.map +1 -1
  179. package/dist/node_modules/@flakes/control-plane/dist/server.js +2 -0
  180. package/dist/node_modules/@flakes/control-plane/dist/server.js.map +1 -1
  181. package/dist/node_modules/@flakes/control-plane/dist/types.d.ts +2 -0
  182. package/dist/node_modules/@flakes/control-plane/dist/types.d.ts.map +1 -1
  183. package/dist/node_modules/@flakes/control-plane/package.json +1 -1
  184. package/dist/node_modules/@flakes/core/dist/config.d.ts.map +1 -1
  185. package/dist/node_modules/@flakes/core/dist/config.js +6 -2
  186. package/dist/node_modules/@flakes/core/dist/config.js.map +1 -1
  187. package/dist/node_modules/@flakes/core/dist/ids.d.ts +4 -0
  188. package/dist/node_modules/@flakes/core/dist/ids.d.ts.map +1 -1
  189. package/dist/node_modules/@flakes/core/dist/ids.js +2 -0
  190. package/dist/node_modules/@flakes/core/dist/ids.js.map +1 -1
  191. package/dist/node_modules/@flakes/core/dist/runtime.d.ts +1 -1
  192. package/dist/node_modules/@flakes/core/dist/schemas.d.ts +11 -0
  193. package/dist/node_modules/@flakes/core/dist/schemas.d.ts.map +1 -1
  194. package/dist/node_modules/@flakes/core/dist/schemas.js +10 -0
  195. package/dist/node_modules/@flakes/core/dist/schemas.js.map +1 -1
  196. package/dist/node_modules/@flakes/core/package.json +1 -1
  197. package/dist/node_modules/@flakes/harness-agent/package.json +1 -1
  198. package/dist/node_modules/@flakes/harness-sdk/package.json +1 -1
  199. package/dist/node_modules/@flakes/pi-agent/package.json +1 -1
  200. package/dist/node_modules/@flakes/protocol/dist/index.d.ts +1 -1
  201. package/dist/node_modules/@flakes/protocol/dist/index.d.ts.map +1 -1
  202. package/dist/node_modules/@flakes/protocol/dist/index.js +1 -1
  203. package/dist/node_modules/@flakes/protocol/dist/index.js.map +1 -1
  204. package/dist/node_modules/@flakes/protocol/dist/v1.d.ts +317 -0
  205. package/dist/node_modules/@flakes/protocol/dist/v1.d.ts.map +1 -1
  206. package/dist/node_modules/@flakes/protocol/dist/v1.js +50 -1
  207. package/dist/node_modules/@flakes/protocol/dist/v1.js.map +1 -1
  208. package/dist/node_modules/@flakes/protocol/package.json +1 -1
  209. package/dist/node_modules/@flakes/sandbox-runtime/dist/transport.js +3 -6
  210. package/dist/node_modules/@flakes/sandbox-runtime/dist/transport.js.map +1 -1
  211. package/dist/node_modules/@flakes/sandbox-runtime/package.json +1 -1
  212. package/dist/node_modules/@flakes/store/dist/artifacts-events-store.d.ts.map +1 -1
  213. package/dist/node_modules/@flakes/store/dist/artifacts-events-store.js +10 -0
  214. package/dist/node_modules/@flakes/store/dist/artifacts-events-store.js.map +1 -1
  215. package/dist/node_modules/@flakes/store/dist/host-provisioning-limits.d.ts +2 -1
  216. package/dist/node_modules/@flakes/store/dist/host-provisioning-limits.d.ts.map +1 -1
  217. package/dist/node_modules/@flakes/store/dist/host-provisioning-limits.js +1 -0
  218. package/dist/node_modules/@flakes/store/dist/host-provisioning-limits.js.map +1 -1
  219. package/dist/node_modules/@flakes/store/dist/kysely-store.d.ts +2 -2
  220. package/dist/node_modules/@flakes/store/dist/kysely-store.d.ts.map +1 -1
  221. package/dist/node_modules/@flakes/store/dist/kysely-store.js +2 -2
  222. package/dist/node_modules/@flakes/store/dist/kysely-store.js.map +1 -1
  223. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.d.ts +6 -2
  224. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.d.ts.map +1 -1
  225. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.js +160 -3
  226. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.js.map +1 -1
  227. package/dist/node_modules/@flakes/store/dist/mappers.d.ts +10 -2
  228. package/dist/node_modules/@flakes/store/dist/mappers.d.ts.map +1 -1
  229. package/dist/node_modules/@flakes/store/dist/mappers.js +45 -0
  230. package/dist/node_modules/@flakes/store/dist/mappers.js.map +1 -1
  231. package/dist/node_modules/@flakes/store/dist/projects-store.d.ts +42 -0
  232. package/dist/node_modules/@flakes/store/dist/projects-store.d.ts.map +1 -0
  233. package/dist/node_modules/@flakes/store/dist/projects-store.js +376 -0
  234. package/dist/node_modules/@flakes/store/dist/projects-store.js.map +1 -0
  235. package/dist/node_modules/@flakes/store/dist/runs-store.d.ts.map +1 -1
  236. package/dist/node_modules/@flakes/store/dist/runs-store.js +7 -2
  237. package/dist/node_modules/@flakes/store/dist/runs-store.js.map +1 -1
  238. package/dist/node_modules/@flakes/store/dist/schema.js +72 -0
  239. package/dist/node_modules/@flakes/store/dist/schema.js.map +1 -1
  240. package/dist/node_modules/@flakes/store/dist/sqlite.d.ts +4 -0
  241. package/dist/node_modules/@flakes/store/dist/sqlite.d.ts.map +1 -0
  242. package/dist/node_modules/@flakes/store/dist/sqlite.js +34 -0
  243. package/dist/node_modules/@flakes/store/dist/sqlite.js.map +1 -0
  244. package/dist/node_modules/@flakes/store/dist/store-base.d.ts +14 -12
  245. package/dist/node_modules/@flakes/store/dist/store-base.d.ts.map +1 -1
  246. package/dist/node_modules/@flakes/store/dist/tables.d.ts +41 -1
  247. package/dist/node_modules/@flakes/store/dist/tables.d.ts.map +1 -1
  248. package/dist/node_modules/@flakes/store/dist/tasks-store.d.ts.map +1 -1
  249. package/dist/node_modules/@flakes/store/dist/tasks-store.js +9 -2
  250. package/dist/node_modules/@flakes/store/dist/tasks-store.js.map +1 -1
  251. package/dist/node_modules/@flakes/store/dist/types.d.ts +159 -1
  252. package/dist/node_modules/@flakes/store/dist/types.d.ts.map +1 -1
  253. package/dist/node_modules/@flakes/store/package.json +1 -1
  254. package/package.json +1 -1
  255. package/dist/node_modules/@flakes/console/.output/public/assets/DocumentationPage-DrqDulyL.js +0 -1
  256. package/dist/node_modules/@flakes/console/.output/public/assets/RunPage-BC3sGoPN.js +0 -3
  257. package/dist/node_modules/@flakes/console/.output/public/assets/RunsPage-LkYGVvbL.js +0 -1
  258. package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesLens-BUQQWmH6.js +0 -1
  259. package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesPage-CwWMogj6.js +0 -1
  260. package/dist/node_modules/@flakes/console/.output/public/assets/TranscriptPage-CTMgJgHp.js +0 -1
  261. package/dist/node_modules/@flakes/console/.output/public/assets/_-DRcA_CG9.js +0 -1
  262. package/dist/node_modules/@flakes/console/.output/public/assets/_runId-CO1ozt9P.js +0 -2
  263. package/dist/node_modules/@flakes/console/.output/public/assets/_taskId-CcIypX6M.js +0 -2
  264. package/dist/node_modules/@flakes/console/.output/public/assets/account-DKgjbb-C.js +0 -1
  265. package/dist/node_modules/@flakes/console/.output/public/assets/account-forms-DrHA3zEd.js +0 -1
  266. package/dist/node_modules/@flakes/console/.output/public/assets/arrow-right-BMW8fJP5.js +0 -1
  267. package/dist/node_modules/@flakes/console/.output/public/assets/auth-layout-INHonQMf.js +0 -1
  268. package/dist/node_modules/@flakes/console/.output/public/assets/bits-Cv0Te4iz.js +0 -1
  269. package/dist/node_modules/@flakes/console/.output/public/assets/card-DSG3_teC.js +0 -1
  270. package/dist/node_modules/@flakes/console/.output/public/assets/circle-check-B0gtb8OH.js +0 -1
  271. package/dist/node_modules/@flakes/console/.output/public/assets/device-DOGZUNMB.js +0 -1
  272. package/dist/node_modules/@flakes/console/.output/public/assets/dist-BtPw3IIV.js +0 -1
  273. package/dist/node_modules/@flakes/console/.output/public/assets/documentation-Dr9Bdqxh.js +0 -1
  274. package/dist/node_modules/@flakes/console/.output/public/assets/forgot-password-C7qvwcpm.js +0 -1
  275. package/dist/node_modules/@flakes/console/.output/public/assets/link-BsixJinJ.js +0 -1
  276. package/dist/node_modules/@flakes/console/.output/public/assets/main-RzjfJZwD.js +0 -1121
  277. package/dist/node_modules/@flakes/console/.output/public/assets/matchContext-tJ0VTv5m.js +0 -1
  278. package/dist/node_modules/@flakes/console/.output/public/assets/otp-verification-Cqa6lopR.js +0 -20
  279. package/dist/node_modules/@flakes/console/.output/public/assets/react-DtOYBmep.js +0 -1
  280. package/dist/node_modules/@flakes/console/.output/public/assets/react-dom-DrIU40PY.js +0 -1
  281. package/dist/node_modules/@flakes/console/.output/public/assets/redirect-BEm0VK76.js +0 -1
  282. package/dist/node_modules/@flakes/console/.output/public/assets/reset-password-tImCgEn0.js +0 -1
  283. package/dist/node_modules/@flakes/console/.output/public/assets/runs-Cuk0VOVi.js +0 -2
  284. package/dist/node_modules/@flakes/console/.output/public/assets/sandboxes-BBIIbVN8.js +0 -2
  285. package/dist/node_modules/@flakes/console/.output/public/assets/security-D3N68cBT.js +0 -1
  286. package/dist/node_modules/@flakes/console/.output/public/assets/signin-DylILjyG.js +0 -1
  287. package/dist/node_modules/@flakes/console/.output/public/assets/signin-form-DWaa_uwj.js +0 -1
  288. package/dist/node_modules/@flakes/console/.output/public/assets/signup-KmFQL_1g.js +0 -1
  289. package/dist/node_modules/@flakes/console/.output/public/assets/styles-8wEqfToJ.css +0 -2
  290. package/dist/node_modules/@flakes/console/.output/public/assets/table-DptQuuuq.js +0 -1
  291. package/dist/node_modules/@flakes/console/.output/public/assets/user-DK27uFod.js +0 -1
  292. package/dist/node_modules/@flakes/console/.output/public/assets/utils-CEE0-YEp.js +0 -1
  293. package/dist/node_modules/@flakes/console/.output/public/assets/x-fKvnmCoQ.js +0 -1
  294. package/dist/node_modules/@flakes/console/.output/server/_ssr/documentation-Do_Mr_e4.mjs +0 -210
  295. package/dist/node_modules/@flakes/console/.output/server/_ssr/runs-BzfGldVd.mjs +0 -12
@@ -1,1121 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/signup-KmFQL_1g.js","assets/react-DtOYBmep.js","assets/link-BsixJinJ.js","assets/react-dom-DrIU40PY.js","assets/utils-CEE0-YEp.js","assets/otp-verification-Cqa6lopR.js","assets/signin-form-DWaa_uwj.js","assets/lock-D4OhqEPW.js","assets/user-DK27uFod.js","assets/auth-layout-INHonQMf.js","assets/card-DSG3_teC.js","assets/signin-DylILjyG.js","assets/sandboxes-BBIIbVN8.js","assets/runs-Cuk0VOVi.js","assets/reset-password-tImCgEn0.js","assets/forgot-password-C7qvwcpm.js","assets/documentation-Dr9Bdqxh.js","assets/DocumentationPage-DrqDulyL.js","assets/lib-DtfURcG3.js","assets/external-link-BW8lpiMR.js","assets/file-text-DMdy8OfN.js","assets/device-DOGZUNMB.js","assets/arrow-right-BMW8fJP5.js","assets/circle-check-B0gtb8OH.js","assets/account-DKgjbb-C.js","assets/account-forms-DrHA3zEd.js","assets/save-1uf5fQff.js","assets/security-D3N68cBT.js","assets/_runId-CO1ozt9P.js","assets/_-DRcA_CG9.js","assets/_taskId-CcIypX6M.js"])))=>i.map(i=>d[i]);
2
- import{a as e,c as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,s as f,t as p,u as m,v as h}from"./react-DtOYBmep.js";import{_ as g,a as _,c as v,d as y,f as b,g as x,h as S,i as C,l as w,m as E,n as D,o as ee,p as te,r as ne,s as O,t as re,u as ie}from"./link-BsixJinJ.js";import{a as ae,i as k,n as A,r as oe,t as se}from"./redirect-BEm0VK76.js";import{n as ce,t as le}from"./qss-4JXuaDtg.js";import{n as ue,r as j,t as de}from"./matchContext-tJ0VTv5m.js";import{a as fe,c as pe,i as me,l as he,n as ge,r as _e,t as ve}from"./react-dom-DrIU40PY.js";import{r as ye,t as be}from"./utils-CEE0-YEp.js";import{a as xe,i as Se,n as Ce,r as we,t as Te}from"./dist-BtPw3IIV.js";var Ee=new WeakMap,De=new WeakMap,Oe={current:[]},ke=!1,Ae=0,je=new Set,Me=new Map;function Ne(e){let t=Array.from(e).sort((e,t)=>e instanceof Be&&e.options.deps.includes(t)?1:t instanceof Be&&t.options.deps.includes(e)?-1:0);for(let e of t){if(Oe.current.includes(e))continue;Oe.current.push(e),e.recompute();let t=De.get(e);if(t)for(let e of t){let t=Ee.get(e);t&&Ne(t)}}}function Pe(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function Fe(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function Ie(e){if(Ae>0&&!Me.has(e)&&Me.set(e,e.prevState),je.add(e),!(Ae>0)&&!ke)try{for(ke=!0;je.size>0;){let e=Array.from(je);je.clear();for(let t of e)t.prevState=Me.get(t)??t.prevState,Pe(t);for(let t of e){let e=Ee.get(t);e&&(Oe.current.push(t),Ne(e))}for(let t of e){let e=Ee.get(t);if(e)for(let t of e)Fe(t)}}}finally{ke=!1,Oe.current=[],Me.clear()}}function Le(e){Ae++;try{e()}finally{if(Ae--,Ae===0){let e=je.values().next().value;e&&Ie(e)}}}function Re(e){return typeof e==`function`}var ze=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):Re(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),Ie(this)}},Be=class e{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),(t=(e=this.options).onUpdate)==null||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let t of this.options.deps)t instanceof e&&t.checkIfRecalculationNeededDeeply();let t=!1,n=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let e=0;e<r.length;e++)if(r[e]!==n[e]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(let e of this._subscriptions)e()}),this.subscribe=e=>{var t;this.listeners.add(e);let n=(t=this.options).onSubscribe?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(let n of t)if(n instanceof e)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof ze){let e=Ee.get(n);e||(e=new Set,Ee.set(n,e)),e.add(this);let t=De.get(this);t||(t=new Set,De.set(this,t)),t.add(n)}}unregisterFromGraph(t=this.options.deps){for(let n of t)if(n instanceof e)this.unregisterFromGraph(n.options.deps);else if(n instanceof ze){let e=Ee.get(n);e&&e.delete(this);let t=De.get(this);t&&t.delete(n)}}},Ve=`__TSR_index`,He=`popstate`,Ue=`beforeunload`;function We(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Je(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Ve];i=Ge(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Ve];i=Ge(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Ve]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ge(e,t){t||={};let n=Ye();return{...t,key:n,__TSR_key:n,[Ve]:e}}function Ke(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Je(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Ye();t.history.replaceState({[Ve]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Je(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Ve]-l.state[Ve],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=We({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ue,S,{capture:!0}),t.removeEventListener(He,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ue,S,{capture:!0}),t.addEventListener(He,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function qe(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Je(e,t){let n=qe(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Ye();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Ve]:0,key:a,__TSR_key:a}}}function Ye(){return(Math.random()+1).toString(36).substring(7)}function Xe(e){let t;return Le(()=>{t=e()}),t}function Ze(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var Qe=`tsr-scroll-restoration-v1_3`,$e=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function et(){let e=Ze();if(!e)return null;let t=e.getItem(Qe),n=t?JSON.parse(t):{};return{state:n,set:t=>{n=s(t,n)||n;try{e.setItem(Qe,JSON.stringify(n))}catch{console.warn(`[ts-router] Could not persist scroll restoration state to sessionStorage.`)}}}}var tt=et(),nt=e=>e.state.__TSR_key||e.href;function rt(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var it=!1;function at({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];it=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}it=!1}function ot(e,t){if(!tt||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!tt))return;e.isScrollRestorationSetup=!0,it=!1;let n=e.options.getScrollRestorationKey||nt;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,$e(t=>{if(it||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:rt(t.target)}let i=n(e.state.location);tt.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(at({storageKey:Qe,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&tt.set(e=>(e[r]||={},e)))})}function st(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}var ct=ut(JSON.parse),lt=dt(JSON.stringify,JSON.parse);function ut(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=le(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function dt(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=ce(e,r);return t?`?${t}`:``}}var ft=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},pt=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),mt=(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},ht=(e,t)=>{let n=e.router.routesById[t.routeId??``]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),l(n.options.notFoundComponent,`No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.`);let r=e.matches.find(e=>e.routeId===n.id);l(r,`Could not find match for route: `+n.id),e.updateMatch(r.id,e=>({...e,status:`notFound`,error:t,isFetching:!1})),t.routerCode===`BEFORE_LOAD`&&n.parentRoute&&(t.routeId=n.parentRoute.id,ht(e,t))},gt=(e,t,n)=>{if(!(!se(n)&&!k(n))){if(se(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;let r=se(n)?`redirected`:`notFound`;t._nonReactive.error=n,e.updateMatch(t.id,i=>({...i,status:r,context:mt(e,t.index),isFetching:!1,error:n})),k(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw se(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(ht(e,n),n)}},_t=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,vt=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,gt(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,gt(e,e.router.getMatch(i),n)}e.updateMatch(i,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}))},yt=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!pt(e,t)&&(n.options.loader||n.options.beforeLoad||kt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{ft(e)},i);r._nonReactive.pendingTimeout=t}},bt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;yt(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&gt(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},xt=(e,t,n,i)=>{let a=e.router.getMatch(t),s=a._nonReactive.loadPromise;a._nonReactive.loadPromise=o(()=>{s?.resolve()});let{paramsError:c,searchError:l}=a;c&&vt(e,n,c,`PARSE_PARAMS`),l&&vt(e,n,l,`VALIDATE_SEARCH`),yt(e,t,i,a);let u=new AbortController,d=!1,f=()=>{d||(d=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:u})))},p=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!i.options.beforeLoad){Xe(()=>{f(),p()});return}a._nonReactive.beforeLoadPromise=o();let m={...mt(e,n,!1),...a.__routeContext},{search:h,params:g,cause:_}=a,v=pt(e,t),y={search:h,abortController:u,params:g,preload:v,context:m,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:_,matches:e.matches,routeId:i.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){Xe(()=>{f(),p()});return}(se(r)||k(r))&&(f(),vt(e,n,r,`BEFORE_LOAD`)),Xe(()=>{f(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),p()})},x;try{if(x=i.options.beforeLoad(y),r(x))return f(),x.catch(t=>{vt(e,n,t,`BEFORE_LOAD`)}).then(b)}catch(t){f(),vt(e,n,t,`BEFORE_LOAD`)}b(x)},St=(e,t)=>{let{id:n,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i],o=()=>c(),s=()=>xt(e,n,t,a),c=()=>{if(_t(e,n))return;let t=bt(e,n,a);return r(t)?t.then(s):s()};return o()},Ct=(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}))},wt=(e,t,n,r)=>{let i=e.matchPromises[n-1],{params:a,loaderDeps:o,abortController:s,cause:c}=e.router.getMatch(t),l=mt(e,n),u=pt(e,t);return{params:a,deps:o,preload:!!u,parentMatchPromise:i,abortController:s,context:l,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:u?`preload`:c,route:r,...e.router.options.additionalContext}},Tt=async(e,t,n,i)=>{try{let a=e.router.getMatch(t);try{Ot(i);let o=i.options.loader?.(wt(e,t,n,i)),s=i.options.loader&&r(o);if((s||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(t,e=>({...e,isFetching:`loader`})),i.options.loader){let n=s?await o:o;gt(e,e.router.getMatch(t),n),n!==void 0&&e.updateMatch(t,e=>({...e,loaderData:n}))}i._lazyPromise&&await i._lazyPromise;let c=a._nonReactive.minPendingPromise;c&&await c,i._componentsPromise&&await i._componentsPromise,e.updateMatch(t,t=>({...t,error:void 0,context:mt(e,n),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(r){let o=r;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:mt(e,n)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,k(r)&&await i.options.notFoundComponent?.preload?.(),gt(e,e.router.getMatch(t),r);try{i.options.onError?.(r)}catch(n){o=n,gt(e,e.router.getMatch(t),n)}e.updateMatch(t,t=>({...t,error:o,context:mt(e,n),status:`error`,isFetching:!1}))}}catch(n){let r=e.router.getMatch(t);r&&(r._nonReactive.loaderPromise=void 0),gt(e,r,n)}},Et=async(e,t)=>{async function n(n,i,o,c){let l=Date.now()-i.updatedAt,u=n?c.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.router.options.defaultStaleTime??0,d=c.options.shouldReload,f=typeof d==`function`?d(wt(e,r,t,c)):d,{status:p,invalid:m}=o;a=p===`success`&&(m||(f??l>u)),n&&c.options.preload===!1||(a&&!e.sync?(s=!0,(async()=>{try{await Tt(e,r,t,c);let n=e.router.getMatch(r);n._nonReactive.loaderPromise?.resolve(),n._nonReactive.loadPromise?.resolve(),n._nonReactive.loaderPromise=void 0}catch(t){se(t)&&await e.router.navigate(t.options)}})()):(p!==`success`||a&&e.sync)&&await Tt(e,r,t,c))}let{id:r,routeId:i}=e.matches[t],a=!1,s=!1,c=e.router.looseRoutesById[i];if(!_t(e,r)){let t=e.router.getMatch(r),i=pt(e,r);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload)return t;await t._nonReactive.loaderPromise;let a=e.router.getMatch(r),o=a._nonReactive.error||a.error;o&&gt(e,a,o),a.status===`pending`&&await n(i,t,a,c)}else{let a=i&&!e.router.state.matches.some(e=>e.id===r),s=e.router.getMatch(r);s._nonReactive.loaderPromise=o(),a!==s.preload&&e.updateMatch(r,e=>({...e,preload:a})),await n(i,t,s,c)}}let l=e.router.getMatch(r);s||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,s||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;let u=s?l.isFetching:!1;return u!==l.isFetching||l.invalid!==!1?(e.updateMatch(r,e=>({...e,isFetching:u,invalid:!1})),e.router.getMatch(r)):l};async function Dt(e){let t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(e=>e._forcePending)&&ft(t);try{for(let e=0;e<t.matches.length;e++){let n=St(t,e);r(n)&&await n}let e=t.firstBadMatchIndex??t.matches.length;for(let n=0;n<e;n++)t.matchPromises.push(Et(t,n));let n=(await Promise.allSettled(t.matchPromises)).filter(e=>e.status===`rejected`).map(e=>e.reason),i;for(let e of n){if(se(e))throw e;!i&&k(e)&&(i=e)}for(let e of t.matches){let{id:n,routeId:r}=e,i=t.router.looseRoutesById[r];try{let e=Ct(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)}}if(i)throw i;let a=ft(t);r(a)&&await a}catch(e){if(k(e)&&!t.preload){let n=ft(t);throw r(n)&&await n,e}if(se(e))throw e}return t.matches}async function Ot(e){if(!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),!e._componentsLoaded&&e._componentsPromise===void 0){let t=()=>{let t=[];for(let n of At){let r=e.options[n]?.preload;r&&t.push(r())}if(t.length)return Promise.all(t).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function kt(e){for(let t of At)if(e.options[t]?.preload)return!0;return!1}var At=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function jt(e){return{input:({url:t})=>{for(let n of e)t=Nt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Pt(e[n],t);return t}}}function Mt(e){let t=w(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=O([`/`,t,e.pathname]),e)}}function Nt(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 Pt(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 Ft(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function It(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}var Lt=class{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn(`The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.`);let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=_(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Ke()),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=g(1e3),e=this.buildRouteTree(),this.setRoutes(e)}!this.__store&&this.latestLocation&&(this.__store=new ze(Bt(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(e=>![`redirected`].includes(e.status))}}}),ot(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=w(o);t&&t!==`/`&&e.push(Mt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:jt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location: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=x(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&S(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=(t,n)=>{let r=({pathname:t,search:r,hash:i,href:a,state:o})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(t)){let s=this.options.parseSearch(r),l=this.options.stringifySearch(s);return{href:t+l+i,publicHref:a,pathname:e(t).path,external:!1,searchStr:l,search:c(n?.search,s),hash:e(i.slice(1)).path,state:c(n?.state,o)}}let s=new URL(a,this.origin),l=Nt(this.rewrite,s),u=this.options.parseSearch(l.search),d=this.options.stringifySearch(u);return l.search=d,{href:l.href.replace(l.origin,``),publicHref:a,pathname:e(l.pathname).path,external:!!this.rewrite&&l.origin!==this.origin,searchStr:d,search:c(n?.search,u),hash:e(l.hash.slice(1)).path,state:c(n?.state,o)}},i=r(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){let e=r(a);return e.state.key=i.state.key,e.state.__TSR_key=i.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:i}}return i},this.resolvePathWithBase=(e,t)=>v({base:e,to:C(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=>Ht({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=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=t=>{let n=(n={})=>{let r=n._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(r);n.from;let a=n.unsafeRelative===`path`?r.pathname:n.from??i.fullPath,o=this.resolvePathWithBase(a,`.`),l=i.search,u={...i.params},d=n.to?this.resolvePathWithBase(o,`${n.to}`):this.resolvePathWithBase(o,`.`),p=n.params===!1||n.params===null?{}:(n.params??!0)===!0?u:Object.assign(u,s(n.params,u)),m=ee({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,h=this.getMatchedRoutes(m),g=h.matchedRoutes;(h.foundRoute?h.foundRoute.path!==`/`&&h.routeParams[`**`]:y(m))&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]);let _=!1;if(Object.keys(p).length>0)for(let e of g){let t=e.options.params?.stringify??e.options.stringifyParams;t&&(_=!0,Object.assign(p,t(p)))}let v=t.leaveParams?d:e(_?ee({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:m).path,b=l;if(t._includeValidateSearch&&this.options.search?.strict){let e={};g.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Vt(t.options.validateSearch,{...e,...b}))}catch{}}),b=e}b=Ut({search:b,dest:n,destRoutes:g,_includeValidateSearch:t._includeValidateSearch}),b=c(l,b);let x=this.options.stringifySearch(b),S=n.hash===!0?r.hash:n.hash?s(n.hash,r.hash):void 0,C=S?`#${S}`:``,w=n.state===!0?r.state:n.state?s(n.state,r.state):{};w=c(r.state,w);let E=`${v}${x}${C}`,D,te,ne=!1;if(this.rewrite){let e=new URL(E,this.origin),t=Pt(this.rewrite,e);D=e.href.replace(e.origin,``),t.origin===this.origin?te=t.pathname+t.search+t.hash:(te=t.href,ne=!0)}else D=f(E),te=D;return{publicHref:te,href:D,pathname:v,search:b,searchStr:x,state:w,hash:S??``,external:ne,unmaskOnReload:n.unmaskOnReload}},r=(e={},r)=>{let i=n(e),a=r?n(r):void 0;if(!a){let e={};if(this.options.routeMasks){let o=b(i.pathname,this.processedTree);if(o){Object.assign(e,o.rawParams);let{from:i,params:c,...l}=o.route,u=c===!1||c===null?{}:(c??!0)===!0?e:Object.assign(e,s(c,e));r={from:t.from,...l,params:u},a=n(r)}}}return a&&(i.maskedLocation=a),i};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=u(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=y(this.latestLocation.href)===y(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=o(()=>{a?.resolve()}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Je(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Nt(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},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(m(t))return Promise.resolve();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 Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r;for(r=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...It({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...It({resolvedLocation:n,location:t})}),await Dt({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[];Xe(()=>{this.__store.setState(r=>{let i=r.matches,a=r.pendingMatches||r.matches;return e=i.filter(e=>!a.some(t=>t.id===e.id)),t=a.filter(e=>!i.some(t=>t.id===e.id)),n=a.filter(e=>i.some(t=>t.id===e.id)),{...r,isLoading:!1,loadedAt:Date.now(),matches:a,pendingMatches:void 0,cachedMatches:[...r.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`)]}}),this.clearExpiredCache()}),[[e,`onLeave`],[t,`onEnter`],[n,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){se(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):k(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(e=>e.status===`error`)&&(i=500),i!==void 0&&this.__store.setState(e=>({...e,statusCode:i}))},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.state.resolvedLocation,a=typeof t.types==`function`?t.types(It({resolvedLocation:i,location:r})):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.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)}))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},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.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.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{}return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=Ot,this.preloadRoute=async e=>{let t=this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);Xe(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await Dt({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(se(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});k(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.state.status!==`pending`)return!1;let i=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=E(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!u(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?u(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??`fuzzy`,stringifySearch:t.stringifySearch??lt,parseSearch:t.parseSearch??ct}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}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)}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,parsedParams:a}=n,{matchedRoutes:s}=n,l=!1;(r?r.path!==`/`&&i[`**`]:y(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:l=!0);let u=l?Gt(this.options.notFoundMode,s):void 0,d=Array(s.length),f=new Map(this.state.matches.map(e=>[e.routeId,e]));for(let n=0;n<s.length;n++){let r=s[n],l=d[n-1],p,m,h;{let n=l?.search??e.search,i=l?._strictSearch??void 0;try{let e=Vt(r.options.validateSearch,{...n})??void 0;p={...n,...e},m={...i,...e},h=void 0}catch(e){let r=e;if(e instanceof Rt||(r=new Rt(e.message,{cause:e})),t?.throwOnError)throw r;p=n,m={},h=r}}let g=r.options.loaderDeps?.({search:p})??``,_=g?JSON.stringify(g):``,{interpolatedPath:v,usedParams:y}=ee({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),b=r.id+v+_,x=this.getMatch(b),S=f.get(r.id),C=x?._strictParams??y,w;if(!x)try{Kt(r,y,a,C)}catch(e){if(w=k(e)||se(e)?e:new zt(e.message,{cause:e}),t?.throwOnError)throw w}Object.assign(i,C);let E=S?`stay`:`enter`,D;if(x)D={...x,cause:E,params:S?.params??i,_strictParams:C,search:c(S?S.search:x.search,p),_strictSearch:m};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||kt(r)?`pending`:`success`;D={id:b,ssr:r.options.ssr,index:n,routeId:r.id,params:S?.params??i,_strictParams:C,pathname:v,updatedAt:Date.now(),search:S?c(S.search,p):p,_strictSearch:m,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:o()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:E,loaderDeps:S?c(S.loaderDeps,g):g,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||(D.globalNotFound=u===r.id),D.searchError=h;let te=this.getParentContext(l);D.context={...te,...D.__routeContext,...D.__beforeLoadContext},d[n]=D}for(let t=0;t<d.length;t++){let n=d[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=f.get(n.routeId);if(n.params=o?c(o.params,i):i,!a){let i=d[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:d,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return d}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=d(t),a={...e.search};for(let e of t)try{Object.assign(a,Vt(e.options.validateSearch,a))}catch{}let o=d(this.state.matches),s=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname,c;if(s)c=o.params;else{let e={...n};for(let i of t)try{Kt(i,n,r??{},e)}catch{}c=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:c}}},Rt=class extends Error{},zt=class extends Error{};function Bt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Vt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Rt(`Async validation not supported`);if(n.issues)throw new Rt(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 Ht({pathname:e,routesById:t,processedTree:n}){let r={},i=y(e),a,o,s=te(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign({},s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function Ut({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Wt(n)(e,t,r??!1)}function Wt(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Vt(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:s(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Gt(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 j}function Kt(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var qt=Symbol.for(`TSR_DEFERRED_PROMISE`);function Jt(e,t){let n=e;return n[qt]?n:(n[qt]={status:`pending`},n.then(e=>{n[qt].status=`success`,n[qt].data=e}).catch(e=>{n[qt].status=`error`,n[qt].error={data:(t?.serializeError??Ft)(e),__isServerError:!0}}),n)}var Yt=class{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=j:this.parentRoute||l(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?j:t?.path;r&&r!==`/`&&(r=ie(r));let i=t?.id||r,a=n?j:O([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=O([`/`,a]));let o=a===`__root__`?`/`:O([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=y(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=>oe({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.`)}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}},Xt=class extends Yt{constructor(e){super(e)}},Zt=(e=>(e[e.AggregateError=1]=`AggregateError`,e[e.ArrowFunction=2]=`ArrowFunction`,e[e.ErrorPrototypeStack=4]=`ErrorPrototypeStack`,e[e.ObjectAssign=8]=`ObjectAssign`,e[e.BigIntTypedArray=16]=`BigIntTypedArray`,e[e.RegExp=32]=`RegExp`,e))(Zt||{}),Qt=Symbol.asyncIterator,$t=Symbol.hasInstance,en=Symbol.isConcatSpreadable,tn=Symbol.iterator,nn=Symbol.match,rn=Symbol.matchAll,an=Symbol.replace,on=Symbol.search,sn=Symbol.species,cn=Symbol.split,ln=Symbol.toPrimitive,un=Symbol.toStringTag,dn=Symbol.unscopables,fn={[Qt]:0,[$t]:1,[en]:2,[tn]:3,[nn]:4,[rn]:5,[an]:6,[on]:7,[sn]:8,[cn]:9,[ln]:10,[un]:11,[dn]:12},pn={0:Qt,1:$t,2:en,3:tn,4:nn,5:rn,6:an,7:on,8:sn,9:cn,10:ln,11:un,12:dn},M=void 0,mn={2:!0,3:!1,1:M,0:null,4:-0,5:1/0,6:-1/0,7:NaN},hn={0:`Error`,1:`EvalError`,2:`RangeError`,3:`ReferenceError`,4:`SyntaxError`,5:`TypeError`,6:`URIError`},gn={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function N(e,t,n,r,i,a,o,s,c,l,u,d){return{t:e,i:t,s:n,c:r,m:i,p:a,e:o,a:s,f:c,b:l,o:u,l:d}}function _n(e){return N(2,M,e,M,M,M,M,M,M,M,M,M)}var vn=_n(2),yn=_n(3),bn=_n(1),xn=_n(0),Sn=_n(4),Cn=_n(5),wn=_n(6),Tn=_n(7);function En(e){switch(e){case`"`:return`\\"`;case`\\`:return`\\\\`;case`
3
- `:return`\\n`;case`\r`:return`\\r`;case`\b`:return`\\b`;case` `:return`\\t`;case`\f`:return`\\f`;case`<`:return`\\x3C`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:return M}}function Dn(e){let t=``,n=0,r;for(let i=0,a=e.length;i<a;i++)r=En(e[i]),r&&(t+=e.slice(n,i)+r,n=i+1);return n===0?t=e:t+=e.slice(n),t}function On(e){switch(e){case`\\\\`:return`\\`;case`\\"`:return`"`;case`\\n`:return`
4
- `;case`\\r`:return`\r`;case`\\b`:return`\b`;case`\\t`:return` `;case`\\f`:return`\f`;case`\\x3C`:return`<`;case`\\u2028`:return`\u2028`;case`\\u2029`:return`\u2029`;default:return e}}function kn(e){return e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,On)}var An=`__SEROVAL_REFS__`,jn=new Map,Mn=new Map;function Nn(e){return jn.has(e)}function Pn(e){return Mn.has(e)}function Fn(e){if(Nn(e))return jn.get(e);throw new Cr(e)}function In(e){if(Pn(e))return Mn.get(e);throw new wr(e)}typeof globalThis<`u`?Object.defineProperty(globalThis,An,{value:Mn,configurable:!0,writable:!1,enumerable:!1}):typeof window<`u`?Object.defineProperty(window,An,{value:Mn,configurable:!0,writable:!1,enumerable:!1}):typeof self<`u`?Object.defineProperty(self,An,{value:Mn,configurable:!0,writable:!1,enumerable:!1}):typeof global<`u`&&Object.defineProperty(global,An,{value:Mn,configurable:!0,writable:!1,enumerable:!1});function Ln(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function Rn(e){let t=hn[Ln(e)];return e.name===t?e.constructor.name===t?{}:{name:e.constructor.name}:{name:e.name}}function zn(e,t){let n=Rn(e),r=Object.getOwnPropertyNames(e);for(let i=0,a=r.length,o;i<a;i++)o=r[i],o!==`name`&&o!==`message`&&(o===`stack`?t&4&&(n||={},n[o]=e[o]):(n||={},n[o]=e[o]));return n}function Bn(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:+!Object.isExtensible(e)}function Vn(e){switch(e){case 1/0:return Cn;case-1/0:return wn}return e===e?Object.is(e,-0)?Sn:N(0,M,e,M,M,M,M,M,M,M,M,M):Tn}function Hn(e){return N(1,M,Dn(e),M,M,M,M,M,M,M,M,M)}function Un(e){return N(3,M,``+e,M,M,M,M,M,M,M,M,M)}function Wn(e){return N(4,e,M,M,M,M,M,M,M,M,M,M)}function Gn(e,t){let n=t.valueOf();return N(5,e,n===n?t.toISOString():``,M,M,M,M,M,M,M,M,M)}function Kn(e,t){return N(6,e,M,Dn(t.source),t.flags,M,M,M,M,M,M,M)}function qn(e,t){return N(17,e,fn[t],M,M,M,M,M,M,M,M,M)}function Jn(e,t){return N(18,e,Dn(Fn(t)),M,M,M,M,M,M,M,M,M)}function Yn(e,t,n){return N(25,e,n,Dn(t),M,M,M,M,M,M,M,M)}function Xn(e,t,n){return N(9,e,M,M,M,M,M,n,M,M,Bn(t),M)}function Zn(e,t){return N(21,e,M,M,M,M,M,M,t,M,M,M)}function Qn(e,t,n){return N(15,e,M,t.constructor.name,M,M,M,M,n,t.byteOffset,M,t.length)}function $n(e,t,n){return N(16,e,M,t.constructor.name,M,M,M,M,n,t.byteOffset,M,t.byteLength)}function er(e,t,n){return N(20,e,M,M,M,M,M,M,n,t.byteOffset,M,t.byteLength)}function tr(e,t,n){return N(13,e,Ln(t),M,Dn(t.message),n,M,M,M,M,M,M)}function nr(e,t,n){return N(14,e,Ln(t),M,Dn(t.message),n,M,M,M,M,M,M)}function rr(e,t){return N(7,e,M,M,M,M,M,t,M,M,M,M)}function ir(e,t){return N(28,M,M,M,M,M,M,[e,t],M,M,M,M)}function ar(e,t){return N(30,M,M,M,M,M,M,[e,t],M,M,M,M)}function or(e,t,n){return N(31,e,M,M,M,M,M,n,t,M,M,M)}function sr(e,t){return N(32,e,M,M,M,M,M,M,t,M,M,M)}function cr(e,t){return N(33,e,M,M,M,M,M,M,t,M,M,M)}function lr(e,t){return N(34,e,M,M,M,M,M,M,t,M,M,M)}function ur(e,t,n,r){return N(35,e,n,M,M,M,M,t,M,M,M,r)}var{toString:dr}=Object.prototype,fr={parsing:1,serialization:2,deserialization:3};function pr(e){return`Seroval Error (step: ${fr[e]})`}var mr=(e,t)=>pr(e),hr=class extends Error{constructor(e,t){super(mr(e,t)),this.cause=t}},gr=class extends hr{constructor(e){super(`parsing`,e)}},_r=class extends hr{constructor(e){super(`deserialization`,e)}};function vr(e){return`Seroval Error (specific: ${e})`}var yr=class extends Error{constructor(e){super(vr(1)),this.value=e}},br=class extends Error{constructor(e){super(vr(2))}},xr=class extends Error{constructor(e){super(vr(3))}},Sr=class extends Error{constructor(e){super(vr(4))}},Cr=class extends Error{constructor(e){super(vr(5)),this.value=e}},wr=class extends Error{constructor(e){super(vr(6))}},Tr=class extends Error{constructor(e){super(vr(7))}},Er=class extends Error{constructor(e){super(vr(8))}},Dr=class extends Error{constructor(e){super(vr(9))}},Or=class{constructor(e,t){this.value=e,this.replacement=t}},kr=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,n)=>{e.s=t,e.f=n}),e};kr.toString(),((e,t)=>{e.s(t),e.p.s=1,e.p.v=t}).toString(),((e,t)=>{e.f(t),e.p.s=2,e.p.v=t}).toString();var Ar=()=>{let e=[],t=[],n=!0,r=!1,i=0,a=(e,n,r)=>{for(r=0;r<i;r++)t[r]&&t[r][n](e)},o=(t,i,a,o)=>{for(i=0,a=e.length;i<a;i++)o=e[i],!n&&i===a-1?t[r?`return`:`throw`](o):t.next(o)},s=(e,r)=>(n&&(r=i++,t[r]=e),o(e),()=>{n&&(t[r]=t[i],t[i--]=void 0)});return{__SEROVAL_STREAM__:!0,on:e=>s(e),next:t=>{n&&(e.push(t),a(t,`next`))},throw:i=>{n&&(e.push(i),a(i,`throw`),n=!1,r=!1,t.length=0)},return:i=>{n&&(e.push(i),a(i,`return`),n=!1,r=!0,t.length=0)}}};Ar.toString();var jr=e=>t=>()=>{let n=0,r={[e]:()=>r,next:()=>{if(n>t.d)return{done:!0,value:void 0};let e=n++,r=t.v[e];if(e===t.t)throw r;return{done:e===t.d,value:r}}};return r};jr.toString();var Mr=(e,t)=>n=>()=>{let r=0,i=-1,a=!1,o=[],s=[],c=(e=0,t=s.length)=>{for(;e<t;e++)s[e].s({done:!0,value:void 0})};n.on({next:e=>{let t=s.shift();t&&t.s({done:!1,value:e}),o.push(e)},throw:e=>{let t=s.shift();t&&t.f(e),c(),i=o.length,a=!0,o.push(e)},return:e=>{let t=s.shift();t&&t.s({done:!0,value:e}),c(),i=o.length,o.push(e)}});let l={[e]:()=>l,next:()=>{if(i===-1){let e=r++;if(e>=o.length){let e=t();return s.push(e),e.p}return{done:!1,value:o[e]}}if(r>i)return{done:!0,value:void 0};let e=r++,n=o[e];if(e!==i)return{done:!1,value:n};if(a)throw n;return{done:!0,value:n}}};return l};Mr.toString();var Nr=e=>{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer};Nr.toString();function Pr(e){return`__SEROVAL_SEQUENCE__`in e}function Fr(e,t,n){return{__SEROVAL_SEQUENCE__:!0,v:e,t,d:n}}function Ir(e){let t=[],n=-1,r=-1,i=e[tn]();for(;;)try{let e=i.next();if(t.push(e.value),e.done){r=t.length-1;break}}catch(e){n=t.length,t.push(e)}return Fr(t,n,r)}var Lr=jr(tn);function Rr(e){return Lr(e)}var zr={},Br={},Vr={0:{},1:{},2:{},3:{},4:{},5:{}};function Hr(e){return`__SEROVAL_STREAM__`in e}function Ur(){return Ar()}function Wr(e){let t=Ur(),n=e[Qt]();async function r(){try{let e=await n.next();e.done?t.return(e.value):(t.next(e.value),await r())}catch(e){t.throw(e)}}return r().catch(()=>{}),t}var Gr=Mr(Qt,kr);function Kr(e){return Gr(e)}async function qr(e){try{return[1,await e]}catch(e){return[0,e]}}function Jr(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:63^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3}}function Yr(e,t){e.marked.add(t)}function Xr(e,t){let n=e.refs.size;return e.refs.set(t,n),n}function Zr(e,t){let n=e.refs.get(t);return n==null?{type:0,value:Xr(e,t)}:(Yr(e,n),{type:1,value:Wn(n)})}function Qr(e,t){let n=Zr(e,t);return n.type===1?n:Nn(t)?{type:2,value:Jn(n.value,t)}:n}function $r(e,t){let n=Qr(e,t);if(n.type!==0)return n.value;if(t in fn)return qn(n.value,t);throw new yr(t)}function ei(e,t){let n=Zr(e,Vr[t]);return n.type===1?n.value:N(26,n.value,t,M,M,M,M,M,M,M,M,M)}function ti(e){let t=Zr(e,zr);return t.type===1?t.value:N(27,t.value,M,M,M,M,M,M,$r(e,tn),M,M,M)}function ni(e){let t=Zr(e,Br);return t.type===1?t.value:N(29,t.value,M,M,M,M,M,[ei(e,1),$r(e,Qt)],M,M,M,M)}function ri(e,t,n,r){return N(n?11:10,e,M,M,M,r,M,M,M,M,Bn(t),M)}function ii(e,t,n,r){return N(8,t,M,M,M,M,{k:n,v:r},M,ei(e,0),M,M,M)}function ai(e,t,n){let r=new Uint8Array(n),i=``;for(let e=0,t=r.length;e<t;e++)i+=String.fromCharCode(r[e]);return N(19,t,Dn(btoa(i)),M,M,M,M,M,ei(e,5),M,M,M)}function oi(e,t){return{base:Jr(e,t),child:void 0}}var si=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return P(this._p,this.depth,e)}};async function ci(e,t,n){let r=[];for(let i=0,a=n.length;i<a;i++)i in n?r[i]=await P(e,t,n[i]):r[i]=0;return r}async function li(e,t,n,r){return Xn(n,r,await ci(e,t,r))}async function ui(e,t,n){let r=Object.entries(n),i=[],a=[];for(let n=0,o=r.length;n<o;n++)i.push(Dn(r[n][0])),a.push(await P(e,t,r[n][1]));return tn in n&&(i.push($r(e.base,tn)),a.push(ir(ti(e.base),await P(e,t,Ir(n))))),Qt in n&&(i.push($r(e.base,Qt)),a.push(ar(ni(e.base),await P(e,t,Wr(n))))),un in n&&(i.push($r(e.base,un)),a.push(Hn(n[un]))),en in n&&(i.push($r(e.base,en)),a.push(n[en]?vn:yn)),{k:i,v:a}}async function di(e,t,n,r,i){return ri(n,r,i,await ui(e,t,r))}async function fi(e,t,n,r){return Zn(n,await P(e,t,r.valueOf()))}async function pi(e,t,n,r){return Qn(n,r,await P(e,t,r.buffer))}async function mi(e,t,n,r){return $n(n,r,await P(e,t,r.buffer))}async function hi(e,t,n,r){return er(n,r,await P(e,t,r.buffer))}async function gi(e,t,n,r){let i=zn(r,e.base.features);return tr(n,r,i?await ui(e,t,i):M)}async function _i(e,t,n,r){let i=zn(r,e.base.features);return nr(n,r,i?await ui(e,t,i):M)}async function vi(e,t,n,r){let i=[],a=[];for(let[n,o]of r.entries())i.push(await P(e,t,n)),a.push(await P(e,t,o));return ii(e.base,n,i,a)}async function yi(e,t,n,r){let i=[];for(let n of r.keys())i.push(await P(e,t,n));return rr(n,i)}async function bi(e,t,n,r){let i=e.base.plugins;if(i)for(let a=0,o=i.length;a<o;a++){let o=i[a];if(o.parse.async&&o.test(r))return Yn(n,o.tag,await o.parse.async(r,new si(e,t),{id:n}))}return M}async function xi(e,t,n,r){let[i,a]=await qr(r);return N(12,n,i,M,M,M,M,M,await P(e,t,a),M,M,M)}function Si(e,t,n,r,i){let a=[],o=n.on({next:n=>{Yr(this.base,t),P(this,e,n).then(e=>{a.push(sr(t,e))},e=>{i(e),o()})},throw:n=>{Yr(this.base,t),P(this,e,n).then(e=>{a.push(cr(t,e)),r(a),o()},e=>{i(e),o()})},return:n=>{Yr(this.base,t),P(this,e,n).then(e=>{a.push(lr(t,e)),r(a),o()},e=>{i(e),o()})}})}async function Ci(e,t,n,r){return or(n,ei(e.base,4),await new Promise(Si.bind(e,t,n,r)))}async function wi(e,t,n,r){let i=[];for(let n=0,a=r.v.length;n<a;n++)i[n]=await P(e,t,r.v[n]);return ur(n,i,r.t,r.d)}async function Ti(e,t,n,r){if(Array.isArray(r))return li(e,t,n,r);if(Hr(r))return Ci(e,t,n,r);if(Pr(r))return wi(e,t,n,r);let i=r.constructor;if(i===Or)return P(e,t,r.replacement);let a=await bi(e,t,n,r);if(a)return a;switch(i){case Object:return di(e,t,n,r,!1);case M:return di(e,t,n,r,!0);case Date:return Gn(n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return gi(e,t,n,r);case Number:case Boolean:case String:case BigInt:return fi(e,t,n,r);case ArrayBuffer:return ai(e.base,n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return pi(e,t,n,r);case DataView:return hi(e,t,n,r);case Map:return vi(e,t,n,r);case Set:return yi(e,t,n,r);default:break}if(i===Promise||r instanceof Promise)return xi(e,t,n,r);let o=e.base.features;if(o&32&&i===RegExp)return Kn(n,r);if(o&16)switch(i){case BigInt64Array:case BigUint64Array:return mi(e,t,n,r);default:break}if(o&1&&typeof AggregateError<`u`&&(i===AggregateError||r instanceof AggregateError))return _i(e,t,n,r);if(r instanceof Error)return gi(e,t,n,r);if(tn in r||Qt in r)return di(e,t,n,r,!!i);throw new yr(r)}async function Ei(e,t,n){let r=Qr(e.base,n);if(r.type!==0)return r.value;let i=await bi(e,t,r.value,n);if(i)return i;throw new yr(n)}async function P(e,t,n){switch(typeof n){case`boolean`:return n?vn:yn;case`undefined`:return bn;case`string`:return Hn(n);case`number`:return Vn(n);case`bigint`:return Un(n);case`object`:if(n){let r=Qr(e.base,n);return r.type===0?await Ti(e,t+1,r.value,n):r.value}return xn;case`symbol`:return $r(e.base,n);case`function`:return Ei(e,t,n);default:throw new yr(n)}}async function Di(e,t){try{return await P(e,0,t)}catch(e){throw e instanceof gr?e:new gr(e)}}var Oi=(e=>(e[e.Vanilla=1]=`Vanilla`,e[e.Cross=2]=`Cross`,e))(Oi||{});function ki(e){return e}function Ai(e,t){for(let n=0,r=t.length;n<r;n++){let r=t[n];e.has(r)||(e.add(r),r.extends&&Ai(e,r.extends))}}function ji(e){if(e){let t=new Set;return Ai(t,e),[...t]}}function Mi(e){switch(e){case`Int8Array`:return Int8Array;case`Int16Array`:return Int16Array;case`Int32Array`:return Int32Array;case`Uint8Array`:return Uint8Array;case`Uint16Array`:return Uint16Array;case`Uint32Array`:return Uint32Array;case`Uint8ClampedArray`:return Uint8ClampedArray;case`Float32Array`:return Float32Array;case`Float64Array`:return Float64Array;case`BigInt64Array`:return BigInt64Array;case`BigUint64Array`:return BigUint64Array;default:throw new Tr(e)}}var Ni=1e6,Pi=1e4,Fi=2e4;function Ii(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var Li=1e3;function F(e,t){let n=t.refs||new Map;return`types`in n||Object.assign(n,{types:new Map}),{mode:e,plugins:t.plugins,refs:n,features:t.features??63^(t.disabledFeatures||0),depthLimit:t.depthLimit||Li}}function I(e){return{mode:2,base:F(2,e),child:M}}var Ri=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return L(this._p,this.depth,e)}};function zi(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new Er({t:4,i:t});if(e.refs.has(t))throw Error(`Conflicted ref id: `+t)}function Bi(e,t,n){return zi(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,n),n}function Vi(e,t,n){return zi(e.base,t),e.base.refs.set(t,n),n}function Hi(e,t,n){return e.mode===1?Bi(e,t,n):Vi(e,t,n)}function Ui(e,t,n){if(Object.hasOwn(t,n))return t[n];throw new Er(e)}function Wi(e,t){return Hi(e,t.i,In(kn(t.s)))}function Gi(e,t,n){let r=n.a,i=r.length,a=Hi(e,n.i,Array(i));for(let n=0,o;n<i;n++)o=r[n],o&&(a[n]=L(e,t,o));return Ii(a,n.o),a}function Ki(e){switch(e){case`constructor`:case`__proto__`:case`prototype`:case`__defineGetter__`:case`__defineSetter__`:case`__lookupGetter__`:case`__lookupSetter__`:return!1;default:return!0}}function qi(e){switch(e){case Qt:case en:case un:case tn:return!0;default:return!1}}function Ji(e,t,n){Ki(t)?e[t]=n:Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function Yi(e,t,n,r,i){if(typeof r==`string`)Ji(n,kn(r),L(e,t,i));else{let a=L(e,t,r);switch(typeof a){case`string`:Ji(n,a,L(e,t,i));break;case`symbol`:qi(a)&&(n[a]=L(e,t,i));break;default:throw new Er(r)}}}function Xi(e,t,n){e.base.refs.types.set(t,n)}function Zi(e,t,n,r){if(e.base.refs.types.get(n)!==r)throw new Er(t)}function Qi(e,t,n,r){let i=n.k;if(i.length>0)for(let a=0,o=n.v,s=i.length;a<s;a++)Yi(e,t,r,i[a],o[a]);return r}function $i(e,t,n){let r=Hi(e,n.i,n.t===10?{}:Object.create(null));return Qi(e,t,n.p,r),Ii(r,n.o),r}function ea(e,t){return Hi(e,t.i,new Date(t.s))}function ta(e,t){if(e.base.features&32){let n=kn(t.c);if(n.length>Fi)throw new Er(t);return Hi(e,t.i,new RegExp(n,t.m))}throw new br(t)}function na(e,t,n){let r=Hi(e,n.i,new Set);for(let i=0,a=n.a,o=a.length;i<o;i++)r.add(L(e,t,a[i]));return r}function ra(e,t,n){let r=Hi(e,n.i,new Map);for(let i=0,a=n.e.k,o=n.e.v,s=a.length;i<s;i++)r.set(L(e,t,a[i]),L(e,t,o[i]));return r}function ia(e,t){if(t.s.length>Ni)throw new Er(t);return Hi(e,t.i,Nr(kn(t.s)))}function aa(e,t,n){let r=Mi(n.c),i=L(e,t,n.f),a=n.b??0;if(a<0||a>i.byteLength)throw new Er(n);return Hi(e,n.i,new r(i,a,n.l))}function oa(e,t,n){let r=L(e,t,n.f),i=n.b??0;if(i<0||i>r.byteLength)throw new Er(n);return Hi(e,n.i,new DataView(r,i,n.l))}function sa(e,t,n,r){if(n.p){let i=Qi(e,t,n.p,{});Object.defineProperties(r,Object.getOwnPropertyDescriptors(i))}return r}function ca(e,t,n){return sa(e,t,n,Hi(e,n.i,AggregateError([],kn(n.m))))}function la(e,t,n){let r=Ui(n,gn,n.s);return sa(e,t,n,Hi(e,n.i,new r(kn(n.m))))}function ua(e,t,n){let r=kr(),i=Hi(e,n.i,r.p),a=L(e,t,n.f);return n.s?r.s(a):r.f(a),i}function da(e,t,n){return Hi(e,n.i,Object(L(e,t,n.f)))}function fa(e,t,n){let r=e.base.plugins;if(r){let i=kn(n.c);for(let a=0,o=r.length;a<o;a++){let o=r[a];if(o.tag===i)return Hi(e,n.i,o.deserialize(n.s,new Ri(e,t),{id:n.i}))}}throw new xr(n.c)}function pa(e,t){let n=Hi(e,t.i,Hi(e,t.s,kr()).p);return Xi(e,t.s,22),n}function ma(e,t,n){let r=e.base.refs.get(n.i);if(r)return Zi(e,n,n.i,22),r.s(L(e,t,n.a[1])),M;throw new Sr(`Promise`)}function ha(e,t,n){let r=e.base.refs.get(n.i);if(r)return Zi(e,n,n.i,22),r.f(L(e,t,n.a[1])),M;throw new Sr(`Promise`)}function ga(e,t,n){return L(e,t,n.a[0]),Rr(L(e,t,n.a[1]))}function _a(e,t,n){return L(e,t,n.a[0]),Kr(L(e,t,n.a[1]))}function va(e,t,n){let r=Hi(e,n.i,Ur());Xi(e,n.i,31);let i=n.a,a=i.length;if(a)for(let n=0;n<a;n++)L(e,t,i[n]);return r}function ya(e,t,n){let r=e.base.refs.get(n.i);if(r)return Zi(e,n,n.i,31),r.next(L(e,t,n.f)),M;throw new Sr(`Stream`)}function ba(e,t,n){let r=e.base.refs.get(n.i);if(r)return Zi(e,n,n.i,31),r.throw(L(e,t,n.f)),M;throw new Sr(`Stream`)}function xa(e,t,n){let r=e.base.refs.get(n.i);if(r)return Zi(e,n,n.i,31),r.return(L(e,t,n.f)),M;throw new Sr(`Stream`)}function Sa(e,t,n){return L(e,t,n.f),M}function Ca(e,t,n){return L(e,t,n.a[1]),M}function wa(e,t,n){let r=Hi(e,n.i,Fr([],n.s,n.l));for(let i=0,a=n.a.length;i<a;i++)r.v[i]=L(e,t,n.a[i]);return r}function L(e,t,n){if(t>e.base.depthLimit)throw new Dr(e.base.depthLimit);switch(t+=1,n.t){case 2:return Ui(n,mn,n.s);case 0:return Number(n.s);case 1:return kn(String(n.s));case 3:if(String(n.s).length>Pi)throw new Er(n);return BigInt(n.s);case 4:return e.base.refs.get(n.i);case 18:return Wi(e,n);case 9:return Gi(e,t,n);case 10:case 11:return $i(e,t,n);case 5:return ea(e,n);case 6:return ta(e,n);case 7:return na(e,t,n);case 8:return ra(e,t,n);case 19:return ia(e,n);case 16:case 15:return aa(e,t,n);case 20:return oa(e,t,n);case 14:return ca(e,t,n);case 13:return la(e,t,n);case 12:return ua(e,t,n);case 17:return Ui(n,pn,n.s);case 21:return da(e,t,n);case 25:return fa(e,t,n);case 22:return pa(e,n);case 23:return ma(e,t,n);case 24:return ha(e,t,n);case 28:return ga(e,t,n);case 30:return _a(e,t,n);case 31:return va(e,t,n);case 32:return ya(e,t,n);case 33:return ba(e,t,n);case 34:return xa(e,t,n);case 27:return Sa(e,t,n);case 29:return Ca(e,t,n);case 35:return wa(e,t,n);default:throw new br(n)}}function Ta(e,t){try{return L(e,0,t)}catch(e){throw new _r(e)}}var Ea=(()=>T).toString();/=>/.test(Ea);function Da(e,t){return Ta(I({plugins:ji(t.plugins),refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures,depthLimit:t.depthLimit}),e)}async function Oa(e,t={}){let n=oi(1,{plugins:ji(t.plugins),disabledFeatures:t.disabledFeatures});return{t:await Di(n,e),f:n.base.features,m:Array.from(n.base.marked)}}function ka(e){return e}function Aa(e){return ki({tag:`$TSR/t/`+e.key,test:e.test,parse:{sync(t,n){return n.parse(e.toSerializable(t))},async async(t,n){return await n.parse(e.toSerializable(t))},stream(t,n){return n.parse(e.toSerializable(t))}},serialize:void 0,deserialize(t,n){return e.fromSerializable(n.deserialize(t))}})}var ja={},Ma=e=>new ReadableStream({start:t=>{e.on({next:e=>{try{t.enqueue(e)}catch{}},throw:e=>{t.error(e)},return:()=>{try{t.close()}catch{}}})}}),Na=ki({tag:`seroval-plugins/web/ReadableStreamFactory`,test(e){return e===ja},parse:{sync(){return ja},async async(){return await Promise.resolve(ja)},stream(){return ja}},serialize(){return Ma.toString()},deserialize(){return ja}});function Pa(e){let t=Ur(),n=e.getReader();async function r(){try{let e=await n.read();e.done?t.return(e.value):(t.next(e.value),await r())}catch(e){t.throw(e)}}return r().catch(()=>{}),t}var Fa=ki({tag:`seroval/plugins/web/ReadableStream`,extends:[Na],test(e){return typeof ReadableStream>`u`?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(ja),stream:t.parse(Ur())}},async async(e,t){return{factory:await t.parse(ja),stream:await t.parse(Pa(e))}},stream(e,t){return{factory:t.parse(ja),stream:t.parse(Pa(e))}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t){return Ma(t.deserialize(e.stream))}}),Ia=ki({tag:`$TSR/Error`,test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return`new Error(`+t.serialize(e.message)+`)`},deserialize(e,t){return Error(t.deserialize(e.message))}}),La=class{constructor(e,t){this.stream=e,this.hint=t?.hint??`binary`}},Ra=globalThis.Buffer,za=!!Ra&&typeof Ra.from==`function`;function Ba(e){if(e.length===0)return``;if(za)return Ra.from(e).toString(`base64`);let t=32768,n=[];for(let r=0;r<e.length;r+=t){let i=e.subarray(r,r+t);n.push(String.fromCharCode.apply(null,i))}return btoa(n.join(``))}function Va(e){if(e.length===0)return new Uint8Array;if(za){let t=Ra.from(e,`base64`);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var Ha=Object.create(null),Ua=Object.create(null),Wa=e=>new ReadableStream({start(t){e.on({next(e){try{t.enqueue(Va(e))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),Ga=new TextEncoder,Ka=e=>new ReadableStream({start(t){e.on({next(e){try{typeof e==`string`?t.enqueue(Ga.encode(e)):t.enqueue(Va(e.$b64))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),qa=`(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))`,Ja=`(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})`;function Ya(e){let t=Ur(),n=e.getReader();return(async()=>{try{for(;;){let{done:e,value:r}=await n.read();if(e){t.return(void 0);break}t.next(Ba(r))}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}function Xa(e){let t=Ur(),n=e.getReader(),r=new TextDecoder(`utf-8`,{fatal:!0});return(async()=>{try{for(;;){let{done:e,value:i}=await n.read();if(e){try{let e=r.decode();e.length>0&&t.next(e)}catch{}t.return(void 0);break}try{let e=r.decode(i,{stream:!0});e.length>0&&t.next(e)}catch{t.next({$b64:Ba(i)})}}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}var Za=ki({tag:`tss/RawStream`,extends:[ki({tag:`tss/RawStreamFactory`,test(e){return e===Ha},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return qa},deserialize(){return Ha}}),ki({tag:`tss/RawStreamFactoryText`,test(e){return e===Ua},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return Ja},deserialize(){return Ua}})],test(e){return e instanceof La},parse:{sync(e,t){let n=e.hint===`text`?Ua:Ha;return{hint:e.hint,factory:t.parse(n),stream:t.parse(Ur())}},async async(e,t){let n=e.hint===`text`?Ua:Ha,r=e.hint===`text`?Xa(e.stream):Ya(e.stream);return{hint:e.hint,factory:await t.parse(n),stream:await t.parse(r)}},stream(e,t){let n=e.hint===`text`?Ua:Ha,r=e.hint===`text`?Xa(e.stream):Ya(e.stream);return{hint:e.hint,factory:t.parse(n),stream:t.parse(r)}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t){let n=t.deserialize(e.stream);return e.hint===`text`?Ka(n):Wa(n)}});function Qa(e){return ki({tag:`tss/RawStream`,test:()=>!1,parse:{},serialize(){throw Error(`RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.`)},deserialize(t){return e(t.streamId)}})}var $a=[Ia,Za,Fa],R=a(),z=h(p(),1);function eo({promise:e}){if(fe)return fe(e);let t=Jt(e);if(t[qt].status===`pending`)throw t;if(t[qt].status===`error`)throw t[qt].error;return t[qt].data}function to(e){let t=(0,R.jsx)(no,{...e});return e.fallback?(0,R.jsx)(z.Suspense,{fallback:e.fallback,children:t}):t}function no(e){let t=eo(e);return e.children(t)}function ro(e){let t=e.errorComponent??ao;return(0,R.jsx)(io,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?z.createElement(t,{error:n,reset:r}):e.children})}var io=class extends z.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function ao({error:e}){let[t,n]=z.useState(!1);return(0,R.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,R.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,R.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,R.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,R.jsx)(`div`,{children:(0,R.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,R.jsx)(`code`,{children:e.message}):null})}):null]})}function oo(e){let t=z.useContext(e.from?de:ue);return D({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(l(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function so(e){return oo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function co(e){let{select:t,...n}=e;return oo({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function lo(e){return oo({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 uo(e){return oo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function fo(e){let t=ge();return z.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var po=class extends Yt{constructor(e){super(e),this.useMatch=e=>oo({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>oo({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>uo({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>lo({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>co({...e,from:this.id}),this.useLoaderData=e=>so({...e,from:this.id}),this.useNavigate=()=>fo({from:this.fullPath}),this.Link=z.forwardRef((e,t)=>(0,R.jsx)(re,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function B(e){return new po(e)}var V=class extends Xt{constructor(e){super(e),this.useMatch=e=>oo({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>oo({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>uo({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>lo({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>co({...e,from:this.id}),this.useLoaderData=e=>so({...e,from:this.id}),this.useNavigate=()=>fo({from:this.fullPath}),this.Link=z.forwardRef((e,t)=>(0,R.jsx)(re,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function mo(e){return new V(e)}function ho(e){return typeof e==`object`?new go(e,{silent:!0}).createRoute(e):new go(e,{silent:!0}).createRoute}var go=class{constructor(e,t){this.path=e,this.createRoute=e=>{me(this.silent,`FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.`);let t=B(e);return t.isRoot=!1,t},this.silent=t?.silent}},_o=class{constructor(e){this.useMatch=e=>oo({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>oo({from:this.options.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>uo({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>lo({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>co({...e,from:this.options.id}),this.useLoaderData=e=>so({...e,from:this.options.id}),this.useNavigate=()=>fo({from:ge().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for(`react.memo`)}};function vo(e){return typeof e==`object`?new _o(e):t=>new _o({id:e,...t})}function yo(e,t){let r,i,a,o,s=()=>(r||=e().then(e=>{r=void 0,i=e[t??`default`]}).catch(e=>{if(a=e,n(a)&&a instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${a.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),o=!0)}}),r),c=function(e){if(o)throw window.location.reload(),new Promise(()=>{});if(a)throw a;if(!i)if(fe)fe(s());else throw s();return z.createElement(i,e)};return c.preload=s,c}function bo(){let e=ge(),t=z.useRef({router:e,mounted:!1}),[n,r]=z.useState(!1),{hasPendingMatches:i,isLoading:a}=D({select:e=>({isLoading:e.isLoading,hasPendingMatches:e.matches.some(e=>e.status===`pending`)}),structuralSharing:!0}),o=he(a),s=a||n||i,c=he(s),l=a||i,u=he(l);return e.startTransition=e=>{r(!0),z.startTransition(()=>{e(),r(!1)})},z.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 y(e.latestLocation.publicHref)!==y(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),pe(()=>{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]),pe(()=>{o&&!a&&e.emit({type:`onLoad`,...It(e.state)})},[o,e,a]),pe(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...It(e.state)})},[l,u,e]),pe(()=>{if(c&&!s){let t=It(e.state);e.emit({type:`onResolved`,...t}),e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),t.hrefChanged&&st(e)}},[s,c,e]),null}function xo(e){let t=D({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,R.jsx)(ro,{getResetKey:()=>t,onCatch:(t,n)=>{if(k(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(k(t))return e.fallback?.(t);throw t},children:e.children})}function So(){return(0,R.jsx)(`p`,{children:`Not Found`})}function Co(e){return(0,R.jsx)(R.Fragment,{children:e.children})}function wo(e,t,n){return t.options.notFoundComponent?(0,R.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,R.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,R.jsx)(So,{})}function To({children:e}){return ge(),null}function Eo(){let e=ge();if(!e.isScrollRestoring||!0)return null;let n=(e.options.getScrollRestorationKey||nt)(e.latestLocation),r=n===nt(e.latestLocation)?void 0:n,i={storageKey:Qe,shouldScrollRestoration:!0};return r&&(i.key=r),(0,R.jsx)(To,{children:`(${at.toString()})(${t(JSON.stringify(i))})`})}var Do=z.memo(function({matchId:e}){let t=ge(),n=D({select:t=>{let n=t.matches.findIndex(t=>t.id===e),r=t.matches[n];return l(r,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:r.routeId,ssr:r.ssr,_displayPending:r._displayPending,resetKey:t.loadedAt,parentRouteId:t.matches[n-1]?.routeId}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,R.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,u=n.ssr===!1||n.ssr===`data-only`,d=(!r.isRoot||r.options.wrapInSuspense||u)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||u))?z.Suspense:Co,f=o?ro:Co,p=c?xo:Co;return(0,R.jsxs)(r.isRoot?r.options.shellComponent??Co:Co,{children:[(0,R.jsx)(ue.Provider,{value:e,children:(0,R.jsx)(d,{fallback:a,children:(0,R.jsx)(f,{getResetKey:()=>n.resetKey,errorComponent:o||ao,onCatch:(t,n)=>{if(k(t))throw t;me(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,R.jsx)(p,{fallback:e=>{if(!c||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return z.createElement(c,e)},children:u||n._displayPending?(0,R.jsx)(ne,{fallback:a,children:(0,R.jsx)(ko,{matchId:e})}):(0,R.jsx)(ko,{matchId:e})})})})}),n.parentRouteId===`__root__`&&t.options.scrollRestoration?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Oo,{}),(0,R.jsx)(Eo,{})]}):null]})});function Oo(){let e=ge(),t=z.useRef(void 0);return(0,R.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...It(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var ko=z.memo(function({matchId:e}){let t=ge(),{match:n,key:r,routeId:i}=D({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,invalid:r.invalid,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],s=z.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,R.jsx)(e,{},r):(0,R.jsx)(Ao,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise){let t=o();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return l(k(n.error),`Expected a notFound error`),wo(t,a,n.error);if(n.status===`redirected`)throw l(se(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`)throw n.error;return s}),Ao=z.memo(function(){let e=ge(),t=z.useContext(ue),n=D({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=D({select:e=>{let n=e.matches.find(e=>e.id===t);return l(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=D({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,R.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return wo(e,r,void 0);if(!a)return null;let s=(0,R.jsx)(Do,{matchId:a});return n===`__root__`?(0,R.jsx)(z.Suspense,{fallback:o,children:s}):s});function jo(){let e=ge(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,R.jsx)(t,{}):null,r=(0,R.jsxs)(typeof document<`u`&&e.ssr?Co:z.Suspense,{fallback:n,children:[(0,R.jsx)(bo,{}),(0,R.jsx)(Mo,{})]});return e.options.InnerWrap?(0,R.jsx)(e.options.InnerWrap,{children:r}):r}function Mo(){let e=ge(),t=D({select:e=>e.matches[0]?.id}),n=D({select:e=>e.loadedAt}),r=t?(0,R.jsx)(Do,{matchId:t}):null;return(0,R.jsx)(ue.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,R.jsx)(ro,{getResetKey:()=>n,errorComponent:ao,onCatch:e=>{me(!1,`The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`),me(!1,e.message||e.toString())},children:r})})}var No=e=>new Po(e),Po=class extends Lt{constructor(e){super(e)}};typeof globalThis<`u`?(globalThis.createFileRoute=ho,globalThis.createLazyFileRoute=vo):typeof window<`u`&&(window.createFileRoute=ho,window.createLazyFileRoute=vo);function Fo({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,R.jsx)(_e().Provider,{value:e,children:t});return e.options.Wrap?(0,R.jsx)(e.options.Wrap,{children:r}):r}function Io({router:e,...t}){return(0,R.jsx)(Fo,{router:e,...t,children:(0,R.jsx)(jo,{})})}function Lo(e){return D({select:t=>e?.select?e.select(t.location):t.location})}function Ro({tag:e,attrs:t,children:n,nonce:r}){switch(e){case`title`:return(0,R.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,R.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,R.jsx)(`link`,{...t,nonce:r,suppressHydrationWarning:!0});case`style`:return(0,R.jsx)(`style`,{...t,dangerouslySetInnerHTML:{__html:n},nonce:r});case`script`:return(0,R.jsx)(zo,{attrs:t,children:n});default:return null}}function zo({attrs:e,children:t}){ge(),z.useEffect(()=>{if(e?.src){let t=(()=>{try{let t=document.baseURI||window.location.href;return new URL(e.src,t).href}catch{return e.src}})();if(Array.from(document.querySelectorAll(`script[src]`)).find(e=>e.src===t))return;let n=document.createElement(`script`);for(let[t,r]of Object.entries(e))t!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&n.setAttribute(t,typeof r==`boolean`?``:String(r));return document.head.appendChild(n),()=>{n.parentNode&&n.parentNode.removeChild(n)}}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;if(Array.from(document.querySelectorAll(`script:not([src])`)).find(e=>{if(!(e instanceof HTMLScriptElement))return!1;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;return e.textContent===t&&i===n&&a===r}))return;let i=document.createElement(`script`);if(i.textContent=t,e)for(let[t,n]of Object.entries(e))t!==`suppressHydrationWarning`&&n!==void 0&&n!==!1&&i.setAttribute(t,typeof n==`boolean`?``:String(n));return document.head.appendChild(i),()=>{i.parentNode&&i.parentNode.removeChild(i)}}},[e,t]);{let{src:t,...n}=e||{};return(0,R.jsx)(`script`,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:``},...n})}return e?.src&&typeof e.src==`string`?(0,R.jsx)(`script`,{...e,suppressHydrationWarning:!0}):typeof t==`string`?(0,R.jsx)(`script`,{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var Bo=()=>{let e=ge(),n=e.options.ssr?.nonce,r=D({select:e=>e.matches.map(e=>e.meta).filter(Boolean)}),i=z.useMemo(()=>{let e=[],i={},a;for(let o=r.length-1;o>=0;o--){let s=r[o];for(let r=s.length-1;r>=0;r--){let o=s[r];if(o)if(o.title)a||={tag:`title`,children:o.title};else if(`script:ld+json`in o)try{let n=JSON.stringify(o[`script:ld+json`]);e.push({tag:`script`,attrs:{type:`application/ld+json`},children:t(n)})}catch{}else{let t=o.name??o.property;if(t){if(i[t])continue;i[t]=!0}e.push({tag:`meta`,attrs:{...o,nonce:n}})}}}return a&&e.push(a),n&&e.push({tag:`meta`,attrs:{property:`csp-nonce`,content:n}}),e.reverse(),e},[r,n]),a=D({select:t=>{let r=t.matches.map(e=>e.links).filter(Boolean).flat(1).map(e=>({tag:`link`,attrs:{...e,nonce:n}})),i=e.ssr?.manifest,a=t.matches.map(e=>i?.routes[e.routeId]?.assets??[]).filter(Boolean).flat(1).filter(e=>e.tag===`link`).map(e=>({tag:`link`,attrs:{...e.attrs,suppressHydrationWarning:!0,nonce:n}}));return[...r,...a]},structuralSharing:!0}),o=D({select:t=>{let r=[];return t.matches.map(t=>e.looseRoutesById[t.routeId]).forEach(t=>e.ssr?.manifest?.routes[t.id]?.preloads?.filter(Boolean).forEach(e=>{r.push({tag:`link`,attrs:{rel:`modulepreload`,href:e,nonce:n}})})),r},structuralSharing:!0}),s=D({select:e=>e.matches.map(e=>e.styles).flat(1).filter(Boolean).map(({children:e,...t})=>({tag:`style`,attrs:{...t,nonce:n},children:e})),structuralSharing:!0}),c=D({select:e=>e.matches.map(e=>e.headScripts).flat(1).filter(Boolean).map(({children:e,...t})=>({tag:`script`,attrs:{...t,nonce:n},children:e})),structuralSharing:!0});return Vo([...i,...o,...a,...s,...c],e=>JSON.stringify(e))};function Vo(e,t){let n=new Set;return e.filter(e=>{let r=t(e);return n.has(r)?!1:(n.add(r),!0)})}function Ho(){let e=Bo(),t=ge().options.ssr?.nonce;return(0,R.jsx)(R.Fragment,{children:e.map(e=>(0,z.createElement)(Ro,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:t}))})}var Uo=()=>{let e=ge(),t=e.options.ssr?.nonce,n=D({select:n=>{let r=[],i=e.ssr?.manifest;return i?(n.matches.map(t=>e.looseRoutesById[t.routeId]).forEach(e=>i.routes[e.id]?.assets?.filter(e=>e.tag===`script`).forEach(e=>{r.push({tag:`script`,attrs:{...e.attrs,nonce:t},children:e.children})})),r):[]},structuralSharing:!0}),{scripts:r}=D({select:e=>({scripts:e.matches.map(e=>e.scripts).flat(1).filter(Boolean).map(({children:e,...n})=>({tag:`script`,attrs:{...n,suppressHydrationWarning:!0,nonce:t},children:e}))}),structuralSharing:!0}),i;e.serverSsr&&(i=e.serverSsr.takeBufferedScripts());let a=[...r,...n];return i&&a.unshift(i),(0,R.jsx)(R.Fragment,{children:a.map((e,t)=>(0,z.createElement)(Ro,{...e,key:`tsr-scripts-${e.tag}-${t}`}))})};function Wo(e){if(Array.isArray(e))return e.flatMap(e=>Wo(e));if(typeof e!=`string`)return[];let t=[],n=0,r,i,a,o,s,c=()=>{for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length},l=()=>(i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`);for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.slice(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.slice(r))}return t}function Go(e){return e instanceof Headers?e:Array.isArray(e)||typeof e==`object`?new Headers(e):null}function Ko(...e){return e.reduce((e,t)=>{let n=Go(t);if(!n)return e;for(let[t,r]of n.entries())t===`set-cookie`?Wo(r).forEach(t=>e.append(`set-cookie`,t)):e.set(t,r);return e},new Headers)}function qo(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e}async function Jo(e){l(window.$_TSR,`Expected to find bootstrap data on window.$_TSR, but we did not. Please file an issue!`);let t=e.options.serializationAdapters;if(t?.length){let e=new Map;t.forEach(t=>{e.set(t.key,t.fromSerializable)}),window.$_TSR.t=e,window.$_TSR.buffer.forEach(e=>e())}window.$_TSR.initialized=!0,l(window.$_TSR.router,`Expected to find a dehydrated data on window.$_TSR.router, but we did not. Please file an issue!`);let{manifest:n,dehydratedData:r,lastMatchId:i}=window.$_TSR.router;e.ssr={manifest:n};let a=document.querySelector(`meta[property="csp-nonce"]`)?.content;e.options.ssr={nonce:a};let s=e.matchRoutes(e.state.location),c=Promise.all(s.map(t=>{let n=e.looseRoutesById[t.routeId];return e.loadRouteChunk(n)}));function u(t){let n=e.looseRoutesById[t.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(n){let r=o();t._nonReactive.minPendingPromise=r,t._forcePending=!0,setTimeout(()=>{r.resolve(),e.updateMatch(t.id,e=>(e._nonReactive.minPendingPromise=void 0,{...e,_forcePending:void 0}))},n)}}function d(t){let n=e.looseRoutesById[t.routeId];n&&(n.options.ssr=t.ssr)}let f;s.forEach(e=>{let t=window.$_TSR.router.matches.find(t=>t.i===e.id);if(!t){e._nonReactive.dehydrated=!1,e.ssr=!1,d(e);return}qo(e,t),d(e),e._nonReactive.dehydrated=e.ssr!==!1,(e.ssr===`data-only`||e.ssr===!1)&&f===void 0&&(f=e.index,u(e))}),e.__store.setState(e=>({...e,matches:s})),await e.options.hydrate?.(r),await Promise.all(e.state.matches.map(async t=>{try{let n=e.looseRoutesById[t.routeId],r=e.state.matches[t.index-1]?.context??e.options.context;if(n.options.context){let i={deps:t.loaderDeps,params:t.params,context:r??{},location:e.state.location,navigate:t=>e.navigate({...t,_fromLocation:e.state.location}),buildLocation:e.buildLocation,cause:t.cause,abortController:t.abortController,preload:!1,matches:s,routeId:n.id};t.__routeContext=n.options.context(i)??void 0}t.context={...r,...t.__routeContext,...t.__beforeLoadContext};let i={ssr:e.options.ssr,matches:e.state.matches,match:t,params:t.params,loaderData:t.loaderData},a=await n.options.head?.(i),o=await n.options.scripts?.(i);t.meta=a?.meta,t.links=a?.links,t.headScripts=a?.scripts,t.styles=a?.styles,t.scripts=o}catch(e){if(k(e))t.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${t.routeId}`,e);else throw t.error=e,console.error(`Error during hydration for route ${t.routeId}:`,e),e}}));let p=s[s.length-1].id!==i;if(!s.some(e=>e.ssr===!1)&&!p)return s.forEach(e=>{e._nonReactive.dehydrated=void 0}),c;let m=Promise.resolve().then(()=>e.load()).catch(e=>{console.error(`Error during router hydration:`,e)});if(p){let t=s[1];l(t,`Expected to find a match below the root match in SPA mode.`),u(t),t._displayPending=!0,t._nonReactive.displayPendingPromise=m,m.then(()=>{Xe(()=>{e.__store.state.status===`pending`&&e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),e.updateMatch(t.id,e=>({...e,_displayPending:void 0,displayPendingPromise:void 0}))})})}return c}var Yo=`__TSS_CONTEXT`,Xo=Symbol.for(`TSS_SERVER_FUNCTION`),Zo=Symbol.for(`TSS_SERVER_FUNCTION_FACTORY`),Qo=`application/x-tss-framed`,$o={JSON:0,CHUNK:1,END:2,ERROR:3};`${Qo}`;var es=/;\s*v=(\d+)/;function ts(e){let t=e.match(es);return t?parseInt(t[1],10):void 0}function ns(e){let t=ts(e);if(t!==void 0&&t!==1)throw Error(`Incompatible framed protocol version: server=${t}, client=1. Please ensure client and server are using compatible versions.`)}var rs=()=>window.__TSS_START_OPTIONS__;function is(){return[...(rs()?.serializationAdapters)?.map(Aa)??[],...$a]}var as=new TextDecoder,os=new Uint8Array,ss=16*1024*1024,cs=32*1024*1024,ls=1024,us=1e5;function ds(e){let t=new Map,n=new Map,r=new Set,i=!1,a=null,o=0,s,c=new ReadableStream({start(e){s=e},cancel(){i=!0;try{a?.cancel()}catch{}t.forEach(e=>{try{e.error(Error(`Framed response cancelled`))}catch{}}),t.clear(),n.clear(),r.clear()}});function l(e){let i=n.get(e);if(i)return i;if(r.has(e))return new ReadableStream({start(e){e.close()}});if(n.size>=ls)throw Error(`Too many raw streams in framed response (max ${ls})`);let a=new ReadableStream({start(n){t.set(e,n)},cancel(){r.add(e),t.delete(e),n.delete(e)}});return n.set(e,a),a}function u(e){return l(e),t.get(e)}return(async()=>{let n=e.getReader();a=n;let c=[],l=0;function d(){if(l<9)return null;let e=c[0];if(e.length>=9)return{type:e[0],streamId:(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0,length:(e[5]<<24|e[6]<<16|e[7]<<8|e[8])>>>0};let t=new Uint8Array(9),n=0,r=9;for(let e=0;e<c.length&&r>0;e++){let i=c[e],a=Math.min(i.length,r);t.set(i.subarray(0,a),n),n+=a,r-=a}return{type:t[0],streamId:(t[1]<<24|t[2]<<16|t[3]<<8|t[4])>>>0,length:(t[5]<<24|t[6]<<16|t[7]<<8|t[8])>>>0}}function f(e){if(e===0)return os;let t=new Uint8Array(e),n=0,r=e;for(;r>0&&c.length>0;){let e=c[0];if(!e)break;let i=Math.min(e.length,r);t.set(e.subarray(0,i),n),n+=i,r-=i,i===e.length?c.shift():c[0]=e.subarray(i)}return l-=e,t}try{for(;;){let{done:e,value:a}=await n.read();if(i||e)break;if(a){if(l+a.length>cs)throw Error(`Framed response buffer exceeded ${cs} bytes`);for(c.push(a),l+=a.length;;){let e=d();if(!e)break;let{type:n,streamId:i,length:a}=e;if(n!==$o.JSON&&n!==$o.CHUNK&&n!==$o.END&&n!==$o.ERROR)throw Error(`Unknown frame type: ${n}`);if(n===$o.JSON){if(i!==0)throw Error(`Invalid JSON frame streamId (expected 0)`)}else if(i===0)throw Error(`Invalid raw frame streamId (expected non-zero)`);if(a>ss)throw Error(`Frame payload too large: ${a} bytes (max ${ss})`);let c=9+a;if(l<c)break;if(++o>us)throw Error(`Too many frames in framed response (max ${us})`);f(9);let p=f(a);switch(n){case $o.JSON:try{s.enqueue(as.decode(p))}catch{}break;case $o.CHUNK:{let e=u(i);e&&e.enqueue(p);break}case $o.END:{let e=u(i);if(r.add(i),e){try{e.close()}catch{}t.delete(i)}break}case $o.ERROR:{let e=u(i);if(r.add(i),e){let n=as.decode(p);e.error(Error(n)),t.delete(i)}break}}}}}if(l!==0)throw Error(`Incomplete frame at end of framed response`);try{s.close()}catch{}t.forEach(e=>{try{e.close()}catch{}}),t.clear()}catch(e){try{s.error(e)}catch{}t.forEach(t=>{try{t.error(e)}catch{}}),t.clear()}finally{try{n.releaseLock()}catch{}a=null}})(),{getOrCreateStream:l,jsonChunks:c}}var fs=null,ps=Object.prototype.hasOwnProperty;function ms(e){for(let t in e)if(ps.call(e,t))return!0;return!1}async function hs(e,t,n){fs||=is();let r=t[0],i=r.fetch??n,a=r.data instanceof FormData?`formData`:`payload`,o=r.headers?new Headers(r.headers):new Headers;if(o.set(`x-tsr-serverFn`,`true`),a===`payload`&&o.set(`accept`,`${Qo}, application/x-ndjson, application/json`),r.method===`GET`){if(a===`formData`)throw Error(`FormData is not supported with GET requests`);let t=await gs(r);if(t!==void 0){let n=ce({payload:t});e.includes(`?`)?e+=`&${n}`:e+=`?${n}`}}let s;if(r.method===`POST`){let e=await vs(r);e?.contentType&&o.set(`content-type`,e.contentType),s=e?.body}return await ys(async()=>i(e,{method:r.method,headers:o,signal:r.signal,body:s}))}async function gs(e){let t=!1,n={};if(e.data!==void 0&&(t=!0,n.data=e.data),e.context&&ms(e.context)&&(t=!0,n.context=e.context),t)return _s(n)}async function _s(e){return JSON.stringify(await Promise.resolve(Oa(e,{plugins:fs})))}async function vs(e){if(e.data instanceof FormData){let t;return e.context&&ms(e.context)&&(t=await _s(e.context)),t!==void 0&&e.data.set(Yo,t),{body:e.data}}let t=await gs(e);if(t)return{body:t,contentType:`application/json`}}async function ys(e){let t;try{t=await e()}catch(e){if(e instanceof Response)t=e;else throw console.log(e),e}if(t.headers.get(`x-tss-raw`)===`true`)return t;let n=t.headers.get(`content-type`);if(l(n,`expected content-type header to be set`),t.headers.get(`x-tss-serialized`)){let e;if(n.includes(`application/x-tss-framed`)){if(ns(n),!t.body)throw Error(`No response body for framed response`);let{getOrCreateStream:r,jsonChunks:i}=ds(t.body),a=[Qa(r),...fs||[]],o=new Map;e=await xs({jsonStream:i,onMessage:e=>Da(e,{refs:o,plugins:a}),onError(e,t){console.error(e,t)}})}else if(n.includes(`application/x-ndjson`)){let n=new Map;e=await bs({response:t,onMessage:e=>Da(e,{refs:n,plugins:fs}),onError(e,t){console.error(e,t)}})}else n.includes(`application/json`)&&(e=Da(await t.json(),{plugins:fs}));if(l(e,`expected result to be resolved`),e instanceof Error)throw e;return e}if(n.includes(`application/json`)){let e=await t.json(),n=A(e);if(n)throw n;if(k(e))throw e;return e}if(!t.ok)throw Error(await t.text());return t}async function bs({response:e,onMessage:t,onError:n}){if(!e.body)throw Error(`No response body`);let r=e.body.pipeThrough(new TextDecoderStream).getReader(),i=``,a=!1,o;for(;!a;){let{value:e,done:t}=await r.read();if(e&&(i+=e),i.length===0&&t)throw Error(`Stream ended before first object`);if(i.endsWith(`
5
- `)){let e=i.split(`
6
- `).filter(Boolean),t=e[0];if(!t)throw Error(`No JSON line in the first chunk`);o=JSON.parse(t),a=!0,i=e.slice(1).join(`
7
- `)}else{let e=i.indexOf(`
8
- `);if(e>=0){let t=i.slice(0,e).trim();i=i.slice(e+1),t.length>0&&(o=JSON.parse(t),a=!0)}}}return(async()=>{try{for(;;){let{value:e,done:a}=await r.read();e&&(i+=e);let o=i.lastIndexOf(`
9
- `);if(o>=0){let e=i.slice(0,o);i=i.slice(o+1);let r=e.split(`
10
- `).filter(Boolean);for(let e of r)try{t(JSON.parse(e))}catch(t){n?.(`Invalid JSON line: ${e}`,t)}}if(a)break}}catch(e){n?.(`Stream processing error:`,e)}})(),t(o)}async function xs({jsonStream:e,onMessage:t,onError:n}){let r=e.getReader(),{value:i,done:a}=await r.read();if(a||!i)throw Error(`Stream ended before first object`);let o=JSON.parse(i);return(async()=>{try{for(;;){let{value:e,done:i}=await r.read();if(i)break;if(e)try{t(JSON.parse(e))}catch(t){n?.(`Invalid JSON: ${e}`,t)}}}catch(e){n?.(`Stream processing error:`,e)}})(),t(o)}function Ss(e){let t=`/console/_serverFn/`+e;return Object.assign((...e)=>{let n=rs()?.serverFns?.fetch;return hs(t,e,n??fetch)},{url:t,serverFnMeta:{id:e},[Xo]:!0})}var Cs=ka({key:`$TSS/serverfn`,test:e=>typeof e!=`function`||!(Xo in e)?!1:!!e[Xo],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>Ss(e)}),ws=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(){}},Ts=new class extends ws{#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`}},Es={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ds=new class{#e=Es;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 Os(e){setTimeout(e,0)}var ks=typeof window>`u`||`Deno`in globalThis;function As(){}function js(e,t){return typeof e==`function`?e(t):e}function Ms(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ns(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ps(e,t){return typeof e==`function`?e(t):e}function Fs(e,t){return typeof e==`function`?e(t):e}function Is(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Rs(o,t.options))return!1}else if(!Bs(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 Ls(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(zs(t.options.mutationKey)!==zs(a))return!1}else if(!Bs(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Rs(e,t){return(t?.queryKeyHashFn||zs)(e)}function zs(e){return JSON.stringify(e,(e,t)=>Gs(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Bs(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Bs(e[n],t[n])):!1}var Vs=Object.prototype.hasOwnProperty;function Hs(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ws(e)&&Ws(t);if(!r&&!(Gs(e)&&Gs(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:Vs.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Hs(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Us(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 Ws(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Gs(e){if(!Ks(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ks(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ks(e){return Object.prototype.toString.call(e)===`[object Object]`}function qs(e){return new Promise(t=>{Ds.setTimeout(t,e)})}function Js(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Hs(e,t)}function Ys(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Xs(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Zs=Symbol();function Qs(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Zs?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $s(e,t){return typeof e==`function`?e(...t):!!e}function ec(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 tc=(()=>{let e=()=>ks;return{isServer(){return e()},setIsServer(t){e=t}}})();function nc(){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 rc=Os;function ic(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=rc,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 H=ic(),ac=new class extends ws{#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 oc(e){return Math.min(1e3*2**e,3e4)}function sc(e){return(e??`online`)===`online`?ac.isOnline():!0}var cc=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function lc(e){let t=!1,n=0,r,i=nc(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new cc(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Ts.isFocused()&&(e.networkMode===`always`||ac.isOnline())&&e.canRun(),u=()=>sc(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??(tc.isServer()?0:3),o=e.retryDelay??oc,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),qs(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 uc=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ms(this.gcTime)&&(this.#e=Ds.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tc.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Ds.clearTimeout(this.#e),this.#e=void 0)}};function dc(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=>{ec(e,()=>t.signal,()=>n=!0)},u=Qs(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=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Xs:Ys;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?pc:fc,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:fc(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 fc(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 pc(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function mc(e,t){return t?fc(e,t)!=null:!1}function hc(e,t){return!t||!e.getPreviousPageParam?!1:pc(e,t)!=null}var gc=class extends uc{#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=yc(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=yc(this.options);e.data!==void 0&&(this.setState(vc(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Js(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(As).catch(As):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=>Fs(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ps(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ns(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=Qs(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`?dc(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=lc({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof cc&&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 cc){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,..._c(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...vc(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),H.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function _c(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sc(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function vc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function yc(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 bc=class extends ws{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=nc(),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),Sc(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Cc(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Cc(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 Fs(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&&!Us(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&wc(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Fs(this.options.enabled,this.#t)!==Fs(t.enabled,this.#t)||Ps(this.options.staleTime,this.#t)!==Ps(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Fs(this.options.enabled,this.#t)!==Fs(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 Ec(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(As)),t}#g(){this.#b();let e=Ps(this.options.staleTime,this.#t);if(tc.isServer()||this.#r.isStale||!Ms(e))return;let t=Ns(this.#r.dataUpdatedAt,e)+1;this.#d=Ds.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,!(tc.isServer()||Fs(this.options.enabled,this.#t)===!1||!Ms(this.#p)||this.#p===0)&&(this.#f=Ds.setInterval(()=>{(this.options.refetchIntervalInBackground||Ts.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Ds.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Ds.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&&Sc(e,t),o=i&&wc(e,n,t,r);(a||o)&&(l={...l,..._c(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=Js(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=Js(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:Tc(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Fs(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=()=>{i(this.#o=x.promise=nc())},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),!Us(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){H.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function xc(e,t){return Fs(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&Fs(t.retryOnMount,e)===!1)}function Sc(e,t){return xc(e,t)||e.state.data!==void 0&&Cc(e,t,t.refetchOnMount)}function Cc(e,t,n){if(Fs(t.enabled,e)!==!1&&Ps(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Tc(e,t)}return!1}function wc(e,t,n,r){return(e!==t||Fs(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Tc(e,n)}function Tc(e,t){return Fs(t.enabled,e)!==!1&&e.isStaleByTime(Ps(t.staleTime,e))}function Ec(e,t){return!Us(e.getCurrentResult(),t)}var Dc=class extends bc{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:mc(t,n.data),hasPreviousPage:hc(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Oc=class extends uc{#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||kc(),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=lc({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),H.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function kc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ac=class extends ws{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 Oc({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=jc(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=jc(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=jc(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=jc(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){H.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=>Ls(t,e))}findAll(e={}){return this.getAll().filter(t=>Ls(e,t))}notify(e){H.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return H.batch(()=>Promise.all(e.map(e=>e.continue().catch(As))))}};function jc(e){return e.options.scope?.id}var Mc=class extends ws{#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),Us(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&zs(t.mutationKey)!==zs(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??kc();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){H.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)})})}},Nc=class extends ws{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Rs(r,t),a=this.get(i);return a||(a=new gc({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(){H.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=>Is(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Is(e,t)):t}notify(e){H.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){H.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){H.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pc=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Nc,this.#t=e.mutationCache||new Ac,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ts.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ac.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(Ps(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=js(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return H.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;H.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return H.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=H.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(As).catch(As)}invalidateQueries(e,t={}){return H.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=H.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(As)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(As)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ps(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(As).catch(As)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(As).catch(As)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ac.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(zs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Bs(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(zs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Bs(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||=Rs(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===Zs&&(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()}},Fc=z.createContext(void 0),Ic=e=>{let t=z.useContext(Fc);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Lc=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(Fc.Provider,{value:e,children:t})),Rc=z.createContext(!1),U=()=>z.useContext(Rc);Rc.Provider;function zc(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Bc=z.createContext(zc()),Vc=()=>z.useContext(Bc),Hc=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?$s(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Uc=e=>{z.useEffect(()=>{e.clearReset()},[e])},Wc=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||$s(n,[e.error,r])),Gc=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))}},Kc=(e,t)=>e.isLoading&&e.isFetching&&!t,qc=(e,t)=>e?.suspense&&t.isPending,Jc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Yc(e,t,n){let r=U(),i=Vc(),a=Ic(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,Gc(o),Hc(o,i,s),Uc(i);let l=!a.getQueryCache().get(o.queryHash),[u]=z.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(z.useSyncExternalStore(z.useCallback(e=>{let t=f?u.subscribe(H.batchCalls(e)):As;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),z.useEffect(()=>{u.setOptions(o)},[o,u]),qc(o,d))throw Jc(o,u,i);if(Wc({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!tc.isServer()&&Kc(d,r)&&(l?Jc(o,u,i):s?.promise)?.catch(As).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function Xc(e,t){return Yc(e,bc,t)}function Zc(e,t){let n=Ic(t),r=n.getQueryCache();return z.useSyncExternalStore(z.useCallback(e=>r.subscribe(H.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function Qc(e,t){let n=Ic(t),[r]=z.useState(()=>new Mc(n,e));z.useEffect(()=>{r.setOptions(e)},[r,e]);let i=z.useSyncExternalStore(z.useCallback(e=>r.subscribe(H.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=z.useCallback((e,t)=>{r.mutate(e,t).catch(As)},[r]);if(i.error&&$s(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function $c(e,t){return Yc(e,Dc,t)}var el=ye(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),tl=ye(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),nl=ye(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),rl=ye(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),il=ye(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),al=ye(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),ol=ye(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),sl=ye(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),cl=ye(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),W=ye(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),ll=ye(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),ul=ye(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),dl=()=>{throw Error(`createServerOnlyFn() functions can only be called on the server!`)};function fl(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function pl(e,t){let n=Object.create(null);if(e)for(let t of Object.keys(e))fl(t)&&(n[t]=e[t]);if(t&&typeof t==`object`)for(let e of Object.keys(t))fl(e)&&(n[e]=t[e]);return n}function ml(e){if(!e)return Object.create(null);let t=Object.create(null);for(let n of Object.keys(e))fl(n)&&(t[n]=e[n]);return t}var hl=(e,t)=>{let n=t||e||{};return n.method===void 0&&(n.method=`GET`),Object.assign(e=>hl(void 0,{...n,...e}),{options:n,middleware:e=>{let t=[...n.middleware||[]];e.map(e=>{Zo in e?e.options.middleware&&t.push(...e.options.middleware):t.push(e)});let r=hl(void 0,{...n,middleware:t});return r[Zo]=!0,r},inputValidator:e=>hl(void 0,{...n,inputValidator:e}),handler:(...e)=>{let[t,r]=e,i={...n,extractedFn:t,serverFn:r},a=[...i.middleware||[],yl(i)];return Object.assign(async e=>{let n=await gl(a,`client`,{...t,...i,data:e?.data,headers:e?.headers,signal:e?.signal,fetch:e?.fetch,context:ml()}),r=A(n.error);if(r)throw r;if(n.error)throw n.error;return n.result},{...t,__executeServer:async e=>{let n=dl(),r=n.contextAfterGlobalMiddlewares;return await gl(a,`server`,{...t,...e,serverFnMeta:t.serverFnMeta,context:pl(r,e.context),request:n.request}).then(e=>({result:e.result,error:e.error,context:e.sendContext}))}})}})};async function gl(e,t,n){let r=_l([...rs()?.functionMiddleware||[],...e]);if(t===`server`){let e=dl({throwIfNotFound:!1});e?.executedRequestMiddlewares&&(r=r.filter(t=>!e.executedRequestMiddlewares.has(t)))}let i=async e=>{let n=r.shift();if(!n)return e;try{`inputValidator`in n.options&&n.options.inputValidator&&t===`server`&&(e.data=await vl(n.options.inputValidator,e.data));let r;if(t===`client`?`client`in n.options&&(r=n.options.client):`server`in n.options&&(r=n.options.server),r){let t=async(t={})=>{let n=await i({...e,...t,context:pl(e.context,t.context),sendContext:pl(e.sendContext,t.sendContext),headers:Ko(e.headers,t.headers),_callSiteFetch:e._callSiteFetch,fetch:e._callSiteFetch??t.fetch??e.fetch,result:t.result===void 0?t instanceof Response?t:e.result:t.result,error:t.error??e.error});if(n.error)throw n.error;return n},n=await r({...e,next:t});if(se(n))return{...e,error:n};if(n instanceof Response)return{...e,result:n};if(!n)throw Error(`User middleware returned undefined. You must call next() or return a result in your middlewares.`);return n}return i(e)}catch(t){return{...e,error:t}}};return i({...n,headers:n.headers||{},sendContext:n.sendContext||{},context:n.context||ml(),_callSiteFetch:n.fetch})}function _l(e,t=100){let n=new Set,r=[],i=(e,a)=>{if(a>t)throw Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);e.forEach(e=>{e.options.middleware&&i(e.options.middleware,a+1),n.has(e)||(n.add(e),r.push(e))})};return i(e,0),r}async function vl(e,t){if(e==null)return{};if(`~standard`in e){let n=await e[`~standard`].validate(t);if(n.issues)throw Error(JSON.stringify(n.issues,void 0,2));return n.value}if(`parse`in e)return e.parse(t);if(typeof e==`function`)return e(t);throw Error(`Invalid validator type!`)}function yl(e){return{"~types":void 0,options:{inputValidator:e.inputValidator,client:async({next:t,sendContext:n,fetch:r,...i})=>{let a={...i,context:n,fetch:r};return t(await e.extractedFn?.(a))},server:async({next:t,...n})=>{let r=await e.serverFn?.(n);return t({...n,result:r})}}}}var bl=hl({method:`GET`}).handler(Ss(`aaeaff504f6c69b303c57758f630a549e4fdfd8025b4a25dce001f39edb2802e`)),xl=hl({method:`GET`}).handler(Ss(`17426eb2474038c03892eee22aa4ff586684916bb28b8d309ab554f7beb34bad`)),Sl=hl({method:`POST`}).handler(Ss(`2c0cbf7a2a60cd273d5efdc22b38a68b32c419c428301906e0f8e5a64b570711`)),Cl=hl({method:`POST`}).handler(Ss(`ab84ba5d863fbaede680f66ae18a8de9cae4082c2ef42f7f8aae80b9e2d0f829`)),wl=hl({method:`POST`}).handler(Ss(`ef1df28e894edbcd3cd95a458748ad5de06f814b9486846c78839a9a1ae34499`)),Tl=class extends Error{},El=class extends Error{},Dl=class extends Error{status;details;constructor(e,t,n){super(e),this.status=t,this.details=n}};async function Ol(e){return Fl(await bl({data:{path:e}}))}async function kl(e){return Fl(await xl({data:{path:e}}))}async function Al(e,t){return Fl(await Sl({data:{path:e,body:t}}))}async function jl(e,t){return Fl(await Cl({data:{path:e,body:t}}))}async function Ml(e){return Fl(await wl({data:{path:e}}))}async function Nl(e,t){let n=await fetch(`/console/api/download?path=${encodeURIComponent(e)}`);if(n.status===401||n.status===403)throw new Tl(`auth failed (${n.status})`);if(!n.ok)throw await Pl(n,e);let r=await n.blob(),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}async function Pl(e,t){let n,r=`${t} failed (${e.status})`;try{n=await e.clone().json(),Il(n)&&typeof n.message==`string`?r=n.message:Il(n)&&typeof n.error==`string`&&(r=n.error)}catch{try{let t=await e.clone().text();t.trim().length>0&&(r=t.trim())}catch{}}return new Dl(r,e.status,n)}function Fl(e){if(e.ok)return e.data;throw e.status===401||e.status===403?new Tl(e.message):e.status===404?new El(e.message):new Dl(e.message,e.status,e.details)}function Il(e){return typeof e==`object`&&!!e}var Ll=1e3;function Rl(e){return $c({queryKey:[`runs`,e??null],initialPageParam:void 0,queryFn:({pageParam:t})=>{let n=new URLSearchParams;e!==void 0&&n.set(`state`,e),t!==void 0&&n.set(`cursor`,t);let r=n.toString();return Ol(`/v1/runs${r?`?${r}`:``}`)},getNextPageParam:e=>e.nextCursor,maxPages:10,refetchInterval:Ll})}function zl(e){return Xc({queryKey:[`run`,e],queryFn:()=>Ol(`/v1/runs/${encodeURIComponent(e)}`),refetchInterval:Ll})}function G(e){return Xc({queryKey:[`run-tasks`,e],queryFn:()=>Ol(`/v1/runs/${encodeURIComponent(e)}/tasks`),refetchInterval:Ll})}function K(e){return Xc({queryKey:[`run-artifacts`,e],queryFn:()=>Ol(`/v1/runs/${encodeURIComponent(e)}/artifacts`),refetchInterval:Ll})}function q(e){return Xc({queryKey:[`run-metrics`,e],queryFn:()=>Ol(`/v1/runs/${encodeURIComponent(e)}/metrics`),refetchInterval:Ll})}function J(e){return Xc({queryKey:[`run-file-reservations`,e],queryFn:()=>Ol(`/v1/runs/${encodeURIComponent(e)}/file-reservations`),refetchInterval:Ll})}function Y(){let e=Ic();return Qc({mutationFn:e=>Ml(`/v1/runs/${encodeURIComponent(e)}`),onSuccess:async(t,n)=>{e.removeQueries({queryKey:[`run`,n]}),e.removeQueries({queryKey:[`run-tasks`,n]}),e.removeQueries({queryKey:[`run-artifacts`,n]}),e.removeQueries({queryKey:[`run-metrics`,n]}),e.removeQueries({queryKey:[`run-file-reservations`,n]}),await e.invalidateQueries({queryKey:[`runs`]})}})}function Bl(e,t){return Xc({queryKey:[`task-pi-session`,e],enabled:e!==null,queryFn:async()=>{let t=Kl(e,`useTaskPiSession`);try{return await Ol(`/v1/tasks/${encodeURIComponent(t)}/pi-session`)}catch(e){if(e instanceof El)return null;throw e}},refetchInterval:t?Ll:!1})}function Vl(e,t,n){return Xc({queryKey:[`task-pi-session-raw`,e],enabled:e!==null&&t,queryFn:async()=>{let t=Kl(e,`useTaskPiSessionRaw`);try{return await kl(`/v1/tasks/${encodeURIComponent(t)}/pi-session?format=raw`)}catch(e){if(e instanceof El)return null;throw e}},refetchInterval:n?Ll:!1})}function Hl(e){let t=Ic();return Qc({mutationFn:t=>{let n=Kl(e,`useSendTaskMessage`);return Al(`/v1/tasks/${encodeURIComponent(n)}/messages`,t)},onSuccess:async()=>{await t.invalidateQueries({queryKey:[`task-pi-session`,e]}),await t.invalidateQueries({queryKey:[`task-pi-session-raw`,e]}),await t.invalidateQueries({queryKey:[`task-activity`,e]})}})}function Ul(e,t){return Xc({queryKey:[`task-workpad`,e],enabled:e!==null,queryFn:()=>Ol(`/v1/tasks/${encodeURIComponent(Kl(e,`useTaskWorkpad`))}/workpad`),refetchInterval:t?Ll:!1})}function Wl(e){let t=Ic();return Qc({mutationFn:t=>{let n=Kl(e,`useSaveTaskWorkpad`);return jl(`/v1/tasks/${encodeURIComponent(n)}/workpad`,t)},onSuccess:async n=>{t.setQueryData([`task-workpad`,e],n),await t.invalidateQueries({queryKey:[`run-tasks`,n.runId]}),await t.invalidateQueries({queryKey:[`task-activity`,e]})},onSettled:async()=>{await t.invalidateQueries({queryKey:[`task-workpad`,e]})}})}function Gl(e,t){return Xc({queryKey:[`task-activity`,e],enabled:e!==null,queryFn:()=>Ol(`/v1/tasks/${encodeURIComponent(Kl(e,`useTaskActivity`))}/activity?limit=20`),refetchInterval:t?Ll:!1})}function Kl(e,t){if(e===null)throw Error(`${t} called without taskId`);return e}var ql=[0,60,120,180,240,300];function Jl(e){let t=(0,z.useId)();return(0,R.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,className:be(`size-5`,e.className),children:[(0,R.jsx)(`defs`,{children:(0,R.jsxs)(`g`,{id:t,children:[(0,R.jsx)(`line`,{x1:`12`,y1:`9.6`,x2:`12`,y2:`6.4`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,opacity:`0.35`}),(0,R.jsx)(`circle`,{cx:`12`,cy:`4.4`,r:`1.4`,fill:`currentColor`})]})}),ql.map(e=>(0,R.jsx)(`use`,{href:`#${t}`,transform:`rotate(${e} 12 12)`},e)),(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.9`,className:`fill-primary`})]})}function Yl(e){return(0,R.jsxs)(`span`,{className:be(`flex min-w-0 items-center gap-2`,e.className),children:[(0,R.jsx)(Jl,{className:`size-[18px] shrink-0`}),(0,R.jsx)(`span`,{className:`truncate font-semibold tracking-[0.12em]`,children:`FLAKES`})]})}var Xl=h(ve(),1),Zl=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ce(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ql(e,t){e&&Xl.flushSync(()=>e.dispatchEvent(t))}function $l(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=z.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>z.createContext(e));return function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,eu(i,...t)]}function eu(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function tu(e){let t=e+`CollectionProvider`,[n,r]=$l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=z.useRef(null),a=z.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Ce(s),l=z.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,R.jsx)(c,{ref:Se(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Ce(u),p=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),s=Se(t,o),c=a(u,n);return z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return z.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[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var nu=globalThis?.document?z.useLayoutEffect:()=>{},ru=z.useInsertionEffect||nu;function iu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=au({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=z.useRef(e!==void 0);z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,z.useCallback(t=>{if(s){let n=ou(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function au({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return ru(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ou(e){return typeof e==`function`}function su(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}var cu=e=>{let{present:t,children:n}=e,r=lu(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=du(r.ref,pu(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null};cu.displayName=`Presence`;function lu(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),[o,s]=su(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{let e=fu(r.current);a.current=o===`mounted`?e:`none`},[o]),nu(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=fu(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),nu(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=fu(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=fu(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:z.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function uu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function du(...e){let t=z.useRef(e);return t.current=e,z.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=uu(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():uu(n[e],null)}}},[])}function fu(e){return e?.animationName||`none`}function pu(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mu=z.useId||(()=>void 0),hu=0;function gu(e){let[t,n]=z.useState(mu());return nu(()=>{e||n(e=>e??String(hu++))},[e]),e||(t?`radix-${t}`:``)}var _u=z.createContext(void 0);function vu(e){let t=z.useContext(_u);return e||t||`ltr`}function yu(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}function bu(e,t=globalThis?.document){let n=yu(e);z.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var xu=`DismissableLayer`,Su=`dismissableLayer.update`,Cu=`dismissableLayer.pointerDownOutside`,wu=`dismissableLayer.focusOutside`,Tu,Eu=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Du=z.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=z.useContext(Eu),[u,d]=z.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=z.useState({}),m=Se(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Au(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=ju(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return bu(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),z.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Tu=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Mu(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(u),l.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=Tu))}},[u,f,n,l]),z.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Mu())},[u,l]),z.useEffect(()=>{let e=()=>p({});return document.addEventListener(Su,e),()=>document.removeEventListener(Su,e)},[]),(0,R.jsx)(Zl.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:X(e.onFocusCapture,S.onFocusCapture),onBlurCapture:X(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,x.onPointerDownCapture)})});Du.displayName=xu;var Ou=`DismissableLayerBranch`,ku=z.forwardRef((e,t)=>{let n=z.useContext(Eu),r=z.useRef(null),i=Se(t,r);return z.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,R.jsx)(Zl.div,{...e,ref:i})});ku.displayName=Ou;function Au(e,t=globalThis?.document){let n=yu(e),r=z.useRef(!1),i=z.useRef(()=>{});return z.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Nu(Cu,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ju(e,t=globalThis?.document){let n=yu(e),r=z.useRef(!1);return z.useEffect(()=>{let e=e=>{e.target&&!r.current&&Nu(wu,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Mu(){let e=new CustomEvent(Su);document.dispatchEvent(e)}function Nu(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?Ql(i,a):i.dispatchEvent(a)}var Pu=`focusScope.autoFocusOnMount`,Fu=`focusScope.autoFocusOnUnmount`,Iu={bubbles:!1,cancelable:!0},Lu=`FocusScope`,Ru=z.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=yu(i),u=yu(a),d=z.useRef(null),f=Se(t,e=>c(e)),p=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Z(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Z(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Z(s)};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]),z.useEffect(()=>{if(s){Gu.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Pu,Iu);s.addEventListener(Pu,l),s.dispatchEvent(t),t.defaultPrevented||(zu(Ju(Vu(s)),{select:!0}),document.activeElement===e&&Z(s))}return()=>{s.removeEventListener(Pu,l),setTimeout(()=>{let t=new CustomEvent(Fu,Iu);s.addEventListener(Fu,u),s.dispatchEvent(t),t.defaultPrevented||Z(e??document.body,{select:!0}),s.removeEventListener(Fu,u),Gu.remove(p)},0)}}},[s,l,u,p]);let m=z.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]=Bu(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Z(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Z(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(Zl.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Ru.displayName=Lu;function zu(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Z(r,{select:t}),document.activeElement!==n)return}function Bu(e){let t=Vu(e);return[Hu(t,e),Hu(t.reverse(),e)]}function Vu(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function Hu(e,t){for(let n of e)if(!Uu(n,{upTo:t}))return n}function Uu(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Wu(e){return e instanceof HTMLInputElement&&`select`in e}function Z(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Wu(e)&&t&&e.select()}}var Gu=Ku();function Ku(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=qu(e,t),e.unshift(t)},remove(t){e=qu(e,t),e[0]?.resume()}}}function qu(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ju(e){return e.filter(e=>e.tagName!==`A`)}var Yu=`Portal`,Xu=z.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=z.useState(!1);nu(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Xl.createPortal((0,R.jsx)(Zl.div,{...r,ref:t}),o):null});Xu.displayName=Yu;var Zu=0,Qu=null;function $u(){z.useEffect(()=>{Qu||={start:ed(),end:ed()};let{start:e,end:t}=Qu;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Zu++,()=>{Zu===1&&(Qu?.start.remove(),Qu?.end.remove(),Qu=null),Zu=Math.max(0,Zu-1)}},[])}function ed(){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}var td=function(){return td=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},td.apply(this,arguments)};function nd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function rd(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var id=`right-scroll-bar-position`,ad=`width-before-scroll-bar`,od=`with-scroll-bars-hidden`,sd=`--removed-body-scroll-bar-size`;function cd(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ld(e,t){var n=(0,z.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ud=typeof window<`u`?z.useLayoutEffect:z.useEffect,dd=new WeakMap;function fd(e,t){var n=ld(t||null,function(t){return e.forEach(function(e){return cd(e,t)})});return ud(function(){var t=dd.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||cd(e,null)}),i.forEach(function(e){r.has(e)||cd(e,a)})}dd.set(n,e)},[e]),n}function pd(e){return e}function md(e,t){t===void 0&&(t=pd);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function hd(e){e===void 0&&(e={});var t=md(null);return t.options=td({async:!0,ssr:!1},e),t}var gd=function(e){var t=e.sideCar,n=nd(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return z.createElement(r,td({},n))};gd.isSideCarExport=!0;function _d(e,t){return e.useMedium(t),gd}var vd=hd(),yd=function(){},Q=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:yd,onWheelCapture:yd,onTouchMoveCapture:yd}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=nd(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=fd([n,t]),C=td(td({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:vd,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),td(td({},C),{ref:S})):z.createElement(v,td({},C,{className:c,ref:S}),s))});Q.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Q.classNames={fullWidth:ad,zeroRight:id};var bd,xd=function(){if(bd)return bd;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Sd(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=xd();return t&&e.setAttribute(`nonce`,t),e}function Cd(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wd(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Td=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Sd())&&(Cd(t,n),wd(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ed=function(){var e=Td();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Dd=function(){var e=Ed();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Od={left:0,top:0,right:0,gap:0},kd=function(e){return parseInt(e||``,10)||0},Ad=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[kd(n),kd(r),kd(i)]},jd=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Od;var t=Ad(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Md=Dd(),$=`data-scroll-locked`,Nd=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
11
- .${od} {
12
- overflow: hidden ${r};
13
- padding-right: ${s}px ${r};
14
- }
15
- body[${$}] {
16
- overflow: hidden ${r};
17
- overscroll-behavior: contain;
18
- ${[t&&`position: relative ${r};`,n===`margin`&&`
19
- padding-left: ${i}px;
20
- padding-top: ${a}px;
21
- padding-right: ${o}px;
22
- margin-left:0;
23
- margin-top:0;
24
- margin-right: ${s}px ${r};
25
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
26
- }
27
-
28
- .${id} {
29
- right: ${s}px ${r};
30
- }
31
-
32
- .${ad} {
33
- margin-right: ${s}px ${r};
34
- }
35
-
36
- .${id} .${id} {
37
- right: 0 ${r};
38
- }
39
-
40
- .${ad} .${ad} {
41
- margin-right: 0 ${r};
42
- }
43
-
44
- body[${$}] {
45
- ${sd}: ${s}px;
46
- }
47
- `},Pd=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Fd=function(){z.useEffect(function(){return document.body.setAttribute($,(Pd()+1).toString()),function(){var e=Pd()-1;e<=0?document.body.removeAttribute($):document.body.setAttribute($,e.toString())}},[])},Id=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Fd();var a=z.useMemo(function(){return jd(i)},[i]);return z.createElement(Md,{styles:Nd(a,!t,i,n?``:`!important`)})},Ld=!1;if(typeof window<`u`)try{var Rd=Object.defineProperty({},"passive",{get:function(){return Ld=!0,!0}});window.addEventListener(`test`,Rd,Rd),window.removeEventListener(`test`,Rd,Rd)}catch{Ld=!1}var zd=Ld?{passive:!1}:!1,Bd=function(e){return e.tagName===`TEXTAREA`},Vd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Bd(e)&&n[t]===`visible`)},Hd=function(e){return Vd(e,`overflowY`)},Ud=function(e){return Vd(e,`overflowX`)},Wd=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),qd(e,r)){var i=Jd(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gd=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Kd=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},qd=function(e,t){return e===`v`?Hd(t):Ud(t)},Jd=function(e,t){return e===`v`?Gd(t):Kd(t)},Yd=function(e,t){return e===`h`&&t===`rtl`?-1:1},Xd=function(e,t,n,r,i){var a=Yd(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Jd(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&qd(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Zd=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qd=function(e){return[e.deltaX,e.deltaY]},$d=function(e){return e&&`current`in e?e.current:e},ef=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tf=function(e){return`
48
- .block-interactivity-${e} {pointer-events: none;}
49
- .allow-interactivity-${e} {pointer-events: all;}
50
- `},nf=0,rf=[];function af(e){var t=z.useRef([]),n=z.useRef([0,0]),r=z.useRef(),i=z.useState(nf++)[0],a=z.useState(Dd)[0],o=z.useRef(e);z.useEffect(function(){o.current=e},[e]),z.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=rd([e.lockRef.current],(e.shards||[]).map($d),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=z.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Zd(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Wd(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Wd(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Xd(h,t,e,h===`h`?s:c,!0)},[]),c=z.useCallback(function(e){var n=e;if(!(!rf.length||rf[rf.length-1]!==a)){var r=`deltaY`in n?Qd(n):Zd(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ef(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map($d).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=z.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:of(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=z.useCallback(function(e){n.current=Zd(e),r.current=void 0},[]),d=z.useCallback(function(t){l(t.type,Qd(t),t.target,s(t,e.lockRef.current))},[]),f=z.useCallback(function(t){l(t.type,Zd(t),t.target,s(t,e.lockRef.current))},[]);z.useEffect(function(){return rf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,zd),document.addEventListener(`touchmove`,c,zd),document.addEventListener(`touchstart`,u,zd),function(){rf=rf.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,zd),document.removeEventListener(`touchmove`,c,zd),document.removeEventListener(`touchstart`,u,zd)}},[]);var p=e.removeScrollBar,m=e.inert;return z.createElement(z.Fragment,null,m?z.createElement(a,{styles:tf(i)}):null,p?z.createElement(Id,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function of(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var sf=_d(vd,af),cf=z.forwardRef(function(e,t){return z.createElement(Q,td({},e,{ref:t,sideCar:sf}))});cf.classNames=Q.classNames;var lf=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},uf=new WeakMap,df=new WeakMap,ff={},pf=0,mf=function(e){return e&&(e.host||mf(e.parentNode))},hf=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=mf(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},gf=function(e,t,n,r){var i=hf(t,Array.isArray(e)?e:[e]);ff[n]||(ff[n]=new WeakMap);var a=ff[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(uf.get(e)||0)+1,l=(a.get(e)||0)+1;uf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&df.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),pf++,function(){o.forEach(function(e){var t=uf.get(e)-1,i=a.get(e)-1;uf.set(e,t),a.set(e,i),t||(df.has(e)||e.removeAttribute(r),df.delete(e)),i||e.removeAttribute(n)}),pf--,pf||(uf=new WeakMap,uf=new WeakMap,df=new WeakMap,ff={})}},_f=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||lf(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),gf(r,i,n,`aria-hidden`)):function(){return null}};function vf(e){let[t,n]=z.useState(void 0);return nu(()=>{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}var yf=[`top`,`right`,`bottom`,`left`],bf=Math.min,xf=Math.max,Sf=Math.round,Cf=Math.floor,wf=e=>({x:e,y:e}),Tf={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ef(e,t,n){return xf(e,bf(t,n))}function Df(e,t){return typeof e==`function`?e(t):e}function Of(e){return e.split(`-`)[0]}function kf(e){return e.split(`-`)[1]}function Af(e){return e===`x`?`y`:`x`}function jf(e){return e===`y`?`height`:`width`}function Mf(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Nf(e){return Af(Mf(e))}function Pf(e,t,n){n===void 0&&(n=!1);let r=kf(e),i=Nf(e),a=jf(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Uf(o)),[o,Uf(o)]}function Ff(e){let t=Uf(e);return[If(e),t,If(t)]}function If(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Lf=[`left`,`right`],Rf=[`right`,`left`],zf=[`top`,`bottom`],Bf=[`bottom`,`top`];function Vf(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Rf:Lf:t?Lf:Rf;case`left`:case`right`:return t?zf:Bf;default:return[]}}function Hf(e,t,n,r){let i=kf(e),a=Vf(Of(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(If)))),a}function Uf(e){let t=Of(e);return Tf[t]+e.slice(t.length)}function Wf(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gf(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Wf(e)}function Kf(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function qf(e,t,n){let{reference:r,floating:i}=e,a=Mf(t),o=Nf(t),s=jf(o),c=Of(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(kf(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Jf(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Df(t,e),p=Gf(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Kf(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Kf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Yf=50,Xf=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Jf},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qf(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Yf&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=qf(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Zf=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Df(e,t)||{};if(l==null)return{};let d=Gf(u),f={x:n,y:r},p=Nf(i),m=jf(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,E=C/2-h[m]/2-1,D=bf(d[_],E),ee=bf(d[v],E),te=D,ne=C-h[m]-ee,O=C/2-h[m]/2+w,re=Ef(te,O,ne),ie=!c.arrow&&kf(i)!=null&&O!==re&&a.reference[m]/2-(O<te?D:ee)-h[m]/2<0,ae=ie?O<te?O-te:O-ne:0;return{[p]:f[p]+ae,data:{[p]:re,centerOffset:O-re-ae,...ie&&{alignmentOffset:ae}},reset:ie}}}),Qf=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Df(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Of(r),_=Mf(o),v=Of(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Uf(o)]:Ff(o)),x=p!==`none`;!d&&x&&b.push(...Hf(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],E=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Pf(r,a,y);w.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Mf(t))||E.every(e=>Mf(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=E.filter(e=>{if(x){let t=Mf(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function $f(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ep(e){return yf.some(t=>e[t]>=0)}var tp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Df(e,t);switch(i){case`referenceHidden`:{let e=$f(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ep(e)}}}case`escaped`:{let e=$f(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ep(e)}}}default:return{}}}}},np=new Set([`left`,`top`]);async function rp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Of(n),s=kf(n),c=Mf(n)===`y`,l=np.has(o)?-1:1,u=a&&c?-1:1,d=Df(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ip=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await rp(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ap=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Df(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Mf(Of(i)),p=Af(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ef(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ef(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},op=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Df(e,t),u={x:n,y:r},d=Mf(i),f=Af(d),p=u[f],m=u[d],h=Df(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=np.has(Of(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},sp=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Df(e,t),u=await o.detectOverflow(t,l),d=Of(i),f=kf(i),p=Mf(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=bf(h-u[g],v),x=bf(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=xf(u.left,0),t=xf(u.right,0),n=xf(u.top,0),r=xf(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:xf(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:xf(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let E=await o.getDimensions(s.floating);return m!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function cp(){return typeof window<`u`}function lp(e){return fp(e)?(e.nodeName||``).toLowerCase():`#document`}function up(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dp(e){return((fp(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fp(e){return cp()?e instanceof Node||e instanceof up(e).Node:!1}function pp(e){return cp()?e instanceof Element||e instanceof up(e).Element:!1}function mp(e){return cp()?e instanceof HTMLElement||e instanceof up(e).HTMLElement:!1}function hp(e){return!cp()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof up(e).ShadowRoot}function gp(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Dp(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _p(e){return/^(table|td|th)$/.test(lp(e))}function vp(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var yp=/transform|translate|scale|rotate|perspective|filter/,bp=/paint|layout|strict|content/,xp=e=>!!e&&e!==`none`,Sp;function Cp(e){let t=pp(e)?Dp(e):e;return xp(t.transform)||xp(t.translate)||xp(t.scale)||xp(t.rotate)||xp(t.perspective)||!Tp()&&(xp(t.backdropFilter)||xp(t.filter))||yp.test(t.willChange||``)||bp.test(t.contain||``)}function wp(e){let t=kp(e);for(;mp(t)&&!Ep(t);){if(Cp(t))return t;if(vp(t))return null;t=kp(t)}return null}function Tp(){return Sp??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Sp}function Ep(e){return/^(html|body|#document)$/.test(lp(e))}function Dp(e){return up(e).getComputedStyle(e)}function Op(e){return pp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kp(e){if(lp(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||hp(e)&&e.host||dp(e);return hp(t)?t.host:t}function Ap(e){let t=kp(e);return Ep(t)?e.ownerDocument?e.ownerDocument.body:e.body:mp(t)&&gp(t)?t:Ap(t)}function jp(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ap(e),i=r===e.ownerDocument?.body,a=up(r);if(i){let e=Mp(a);return t.concat(a,a.visualViewport||[],gp(r)?r:[],e&&n?jp(e):[])}else return t.concat(r,jp(r,[],n))}function Mp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Np(e){let t=Dp(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=mp(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Sf(n)!==a||Sf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pp(e){return pp(e)?e:e.contextElement}function Fp(e){let t=Pp(e);if(!mp(t))return wf(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Np(t),o=(a?Sf(n.width):n.width)/r,s=(a?Sf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ip=wf(0);function Lp(e){let t=up(e);return!Tp()||!t.visualViewport?Ip:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rp(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==up(e)?!1:t}function zp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pp(e),o=wf(1);t&&(r?pp(r)&&(o=Fp(r)):o=Fp(e));let s=Rp(a,n,r)?Lp(a):wf(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=up(a),t=r&&pp(r)?up(r):r,n=e,i=Mp(n);for(;i&&r&&t!==n;){let e=Fp(i),t=i.getBoundingClientRect(),r=Dp(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=up(i),i=Mp(n)}}return Kf({width:u,height:d,x:c,y:l})}function Bp(e,t){let n=Op(e).scrollLeft;return t?t.left+n:zp(dp(e)).left+n}function Vp(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bp(e,n),y:n.top+t.scrollTop}}function Hp(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=dp(r),s=t?vp(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=wf(1),u=wf(0),d=mp(r);if((d||!d&&!a)&&((lp(r)!==`body`||gp(o))&&(c=Op(r)),d)){let e=zp(r);l=Fp(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vp(o,c):wf(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Up(e){return Array.from(e.getClientRects())}function Wp(e){let t=dp(e),n=Op(e),r=e.ownerDocument.body,i=xf(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=xf(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Bp(e),s=-n.scrollTop;return Dp(r).direction===`rtl`&&(o+=xf(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Gp=25;function Kp(e,t){let n=up(e),r=dp(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Tp();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Bp(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Gp&&(a-=o)}else l<=Gp&&(a+=l);return{width:a,height:o,x:s,y:c}}function qp(e,t){let n=zp(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=mp(e)?Fp(e):wf(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Jp(e,t,n){let r;if(t===`viewport`)r=Kp(e,n);else if(t===`document`)r=Wp(dp(e));else if(pp(t))r=qp(t,n);else{let n=Lp(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Kf(r)}function Yp(e,t){let n=kp(e);return n===t||!pp(n)||Ep(n)?!1:Dp(n).position===`fixed`||Yp(n,t)}function Xp(e,t){let n=t.get(e);if(n)return n;let r=jp(e,[],!1).filter(e=>pp(e)&&lp(e)!==`body`),i=null,a=Dp(e).position===`fixed`,o=a?kp(e):e;for(;pp(o)&&!Ep(o);){let t=Dp(o),n=Cp(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||gp(o)&&!n&&Yp(e,o))?r=r.filter(e=>e!==o):i=t,o=kp(o)}return t.set(e,r),r}function Zp(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?vp(t)?[]:Xp(t,this._c):[].concat(n),r],o=Jp(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Jp(t,a[e],i);s=xf(n.top,s),c=bf(n.right,c),l=bf(n.bottom,l),u=xf(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Qp(e){let{width:t,height:n}=Np(e);return{width:t,height:n}}function $p(e,t,n){let r=mp(t),i=dp(t),a=n===`fixed`,o=zp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=wf(0);function l(){c.x=Bp(i)}if(r||!r&&!a)if((lp(t)!==`body`||gp(i))&&(s=Op(t)),r){let e=zp(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Vp(i,s):wf(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function em(e){return Dp(e).position===`static`}function tm(e,t){if(!mp(e)||Dp(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return dp(e)===n&&(n=n.ownerDocument.body),n}function nm(e,t){let n=up(e);if(vp(e))return n;if(!mp(e)){let t=kp(e);for(;t&&!Ep(t);){if(pp(t)&&!em(t))return t;t=kp(t)}return n}let r=tm(e,t);for(;r&&_p(r)&&em(r);)r=tm(r,t);return r&&Ep(r)&&em(r)&&!Cp(r)?n:r||wp(e)||n}var rm=async function(e){let t=this.getOffsetParent||nm,n=this.getDimensions,r=await n(e.floating);return{reference:$p(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function im(e){return Dp(e).direction===`rtl`}var am={convertOffsetParentRelativeRectToViewportRelativeRect:Hp,getDocumentElement:dp,getClippingRect:Zp,getOffsetParent:nm,getElementRects:rm,getClientRects:Up,getDimensions:Qp,getScale:Fp,isElement:pp,isRTL:im};function om(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sm(e,t){let n=null,r,i=dp(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Cf(d),h=Cf(i.clientWidth-(u+f)),g=Cf(i.clientHeight-(d+p)),_=Cf(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:xf(0,bf(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!om(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function cm(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Pp(e),u=i||a?[...l?jp(l):[],...t?jp(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?sm(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?zp(e):null;c&&g();function g(){let t=zp(e);h&&!om(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var lm=ip,um=ap,dm=Qf,fm=sp,pm=tp,mm=Zf,hm=op,gm=(e,t,n)=>{let r=new Map,i={platform:am,...n},a={...i.platform,_c:r};return Xf(e,t,{...i,platform:a})},_m=typeof document<`u`?z.useLayoutEffect:function(){};function vm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!vm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!vm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ym(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bm(e,t){let n=ym(e);return Math.round(t*n)/n}function xm(e){let t=z.useRef(e);return _m(()=>{t.current=e}),t}function Sm(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);vm(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),E=c!=null,D=xm(c),ee=xm(i),te=xm(l),ne=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),gm(S.current,C.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};O.current&&!vm(w.current,t)&&(w.current=t,Xl.flushSync(()=>{d(t)}))})},[f,t,n,ee,te]);_m(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let O=z.useRef(!1);_m(()=>(O.current=!0,()=>{O.current=!1}),[]),_m(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,ne);ne()}},[b,x,ne,D,E]);let re=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ie=z.useMemo(()=>({reference:b,floating:x}),[b,x]),ae=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!ie.floating)return e;let t=bm(ie.floating,u.x),r=bm(ie.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ym(ie.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ie.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:ne,refs:re,elements:ie,floatingStyles:ae}),[u,ne,re,ie,ae])}var Cm=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:mm({element:r.current,padding:i}).fn(n):r?mm({element:r,padding:i}).fn(n):{}}}},wm=(e,t)=>{let n=lm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tm=(e,t)=>{let n=um(e);return{name:n.name,fn:n.fn,options:[e,t]}},Em=(e,t)=>({fn:hm(e).fn,options:[e,t]}),Dm=(e,t)=>{let n=dm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Om=(e,t)=>{let n=fm(e);return{name:n.name,fn:n.fn,options:[e,t]}},km=(e,t)=>{let n=pm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Am=(e,t)=>{let n=Cm(e);return{name:n.name,fn:n.fn,options:[e,t]}},jm=`Arrow`,Mm=z.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(Zl.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Mm.displayName=jm;var Nm=Mm,Pm=`Popper`,[Fm,Im]=$l(Pm),[Lm,Rm]=Fm(Pm),zm=e=>{let{__scopePopper:t,children:n}=e,[r,i]=z.useState(null),[a,o]=z.useState(void 0);return(0,R.jsx)(Lm,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};zm.displayName=Pm;var Bm=`PopperAnchor`,Vm=z.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Rm(Bm,n),o=z.useRef(null),s=a.onAnchorChange,c=Se(t,z.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=z.useRef(null);z.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Zm(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,R.jsx)(Zl.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});Vm.displayName=Bm;var Hm=`PopperContent`,[Um,Wm]=Fm(Hm),Gm=z.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l,collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Rm(Hm,n),[_,v]=z.useState(null),y=Se(t,e=>v(e)),[b,x]=z.useState(null),S=vf(b),C=S?.width??0,w=S?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=l?Array.isArray(l)?l:[l]:void 0,te=ee!==void 0&&ee.length>0,ne={padding:D,boundary:ee?.filter(Ym),altBoundary:te},{refs:O,floatingStyles:re,placement:ie,isPositioned:ae,middlewareData:k}=Sm({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>cm(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[wm({mainAxis:i+w,alignmentAxis:o}),c&&Tm({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Em():void 0,...ne}),c&&Dm({...ne}),Om({...ne,apply:({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`)}}),b&&Am({element:b,padding:s}),Xm({arrowWidth:C,arrowHeight:w}),f&&km({strategy:`referenceHidden`,...ne})]}),A=g.setPlacementState;nu(()=>(A(ie),()=>{A(void 0)}),[ie,A]);let[oe,se]=Zm(ie),ce=yu(m);nu(()=>{ae&&ce?.()},[ae,ce]);let le=k.arrow?.x,ue=k.arrow?.y,j=k.arrow?.centerOffset!==0,[de,fe]=z.useState();return nu(()=>{_&&fe(window.getComputedStyle(_).zIndex)},[_]),(0,R.jsx)(`div`,{ref:O.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ae?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(` `),...k.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(Um,{scope:n,placedSide:oe,placedAlign:se,onArrowChange:x,arrowX:le,arrowY:ue,shouldHideArrow:j,children:(0,R.jsx)(Zl.div,{"data-side":oe,"data-align":se,...h,ref:y,style:{...h.style,animation:ae?void 0:`none`}})})})});Gm.displayName=Hm;var Km=`PopperArrow`,qm={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Jm=z.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Wm(Km,n),a=qm[i.placedSide];return(0,R.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,R.jsx)(Nm,{...r,ref:t,style:{...r.style,display:`block`}})})});Jm.displayName=Km;function Ym(e){return e!==null}var Xm=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]=Zm(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}}}});function Zm(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Qm=zm,$m=Vm,eh=Gm,th=Jm,nh=`rovingFocusGroup.onEntryFocus`,rh={bubbles:!1,cancelable:!0},ih=`RovingFocusGroup`,[ah,oh,sh]=tu(ih),[ch,lh]=$l(ih,[sh]),[uh,dh]=ch(ih),fh=z.forwardRef((e,t)=>(0,R.jsx)(ah.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(ah.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(ph,{...e,ref:t})})}));fh.displayName=ih;var ph=z.forwardRef((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=z.useRef(null),p=Se(t,f),m=vu(a),[h,g]=iu({prop:o,defaultProp:s??null,onChange:c,caller:ih}),[_,v]=z.useState(!1),y=yu(l),b=oh(n),x=z.useRef(!1),[S,C]=z.useState(0);return z.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(nh,y),()=>e.removeEventListener(nh,y)},[y]),(0,R.jsx)(uh,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:z.useCallback(e=>g(e),[g]),onItemShiftTab:z.useCallback(()=>v(!0),[]),onFocusableItemAdd:z.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:z.useCallback(()=>C(e=>e-1),[]),children:(0,R.jsx)(Zl.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:X(e.onMouseDown,()=>{x.current=!0}),onFocus:X(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(nh,rh);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);yh([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:X(e.onBlur,()=>v(!1))})})}),mh=`RovingFocusGroupItem`,hh=z.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=gu(),l=a||c,u=dh(mh,n),d=u.currentTabStopId===l,f=oh(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return z.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,R.jsx)(ah.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(Zl.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:X(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:X(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:X(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=vh(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?bh(n,r+1):n.slice(r+1)}setTimeout(()=>yh(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});hh.displayName=mh;var gh={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function _h(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function vh(e,t,n){let r=_h(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return gh[r]}function yh(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xh=fh,Sh=hh,Ch=[`Enter`,` `],wh=[`ArrowDown`,`PageUp`,`Home`],Th=[`ArrowUp`,`PageDown`,`End`],Eh=[...wh,...Th],Dh={ltr:[...Ch,`ArrowRight`],rtl:[...Ch,`ArrowLeft`]},Oh={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},kh=`Menu`,[Ah,jh,Mh]=tu(kh),[Nh,Ph]=$l(kh,[Mh,Im,lh]),Fh=Im(),Ih=lh(),[Lh,Rh]=Nh(kh),[zh,Bh]=Nh(kh),Vh=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Fh(t),[c,l]=z.useState(null),u=z.useRef(!1),d=yu(a),f=vu(i);return z.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;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})}},[]),(0,R.jsx)(Qm,{...s,children:(0,R.jsx)(Lh,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,R.jsx)(zh,{scope:t,onClose:z.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Vh.displayName=kh;var Hh=`MenuAnchor`,Uh=z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Fh(n);return(0,R.jsx)($m,{...i,...r,ref:t})});Uh.displayName=Hh;var Wh=`MenuPortal`,[Gh,Kh]=Nh(Wh,{forceMount:void 0}),qh=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Rh(Wh,t);return(0,R.jsx)(Gh,{scope:t,forceMount:n,children:(0,R.jsx)(cu,{present:n||a.open,children:(0,R.jsx)(Xu,{asChild:!0,container:i,children:r})})})};qh.displayName=Wh;var Jh=`MenuContent`,[Yh,Xh]=Nh(Jh),Zh=z.forwardRef((e,t)=>{let n=Kh(Jh,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Rh(Jh,e.__scopeMenu),o=Bh(Jh,e.__scopeMenu);return(0,R.jsx)(Ah.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(cu,{present:r||a.open,children:(0,R.jsx)(Ah.Slot,{scope:e.__scopeMenu,children:o.modal?(0,R.jsx)(Qh,{...i,ref:t}):(0,R.jsx)($h,{...i,ref:t})})})})}),Qh=z.forwardRef((e,t)=>{let n=Rh(Jh,e.__scopeMenu),r=z.useRef(null),i=Se(t,r);return z.useEffect(()=>{let e=r.current;if(e)return _f(e)},[]),(0,R.jsx)(tg,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$h=z.forwardRef((e,t)=>{let n=Rh(Jh,e.__scopeMenu);return(0,R.jsx)(tg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),eg=Ce(`MenuContent.ScrollLock`),tg=z.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Rh(Jh,n),_=Bh(Jh,n),v=Fh(n),y=Ih(n),b=jh(n),[x,S]=z.useState(null),C=z.useRef(null),w=Se(t,C,g.onContentChange),E=z.useRef(0),D=z.useRef(``),ee=z.useRef(0),te=z.useRef(null),ne=z.useRef(`right`),O=z.useRef(0),re=m?cf:z.Fragment,ie=m?{as:eg,allowPinchZoom:!0}:void 0,ae=e=>{let t=D.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=zg(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};z.useEffect(()=>()=>window.clearTimeout(E.current),[]),$u();let k=z.useCallback(e=>ne.current===te.current?.side&&Vg(e,te.current?.area),[]);return(0,R.jsx)(Yh,{scope:n,searchRef:D,onItemEnter:z.useCallback(e=>{k(e)&&e.preventDefault()},[k]),onItemLeave:z.useCallback(e=>{k(e)||(C.current?.focus(),S(null))},[k]),onTriggerLeave:z.useCallback(e=>{k(e)&&e.preventDefault()},[k]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:z.useCallback(e=>{te.current=e},[]),children:(0,R.jsx)(re,{...ie,children:(0,R.jsx)(Ru,{asChild:!0,trapped:i,onMountAutoFocus:X(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,R.jsx)(Du,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,R.jsx)(xh,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:X(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,R.jsx)(eh,{role:`menu`,"aria-orientation":`vertical`,"data-state":Pg(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:X(h.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&&ae(e.key));let i=C.current;if(e.target!==i||!Eh.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);Th.includes(e.key)&&a.reverse(),Lg(a)}),onBlur:X(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:X(e.onPointerMove,Hg(e=>{let t=e.target,n=O.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ne.current=e.clientX>O.current?`right`:`left`,O.current=e.clientX)}))})})})})})})});Zh.displayName=Jh;var ng=`MenuGroup`,rg=z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Zl.div,{role:`group`,...r,ref:t})});rg.displayName=ng;var ig=`MenuLabel`,ag=z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Zl.div,{...r,ref:t})});ag.displayName=ig;var og=`MenuItem`,sg=`menu.itemSelect`,cg=z.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=z.useRef(null),o=Bh(og,e.__scopeMenu),s=Xh(og,e.__scopeMenu),c=Se(t,a),l=z.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(sg,{bubbles:!0,cancelable:!0});e.addEventListener(sg,e=>r?.(e),{once:!0}),Ql(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,R.jsx)(lg,{...i,ref:c,disabled:n,onClick:X(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:X(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:X(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Ch.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});cg.displayName=og;var lg=z.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Xh(og,n),s=Ih(n),c=z.useRef(null),l=Se(t,c),[u,d]=z.useState(!1),[f,p]=z.useState(``);return z.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,R.jsx)(Ah.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,R.jsx)(Sh,{asChild:!0,...s,focusable:!r,children:(0,R.jsx)(Zl.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:X(e.onPointerMove,Hg(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:X(e.onPointerLeave,Hg(e=>o.onItemLeave(e))),onFocus:X(e.onFocus,()=>d(!0)),onBlur:X(e.onBlur,()=>d(!1))})})})}),ug=`MenuCheckboxItem`,dg=z.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,R.jsx)(yg,{scope:e.__scopeMenu,checked:n,children:(0,R.jsx)(cg,{role:`menuitemcheckbox`,"aria-checked":Fg(n)?`mixed`:n,...i,ref:t,"data-state":Ig(n),onSelect:X(i.onSelect,()=>r?.(Fg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});dg.displayName=ug;var fg=`MenuRadioGroup`,[pg,mg]=Nh(fg,{value:void 0,onValueChange:()=>{}}),hg=z.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=yu(r);return(0,R.jsx)(pg,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,R.jsx)(rg,{...i,ref:t})})});hg.displayName=fg;var gg=`MenuRadioItem`,_g=z.forwardRef((e,t)=>{let{value:n,...r}=e,i=mg(gg,e.__scopeMenu),a=n===i.value;return(0,R.jsx)(yg,{scope:e.__scopeMenu,checked:a,children:(0,R.jsx)(cg,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Ig(a),onSelect:X(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});_g.displayName=gg;var vg=`MenuItemIndicator`,[yg,bg]=Nh(vg,{checked:!1}),xg=z.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=bg(vg,n);return(0,R.jsx)(cu,{present:r||Fg(a.checked)||a.checked===!0,children:(0,R.jsx)(Zl.span,{...i,ref:t,"data-state":Ig(a.checked)})})});xg.displayName=vg;var Sg=`MenuSeparator`,Cg=z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Zl.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Cg.displayName=Sg;var wg=`MenuArrow`,Tg=z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Fh(n);return(0,R.jsx)(th,{...i,...r,ref:t})});Tg.displayName=wg;var Eg=`MenuSub`,[Dg,Og]=Nh(Eg),kg=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Rh(Eg,t),o=Fh(t),[s,c]=z.useState(null),[l,u]=z.useState(null),d=yu(i);return z.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,R.jsx)(Qm,{...o,children:(0,R.jsx)(Lh,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,R.jsx)(Dg,{scope:t,contentId:gu(),triggerId:gu(),trigger:s,onTriggerChange:c,children:n})})})};kg.displayName=Eg;var Ag=`MenuSubTrigger`,jg=z.forwardRef((e,t)=>{let n=Rh(Ag,e.__scopeMenu),r=Bh(Ag,e.__scopeMenu),i=Og(Ag,e.__scopeMenu),a=Xh(Ag,e.__scopeMenu),o=z.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=z.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return z.useEffect(()=>u,[u]),z.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,R.jsx)(Uh,{asChild:!0,...l,children:(0,R.jsx)(lg,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Pg(n.open),...e,ref:we(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:X(e.onPointerMove,Hg(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:X(e.onPointerLeave,Hg(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:X(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Dh[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});jg.displayName=Ag;var Mg=`MenuSubContent`,Ng=z.forwardRef((e,t)=>{let n=Kh(Jh,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Rh(Jh,e.__scopeMenu),s=Bh(Jh,e.__scopeMenu),c=Og(Mg,e.__scopeMenu),l=z.useRef(null),u=Se(t,l);return(0,R.jsx)(Ah.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(cu,{present:r||o.open,children:(0,R.jsx)(Ah.Slot,{scope:e.__scopeMenu,children:(0,R.jsx)(tg,{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:X(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:X(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:X(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Oh[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Ng.displayName=Mg;function Pg(e){return e?`open`:`closed`}function Fg(e){return e===`indeterminate`}function Ig(e){return Fg(e)?`indeterminate`:e?`checked`:`unchecked`}function Lg(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Rg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zg(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=Rg(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}function Bg(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}function Vg(e,t){return t?Bg({x:e.clientX,y:e.clientY},t):!1}function Hg(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Ug=Vh,Wg=Uh,Gg=qh,Kg=Zh,qg=rg,Jg=ag,Yg=cg,Xg=dg,Zg=hg,Qg=_g,$g=xg,e_=Cg,t_=Tg,n_=jg,r_=Ng,i_=`DropdownMenu`,[a_,o_]=$l(i_,[Ph]),s_=Ph(),[c_,l_]=a_(i_),u_=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=s_(t),l=z.useRef(null),[u,d]=iu({prop:i,defaultProp:a??!1,onChange:o,caller:i_});return(0,R.jsx)(c_,{scope:t,triggerId:gu(),triggerRef:l,contentId:gu(),open:u,onOpenChange:d,onOpenToggle:z.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,R.jsx)(Ug,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};u_.displayName=i_;var d_=`DropdownMenuTrigger`,f_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=l_(d_,n),o=s_(n);return(0,R.jsx)(Wg,{asChild:!0,...o,children:(0,R.jsx)(Zl.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:we(t,a.triggerRef),onPointerDown:X(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:X(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});f_.displayName=d_;var p_=`DropdownMenuPortal`,m_=e=>{let{__scopeDropdownMenu:t,...n}=e,r=s_(t);return(0,R.jsx)(Gg,{...r,...n})};m_.displayName=p_;var h_=`DropdownMenuContent`,g_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=l_(h_,n),a=s_(n),o=z.useRef(!1);return(0,R.jsx)(Kg,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:X(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)`}})});g_.displayName=h_;var __=`DropdownMenuGroup`,v_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(qg,{...i,...r,ref:t})});v_.displayName=__;var y_=`DropdownMenuLabel`,b_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(Jg,{...i,...r,ref:t})});b_.displayName=y_;var x_=`DropdownMenuItem`,S_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(Yg,{...i,...r,ref:t})});S_.displayName=x_;var C_=`DropdownMenuCheckboxItem`,w_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(Xg,{...i,...r,ref:t})});w_.displayName=C_;var T_=`DropdownMenuRadioGroup`,E_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(Zg,{...i,...r,ref:t})});E_.displayName=T_;var D_=`DropdownMenuRadioItem`,O_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(Qg,{...i,...r,ref:t})});O_.displayName=D_;var k_=`DropdownMenuItemIndicator`,A_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)($g,{...i,...r,ref:t})});A_.displayName=k_;var j_=`DropdownMenuSeparator`,M_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(e_,{...i,...r,ref:t})});M_.displayName=j_;var N_=`DropdownMenuArrow`,P_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(t_,{...i,...r,ref:t})});P_.displayName=N_;var F_=`DropdownMenuSubTrigger`,I_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(n_,{...i,...r,ref:t})});I_.displayName=F_;var L_=`DropdownMenuSubContent`,R_=z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,R.jsx)(r_,{...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)`}})});R_.displayName=L_;var z_=u_,B_=f_,V_=m_,H_=g_,U_=b_,W_=S_,G_=M_,K_=xe(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function q_({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,R.jsx)(r?Te:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:be(K_({variant:t,size:n,className:e})),...i})}var J_=`flakes.console.theme`;function Y_(e){document.documentElement.classList.toggle(`dark`,e===`dark`)}function X_(){let e=window.localStorage.getItem(J_)===`light`?`light`:`dark`;return Y_(e),e}function Z_(){return document.documentElement.classList.contains(`dark`)?`dark`:`light`}function Q_(e){let t=e===`dark`?`light`:`dark`;return window.localStorage.setItem(J_,t),Y_(t),t}function $_(){let[e,t]=(0,z.useState)(()=>Z_());return(0,R.jsx)(q_,{variant:`ghost`,size:`icon`,"aria-label":`Toggle theme`,onClick:()=>t(Q_(e)),children:e===`dark`?(0,R.jsx)(W,{className:`size-4`}):(0,R.jsx)(il,{className:`size-4`})})}function ev({...e}){return(0,R.jsx)(z_,{"data-slot":`dropdown-menu`,...e})}function tv({...e}){return(0,R.jsx)(B_,{"data-slot":`dropdown-menu-trigger`,...e})}function nv({className:e,sideOffset:t=4,...n}){return(0,R.jsx)(V_,{children:(0,R.jsx)(H_,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:be(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function rv({className:e,inset:t,variant:n=`default`,...r}){return(0,R.jsx)(W_,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:be(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function iv({className:e,inset:t,...n}){return(0,R.jsx)(U_,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:be(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function av({className:e,...t}){return(0,R.jsx)(G_,{"data-slot":`dropdown-menu-separator`,className:be(`-mx-1 my-1 h-px bg-border`,e),...t})}var ov=`flakes.console.sidebar`;function sv(e){let t=Lo(),n=hv(`(max-width: 767px)`),[r,i]=(0,z.useState)(()=>window.localStorage.getItem(ov)===`collapsed`),a=r||n,o=()=>{let e=!r;i(e),window.localStorage.setItem(ov,e?`collapsed`:`open`)},s=mv();return(0,R.jsxs)(`div`,{className:`flex h-screen overflow-hidden transition-opacity duration-300 starting:opacity-0`,children:[(0,R.jsxs)(`aside`,{className:be(`flex shrink-0 flex-col border-r bg-sidebar text-sidebar-foreground transition-[width]`,a?`w-14`:`w-[17rem]`),children:[(0,R.jsxs)(`div`,{className:`flex h-14 items-center gap-1.5 border-b border-sidebar-border px-2`,children:[a?(0,R.jsx)(re,{to:`/runs`,"aria-label":`Flakes runs`,className:`mx-auto rounded-md p-1.5 transition-colors hover:bg-sidebar-accent/40`,children:(0,R.jsx)(Jl,{className:`size-[18px]`})}):(0,R.jsx)(re,{to:`/runs`,className:`flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-2 transition-colors hover:bg-sidebar-accent/40`,children:(0,R.jsx)(Yl,{})}),a?null:(0,R.jsx)(q_,{variant:`ghost`,size:`icon-sm`,className:`shrink-0`,"aria-label":`Collapse sidebar`,onClick:o,children:(0,R.jsx)(al,{className:`size-4`})})]}),r&&!n?(0,R.jsx)(`div`,{className:`flex justify-center py-1.5`,children:(0,R.jsx)(q_,{variant:`ghost`,size:`icon-sm`,"aria-label":`Expand sidebar`,onClick:o,children:(0,R.jsx)(al,{className:`size-4`})})}):null,(0,R.jsx)(lv,{collapsed:a,pathname:t.pathname}),a?(0,R.jsx)(`div`,{className:`flex-1`}):(0,R.jsx)(yv,{}),(0,R.jsx)(cv,{collapsed:a,pathname:t.pathname})]}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsxs)(`header`,{className:`relative flex h-14 shrink-0 items-center gap-3 overflow-x-clip border-b px-5`,children:[(0,R.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:(0,R.jsx)(pv,{pathname:t.pathname})}),(0,R.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,R.jsx)(gv,{}),(0,R.jsx)(vv,{state:e.connection,pollKey:s}),(0,R.jsx)($_,{}),(0,R.jsxs)(ev,{children:[(0,R.jsx)(tv,{asChild:!0,children:(0,R.jsx)(q_,{variant:`ghost`,size:`icon`,"aria-label":`Account menu`,children:(0,R.jsx)(uv,{user:e.user})})}),(0,R.jsxs)(nv,{align:`end`,className:`w-64`,children:[(0,R.jsxs)(iv,{className:`flex min-w-0 items-center gap-3`,children:[(0,R.jsx)(uv,{user:e.user}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate font-medium`,children:dv(e.user)}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground`,children:e.user.email??`No email recorded`})]})]}),(0,R.jsx)(av,{}),(0,R.jsx)(rv,{asChild:!0,children:(0,R.jsxs)(re,{to:`/account`,children:[(0,R.jsx)(ul,{className:`size-4`}),` Account`]})}),(0,R.jsx)(rv,{asChild:!0,children:(0,R.jsxs)(re,{to:`/account/security`,children:[(0,R.jsx)(cl,{className:`size-4`}),` Security`]})}),(0,R.jsx)(av,{}),(0,R.jsxs)(rv,{variant:`destructive`,onClick:e.onSignOut,children:[(0,R.jsx)(rl,{className:`size-4`}),` Sign out`]})]})]})]}),s>0&&(0,R.jsx)(`div`,{className:`animate-sweep`},s)]}),(0,R.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,R.jsx)(`div`,{className:`mx-auto max-w-6xl p-6`,children:e.children})})]})]})}function cv(e){let t=e.pathname.startsWith(`/documentation`);return(0,R.jsx)(`div`,{className:be(`border-t border-sidebar-border p-2`,e.collapsed&&`grid justify-items-center`),children:(0,R.jsxs)(re,{to:`/documentation`,"aria-label":e.collapsed?`Documentation`:void 0,title:e.collapsed?`Documentation`:void 0,className:be(`flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,e.collapsed&&`size-9 justify-center px-0`,t?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-muted-foreground hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground`),children:[(0,R.jsx)(el,{className:`size-4 shrink-0`,"aria-hidden":`true`}),e.collapsed?null:(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate font-medium`,children:`Documentation`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground`,children:`Guides and reference`})]})]})})}function lv(e){let t=[{to:`/runs`,label:`Runs`,detail:`Task runs`,icon:tl,active:e.pathname===`/`||e.pathname.startsWith(`/runs`)},{to:`/sandboxes`,label:`Sandboxes`,detail:`Run task placement`,icon:sl,active:e.pathname.startsWith(`/sandboxes`)}];return(0,R.jsx)(`nav`,{"aria-label":`Console sections`,className:be(`grid gap-1 border-b border-sidebar-border p-2`,e.collapsed&&`justify-items-center`),children:t.map(t=>{let n=t.icon;return(0,R.jsxs)(re,{to:t.to,"aria-label":e.collapsed?t.label:void 0,title:e.collapsed?t.label:void 0,className:be(`flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,e.collapsed&&`size-9 justify-center px-0`,t.active?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-muted-foreground hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground`),children:[(0,R.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":`true`}),e.collapsed?null:(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate font-medium`,children:t.label}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground`,children:t.detail})]})]},t.to)})})}function uv(e){return e.user.image?(0,R.jsx)(`img`,{src:e.user.image,alt:``,referrerPolicy:`no-referrer`,className:`size-6 rounded-full border object-cover`}):(0,R.jsx)(`span`,{className:`inline-flex size-6 items-center justify-center rounded-full border bg-muted font-mono text-[10px] text-muted-foreground`,children:fv(e.user)})}function dv(e){let t=e.name?.trim();return t&&t.length>0?t:e.email??`Flakes user`}function fv(e){let t=dv(e),n=t.split(/[\s@._-]+/).filter(Boolean);return(n.length>1?`${n[0]?.[0]??``}${n[1]?.[0]??``}`:t.slice(0,2)).toUpperCase()}function pv(e){let t=e.pathname.split(`/`).filter(Boolean);if(t[0]===`account`)return t[1]===`security`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(re,{to:`/account`,className:`hover:text-foreground`,children:`Account`}),` / `,(0,R.jsx)(`span`,{className:`text-foreground`,children:`Security`})]}):(0,R.jsx)(`span`,{className:`text-foreground`,children:`Account`});if(t[0]===`documentation`)return(0,R.jsx)(`span`,{className:`text-foreground`,children:`Documentation`});if(t[0]===`sandboxes`)return(0,R.jsx)(`span`,{className:`text-foreground`,children:`Sandboxes`});let n=t[0]===`runs`?t[1]:void 0;if(n===void 0)return(0,R.jsx)(`span`,{className:`text-foreground`,children:`Runs`});let r=t[2]===`t`?t[3]:void 0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(re,{to:`/runs`,className:`hover:text-foreground`,children:`Runs`}),` / `,r===void 0?(0,R.jsx)(`span`,{className:`text-foreground`,children:n}):(0,R.jsx)(re,{to:`/runs/$runId`,params:{runId:n},className:`hover:text-foreground`,children:n}),r===void 0?null:(0,R.jsxs)(R.Fragment,{children:[` / `,(0,R.jsx)(`span`,{className:`text-foreground`,children:r})]})]})}function mv(){let e=Zc(),t=(0,z.useRef)(!1),[n,r]=(0,z.useState)(0);return(0,z.useEffect)(()=>{t.current&&e===0&&r(e=>e+1),t.current=e>0},[e]),n}function hv(e){let[t,n]=(0,z.useState)(()=>typeof window>`u`?!1:window.matchMedia(e).matches);return(0,z.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function gv(){let[e,t]=(0,z.useState)(()=>new Date);return(0,z.useEffect)(()=>{let e=setInterval(()=>t(new Date),1e3);return()=>clearInterval(e)},[]),(0,R.jsx)(`span`,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,children:`${e.toISOString().slice(11,19)}Z`})}var _v={ok:{dot:`bg-primary`,label:`CONNECTED`},degraded:{dot:`bg-status-warn`,label:`DEGRADED`},error:{dot:`bg-status-failed`,label:`UNREACHABLE`},pending:{dot:`bg-status-idle animate-pulse`,label:`CONNECTING`}};function vv(e){let t=_v[e.state];return(0,R.jsxs)(`span`,{className:be(`flex items-center gap-1.5 rounded-full border px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground`,e.state===`degraded`&&`text-status-warn`,e.state===`error`&&`text-status-failed`),children:[(0,R.jsxs)(`span`,{className:`relative size-1.5`,children:[(0,R.jsx)(`span`,{className:be(`absolute inset-0 rounded-full`,t.dot)}),e.state===`ok`&&e.pollKey>0&&(0,R.jsx)(`span`,{className:`blip absolute inset-0 rounded-full border border-primary`},e.pollKey)]}),t.label]})}function yv(){let[e,t]=(0,z.useState)(!1),n=Rl(),r=(n.data?.pages??[]).flatMap(e=>e.runs);if(r.length===0)return(0,R.jsx)(`div`,{className:`min-h-0 flex-1 px-3 py-2 text-xs text-muted-foreground`,children:n.isPending?`Loading sessions…`:`No sessions yet.`});let i=Ev(r),a=i.some(e=>e.project!==null);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`border-b border-sidebar-border p-2`,children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(!0),className:`flex h-8 w-full items-center gap-2 rounded-md border border-sidebar-border bg-background/70 px-2.5 text-left text-sm text-muted-foreground transition-colors hover:bg-sidebar-accent/40 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,children:[(0,R.jsx)(ol,{className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Search runs`}),(0,R.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:`⌘K`})]})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:i.map(e=>(0,R.jsxs)(`div`,{className:`mb-3`,children:[e.project!==null||a?(0,R.jsx)(`div`,{className:`console-callout truncate px-2 pt-1 pb-1.5`,children:e.project??`Inbox`}):null,(0,R.jsx)(`div`,{className:`grid gap-0.5`,children:e.runs.map(e=>(0,R.jsx)(xv,{run:e},e.runId))})]},e.project??`__inbox`))}),(0,R.jsx)(bv,{open:e,runs:r,onOpenChange:t})]})}function bv(e){let t=fo(),n=(0,z.useRef)(null),[r,i]=(0,z.useState)(``);if((0,z.useEffect)(()=>{if(!e.open){i(``);return}let t=requestAnimationFrame(()=>n.current?.focus());function r(t){t.key===`Escape`&&e.onOpenChange(!1)}return window.addEventListener(`keydown`,r),()=>{cancelAnimationFrame(t),window.removeEventListener(`keydown`,r)}},[e.open,e.onOpenChange]),(0,z.useEffect)(()=>{function t(t){(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e.onOpenChange(!0))}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.onOpenChange]),!e.open)return null;let a=Sv(e.runs,r).slice(0,12);return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background/65 p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":`Search runs`,onMouseDown:t=>{t.target===t.currentTarget&&e.onOpenChange(!1)},children:(0,R.jsxs)(`div`,{className:`mx-auto mt-[12vh] w-full max-w-xl overflow-hidden rounded-lg border bg-popover shadow-2xl`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,R.jsx)(ol,{className:`size-4 shrink-0 text-muted-foreground`}),(0,R.jsx)(`input`,{ref:n,value:r,onChange:e=>i(e.currentTarget.value),name:`run-search-dialog`,placeholder:`Search runs`,"aria-label":`Search runs`,autoComplete:`off`,className:`h-10 min-w-0 flex-1 bg-transparent text-base outline-none placeholder:text-muted-foreground`}),(0,R.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`ESC`})]}),(0,R.jsx)(`div`,{className:`max-h-[26rem] overflow-y-auto p-2`,children:a.length===0?(0,R.jsx)(`div`,{className:`px-3 py-8 text-center text-sm text-muted-foreground`,children:`No matching runs.`}):(0,R.jsx)(`div`,{className:`grid gap-1`,children:a.map(n=>(0,R.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-start gap-2 rounded-md px-3 py-2 text-left transition-colors hover:bg-accent focus-visible:bg-accent focus-visible:outline-none`,onClick:()=>{e.onOpenChange(!1),t({to:`/runs/$runId`,params:{runId:n.runId}})},children:[(0,R.jsx)(`span`,{className:be(`mt-1.5 size-1.5 shrink-0 rounded-full`,Dv(n.state))}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:n.name}),(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:n.state.toLowerCase()}),(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{"data-num":!0,children:Cv(n)}),(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{className:`truncate`,children:n.runId})]})]})]},n.runId))})})]})})}function xv(e){let t=Lo(),n=fo(),r=Y(),i=t.pathname.startsWith(`/runs/${e.run.runId}`),a=Tv.has(e.run.state);async function o(){if(window.confirm(`Delete "${e.run.name}" from run history?`))try{await r.mutateAsync(e.run.runId),i&&n({to:`/runs`})}catch(e){window.alert(e instanceof Error?e.message:`Failed to delete run`)}}return(0,R.jsxs)(`div`,{className:be(`group flex items-center rounded-md transition-colors`,i?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-muted-foreground hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground`),children:[(0,R.jsxs)(re,{to:`/runs/$runId`,params:{runId:e.run.runId},title:e.run.name,className:`flex min-w-0 flex-1 items-start gap-2 px-2 py-2 text-sm`,children:[(0,R.jsx)(`span`,{className:be(`mt-1.5 size-1.5 shrink-0 rounded-full`,Dv(e.run.state))}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate font-medium leading-5`,children:e.run.name}),(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:e.run.state.toLowerCase()}),(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{"data-num":!0,children:Cv(e.run)}),(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{title:e.run.updatedAt,children:wv(e.run)})]})]})]}),a?(0,R.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.run.name}`,title:`Delete run`,disabled:r.isPending,onClick:()=>{o()},className:be(`mr-1 rounded p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-destructive/10 hover:text-destructive focus:opacity-100 group-hover:opacity-100`,r.isPending&&`cursor-not-allowed opacity-50`),children:(0,R.jsx)(ll,{className:`size-3.5`})}):null]})}function Sv(e,t){let n=t.trim().toLowerCase();return n.length===0?e:e.filter(e=>[e.name,e.runId,e.state,typeof e.metadata?.project==`string`?e.metadata.project:void 0].some(e=>e?.toLowerCase().includes(n)))}function Cv(e){let t=e.taskStatusCounts;if(t===void 0)return`—`;let n=Object.values(t).reduce((e,t)=>e+t,0),r=(t.SUCCEEDED??0)+(t.FAILED??0)+(t.CANCELLED??0);return n===0?`0/0`:`${r}/${n}`}function wv(e){let t=e.updatedAt,n=Date.now()-Date.parse(t);if(!Number.isFinite(n)||n<0)return`now`;let r=Math.floor(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60);if(i<60)return`${i}m`;let a=Math.floor(i/60);return a<48?`${a}h`:`${Math.floor(a/24)}d`}var Tv=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`,`STALLED`]);function Ev(e){let t=new Map,n=[];for(let r of e){let e=typeof r.metadata?.project==`string`?r.metadata.project:void 0;if(e!==void 0&&e.length>0){let n=t.get(e)??[];n.push(r),t.set(e,n)}else n.push(r)}let r=[];for(let e of[...t.keys()].sort())r.push({project:e,runs:t.get(e)??[]});return n.length>0&&r.push({project:null,runs:n}),r}function Dv(e){switch(e.toLowerCase()){case`running`:return`bg-status-running`;case`succeeded`:return`bg-status-succeeded`;case`failed`:return`bg-status-failed`;case`cancelled`:case`stalled`:return`bg-status-warn`;case`blocked`:return`bg-status-blocked`;default:return`bg-status-idle`}}var Ov=Object.create(null),kv=e=>({}),Av=new Proxy(Ov,{get(e,t){return kv()[t]??Ov[t]},has(e,t){return t in kv()||t in Ov},set(e,t,n){let r=kv(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=kv(!0);return delete n[t],!0},ownKeys(){let e=kv(!0);return Object.keys(e)}});Av.NODE_ENV;function jv(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return jv(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return jv(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return jv(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return jv(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return jv(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return jv(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return jv(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function Mv(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}function Nv(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function Pv(e){let t=e.split(`
51
- at `);return t.length<=1?e:(t.splice(1,1),t.join(`
52
- at `))}function Fv(e,t){class n extends e{#e;constructor(...e){if(Nv()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=Pv(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var Iv={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};Fv(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:Iv[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var Lv=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},Rv=47;function zv(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Rv;)t--;return t===e.length?e:e.slice(0,t)}function Bv(e){try{return(zv(new URL(e).pathname)||`/`)!==`/`}catch{throw new Lv(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Vv(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new Lv(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof Lv?t:new Lv(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Hv(e,t=`/api/auth`){if(Vv(e),Bv(e))return e;let n=zv(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function Uv(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function Wv(e,t,n,r,i){if(e)return Hv(e,t);if(r!==!1){let e=Av.BETTER_AUTH_URL||Av.NEXT_PUBLIC_BETTER_AUTH_URL||Av.PUBLIC_BETTER_AUTH_URL||Av.NUXT_PUBLIC_BETTER_AUTH_URL||Av.NUXT_PUBLIC_AUTH_URL||(Av.BASE_URL===`/`?void 0:Av.BASE_URL);if(e)return Hv(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&Uv(o,`proto`)&&Uv(a,`host`))try{return Hv(`${o}://${a}`,t)}catch{}if(n){let e=Gv(n.url);if(!e)throw new Lv(`Could not get origin from request. Please provide a valid base URL.`);return Hv(e,t)}if(typeof window<`u`&&window.location)return Hv(window.location.origin,t)}function Gv(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Kv={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},qv=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Jv={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},Yv=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Xv(e){return e instanceof Date&&!isNaN(e.getTime())}function Zv(e){let t=Yv.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return Xv(f)?f:null}function Qv(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in Jv)return Jv[s];if(!qv.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(Kv).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=Zv(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function $v(e,t={strict:!0}){return Qv(e,t)}var ey=[`javascript:`,`data:`,`vbscript:`];function ty(e){let t;try{t=new URL(e)}catch{return!0}return!ey.includes(t.protocol)}var ny={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&ty(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},ry=[],iy=0,ay=4,oy=globalThis.nanostoresGlobal||={epoch:0},sy=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=iy+ay;t<ry.length;)ry[t]===e?ry.splice(t,ay):t+=ay;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){oy.epoch++;let i=!ry.length;for(let i of t)ry.push(i,n.value,e,r);if(i){for(iy=0;iy<ry.length;iy+=ay)ry[iy](ry[iy+1],ry[iy+2],ry[iy+3]);ry.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},cy=2,ly=5,uy=6,dy=10,fy=(e,t,n,r)=>(e.events=e.events||{},e.events[n+dy]||(e.events[n+dy]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+dy](),delete e.events[n+dy])}),py=(e,t)=>fy(e,t,cy,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),my=1e3,hy=(e,t)=>fy(e,n=>{let r=t(n);r&&e.events[uy].push(r)},ly,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[uy]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[uy])t();e.events[uy]=[]}},my)},()=>{e.listen=n,e.off=r}});function gy(e,t,n){let r=new Set(t).add(void 0);return e.listen((e,t,i)=>{r.has(i)&&n(e,t,i)})}function _y(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function vy(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!vy(e[n],t[n]))return!1;return!0}if(_y(e)&&_y(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!vy(e[r],t[r]))return!1;return!0}return!1}function yy(e,t){return py(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var by=Symbol.for(`better-auth:broadcast-channel`),xy=()=>Math.floor(Date.now()/1e3),Sy=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:xy()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Cy(e=`better-auth.message`){return globalThis[by]||(globalThis[by]=new Sy(e)),globalThis[by]}var wy=Symbol.for(`better-auth:focus-manager`),Ty=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Ey(){return globalThis[wy]||(globalThis[wy]=new Ty),globalThis[wy]}var Dy=Symbol.for(`better-auth:online-manager`),Oy=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function ky(){return globalThis[Dy]||(globalThis[Dy]=new Oy),globalThis[Dy]}var Ay=()=>Math.floor(Date.now()/1e3),jy=5;function My(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||ky().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=Ay(),t();return}if(e?.event===`visibilitychange`){if(Ay()-c.lastSessionRequest<jy)return;c.lastSessionRequest=Ay(),t();return}t()}},d=e=>{Cy().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Cy().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Ey().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=ky().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=Cy().setup(),c.cleanupFocusSetup=Ey().setup(),c.cleanupOnlineSetup=ky().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var Ny=()=>typeof window>`u`;function Py(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function Fy(e){return!e||e.session===null&&e.user===null?null:e}function Iy(e,t){return vy(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function Ly(e,t){let n=sy(!1),r,i=e=>s(e),a=sy({data:null,error:null,isPending:!0,isRefetching:!1,refetch:i});yy(a,Iy);let o=e=>{if(r!==e)return;let t=a.get();r=void 0,!(!t.isPending&&!t.isRefetching)&&a.set({...t,isPending:!1,isRefetching:!1,refetch:i})},s=async t=>{r?.abort();let n=new AbortController;r=n;let s=a.get();a.set({...s,isPending:s.data===null,isRefetching:!0,error:null,refetch:i});try{let r=await e(`/get-session`,{method:`GET`,query:t?.query,signal:n.signal});if(n.signal.aborted){o(n);return}let{data:s,error:c}=Py(r);if(s?.needsRefresh)try{let t=await e(`/get-session`,{method:`POST`,signal:n.signal});if(n.signal.aborted){o(n);return}({data:s,error:c}=Py(t))}catch{if(n.signal.aborted){o(n);return}}if(c){let e=a.get(),t=c?.status===401;a.set({data:t?null:e.data,error:c,isPending:!1,isRefetching:!1,refetch:i});return}let l=Fy(s),u=a.get(),d=u.data!=null&&l!=null&&vy(u.data,l)?u.data:l;a.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:i})}catch(e){if(n.signal.aborted){o(n);return}let t=a.get();a.set({data:t.data,error:e,isPending:!1,isRefetching:!1,refetch:i})}},c=()=>{};return hy(a,()=>{let e;Ny()||(e=setTimeout(()=>{s()},0));let i=My({fetchSession:s,shouldPollSession:()=>a.get().data!=null,sessionSignal:n,options:t});return i.init(),c=i.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=r;t?.abort(),t&&o(t),i.cleanup()}}),{session:a,$sessionSignal:n,broadcastSessionUpdate:e=>c(e)}}function Ry(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function zy(e,t,n=`.`,r){if(!Ry(t))return zy(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:Ry(a)&&Ry(i[t])?i[t]=zy(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function By(e){return(...t)=>t.reduce((t,n)=>zy(t,n,``,e),{})}var Vy=By(),Hy=Object.defineProperty,Uy=Object.defineProperties,Wy=Object.getOwnPropertyDescriptors,Gy=Object.getOwnPropertySymbols,Ky=Object.prototype.hasOwnProperty,qy=Object.prototype.propertyIsEnumerable,Jy=(e,t,n)=>t in e?Hy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yy=(e,t)=>{for(var n in t||={})Ky.call(t,n)&&Jy(e,n,t[n]);if(Gy)for(var n of Gy(t))qy.call(t,n)&&Jy(e,n,t[n]);return e},Xy=(e,t)=>Uy(e,Wy(t)),Zy=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},Qy=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},$y=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},eb=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function tb(e){if(typeof e==`number`)return new $y({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new $y(e);case`exponential`:return new eb(e);default:throw Error(`Invalid retry strategy`)}}var nb=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},rb=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function ib(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return rb.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function ab(e){try{return JSON.parse(e),!0}catch{return!1}}function ob(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function sb(e){try{return JSON.parse(e)}catch{return e}}function cb(e){return typeof e==`function`}function lb(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&cb(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&cb(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function ub(...e){let t={};for(let n of e)if(n)if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}return t}async function db(e){let t=new Headers(ub(e?.headers,await nb(e)));if(!t.has(`content-type`)){let n=fb(e?.body);n&&t.set(`content-type`,n)}return t}function fb(e){return ob(e)?`application/json`:null}function pb(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function mb(e,t){let{body:n}=e;return n?!ob(n)||typeof n==`string`?n:pb(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function hb(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return yb.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function gb(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var _b=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function vb(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new _b(n.issues);return n.value}var yb=[`get`,`post`,`put`,`patch`,`delete`],bb=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``)),e.startsWith(`/`)&&e.charAt(1)===`@`&&(e=e.substring(1));let i=r.schema[e];if(i){let e=n?.headers;if(i.headers&&!n?.disableValidation){let t={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((e,n)=>{t[n.toLowerCase()]=e});else if(typeof n.headers==`object`)for(let[e,r]of Object.entries(n.headers))r!=null&&(t[e.toLowerCase()]=r)}let r=await vb(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=Xy(Yy({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=Xy(Yy({},r),{body:i.input?await vb(i.input,n?.body):n?.body,params:i.params?await vb(i.params,n?.params):n?.params,query:i.query?await vb(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),xb=e=>{async function t(t,n){let r=Xy(Yy(Yy({},e),n),{headers:ub(e?.headers,n?.headers),plugins:[...e?.plugins||[],bb(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await Tb(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await Tb(t,r)}return t},Sb=e=>e===`.`||e===`..`;function Cb(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(Sb(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function wb(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];yb.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}let l=new Map;if(r)if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];l.set(n,String(e))}}else for(let[e,t]of Object.entries(r))l.set(`:${e}`,String(t));o=o.split(`/`).map(e=>Cb(e,l)).join(`/`),o=o.replace(/^\/+/,``);let u=c.toString();return u=u.length>0?`?${u}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${u}`,a):`${a}${o}${u}`}var Tb=async(e,t)=>{let{hooks:n,url:r,options:i}=await Qy(e,t),a=lb(i),o=new AbortController,s=i.signal??o.signal,c=wb(r,i),l=await db(i),u=mb(i,l),d=hb(r,i),f=Xy(Yy({},i),{url:c,headers:l,body:u,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&Object.assign(f,t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=gb(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(Xy(Yy({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=ib(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??sb)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await vb(f.output,r.data));for(let e of n.onSuccess)e&&await e(Xy(Yy({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??sb,_=await m.text(),v=ab(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:Xy(Yy({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(Xy(Yy({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=tb(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await Tb(e,Xy(Yy({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new Zy(m.status,m.statusText,v?y:_);return{data:null,error:Xy(Yy({},y),{status:m.status,statusText:m.statusText})}},Eb=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Db=(e,t)=>{let n=`credentials`in Request.prototype,r=Wv(e?.baseURL,e?.basePath,void 0,t)??Eb(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=xb({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?$v(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[ny],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=Ly(d,e),h=e?.plugins||[],g={},_={$sessionSignal:f,session:p},v={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},y=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of h)e.getAtoms&&Object.assign(_,e.getAtoms?.(d)),e.pathMethods&&Object.assign(v,e.pathMethods),e.atomListeners&&y.push(...e.atomListeners);let b={notify:e=>{_[e].set(!_[e].get())},listen:(e,t)=>{_[e].subscribe(t)},atoms:_};for(let t of h)t.getActions&&(g=Vy(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function Ob(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function kb(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ab=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,jb=/['\u2019]/g;function Mb(e){return e.replace(jb,``).match(Ab)??[]}function Nb(e){return Mb(e).map(e=>e.toLowerCase()).join(`-`)}function Pb(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Fb(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||Ob(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(Nb).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Pb(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function Ib(e,t={}){let n=(0,z.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,z.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?gy(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,z.useSyncExternalStore)(a,o,o)}function Lb(e){return`use${kb(e)}`}function Rb(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:i,$store:a,atomListeners:o}=Db(e),s={};for(let[e,t]of Object.entries(r))s[Lb(e)]=()=>Ib(t);return Fb({...n,...s,$fetch:i,$store:a},i,t,r,o)}var zb=`1.6.20`,Bb=()=>({id:`device-authorization`,version:zb,$InferServerPlugin:{},pathMethods:{"/device/code":`POST`,"/device/token":`POST`,"/device":`GET`,"/device/approve":`POST`,"/device/deny":`POST`}}),Vb=Mv({OTP_EXPIRED:`OTP expired`,INVALID_OTP:`Invalid OTP`,TOO_MANY_ATTEMPTS:`Too many attempts`}),Hb=()=>({id:`email-otp`,version:zb,$InferServerPlugin:{},atomListeners:[{matcher:e=>e===`/email-otp/verify-email`||e===`/sign-in/email-otp`||e===`/email-otp/request-email-change`,signal:`$sessionSignal`}],$ERROR_CODES:Vb}),Ub=`/console/api/auth`;function Wb(e=globalThis.location){return qb()||(e?`${Gb(e.origin)}${Ub}`:`${Kb}${Ub}`)}function Gb(e){return e.endsWith(`/`)?e.slice(0,-1):e}var Kb=`http://127.0.0.1:3000`;function qb(){let e=Jb(`BETTER_AUTH_URL`)??Jb(`PUBLIC_BETTER_AUTH_URL`)??Yb(`VITE_BETTER_AUTH_URL`);return e?Gb(e):void 0}function Jb(e){return typeof process>`u`?void 0:{}[e]?.trim()||void 0}function Yb(e){return{BASE_URL:`/console/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_CLIENT_OUTPUT_DIR:`dist/client`,TSS_DEV_SERVER:`false`,TSS_ROUTER_BASEPATH:`console`,TSS_SERVER_FN_BASE:`/console/_serverFn/`}[e]?.trim()||void 0}var Xb=Rb({baseURL:Zb(),plugins:[Bb(),Hb()]});function Zb(){return Wb(globalThis.location===void 0?void 0:globalThis.location)}var Qb=`http://console.invalid`,$b=`/console`,ex=`/runs`,tx=[`/signin`,`/signup`,`/forgot-password`,`/reset-password`,`/device`];function nx(e){let t=sx(e);return tx.some(e=>t===e||t.startsWith(`${e}/`))}function rx(e){let t=sx(e);return!(t.startsWith(`/api/`)||nx(t))}function ix(e){if(e==null)return ex;let t=e.trim();if(!t.startsWith(`/`)||t.startsWith(`//`)||t.includes(`\\`))return ex;let n;try{n=new URL(t,Qb)}catch{return ex}if(n.origin!==Qb)return ex;let r=sx(n.pathname);return!cx(r)||!lx(r)?ex:`${r}${n.search}${n.hash}`}function ax(e){return`${e.pathname}${e.searchStr}`}function ox(e){return`${$b}${ix(e)}`}function sx(e){let t;try{t=new URL(e,Qb).pathname}catch{t=`/`}return t===$b?`/`:t.startsWith(`${$b}/`)?t.slice(8):t||`/`}function cx(e){try{let t=decodeURIComponent(e);return!t.startsWith(`//`)&&!t.startsWith(`/\\`)}catch{return!1}}function lx(e){return rx(e)||e===`/device`}var ux=(0,z.createContext)(null);function dx(){let e=(0,z.useContext)(ux);if(e===null)throw Error(`useConsoleSession must be used inside App`);return e}function fx(e){let t=Ic(),n=Lo(),r=fo(),i=Xb.useSession(),a=i.data?.user,o=ax(n),s=rx(n.pathname),c=nx(n.pathname),l=a==null&&s,[u,d]=(0,z.useState)(!1);(0,z.useEffect)(()=>{i.isPending||d(!0)},[i.isPending]);let f=(0,z.useCallback)(async()=>{await i.refetch()},[i.refetch]),p=(0,z.useCallback)(async()=>{await Xb.signOut(),t.clear(),await r({to:`/signin`,search:{redirect:ix(o)},replace:!0})},[r,o,t]);return(0,z.useEffect)(()=>{i.isPending||!l||r({to:`/signin`,search:{redirect:ix(o)},replace:!0})},[l,r,o,i.isPending]),i.isPending&&!u?null:a==null?l?null:(0,R.jsx)(R.Fragment,{children:e.children}):(0,R.jsx)(ux.Provider,{value:{user:a,refreshSession:f,onSignOut:p},children:c?e.children:(0,R.jsx)(px,{children:e.children})})}function px(e){let{onSignOut:t,user:n}=dx(),r=Rl();return(0,R.jsx)(sv,{connection:r.isError?r.data===void 0?`error`:`degraded`:r.isPending?`pending`:`ok`,user:n,onSignOut:t,children:e.children})}var mx=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%3e%3ctitle%3eFlakes%3c/title%3e%3cdefs%3e%3ccircle%20id='n'%20cx='12'%20cy='4.2'%20r='1.9'%20fill='%2310b981'/%3e%3c/defs%3e%3cuse%20href='%23n'/%3e%3cuse%20href='%23n'%20transform='rotate(60%2012%2012)'/%3e%3cuse%20href='%23n'%20transform='rotate(120%2012%2012)'/%3e%3cuse%20href='%23n'%20transform='rotate(180%2012%2012)'/%3e%3cuse%20href='%23n'%20transform='rotate(240%2012%2012)'/%3e%3cuse%20href='%23n'%20transform='rotate(300%2012%2012)'/%3e%3ccircle%20cx='12'%20cy='12'%20r='2.4'%20fill='%2310b981'/%3e%3c/svg%3e`,hx=`/console/assets/styles-8wEqfToJ.css`,gx=`modulepreload`,_x=function(e){return`/console/`+e},vx={},yx=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=_x(t,n),t in vx)return;vx[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:gx,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},bx=mo({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1.0`},{title:`flakes console`}],links:[{rel:`stylesheet`,href:hx},{rel:`icon`,type:`image/svg+xml`,href:mx}]}),component:xx});function xx(){let[e,t]=(0,z.useState)(!1);(0,z.useEffect)(()=>{t(!0),X_()},[]);let[n]=(0,z.useState)(wx);return(0,R.jsx)(Sx,{children:(0,R.jsxs)(Lc,{client:n,children:[(0,R.jsx)(fx,{children:(0,R.jsx)(z.Suspense,{fallback:(0,R.jsx)(Cx,{}),children:(0,R.jsx)(Ao,{})})}),null]})})}function Sx({children:e}){return(0,R.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,R.jsx)(`head`,{children:(0,R.jsx)(Ho,{})}),(0,R.jsxs)(`body`,{className:`flex min-h-screen flex-col`,children:[e,(0,R.jsx)(Uo,{})]})]})}function Cx(){return(0,R.jsx)(`section`,{className:`grid min-h-72 place-items-center p-8`,children:(0,R.jsx)(nl,{className:`size-5 animate-spin text-muted-foreground`})})}function wx(){return new Pc({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0}}})}var Tx=ho(`/signup`)({validateSearch:e=>({redirect:ix(typeof e.redirect==`string`?e.redirect:void 0)}),component:yo(()=>yx(()=>import(`./signup-KmFQL_1g.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),`component`)}),Ex=ho(`/signin`)({validateSearch:e=>({redirect:ix(typeof e.redirect==`string`?e.redirect:void 0)}),component:yo(()=>yx(()=>import(`./signin-DylILjyG.js`),__vite__mapDeps([11,1,2,3,5,4,6,7,9,10])),`component`)}),Dx=ho(`/sandboxes`)({validateSearch:e=>({runId:typeof e.runId==`string`?e.runId:void 0}),component:yo(()=>yx(()=>import(`./sandboxes-BBIIbVN8.js`),__vite__mapDeps([12,1])),`component`)}),Ox=ho(`/runs`)({validateSearch:e=>{let t=e.state;return t===`RUNNING`||t===`SUCCEEDED`||t===`FAILED`?{state:t}:{}},component:yo(()=>yx(()=>import(`./runs-Cuk0VOVi.js`),__vite__mapDeps([13,1])),`component`)}),kx=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Ax(e){let t=e.email.trim().toLowerCase(),n=e.password,r={};return kx.test(t)||(r.email=`Enter a valid email address.`),n.length===0&&(r.password=`Enter your password.`),Object.keys(r).length>0?{ok:!1,errors:r}:{ok:!0,data:{email:t,password:n}}}function jx(e){let t=e.name.trim(),n=e.email.trim().toLowerCase(),r=e.password,i={};return t.length===0&&(i.name=`Enter your name.`),kx.test(n)||(i.email=`Enter a valid email address.`),r.length<8&&(i.password=`Use at least 8 characters for the password.`),Object.keys(i).length>0?{ok:!1,errors:i}:{ok:!0,data:{name:t,email:n,password:r}}}function Mx(e){let t=e.password,n=e.confirmPassword,r={};return t.length<8&&(r.password=`Use at least 8 characters for the password.`),(n.length===0||n!==t)&&(r.confirmPassword=`Passwords must match.`),Object.keys(r).length>0?{ok:!1,errors:r}:{ok:!0,data:{password:t,confirmPassword:n}}}function Nx(e){let t=e.name.trim(),n={};return t.length===0&&(n.name=`Enter your name.`),Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,data:{name:t}}}function Px(e){let t=e.currentPassword,n=e.newPassword,r=e.confirmPassword,i={};return t.length===0&&(i.currentPassword=`Enter your current password.`),n.length<8?i.newPassword=`Use at least 8 characters for the new password.`:n===t&&(i.newPassword=`Choose a different password.`),(r.length===0||r!==n)&&(i.confirmPassword=`Passwords must match.`),Object.keys(i).length>0?{ok:!1,errors:i}:{ok:!0,data:{currentPassword:t,newPassword:n,confirmPassword:r}}}function Fx(e){let t=zx(e.token)??zx(e.code);return t===``?null:t}function Ix(e){let t=Bx(e,`code`).toLowerCase(),n=Bx(e,`statusText`).toLowerCase(),r=Vx(e).toLowerCase();return t===`invalid_token`||n===`invalid_token`||(r.includes(`token`)||r.includes(`link`))&&(r.includes(`invalid`)||r.includes(`expired`)||r.includes(`expire`))}function Lx(e,t=`Authentication failed.`){let n=Vx(e),r=n.toLowerCase();return Rx(e)?`Please verify your email before signing in.`:r.includes(`already exists`)||r.includes(`already registered`)?`An account already exists for that email.`:r.includes(`invalid email or password`)||r.includes(`invalid credentials`)?`Email or password is incorrect.`:n||t}function Rx(e){let t=Vx(e).toLowerCase();return t.includes(`email not verified`)||t.includes(`verify your email`)}function zx(e){return typeof e==`string`?e.trim():null}function Bx(e,t){if(typeof e==`object`&&e&&t in e){let n=e[t];return typeof n==`string`?n:``}return``}function Vx(e){if(typeof e==`object`&&e&&`message`in e){let t=e.message;return typeof t==`string`?t:``}return e instanceof Error?e.message:``}var Hx=ho(`/reset-password`)({validateSearch:e=>({redirect:ix(typeof e.redirect==`string`?e.redirect:void 0),token:Fx(e),error:typeof e.error==`string`?e.error:null}),component:yo(()=>yx(()=>import(`./reset-password-tImCgEn0.js`),__vite__mapDeps([14,1,2,3,4,6,7,9,10])),`component`)}),Ux=ho(`/forgot-password`)({validateSearch:e=>({redirect:ix(typeof e.redirect==`string`?e.redirect:void 0)}),component:yo(()=>yx(()=>import(`./forgot-password-C7qvwcpm.js`),__vite__mapDeps([15,1,2,3,4,6,7,9,10])),`component`)}),Wx=`---
53
- title: Concepts
54
- description: Core vocabulary for runs, tasks, hosts, sandboxes, and task outputs.
55
- ---
56
-
57
- This page defines the terms used across the hosted-console documentation. It is
58
- for product users, host operators, and workflow authors, not a protocol or
59
- storage reference.
60
-
61
- For parent-task authoring, see [Harnesses](/docs/harnesses).
62
-
63
- ## Terms
64
-
65
- ### Run
66
-
67
- A **run** is the durable container for related work. A run holds the tasks you
68
- save, the tasks admitted for execution, and the history needed to inspect what
69
- happened later. Close a run when no more top-level tasks should be added.
70
-
71
- ### Task
72
-
73
- A **task** is one unit of work inside a run. It has instructions, target
74
- execution requirements, optional inputs and outputs, and a final result.
75
- Tasks can be created directly by a user or integrator, or spawned by a running
76
- parent task.
77
-
78
- ### Group
79
-
80
- A **group** is a durable phase owned by a running parent task. The parent opens
81
- the group, spawns fresh child tasks into it, closes the child set, and waits
82
- for the group to settle. Harnesses use groups for phases such as draft, review,
83
- revise, and promote.
84
-
85
- ### Assignment
86
-
87
- An **assignment** is Flakes saying that one sandbox currently owns one task.
88
- When a task reports activity, output, or a final result, Flakes checks that the
89
- report comes from the current assignment. That keeps stale retries or late
90
- updates from replacing newer task state.
91
-
92
- ### Host
93
-
94
- A **host** is the Linux or Mac machine that runs the Flakes host agent. The host
95
- connects user-supplied capacity to Flakes and keeps local configuration,
96
- credentials, paths, mounts, and tool details on that machine. Flakes only needs
97
- the sanitized capacity information required to decide where work can run.
98
-
99
- ### Sandbox
100
-
101
- A **sandbox** is the execution environment where assigned tasks run. It may be a
102
- VM, container, local environment, or another isolated runtime started from host
103
- capacity. The sandbox is what Flakes schedules for task execution.
104
-
105
- ### Thread
106
-
107
- A **thread** is one active task execution inside a sandbox. It includes the
108
- task's running agent process, task-local files, session record, messages, and
109
- result handling for the current assignment.
110
-
111
- ### Workpad
112
-
113
- A **workpad** is the durable Markdown note attached to a task. Humans and
114
- agents use it for plans, progress, decisions, and handoffs. It is saved with
115
- version checks so a stale update does not overwrite newer edits.
116
-
117
- ### Transcript
118
-
119
- A **transcript** is the saved agent session record for a task. Use it when you
120
- need to inspect what the agent saw, said, and did during execution. A transcript
121
- is evidence, not the task result by itself.
122
-
123
- ### Artifact
124
-
125
- An **artifact** is an optional managed file or blob that a task consumes or
126
- produces. Use artifacts for concrete deliverables such as reports, logs,
127
- datasets, images, or archives. A task can still be useful without declaring an
128
- artifact when the result is captured by status, workpad, activity, or a
129
- workspace handle.
130
-
131
- ### Workspace Handle
132
-
133
- A **workspace handle** is an immutable, git-backed reference to bounded paths in
134
- a run workspace. Harnesses use workspace handles to pass repo-shaped state to
135
- children and to receive bounded candidate changes back from them. The handle is
136
- a reference to committed state, not a shared mutable directory.
137
-
138
- ## Host, Sandbox, And Task Thread
139
-
140
- These three terms often appear together, but they are different layers.
141
-
142
- | Question | Host | Sandbox | Task thread |
143
- | --- | --- | --- | --- |
144
- | What is it? | The machine running the host agent. | The environment that can run assigned tasks. | One active task execution inside that environment. |
145
- | What owns it? | The host owns capacity and local configuration. | The sandbox is what Flakes schedules. | The task thread is the running attempt for one assignment. |
146
- | Who cares most? | Host operators. | Host operators and workflow authors. | Workflow authors and users inspecting task detail. |
147
- | What is visible in the product? | Host status and advertised capacity. | Task placement and runtime capability. | Task activity, workpad changes, transcripts, artifacts, and results. |
148
- | What should not be mixed up? | A host is not the task itself. | A sandbox is not a whole run. | A thread is not durable workflow state by itself. |
149
-
150
- The practical rule: connect and operate hosts, let Flakes schedule sandboxes,
151
- and inspect task threads when you need to understand a specific running or
152
- completed task.
153
- `,Gx=`---
154
- title: Connect A Host
155
- description: Onboard user-supplied host capacity, configure pools, and run the host agent.
156
- ---
157
-
158
- Connect a host when you want Flakes to run task work on compute you provide.
159
- The setup path starts from a hosted account, creates a host directly from the
160
- authenticated CLI, writes credentials locally on the host, and then keeps a
161
- host agent connected to \`https://flakes.dev\`.
162
-
163
- ## Prerequisites
164
-
165
- Use this page on the physical Linux or Mac machine that will run the Flakes host
166
- agent and start MatchLock sandboxes.
167
-
168
- You need:
169
-
170
- - A signed-in account at \`https://flakes.dev/console\`.
171
- - The \`flakes\` CLI available on the host machine.
172
- - MatchLock available on the host machine.
173
- - A workspace directory for sandbox work.
174
-
175
- Host setup is a CLI/direct user auth flow. Do not route raw host credentials
176
- through the browser console, and do not assume the web console can display host
177
- secrets. The setup route returns the raw host credential exactly once to the
178
- CLI so the host can persist it locally.
179
-
180
- ## 1. Authorize The CLI
181
-
182
- Authorize the CLI on the host machine against the hosted API:
183
-
184
- \`\`\`sh
185
- flakes auth login
186
- flakes auth status
187
- \`\`\`
188
-
189
- \`flakes host setup\` uses this stored CLI credential. If no valid credential is
190
- available, setup can start the same device authorization flow before creating
191
- the host.
192
-
193
- ## 2. Create The Host
194
-
195
- Run setup on the host machine:
196
-
197
- \`\`\`sh
198
- flakes host setup --config <host.toml>
199
- \`\`\`
200
-
201
- Setup calls the direct host setup API using CLI user auth. The server creates
202
- the host and its first host-scoped credential in one transaction, then returns
203
- the raw credential exactly once so the CLI can write it to a protected local
204
- credential file. Command output and browser console responses should expose
205
- credential summaries, not the secret value.
206
-
207
- By default, setup writes under the user's Flakes config directory. Passing
208
- \`--config\`, \`--credential-file\`, and \`--state-dir\` lets you choose explicit host
209
- paths.
210
-
211
- ## 3. Add Pools To The Host Config
212
-
213
- \`flakes host setup\` writes the host identity and credential reference first. Add
214
- one or more \`[[pools]]\` entries before starting the host agent:
215
-
216
- \`\`\`toml
217
- controlPlaneUrl = "https://flakes.dev"
218
- hostId = "host_..."
219
- credentialFile = "/home/flakes/.config/flakes/host.credential"
220
- stateDir = "/home/flakes/.config/flakes/state"
221
-
222
- [[pools]]
223
- poolKey = "local-pi"
224
- matchlockImage = "registry.example.com/flakes/pi:latest"
225
- workspace = "/srv/flakes/workspaces"
226
- adapter = "pi"
227
- maxInstances = 2
228
- maxConcurrency = 1
229
- advertisedCapabilities = ["pi"]
230
-
231
- [pools.executablePaths]
232
- matchlock = "/usr/local/bin/matchlock"
233
-
234
- [pools.resourceBounds]
235
- cpus = 4
236
- memoryMb = 8192
237
- \`\`\`
238
-
239
- Pool config is host-local. The host uses values such as \`matchlockImage\`,
240
- \`workspace\`, \`credentialFile\`, \`stateDir\`, executable paths, mounts, and
241
- environment values locally. When the host connects, Flakes receives a sanitized
242
- pool advertisement: pool key, provider, adapter, capacity limits, advertised
243
- capabilities, and safe resource bounds.
244
-
245
- ## 4. Check Status
246
-
247
- Validate the local config and read the remote host summary:
248
-
249
- \`\`\`sh
250
- flakes host status --config <host.toml>
251
- \`\`\`
252
-
253
- The command checks that the credential file is private, the host config is
254
- valid, and the configured pools can be advertised. When the CLI has a valid
255
- stored user credential, it also reads remote host, pool, and credential
256
- summaries for the same account.
257
-
258
- ## 5. Run The Host Agent
259
-
260
- Start the host process:
261
-
262
- \`\`\`sh
263
- flakes host run --config <host.toml>
264
- \`\`\`
265
-
266
- Keep this process running on the host. It connects to the hosted control plane,
267
- advertises sanitized pool capacity, claims matching launch work, starts
268
- MatchLock only after the control plane accepts the claim, and reports lifecycle
269
- results back to Flakes.
270
-
271
- The host status moves through \`created\`, \`offline\`, \`online\`, and \`disabled\`.
272
- Pools become schedulable only after the running host connects and Flakes
273
- acknowledges the pool snapshot.
274
-
275
- ## Credential Handling
276
-
277
- Host credentials are separate from user CLI credentials:
278
-
279
- - \`flakes auth login\` stores a user CLI
280
- credential for the hosted API.
281
- - \`flakes host setup\` uses that user credential to create a host and first
282
- host-scoped credential, then writes the raw host credential only to the local
283
- credential file.
284
- - \`flakes host run\` reads the host credential file and uses the host-scoped
285
- credential to connect as that host.
286
- - \`flakes host rotate --config <host.toml>\` rotates the host-scoped credential
287
- through direct CLI user auth, writes the new raw host credential only to the
288
- credential file, and requires restarting \`flakes host run\` before claiming new
289
- launch work.
290
-
291
- The web console in the browser is for operating and observing Flakes. It should
292
- not expose raw host credential setup or rotation flows.
293
- `,Kx=`---
294
- title: Get Started
295
- description: Sign in to flakes.dev, authorize the CLI, and prepare the first hosted workflow.
296
- ---
297
-
298
- Start here to sign in to the hosted console, authorize the CLI against
299
- \`https://flakes.dev\`, and decide whether you need to connect user-supplied host
300
- capacity before running work.
301
-
302
- ## Before You Start
303
-
304
- You need a Flakes account and the \`flakes\` CLI available on your machine. This
305
- page assumes the CLI is already installed by your team or account setup; it does
306
- not document an install method that is not yet part of the public hosted path.
307
-
308
- ## 1. Sign In To The Console
309
-
310
- Open \`https://flakes.dev/console\` and sign in or create an account. The console
311
- is where you review runs, watch task activity, inspect workpads and artifacts,
312
- respond to permission requests, and send live input.
313
-
314
- ## 2. Authorize The CLI
315
-
316
- Authorize the local CLI against the hosted API:
317
-
318
- \`\`\`sh
319
- flakes auth login
320
- \`\`\`
321
-
322
- The command starts a device authorization flow. Approve the request in the
323
- browser while signed in to the console. After approval, the CLI stores a Better
324
- Auth credential for \`https://flakes.dev\` in the local CLI credential store.
325
-
326
- Check the stored CLI credential:
327
-
328
- \`\`\`sh
329
- flakes auth status
330
- \`\`\`
331
-
332
- Run, task, artifact, and host setup commands use that stored CLI credential
333
- automatically. You should not need to handle a raw hosted API credential during
334
- normal first-run setup.
335
-
336
- ## 3. Confirm Host Capacity
337
-
338
- Flakes runs task work on host capacity connected to your account. If a host is
339
- already online for your account, continue to [Run Work](/docs/run-work).
340
-
341
- If you need to connect a user-supplied host, continue to
342
- [Connect A Host](/docs/connect-a-host). Host setup is a CLI flow that uses your
343
- stored CLI credential to create a host and first host-scoped credential, writes
344
- that credential locally, and then starts the host agent.
345
-
346
- ## 4. Keep The Console Open
347
-
348
- The console is the primary operating surface after the CLI is authorized. Use it
349
- to follow the first run, inspect task history, and steer work while the host
350
- agent stays connected.
351
- `,qx=`---
352
- title: Harnesses
353
- description: Author durable parent tasks that spawn, wait for, and resume child work.
354
- ---
355
-
356
- A harness is a TypeScript task that coordinates other tasks. Use one when a
357
- workflow needs durable fan-out, review/revise loops, staged workspace handoffs,
358
- or a parent task that can pause while children run and later resume from saved
359
- state.
360
-
361
- For vocabulary used here, see [Concepts](/docs/concepts).
362
-
363
- ## When To Use A Harness
364
-
365
- Use the Harness SDK when the parent task needs to make decisions while work is
366
- running:
367
-
368
- - split a larger job into child tasks and collect their declared outputs;
369
- - run phases such as draft, review, revise, and promote;
370
- - wait for a group of children without keeping a local process alive;
371
- - pass repo-shaped state through workspace handles;
372
- - rebuild its next step after a yielded wait, retry, or sandbox change.
373
-
374
- Do not use a harness for a single prompt, a static dependency graph, or a job
375
- that only needs ordinary task creation from the console or CLI. In those cases,
376
- save normal tasks and dependencies from the Run Work flow.
377
-
378
- ## Where Harness Code Runs
379
-
380
- Harness code runs only when a task using the \`harness\` adapter is assigned to a
381
- sandbox. It does not run in the console, the CLI, the host process, or as a
382
- privileged control-plane script.
383
-
384
- The product path is:
385
-
386
- 1. You write and check a harness module.
387
- 2. You submit it as an ordinary task with \`--adapter harness\`.
388
- 3. Flakes schedules that task onto a sandbox that can run the harness adapter.
389
- 4. The harness opens groups, spawns children, waits, resumes, and returns a
390
- normal task result.
391
-
392
- The main package name a harness author needs is \`@flakes/harness-sdk\`, used for
393
- the \`defineHarness(...)\` import in the module source.
394
-
395
- ## Start From A Template
396
-
397
- Create a starter harness, then run the checker before submitting it:
398
-
399
- \`\`\`bash
400
- flakes harness init --template paper --dir harnesses
401
- flakes harness check harnesses/paper-writer.ts
402
- \`\`\`
403
-
404
- The current CLI starter templates are:
405
-
406
- - \`paper\`
407
- - \`review-revise\`
408
- - \`fanout-fanin\`
409
- - \`autowrite\`
410
- - \`autoresearch\`
411
-
412
- The SDK source also includes \`fix-review-live.ts\` for live implementer/reviewer
413
- loops. Use it only when the child adapter advertises live task round support.
414
-
415
- If a template uses \`ctx.pi(...)\` without explicit child agent IDs, provide
416
- checker defaults:
417
-
418
- \`\`\`bash
419
- cat > harnesses/defaults.json <<'JSON'
420
- { "agents": { "pi": "agent_pi_writer" } }
421
- JSON
422
-
423
- flakes harness check harnesses/paper-writer.ts \\
424
- --defaults harnesses/defaults.json
425
- \`\`\`
426
-
427
- Submit a checked module as a normal task:
428
-
429
- \`\`\`bash
430
- flakes tasks save \\
431
- --run paper-run \\
432
- --key paper-planner \\
433
- --title "Paper planner" \\
434
- --adapter harness \\
435
- --harness-file harnesses/paper-writer.ts \\
436
- --tool-grant flakes.tasks.spawn \\
437
- --tool-grant flakes.groups.open \\
438
- --tool-grant flakes.groups.close \\
439
- --tool-grant flakes.groups.wait \\
440
- --tool-grant flakes.workspace.commit \\
441
- --tool-grant flakes.workspace.resolve \\
442
- --tool-grant flakes.workspace.promote \\
443
- --tool-grant flakes.childOutputs.read
444
-
445
- flakes tasks admit --run paper-run paper-planner
446
- \`\`\`
447
-
448
- ## Groups, Spawn, Wait, And Resume
449
-
450
- Harnesses build around durable groups. A group is one named phase owned by the
451
- running parent task. In code, \`ctx.group(...)\` opens the group, lets you call
452
- \`group.spawn(...)\` for children, closes the child set, and waits for the group
453
- to settle.
454
-
455
- \`\`\`ts
456
- import { defineHarness } from "@flakes/harness-sdk";
457
-
458
- export default defineHarness(async (ctx) => {
459
- const draft = await ctx.group(
460
- "draft-sections",
461
- { join: "all_success", maxChildren: 2 },
462
- (group) => {
463
- group.spawn(
464
- "intro",
465
- ctx.pi({
466
- title: "Draft introduction",
467
- prompt: "Write the introduction and publish notes.",
468
- outputs: {
469
- notes: ctx.output.json({ required: true }),
470
- },
471
- }),
472
- );
473
- },
474
- );
475
-
476
- ctx.requireGroupSuccess(draft);
477
- const notes = await ctx.outputs.readJson(draft, "intro", "notes");
478
- return ctx.succeeded({ data: { notes } });
479
- });
480
- \`\`\`
481
-
482
- If the group is not terminal yet, Flakes can yield the current assignment. The
483
- logical parent task is scheduled again after the wait condition is satisfied.
484
- Resume is reconstruction, not a live JavaScript continuation: use stable group
485
- keys, child keys, output keys, workspace labels, and promotion labels, then
486
- rebuild decisions from durable group status, child outputs, workpad snapshots,
487
- and promotion records.
488
-
489
- ## Workspace Handles
490
-
491
- Workspace handles are immutable, git-backed references to bounded paths in a
492
- run workspace. Use them for repo-shaped handoffs instead of copying directories
493
- or sharing a mutable worktree.
494
-
495
- The normal pattern is:
496
-
497
- 1. Commit bounded parent paths with \`ctx.workspace.commit(...)\`.
498
- 2. Pass the returned handle to children in their \`inputs\`.
499
- 3. Require children to publish bounded workspace outputs.
500
- 4. Read a child candidate with \`ctx.outputs.workspace(...)\`.
501
- 5. Review and promote selected paths with \`ctx.workspace.promote(...)\`.
502
-
503
- \`\`\`ts
504
- const base = await ctx.workspace.commit("paper-base", {
505
- paths: ["paper", ".harness/plan.json"],
506
- message: "Base paper state",
507
- });
508
-
509
- const draft = await ctx.group("draft", { join: "all_success" }, (group) => {
510
- group.spawn(
511
- "intro",
512
- ctx.pi({
513
- title: "Draft intro",
514
- prompt: "Edit work/paper/intro.md and publish a candidate.",
515
- inputs: { "work/": base },
516
- outputs: {
517
- candidate: ctx.output.workspace({
518
- paths: ["work/paper/intro.md"],
519
- required: true,
520
- }),
521
- },
522
- }),
523
- );
524
- });
525
-
526
- ctx.requireGroupSuccess(draft);
527
- const candidate = await ctx.outputs.workspace(draft, "intro", "candidate");
528
-
529
- await ctx.workspace.promote("promote-intro", {
530
- base,
531
- candidate,
532
- paths: ["paper/intro.md"],
533
- mode: "replace_bounded_paths",
534
- conflictPolicy: "fail",
535
- });
536
- \`\`\`
537
-
538
- Small settings can go in child \`input\` or in bounded workspace files written by
539
- the parent before commit. Use workspace handles for source trees, papers,
540
- experiment folders, and other state where history and path boundaries matter.
541
-
542
- ## Current MVP Boundaries
543
-
544
- The current Harness SDK MVP supports direct child group orchestration, yielded
545
- wait/resume, declared terminal child outputs, child workpad snapshots, live
546
- round helpers for supported child adapters, and workspace handles.
547
-
548
- It does not support broad child browsing, spawned child \`inputArtifacts\`,
549
- shared mutable worktrees, arbitrary npm dependencies, unbounded loops without a
550
- clear budget, or control-plane-side TypeScript execution.
551
-
552
- Keep harnesses deterministic. Group keys, child keys, output keys, workspace
553
- labels, and promotion labels should come from stable workflow input, not random
554
- values or current time.
555
- `,Jx=`---
556
- title: Overview
557
- description: Hosted console docs for durable task runs on user-supplied hosts.
558
- ---
559
-
560
- Flakes runs at \`https://flakes.dev\` as a hosted console for coordinating durable
561
- agent work on user-supplied host capacity. The console at
562
- \`https://flakes.dev/console\` is the primary operating surface: use it to review
563
- runs, inspect task state, read transcripts and artifacts, respond to permission
564
- requests, and steer running work.
565
-
566
- Flakes keeps durable task history in the hosted control plane while work runs on
567
- hosts you provide. A host advertises one or more pools, Flakes matches ready
568
- tasks to compatible capacity, and the console remains the place to see what
569
- happened even when machines, sandboxes, or task runners disconnect and return
570
- later.
571
-
572
- ## What Flakes Does
573
-
574
- - Coordinates long-running agent tasks as durable runs instead of throwaway
575
- local sessions.
576
- - Lets users authorize the CLI against the hosted API without handling raw
577
- service credentials.
578
- - Connects user-supplied hosts that run the host agent and advertise sanitized
579
- pool capacity.
580
- - Preserves task activity, workpads, transcripts, artifacts, and permission
581
- events for review in the console.
582
-
583
- ## First-Run Path
584
-
585
- The hosted product path is:
586
-
587
- 1. Sign in at \`https://flakes.dev/console\`.
588
-
589
- 2. Authorize the CLI with \`flakes auth login\`.
590
-
591
- 3. Connect a user-supplied host with \`flakes host setup\` and
592
- \`flakes host run\`.
593
-
594
- 4. Create runs, save tasks with dependencies, admit ready work, and close a run
595
- when no more top-level tasks should be added.
596
-
597
- 5. Use the console to inspect task activity, live input, permission requests,
598
- transcripts, workpads, and artifacts.
599
-
600
- Start with [Get Started](/docs/get-started). If you are bringing your own
601
- capacity, continue to [Connect A Host](/docs/connect-a-host).
602
-
603
- Contributor build commands and repository internals are intentionally outside
604
- this first-read product path.
605
- `,Yx=`---
606
- title: Observe And Steer
607
- description: Inspect runs in the console, read task history, and send live input.
608
- ---
609
-
610
- Use the console at \`https://flakes.dev/console\` to watch durable work, inspect
611
- what an agent did, and send live input while a task is running.
612
-
613
- The important boundary: durable task state is the source of truth. Status,
614
- dependencies, workpads, activity, artifacts, and transcript pointers live in
615
- the control plane. A transient agent process, sandbox assignment, or local
616
- session can end and be replaced without erasing that durable task state.
617
-
618
- ## Runs
619
-
620
- The Runs page lists every run your account can read, newest first. Use the
621
- state filters for all, running, succeeded, or failed runs. Each row shows the
622
- run name, run id, current state, task progress, creation time, and last update.
623
- Open a row to inspect the run.
624
-
625
- Queued work is visible here as a running run whose task progress has not moved
626
- to terminal states yet. If a run remains active longer than expected, open the
627
- run and check whether tasks are waiting for capacity, waiting for dependencies,
628
- running on a sandbox, or blocked on input.
629
-
630
- ## Run Detail
631
-
632
- Run detail starts with the run state, elapsed time, task terminal count, and a
633
- download action for the run history. The Overview tab has three views:
634
-
635
- - Map: shows the task graph and dependency shape.
636
- - Timeline: shows queue time and execution time for each task.
637
- - By Sandbox: groups tasks by the sandbox that ran or is running them.
638
-
639
- The Tasks table is the operational list. It shows task number, task name,
640
- status, workpad version, sandbox, dependencies, accepted time, finished time,
641
- and a Task button that opens task detail.
642
-
643
- Other run tabs show declared artifacts, metrics, and active file reservations.
644
- Delete is available only after the run is terminal; it removes finished run
645
- history and is not a control for stopping active work.
646
-
647
- ## Task Detail
648
-
649
- Open a task from the run map, timeline, sandbox view, or Tasks table. Task
650
- detail shows the task brief, acceptance criteria, adapter, live round state when
651
- present, dependencies, sandbox, attempt, accepted time, heartbeat, and finished
652
- time.
653
-
654
- The Workpad panel is the durable task note. Use it for current plan, progress,
655
- findings, and handoff notes. The console saves with a version check, so if
656
- someone else updated the workpad first, your edit is rejected instead of
657
- silently overwriting newer text.
658
-
659
- The Activity panel is the short timeline for product events. It can show
660
- workpad edits, human input, live round events, \`permission.requested\`, and
661
- \`permission.responded\`. Activity is not a full transcript and does not replace
662
- the workpad.
663
-
664
- The Agent transcript panel shows the saved Pi session when the task uses the
665
- Pi adapter. Use Parsed for a readable conversation and tool view. Use Raw when
666
- you need the underlying session record. A transcript is evidence of what the
667
- agent did; it is not how Flakes decides whether the task succeeded.
668
-
669
- ## Steer Running Work
670
-
671
- The task transcript includes live input controls while the task is running:
672
-
673
- - Follow up: add information or answer a question from the agent.
674
- - Steer: nudge direction without replacing the task definition.
675
-
676
- The console queues the message and sends it to the active running task. The
677
- message is accepted only while the task is running on a connected sandbox. If
678
- the task has already finished, is waiting, or its sandbox is offline, the
679
- composer is disabled or the send fails and you can retry only after there is an
680
- active running assignment again.
681
-
682
- Live input does not edit the saved task. It is an event delivered to the
683
- current agent process. The durable record is the task state, activity entry,
684
- workpad, and transcript update that follow.
685
-
686
- ## Permission Requests
687
-
688
- When an adapter needs human approval, it can create a durable permission
689
- request. The task activity shows \`permission.requested\`; after a response is
690
- accepted it shows \`permission.responded\` with the decision.
691
-
692
- If your console deployment renders an inline permission prompt, answer it from
693
- the task page by approving or denying the request and include a reason when the
694
- prompt asks for one. A permission request accepts only one response. Flakes
695
- delivers the answer only to the active assignment for that task, so stale
696
- agents cannot receive answers for work they no longer own.
697
-
698
- Permission requests are always visible as durable activity events. Some
699
- deployments or integrations may also render an inline approval prompt in the
700
- console, but do not assume every task page has a general approve or deny
701
- control. When no control is visible, answer the request through the integration
702
- or API client that surfaced it, then use the console activity and transcript to
703
- confirm the response was recorded and delivered.
704
-
705
- ## What To Do By State
706
-
707
- | State | What it means | What you can do |
708
- | --- | --- | --- |
709
- | queued | The task is admitted but has not started. | Check dependencies, required capabilities, and connected host capacity. Usually the right action is to wait for capacity or connect capacity that advertises the needed adapter and capabilities. |
710
- | running | A sandbox currently owns the task. | Watch heartbeat, activity, workpad, and transcript. Send a follow-up or steer message if the agent needs more context. |
711
- | waiting | The task yielded because a durable wait condition is not satisfied. | Inspect the group or dependency that must settle. Do not expect the old process to resume; Flakes resumes the logical task from durable state when the wait condition resolves. |
712
- | failed | The task reached a terminal failure. | Open task detail, read the activity and transcript, inspect the workpad, and decide whether to create follow-up work in a new or still-open run. |
713
- | blocked on input | The task needs a human answer, such as a permission decision or missing context. | Use the visible prompt or live follow-up control when available. If no permission control is visible, respond through the client or integration that owns the prompt and verify \`permission.responded\` in activity. |
714
-
715
- For scheduling issues, start with the run Timeline and By Sandbox views. For
716
- agent behavior, start with task Activity, Workpad, and Agent transcript. For
717
- human intervention, use Follow up, Steer, and the permission response path
718
- available in your deployment.
719
- `,Xx='---\ntitle: Reference\ndescription: CLI commands, host configuration, selected API routes, and integrator exports for hosted Flakes.\n---\n\nUse this page after you understand the main workflows. It is a lookup for the\nhosted console at `https://flakes.dev`, the `flakes` CLI, user-supplied hosts,\nand selected integration surfaces.\n\nFor first-run steps, start with [Get Started](/docs/get-started). For host\nsetup, see [Connect A Host](/docs/connect-a-host).\n\n## CLI Command Reference\n\nCLI commands target the hosted control plane at `https://flakes.dev`. Most\ncommands use the stored credential from `flakes auth login`; commands that also\naccept `--token` are mainly for trusted automation.\n\n### Auth\n\n| Command | Use |\n| --- | --- |\n| `flakes auth login` | Start device authorization, open the browser approval page, and save the CLI credential. |\n| `flakes auth login --no-open` | Print the verification URL and user code without opening a browser. Useful on remote shells. |\n| `flakes auth login --timeout-ms 600000` | Wait longer for browser approval. |\n| `flakes auth status` | Show whether the stored CLI credential is authenticated, expired, or missing. |\n| `flakes auth logout` | Remove the stored CLI credential. |\n\n### Host Setup And Operation\n\n| Command | Use |\n| --- | --- |\n| `flakes host setup --config <host.toml>` | Create a host and first host-scoped credential through direct CLI user auth, then write the host config. |\n| `flakes host setup --config <host.toml> --credential-file <path> --state-dir <dir> --host-name <name>` | Override the credential file, state directory, or displayed host name. |\n| `flakes host setup --config <host.toml> --json` | Emit structured setup output with redacted host and credential summaries. The raw credential is not printed. |\n| `flakes host rotate --config <host.toml>` | Request a new host credential, write it to the configured credential file, and retire the replaced credential. Restart the host process afterward. |\n| `flakes host rotate --config <host.toml> --json` | Emit structured rotation output, including the new credential summary and next steps. The raw credential is not printed. |\n| `flakes host run --config <host.toml>` | Start the host runtime and connect capacity to Flakes. This process should stay running. |\n| `flakes host status --config <host.toml>` | Validate local config and, when a CLI credential is available, read remote host, pool, and credential status. |\n| `flakes host status --config <host.toml> --json` | Emit structured local and remote status. |\n\nSetup writes new files only when the target config and credential file do not\nalready exist. Setup and rotation require an authenticated CLI user credential\nfor the same hosted origin; they are direct user bearer auth flows, not console\nproxy flows.\n\n### Runs\n\n| Command | Use |\n| --- | --- |\n| `flakes runs create --key <run-key> --name "Release notes"` | Create or reuse a run identified by a stable run key. |\n| `flakes runs close <run-key>` | Close the run so no more top-level tasks can be admitted. |\n| `flakes runs close <run-key> --wait --timeout-ms 600000` | Close the run and poll until the run reaches a terminal state or the timeout expires. |\n| `flakes inspect <run-id-or-key>` | Read a run. A non-`run_` value is treated as a run key. |\n| `flakes inspect <task-id> --task` | Read a task explicitly. |\n| `flakes logs <task-id> --after <cursor> --limit <n>` | Read bounded task logs. |\n| `flakes metrics <run-id>` | Read run metrics. |\n\n### Tasks\n\n| Command | Use |\n| --- | --- |\n| `flakes tasks save --run <run-key> --key <task-key> --title "Draft" --adapter pi --body "Write the draft."` | Save or update a not-yet-admitted task. |\n| `flakes tasks save --run <run-key> --key <task-key> --title "Draft" --adapter pi --body-file prompt.md --required-capability pi --depends-on outline` | Save a task with a file body, capability requirement, and dependency. |\n| `flakes tasks save --run <run-key> --key <task-key> --title "Plan" --adapter harness --harness-file harnesses/paper-writer.ts --tool-grant flakes.tasks.spawn` | Submit a harness module as a normal task. |\n| `flakes tasks admit --run <run-key> <task-key>` | Admit specific saved tasks for scheduling. |\n| `flakes tasks admit --run <run-key> --all` | Admit all saved tasks that are ready for admission. |\n\nTask save accepts `--acceptance`, `--depends-on`, `--required-capability`, and\n`--tool-grant` more than once. `--harness-file` requires `--adapter harness`.\n\n### Workpads And File Reservations\n\n| Command | Use |\n| --- | --- |\n| `flakes tasks workpad show <task-id>` | Read a task workpad as JSON. |\n| `flakes tasks workpad show <task-id> --raw` | Print only the Markdown body. |\n| `flakes tasks workpad save <task-id> --file <workpad.md> --base-version <version>` | Save a workpad with an optimistic version check. |\n| `flakes tasks workpad template <task-id> -o <workpad.md>` | Create a local Markdown template for editing. |\n| `flakes tasks workpad pull` | Inside a running Flakes task, pull the assignment-local workpad into the thread state directory. |\n| `flakes tasks workpad push` | Inside a running Flakes task, push the assignment-local workpad with its saved base version. |\n| `flakes tasks files reserve <path...> --reason "editing" --json` | Inside a running task, reserve assignment-scoped file paths before editing. |\n| `flakes tasks files release <path...> --json` | Release assignment-scoped file reservations. |\n| `flakes tasks files release --all --json` | Release all reservations owned by the current assignment. |\n| `flakes tasks files list --json` | List current assignment file reservations. |\n| `flakes tasks files check <path...> --json` | Check whether paths conflict with existing reservations. |\n\nThe `pull`, `push`, and `files` commands are attached to a running task through\nthread-local environment variables. They fail outside a running Flakes task.\n\n### Messages And Permissions\n\nMessages and permission responses do not have standalone top-level CLI commands.\nUse the console controls when available, or call the selected API routes:\n\n| Route | Use |\n| --- | --- |\n| `POST /v1/tasks/:taskId/messages` | Send a `follow_up` or `steer` message to a running task. |\n| `POST /v1/tasks/:taskId/permissions/:permissionRequestId/respond` | Answer a task permission request with `approved` or `denied`. |\n\nBoth routes require the task to be running on a connected sandbox. See\n[Observe And Steer](/docs/observe-and-steer) for user-facing behavior.\n\n### Harness Checks\n\n| Command | Use |\n| --- | --- |\n| `flakes harness init --template paper --dir harnesses` | Create a starter harness module. |\n| `flakes harness init --template review-revise --dir harnesses --file review.ts --force` | Write a specific template and overwrite the target file. |\n| `flakes harness check harnesses/paper-writer.ts` | Typecheck and validate a harness module before submission. |\n| `flakes harness check harnesses/paper-writer.ts --defaults harnesses/defaults.json --json` | Check with adapter/agent defaults and emit structured diagnostics. |\n\nCurrent template names are `paper`, `review-revise`, `fanout-fanin`,\n`autowrite`, and `autoresearch`.\n\n### Artifacts\n\n| Command | Use |\n| --- | --- |\n| `flakes artifacts create --file artifact.json` | Create artifact metadata, optionally with inline bytes in the JSON payload. |\n| `flakes artifacts get <artifact-id>` | Read artifact metadata. |\n| `flakes artifacts fetch <artifact-id> -o <file>` | Fetch artifact bytes to a file. |\n| `flakes artifacts fetch <artifact-id> --raw` | Write exact artifact bytes to stdout. |\n\n## Host Config Reference\n\n`flakes host setup` writes a starter Host config TOML file. Add at least one\npool before running `flakes host run`.\n\n```toml\ncontrolPlaneUrl = "https://flakes.dev"\nhostId = "host_abc123"\ncredentialFile = "/Users/me/.config/flakes/host.credential"\nstateDir = "/Users/me/.config/flakes/state"\n\n[[pools]]\npoolKey = "mac-coding"\nmatchlockImage = "registry.example/flakes/macos:latest"\nworkspace = "/Users/me/flakes-workspaces"\nmounts = ["/Users/me/.cache/flakes:/cache"]\nadapter = "pi"\nmaxInstances = 2\nmaxConcurrency = 1\nadvertisedCapabilities = ["pi", "node", "mac"]\n\n[pools.resourceBounds]\nmemoryMb = 8192\ncpus = 4\n\n[pools.env]\nEXAMPLE = "value"\n\n[pools.executablePaths]\nmatchlock = "/usr/local/bin/matchlock"\nflakes = "/usr/local/bin/flakes"\n```\n\n### Top-Level Fields\n\n| Field | Required | Meaning |\n| --- | --- | --- |\n| `controlPlaneUrl` | Yes | Hosted API origin. Host setup writes `https://flakes.dev`. |\n| `hostId` | Yes | Host identity returned by setup. It must be a non-empty identifier. |\n| `credentialFile` | Yes | Absolute path to the host-scoped credential file. `credentialFile must be an absolute path`; it must be a regular file owned by the current user, not a symlink, with `0600` permissions. |\n| `stateDir` | No | Absolute private directory for host runtime state. When omitted, it defaults beside the credential file. The runtime also creates a generated sandbox config directory under this state directory. |\n| `pools` | Yes | One to 64 pool definitions. A config with no pools is invalid for `flakes host run`. |\n\n### Pool Fields\n\n| Field | Required | Meaning |\n| --- | --- | --- |\n| `poolKey` | Yes | Stable pool identifier advertised to Flakes. Must be unique within the host config. |\n| `provider` | Implied | The current provider is `matchlock`. It is advertised as `provider: "matchlock"`; it is not a required TOML field. |\n| `matchlockImage` | Yes | Local MatchLock image or template used by the host to launch sandboxes. This is local-only and is not sent in the sanitized pool advertisement. |\n| `workspace` | Yes | Absolute local directory used as the pool workspace. It must exist and must be a directory. This is local-only. |\n| `mounts` | No | Local mount strings passed to the provider. These stay on the host. |\n| `adapter` | Yes | Adapter the sandbox should run, such as `pi` or `harness`. This is advertised for scheduling. |\n| `maxInstances` | Yes | Positive integer limit for provider instances in the pool. |\n| `maxConcurrency` | Yes | Positive integer limit for concurrent work in each advertised sandbox config. |\n| `advertisedCapabilities` | Yes | Up to 64 scheduling capability strings, such as `pi`, `node`, or `mac`. These become advertised as `capabilities`. |\n| `resourceBounds` | No | Small sanitized record for scheduler-facing bounds, such as CPU or memory. Oversized or unsafe records are rejected. |\n| `env` | No | Local environment variables for provider startup. These are local-only and are not advertised. |\n| `executablePaths.matchlock` | Yes | Absolute path to the MatchLock executable. It must exist, be a file, be executable, and not be a symlink. |\n| `executablePaths.<name>` | No | Additional executable paths, for example `flakes`. These are local-only. |\n\n### Sanitized Pool Advertisement\n\nThe host sends only a sanitized pool advertisement to the control plane:\n\n- `poolKey`\n- `provider`\n- `adapter`\n- `maxInstances`\n- `maxConcurrency`\n- `capabilities`\n- sanitized `resourceBounds`, when present\n\nLocal-only fields stay on the host: `matchlockImage`, `workspace`, `mounts`,\n`env`, `credentialFile`, `stateDir`, and `executablePaths`. Do not rely on\nthose fields appearing in the console or API pool responses.\n\n## Selected API Reference\n\nThis section is for integrators. Ordinary users should prefer the console and\nCLI workflows above. Unless noted otherwise, routes use `/v1`, require a user\nbearer credential for the same hosted origin, and are scoped to the authenticated\nowner.\n\n### Runs And Tasks\n\n| Route | Use |\n| --- | --- |\n| `PUT /v1/runs/:runKey` | Create or idempotently read a run by stable key. Body includes `name`; optional `metadata` is stored with the run key. |\n| `GET /v1/runs?state=<state>&cursor=<cursor>&limit=<n>` | List owned runs. |\n| `GET /v1/runs/:runId` | Read one owned run by run ID. |\n| `DELETE /v1/runs/:runId` | Delete an owned run after cancel delivery is attempted for live tasks. |\n| `POST /v1/runs/:runKey/close` | Close a run so no more top-level work can be admitted. |\n| `GET /v1/runs/:runId/tasks` | List tasks with workpad metadata for console task overview screens. |\n| `PUT /v1/runs/:runKey/tasks/:taskKey` | Save a task before admission. Body includes task metadata, target adapter, input, dependencies, capabilities, and grants. |\n| `POST /v1/runs/:runKey/tasks/admit` | Admit selected task keys or all saved tasks. |\n| `GET /v1/tasks/:taskId` | Read one task. |\n| `POST /v1/tasks/:taskId/cancel` | Request cancellation for a live task and record task state. |\n| `GET /v1/tasks/:taskId/logs` | Read bounded task logs. |\n| `GET /v1/tasks/:taskId/activity` | Read activity events such as workpad updates, human input, and permission events. |\n\n### Workpads, Messages, And Permissions\n\n| Route | Use |\n| --- | --- |\n| `GET /v1/tasks/:taskId/workpad` | Read the current task workpad. |\n| `PUT /v1/tasks/:taskId/workpad` | Save Markdown with `bodyMarkdown` and `baseVersion`. A stale version returns `workpad_version_conflict` with the current workpad. Workpads are limited to 512 KiB. |\n| `POST /v1/tasks/:taskId/messages` | Queue `follow_up` or `steer` input for a running task. Messages must be non-empty and at most 20000 characters. |\n| `POST /v1/tasks/:taskId/permissions/:permissionRequestId/respond` | Send `approved` or `denied` for a permission request. A request accepts only one answer and must still belong to the active assignment. |\n| `GET /v1/tasks/:taskId/rounds/:roundKey/outputs/:outputKey/fetch` | Read a bounded JSON or text live-round output. |\n| `GET /v1/tasks/:taskId/rounds/:roundKey/outputs/:outputKey/workspace` | Resolve a live-round workspace output handle. |\n\n### Hosts\n\n| Route | Use |\n| --- | --- |\n| `GET /v1/hosts` | List owned hosts. |\n| `POST /v1/hosts` | Create a host record directly for integrator workflows that do not need the CLI to mint a local host credential. |\n| `POST /v1/hosts/setup` | Create a host and its first host-scoped credential in one transaction. Requires direct user bearer auth and returns the raw credential exactly once for CLI persistence. |\n| `GET /v1/hosts/:hostId` | Read one owned host. |\n| `PATCH /v1/hosts/:hostId` | Update safe display fields and user metadata. Runtime, adapter, path, env, image, provider, and status metadata keys are rejected. |\n| `POST /v1/hosts/:hostId/disable` | Disable a host. Disabled hosts cannot claim new work. |\n| `DELETE /v1/hosts/:hostId` | Delete a host only when active lifecycle state no longer blocks deletion. |\n| `GET /v1/hosts/:hostId/pools` | Read pools synced from the running host. There is no user-facing pool write route; edit host TOML and restart or reconnect the host. |\n| `GET /v1/hosts/:hostId/credentials` | List redacted host credential summaries. |\n| `GET /v1/hosts/:hostId/credentials/:hostCredentialId` | Read one redacted host credential summary. |\n| `POST /v1/hosts/:hostId/credentials/rotate` | Rotate a host credential. Requires direct user bearer auth and returns the raw replacement credential once. |\n| `POST /v1/hosts/:hostId/credentials/:hostCredentialId/revoke` | Revoke a host credential. |\n\nHost setup and credential rotation require direct user bearer auth. Do not send\nthose requests through the browser console proxy.\n\n### Artifacts And Run Outputs\n\n| Route | Use |\n| --- | --- |\n| `POST /v1/artifacts` | Create artifact metadata and optional inline bytes. |\n| `GET /v1/artifacts/:artifactId` | Read artifact metadata. |\n| `GET /v1/artifacts/:artifactId/fetch` | Fetch artifact bytes. |\n| `GET /v1/runs/:runId/artifacts` | List artifacts associated with a run. |\n| `GET /v1/runs/:runId/history.jsonl` | Export redacted run history as JSONL. |\n| `GET /v1/runs/:runId/file-reservations` | List file reservations visible for the run. |\n| `GET /v1/runs/:runId/metrics` | Read evaluation metrics for the run. |\n\nSandbox-scoped workspace, group, and live-round routes are runtime surfaces for\nadapters and harness execution. Integrators should normally use the CLI,\nselected client routes, or Harness SDK helpers instead of calling those routes\ndirectly.\n\n## Relevant Exports\n\nThe hosted API and CLI are the primary user boundary. These exports are useful\nonly for integrations, harness modules, adapters, or repository-local tooling.\n\n| Export | Use |\n| --- | --- |\n| `@flakes/harness-sdk` | Harness authors import `defineHarness`, use `HarnessContext`, and call helpers such as `ctx.group(...)`, `ctx.groups.open(...)`, `ctx.output.json(...)`, `ctx.outputs.readJson(...)`, `ctx.workpads.read(...)`, `ctx.workspace.commit(...)`, `ctx.workspace.promote(...)`, and `ctx.liveTasks.send(...)`. |\n| `@flakes/core` | Integrators that build typed payloads can reuse schemas and types for run/task IDs, saved tasks, task metadata, task groups, task spawn requests, workpads, file reservations, and workspace handles. Common names include `WorkspaceHandle`, `WorkspaceHandleSchema`, `TaskProductMetadataSchema`, and `TaskWorkpadPutRequestSchema`. |\n| `@flakes/protocol` | Runtime implementers can parse and validate sandbox and host stream messages with protocol schemas and safe parse helpers. Ordinary API clients do not need these types. |\n| `@flakes/cli` | Test harnesses or wrappers can call `runCli(...)` with injected IO and transport dependencies instead of shelling out. The installed binary remains `flakes`. |\n\nDo not treat this table as a package architecture guide. It lists only the\nexports a user, harness author, or integrator might reasonably need.\n',Zx=`---
720
- title: Run Work
721
- description: Create runs, save tasks, admit ready work, and close durable workflows.
722
- ---
723
-
724
- Run Work covers the control-plane workflow for creating durable work from the
725
- hosted product. Use it after you can sign in at \`https://flakes.dev/console\`,
726
- authorize the CLI, and see enough connected host capacity for the adapter you
727
- want to use.
728
-
729
- ## The Model
730
-
731
- A run is the durable container for one job. It holds saved tasks, admitted
732
- tasks, dependencies, task status, workpads, activity, artifacts, and history.
733
- That durable task state lives in Flakes even if an agent process exits, a
734
- sandbox disconnects, or a transient agent process starts again on another
735
- assignment.
736
-
737
- A saved task is a draft definition inside an open run. Save tasks while you are
738
- still shaping the graph: title, Markdown body, acceptance criteria, target
739
- adapter, dependencies, required capabilities, and any grants needed by a
740
- planner or harness. Saved tasks are not schedulable yet.
741
-
742
- Admission turns saved tasks into durable runtime work. After a task is
743
- admitted, treat it as immutable user intent: do not expect to edit, delete, or
744
- rewire it. Add another saved task before admission, or have an authorized
745
- running task append children through its granted runtime tools.
746
-
747
- Closing a run means no more top-level saved tasks should be admitted by the
748
- client. Close does not stop work that is already admitted. With \`--wait\`, the
749
- CLI waits for the run to reach a terminal state or until the timeout expires.
750
- If the timeout expires, the run can still continue in the console.
751
-
752
- ## Create A Run
753
-
754
- This example uses the hosted user-auth flow. It assumes the CLI is already
755
- installed and host capacity has been connected by you or your workspace
756
- operator.
757
-
758
- \`\`\`bash
759
- flakes auth login
760
-
761
- flakes runs create \\
762
- --key release-notes \\
763
- --name "Draft release notes"
764
-
765
- flakes tasks save \\
766
- --run release-notes \\
767
- --key draft \\
768
- --title "Draft release notes" \\
769
- --adapter pi \\
770
- --body "Read the shipped changes and draft concise release notes for users." \\
771
- --acceptance "Notes describe user-visible changes" \\
772
- --acceptance "Open questions are listed at the end" \\
773
- --required-capability pi
774
-
775
- flakes tasks save \\
776
- --run release-notes \\
777
- --key review \\
778
- --title "Review release notes" \\
779
- --adapter pi \\
780
- --body "Review the draft for accuracy, missing risks, and unclear wording." \\
781
- --depends-on draft \\
782
- --acceptance "Review comments are actionable" \\
783
- --required-capability pi
784
-
785
- flakes tasks admit --run release-notes --all
786
- flakes runs close release-notes --wait --timeout-ms 600000
787
- \`\`\`
788
-
789
- The first command authorizes the CLI against \`https://flakes.dev\`. The run is
790
- created under your account, the two tasks are saved under stable keys, and the
791
- \`review\` task depends on \`draft\`. Admission makes both tasks part of the
792
- durable graph. The close command tells Flakes there is no more top-level work
793
- to add and then waits for the graph to settle.
794
-
795
- ## Shape The Graph
796
-
797
- Use dependencies only for real ordering requirements. A task with unsatisfied
798
- dependencies is not ready, even if capacity is available. In the example above,
799
- \`review\` waits until \`draft\` is terminal according to the dependency policy
800
- before it can run.
801
-
802
- Use required capabilities to keep work on compatible capacity. A task that
803
- requires \`pi\` should only be assigned to connected capacity that advertises the
804
- \`pi\` capability and the matching adapter. If no connected host capacity can
805
- satisfy the adapter and required capabilities, the task stays queued.
806
-
807
- Acceptance criteria should be short, observable checks. The agent receives the
808
- task title, body, and acceptance criteria as its brief, and the console shows
809
- the same user-facing context on the task page.
810
-
811
- ## Scheduling
812
-
813
- Flakes schedules admitted, ready tasks to connected host capacity. A host
814
- advertises sanitized pool capacity: adapter, capabilities, and concurrency,
815
- not local paths, secrets, mounts, or private execution details. The scheduler
816
- matches each queued task against ready dependencies, required capabilities, and
817
- available concurrency.
818
-
819
- Queued work usually means one of three things:
820
-
821
- - a dependency has not finished;
822
- - no connected host capacity currently matches the adapter or required
823
- capabilities;
824
- - matching capacity exists, but all concurrency is busy.
825
-
826
- When capacity appears, Flakes can assign the task to a sandbox. The task then
827
- moves through running status as the sandbox accepts the assignment and starts
828
- the agent process. The process and its local session are transient. The task
829
- record, status, workpad, activity, artifacts, and transcript pointers are the
830
- durable state.
831
-
832
- ## Dynamic Work
833
-
834
- A trusted client should use \`flakes tasks save\` and \`flakes tasks admit\` for the
835
- initial graph. A running planner or harness can append children only when its
836
- admitted task includes the needed grants, such as \`flakes.tasks.spawn\` and the
837
- task-group grants documented in [Harnesses](/docs/harnesses).
838
-
839
- Spawned children are appended to the same run. They do not edit existing
840
- accepted tasks, and they do not inherit broad graph-editing powers unless the
841
- parent explicitly grants the runtime tools the workflow needs.
842
-
843
- ## Close And Wait
844
-
845
- Close a run when the client has admitted all intended top-level work. Keep the
846
- run open while a planner is expected to add children. Close it after the
847
- planner has created the work you want the scheduler to drain.
848
-
849
- \`flakes runs close RUN_KEY --wait\` is useful for scripts and handoffs. It
850
- returns the latest run body after the wait completes or times out, while the
851
- console remains the best place to inspect detailed task state.
852
-
853
- \`WAITING\` is different from queued capacity. A task in \`WAITING\` has yielded its
854
- current assignment because it is waiting on durable state, such as a closed
855
- task group. It is not schedulable until the wait condition is satisfied. When
856
- the condition resolves, Flakes can resume the logical task from durable state
857
- with a fresh assignment.
858
- `,Qx=`---
859
- title: Troubleshooting
860
- description: Diagnose hosted-console, CLI auth, host setup, scheduling, and task input failures.
861
- ---
862
-
863
- Start with the surface that failed: console sign-in, CLI auth, host setup,
864
- host runtime, task scheduling, or task interaction. Most failures are caused by
865
- a missing credential, an invalid host config, no matching host capacity, or a
866
- running task that no longer has a connected sandbox.
867
-
868
- ## Authentication And Device Login
869
-
870
- ### Device authorization does not finish
871
-
872
- Symptoms include:
873
-
874
- - \`device authorization timed out\`
875
- - \`device authorization denied\`
876
- - \`device authorization expired\`
877
-
878
- A browser page that no longer accepts the code is the same class of problem.
879
-
880
- Run a fresh login:
881
-
882
- \`\`\`bash
883
- flakes auth login
884
- \`\`\`
885
-
886
- For remote shells, print the URL and code instead of opening a browser:
887
-
888
- \`\`\`bash
889
- flakes auth login --no-open
890
- \`\`\`
891
-
892
- If approval normally takes longer than five minutes, pass a longer timeout:
893
-
894
- \`\`\`bash
895
- flakes auth login --timeout-ms 600000
896
- \`\`\`
897
-
898
- Use the same Flakes account in the browser that started the device request. If
899
- the request was denied or expired, start over; old device codes are not
900
- recoverable.
901
-
902
- ### CLI commands cannot find credentials
903
-
904
- Common error text:
905
-
906
- - \`No CLI credential found\`
907
- - \`Stored CLI credential expired\`
908
- - \`Stored CLI credential has invalid expiry metadata\`
909
-
910
- Check the current status:
911
-
912
- \`\`\`bash
913
- flakes auth status
914
- \`\`\`
915
-
916
- Then log in again:
917
-
918
- \`\`\`bash
919
- flakes auth login
920
- \`\`\`
921
-
922
- If you intentionally changed accounts, remove the old local credential first:
923
-
924
- \`\`\`bash
925
- flakes auth logout
926
- flakes auth login
927
- \`\`\`
928
-
929
- ## Host Setup And Config
930
-
931
- ### Host setup fails before writing files
932
-
933
- \`flakes host setup\` refuses to overwrite an existing config or credential file.
934
- Move the existing file, or pass new paths:
935
-
936
- \`\`\`bash
937
- flakes host setup \\
938
- --config <host.toml> \\
939
- --credential-file <host.credential> \\
940
- --state-dir <host-state>
941
- \`\`\`
942
-
943
- The config path, credential file path, and state directory must be distinct.
944
- They cannot point at the same file or nest inside each other in a way that
945
- makes setup ambiguous.
946
-
947
- ### Host setup request fails
948
-
949
- Common error text includes \`host setup failed with HTTP ...\`,
950
- \`host setup requires direct user bearer auth\`,
951
- \`direct_user_auth_required\`, or \`host_credentials_not_configured\`.
952
-
953
- Recover by checking these items:
954
-
955
- - Run \`flakes auth status\`; if it is not
956
- authenticated, run \`flakes auth login\`.
957
- - Run setup directly from the CLI. The setup request requires direct user bearer
958
- auth and should not be sent through the browser console proxy.
959
- - If setup failed after the server created a credential but before local files
960
- were written, the CLI attempts to revoke that newly created credential. Remove
961
- partial local files and rerun setup.
962
-
963
- ### Host config is invalid
964
-
965
- \`flakes host status --config <host.toml>\` reports \`host config is invalid\` when
966
- the runtime cannot load or validate the config. The most common causes are:
967
-
968
- - \`controlPlaneUrl\` is missing, malformed, or uses plaintext HTTP outside
969
- localhost.
970
- - \`hostId\` is missing or not a valid identifier.
971
- - \`credentialFile\` is missing, is not absolute, is a symlink, is not owned by
972
- the current user, or \`credentialFile must have 0600 permissions\`.
973
- - \`stateDir\` is not an absolute private directory.
974
- - \`at least one pool is required\`.
975
- - \`workspace\` does not exist or is not a directory.
976
- - \`executablePaths.matchlock\` is missing, is not absolute, is a symlink, or is
977
- not executable.
978
- - \`maxInstances\` or \`maxConcurrency\` is not a positive integer.
979
-
980
- Validate the local and remote view:
981
-
982
- \`\`\`bash
983
- flakes host status --config <host.toml> --json
984
- \`\`\`
985
-
986
- If local validation passes but remote status is not checked, the hosted CLI user
987
- credential is missing or expired. Run \`flakes auth status\`, then re-run
988
- \`flakes auth login\` if needed. Remote host status uses the hosted control plane
989
- and the \`hostId\` from the local config.
990
-
991
- ### Host rotation succeeds but work does not launch
992
-
993
- \`flakes host rotate --config <host.toml>\` writes a new host credential and
994
- retires the replaced credential. Restart the host process after rotation:
995
-
996
- \`\`\`bash
997
- flakes host rotate --config <host.toml>
998
- flakes host run --config <host.toml>
999
- \`\`\`
1000
-
1001
- Old active streams cannot claim new launch work after the replaced credential
1002
- is retired. A restart makes the host reconnect with the new credential.
1003
-
1004
- ## Scheduling And Runtime
1005
-
1006
- ### No matching host capacity
1007
-
1008
- If the console shows \`No matching host capacity\` or tasks stay \`queued\`, compare
1009
- the task requirements with the connected host pools:
1010
-
1011
- \`\`\`bash
1012
- flakes host status --config <host.toml> --json
1013
- \`\`\`
1014
-
1015
- Check:
1016
-
1017
- - The host is \`online\`, not \`offline\` or \`disabled\`.
1018
- - At least one pool advertises the task adapter, such as \`pi\` or \`harness\`.
1019
- - The pool advertises every \`--required-capability\` used by the task.
1020
- - The pool is not already at its \`maxInstances\` or \`maxConcurrency\` limit.
1021
- - \`flakes host run --config <host.toml>\` is still running.
1022
- - A sandbox has connected back and become schedulable after startup.
1023
-
1024
- Saved tasks do not run until they are admitted. If a task is only saved, run:
1025
-
1026
- \`\`\`bash
1027
- flakes tasks admit --run <run-key> <task-key>
1028
- \`\`\`
1029
-
1030
- ### Queued tasks do not start
1031
-
1032
- A queued task is waiting for prerequisites. Common causes:
1033
-
1034
- - The run has saved tasks that were never admitted.
1035
- - The task depends on another task that has not finished successfully.
1036
- - The task requests capabilities that no online pool advertises.
1037
- - The run was closed after admission but no matching capacity is available.
1038
- - The host process exited or lost connectivity.
1039
-
1040
- Use the run and task views in the console first. From the CLI, inspect the run
1041
- or task and read logs for a running task:
1042
-
1043
- \`\`\`bash
1044
- flakes inspect <run-id-or-key>
1045
- flakes inspect <task-id> --task
1046
- flakes logs <task-id>
1047
- \`\`\`
1048
-
1049
- ### Offline sandboxes block messages or permissions
1050
-
1051
- When a task interaction returns \`sandbox_offline\` or \`task sandbox is not
1052
- connected\`, the task record still points at a sandbox but the sandbox stream is
1053
- not connected.
1054
-
1055
- Recover by:
1056
-
1057
- - Checking whether the host is still running.
1058
- - Reading host status and pool status with \`flakes host status --config
1059
- <host.toml> --json\`.
1060
- - Restarting \`flakes host run --config <host.toml>\` if the process exited.
1061
- - Waiting for the scheduler to retry if the task is retryable.
1062
- - Creating follow-up work in a new task if the original task reached a
1063
- terminal state.
1064
-
1065
- ## Task Input And Permissions
1066
-
1067
- ### Follow-up or steer input is rejected
1068
-
1069
- The task messages API accepts only running tasks on connected sandboxes.
1070
- Messages must be non-empty, at most 20000 characters, and use mode \`follow_up\`
1071
- or \`steer\`.
1072
-
1073
- If the console input box is disabled, check the task state:
1074
-
1075
- - \`queued\`: wait for capacity or fix host matching.
1076
- - \`running\`: the task can receive input only while its sandbox is connected.
1077
- - \`waiting\`: the task is waiting on durable workflow state; use the harness or
1078
- wait condition instead of sending arbitrary input.
1079
- - terminal states: create follow-up work in a new task or run.
1080
-
1081
- ### Permission prompt cannot be answered
1082
-
1083
- Permission responses require a running task, a connected sandbox, and an
1084
- unanswered request that still belongs to the active assignment.
1085
-
1086
- Common API errors:
1087
-
1088
- - \`permission_already_responded\`: someone already answered this request. Read
1089
- task activity for the accepted response.
1090
- - \`permission_stale_assignment\`: the request belonged to older work and cannot
1091
- be answered for the current assignment.
1092
- - \`task_not_running\`: the task is no longer running on an active sandbox.
1093
- - \`sandbox_offline\`: the task sandbox is not connected.
1094
-
1095
- Use the console prompt when it is visible. If no prompt is visible but activity
1096
- shows \`permission.requested\`, answer through the integration that owns the
1097
- prompt or wait for the task to fail and create follow-up work.
1098
-
1099
- ### Workpad save conflicts
1100
-
1101
- \`workpad_version_conflict\` means another user or agent saved a newer workpad
1102
- after your base version. Pull or read the latest workpad, merge your changes,
1103
- and save again with the latest version:
1104
-
1105
- \`\`\`bash
1106
- flakes tasks workpad show <task-id>
1107
- flakes tasks workpad save <task-id> --file <workpad.md> --base-version <latest-version>
1108
- \`\`\`
1109
-
1110
- Inside a running task, \`flakes tasks workpad push\` writes the latest conflicting
1111
- body and version to \`workpad.current.md\` and \`workpad.current.version\`. Merge
1112
- those changes before retrying.
1113
- `,$x={title:`Flakes`,pages:[`index`,`get-started`,`connect-a-host`,`run-work`,`observe-and-steer`,`harnesses`,`concepts`,`reference`,`troubleshooting`]},eS={title:`Reference`,pages:[`index`]},tS=Object.assign({"../../../../docs/content/docs/concepts.mdx":Wx,"../../../../docs/content/docs/connect-a-host.mdx":Gx,"../../../../docs/content/docs/get-started.mdx":Kx,"../../../../docs/content/docs/harnesses.mdx":qx,"../../../../docs/content/docs/index.mdx":Jx,"../../../../docs/content/docs/observe-and-steer.mdx":Yx,"../../../../docs/content/docs/reference/index.mdx":Xx,"../../../../docs/content/docs/run-work.mdx":Zx,"../../../../docs/content/docs/troubleshooting.mdx":Qx}),nS=Object.assign({"../../../../docs/content/docs/meta.json":$x,"../../../../docs/content/docs/reference/meta.json":eS}),rS=new Map(Object.entries(tS).map(([e,t])=>[_S(e),t])),iS=new Map(Object.entries(nS).map(([e,t])=>[vS(e),t])),aS=pS(),oS=new Map(aS.map(e=>[e.path,e])),sS=mS(``);aS[0]?.slug;var cS=aS[0]?.path??``;function lS(e){return aS.find(t=>t.slug===e||t.path===yS(e))}function uS(e){return oS.get(yS(e??``))}function dS(e){return typeof e==`string`?(uS(e)??lS(e))?.path??cS:cS}function fS(e){if(e===void 0)return;let[t]=e.split(/[?#]/);if(t===void 0||t.startsWith(`#`)||t.startsWith(`http`))return;let n=yS(t);return oS.has(n)?n:void 0}function pS(){let e=[],t=new Set;function n(n,r){if(t.has(n))return;let i=rS.get(n);if(i===void 0)return;let a=CS(i),o=SS(n,e);e.push({slug:o,path:n,title:a.frontmatter.title??ES(n),description:a.frontmatter.description??``,body:a.body,...r?{groupTitle:r}:{}}),t.add(n)}function r(e){let t=iS.get(e),i=e?t?.title:void 0,a=t?.pages??hS(e);for(let t of a){let a=bS(e,t);n(t===`index`?e:a,i),t!==`index`&&iS.has(a)&&r(a)}}r(``);for(let e of[...rS.keys()].sort((e,t)=>e.localeCompare(t)))n(e,xS(e));return e}function mS(e){let t=iS.get(e)?.pages??hS(e),n=[];for(let r of t){let t=bS(e,r),i=r===`index`?e:t,a=oS.get(i);if(a!==void 0){n.push({type:`page`,page:a});continue}if(iS.has(t)){let e=mS(t);e.length>0&&n.push({type:`folder`,key:`folder-${t}`,path:t,title:iS.get(t)?.title??ES(t),children:e})}}return n}function hS(e){let t=e?`${e}/`:``,n=new Set;for(let e of rS.keys()){if(!e.startsWith(t))continue;let r=e.slice(t.length);if(!r){n.add(`index`);continue}n.add(r.split(`/`)[0]??r)}for(let r of iS.keys()){if(!r.startsWith(t)||r===e)continue;let i=r.slice(t.length);n.add(i.split(`/`)[0]??i)}return[...n].sort((e,t)=>e.localeCompare(t))}function gS(e){let t=e.replace(/\\/g,`/`),n=t.indexOf(`docs/content/docs/`);return n===-1?t:t.slice(n+18)}function _S(e){return yS(gS(e).replace(/\.mdx$/,``))}function vS(e){return yS(gS(e).replace(/\/?meta\.json$/,``))}function yS(e){let t=e.replace(/\\/g,`/`).replace(/^\/docs\/?/,``).replace(/^docs\/?/,``).replace(/^\/+/,``).replace(/\/+$/,``);return t===``||t===`index`||t===`overview`?``:t.replace(/\/index$/,``)}function bS(e,t){return e?`${e}/${t}`:t}function xS(e){let t=e.split(`/`).slice(0,-1).join(`/`);return t?iS.get(t)?.title:void 0}function SS(e,t){let n=e===``?`overview`:e.split(`/`).at(-1)??e;if(!t.some(e=>e.slug===n))return n;let r=e.replaceAll(`/`,`-`)||`overview`;if(!t.some(e=>e.slug===r))return r;let i=2;for(;t.some(e=>e.slug===`${r}-${i}`);)i+=1;return`${r}-${i}`}function CS(e){let t=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(e);return t===null?{frontmatter:{},body:e.trim()}:{frontmatter:wS(t[1]??``),body:e.slice(t[0].length).trim()}}function wS(e){let t={};for(let n of e.split(/\r?\n/)){let e=n.indexOf(`:`);if(e===-1)continue;let r=n.slice(0,e).trim();r!==`title`&&r!==`description`||(t[r]=TS(n.slice(e+1).trim()))}return t}function TS(e){return e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`)?e.slice(1,-1):e}function ES(e){return(e===``?`overview`:e.split(`/`).at(-1)??e).split(`-`).map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1)}`).join(` `)}var DS=ho(`/documentation`)({validateSearch:e=>typeof e.doc==`string`?{doc:e.doc}:{},beforeLoad:({search:e})=>{if(e.doc===void 0)return;let t=lS(e.doc)??lS(dS(e.doc));throw t===void 0||t.path===cS?oe({to:`/documentation`,replace:!0}):oe({to:`/documentation/$`,params:{_splat:t.path},replace:!0})},component:yo(()=>yx(()=>import(`./documentation-Dr9Bdqxh.js`),__vite__mapDeps([16,1,17,2,3,18,4,19,20])),`component`)}),OS=ho(`/device`)({validateSearch:e=>({user_code:typeof e.user_code==`string`?e.user_code:``}),component:yo(()=>yx(()=>import(`./device-DOGZUNMB.js`),__vite__mapDeps([21,1,2,3,4,5,22,6,7,23,8,9,10])),`component`)}),kS=ho(`/$`)({beforeLoad:()=>{throw oe({to:`/runs`,replace:!0})}}),AS=ho(`/`)({beforeLoad:()=>{throw oe({to:`/runs`,replace:!0})}}),jS=ho(`/account/`)({component:yo(()=>yx(()=>import(`./account-DKgjbb-C.js`),__vite__mapDeps([24,1,25,6,2,3,4,7,23,26,8,10])),`component`)}),MS=ho(`/account/security`)({component:yo(()=>yx(()=>import(`./security-D3N68cBT.js`),__vite__mapDeps([27,1,25,6,2,3,4,7,23,26,8,10])),`component`)}),NS=ho(`/runs/$runId`)({validateSearch:e=>{let t={},n=e.tab;(n===`artifacts`||n===`metrics`||n===`files`)&&(t.tab=n);let r=e.view;return(r===`timeline`||r===`sandboxes`)&&(t.view=r),t},component:yo(()=>yx(()=>import(`./_runId-CO1ozt9P.js`),__vite__mapDeps([28,1])),`component`)}),PS=ho(`/documentation/$`)({loader:({params:e})=>{let t=uS(e._splat);if(t===void 0)throw ae();return{path:t.path}},component:yo(()=>yx(()=>import(`./_-DRcA_CG9.js`),__vite__mapDeps([29,1,17,2,3,18,4,19,20])),`component`)}),FS=ho(`/runs/$runId/t/$taskId`)({validateSearch:e=>e.transcript===`raw`?{transcript:`raw`}:{},component:yo(()=>yx(()=>import(`./_taskId-CcIypX6M.js`),__vite__mapDeps([30,1])),`component`)}),IS=Tx.update({id:`/signup`,path:`/signup`,getParentRoute:()=>bx}),LS=Ex.update({id:`/signin`,path:`/signin`,getParentRoute:()=>bx}),RS=Dx.update({id:`/sandboxes`,path:`/sandboxes`,getParentRoute:()=>bx}),zS=Ox.update({id:`/runs`,path:`/runs`,getParentRoute:()=>bx}),BS=Hx.update({id:`/reset-password`,path:`/reset-password`,getParentRoute:()=>bx}),VS=Ux.update({id:`/forgot-password`,path:`/forgot-password`,getParentRoute:()=>bx}),HS=DS.update({id:`/documentation`,path:`/documentation`,getParentRoute:()=>bx}),US=OS.update({id:`/device`,path:`/device`,getParentRoute:()=>bx}),WS=kS.update({id:`/$`,path:`/$`,getParentRoute:()=>bx}),GS=AS.update({id:`/`,path:`/`,getParentRoute:()=>bx}),KS=jS.update({id:`/account/`,path:`/account/`,getParentRoute:()=>bx}),qS=MS.update({id:`/account/security`,path:`/account/security`,getParentRoute:()=>bx}),JS=NS.update({id:`/$runId`,path:`/$runId`,getParentRoute:()=>zS}),YS=PS.update({id:`/$`,path:`/$`,getParentRoute:()=>HS}),XS=FS.update({id:`/t/$taskId`,path:`/t/$taskId`,getParentRoute:()=>JS}),ZS={DocumentationSplatRoute:YS},QS=HS._addFileChildren(ZS),$S={RunsRunIdTTaskIdRoute:XS},eC={RunsRunIdRoute:JS._addFileChildren($S)},tC={IndexRoute:GS,SplatRoute:WS,DeviceRoute:US,DocumentationRoute:QS,ForgotPasswordRoute:VS,ResetPasswordRoute:BS,RunsRoute:zS._addFileChildren(eC),SandboxesRoute:RS,SigninRoute:LS,SignupRoute:IS,AccountSecurityRoute:qS,AccountIndexRoute:KS},nC=bx._addFileChildren(tC);function rC(){return No({routeTree:nC,basepath:`/console`,defaultPreload:`intent`,scrollRestoration:!0})}async function iC(){let e=await rC(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(Cs),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:`console`,serializationAdapters:t}),e.state.matches.length||await Jo(e),e}async function aC(){let e=await iC();return window.$_TSR?.h(),e}var oC;function sC(){return oC||=aC(),(0,R.jsx)(to,{promise:oC,children:e=>(0,R.jsx)(Io,{router:e})})}var cC=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}var S=!1,C=-1,w=5,E=-1;function D(){return g?!0:!(e.unstable_now()-E<w)}function ee(){if(g=!1,S){var t=e.unstable_now();E=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,O=ne.port2;ne.port1.onmessage=ee,te=function(){O.postMessage(null)}}else te=function(){_(ee,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),lC=i(((e,t)=>{t.exports=cC()})),uC=i((e=>{var t=lC(),n=p(),r=ve();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.iterator;function O(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function ue(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function j(e,t){ce++,se[ce]=e.current,e.current=t}var de=le(null),fe=le(null),pe=le(null),me=le(null);function he(e,t){switch(j(pe,t),j(fe,e),j(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ue(de),j(de,e)}function ge(){ue(de),ue(fe),ue(pe)}function _e(e){e.memoizedState!==null&&j(me,e);var t=de.current,n=Hd(t,e.type);t!==n&&(j(fe,e),j(de,n))}function ye(e){fe.current===e&&(ue(de),ue(fe)),me.current===e&&(ue(me),Qf._currentValue=oe)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
1114
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
1115
- `+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
1116
- `),l=s.split(`
1117
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
1118
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
1119
- Error generating stack: `+e.message+`
1120
- `+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-We(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=A.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function dt(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft;function xt(e){delete e[pt],delete e[mt],delete e[gt],delete e[_t],delete e[vt]}function St(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[pt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Tt(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Et(e){e[bt]=!0}var Dt=new Set,Ot={};function kt(e,t){At(e,t),At(e+`Capture`,t)}function At(e,t){for(Ot[e]=t,e=0;e<t.length;e++)Dt.add(t[e])}var jt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Mt={},Nt={};function Pt(e){return De.call(Nt,e)?!0:De.call(Mt,e)?!1:jt.test(e)?Nt[e]=!0:(Mt[e]=!0,!1)}function Ft(e,t,n){if(Pt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function It(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Lt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Rt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Bt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vt(e){if(!e._valueTracker){var t=zt(e)?`checked`:`value`;e._valueTracker=Bt(e,t,``+e[t])}}function Ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=zt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ut(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Wt=/[\n"\\]/g;function Gt(e){return e.replace(Wt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Kt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Rt(t)):e.value!==``+Rt(t)&&(e.value=``+Rt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Jt(e,o,Rt(n)):Jt(e,o,Rt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Rt(s):e.removeAttribute(`name`)}function qt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Vt(e);return}n=n==null?``:``+Rt(n),t=t==null?n:``+Rt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Vt(e)}function Jt(e,t,n){t===`number`&&Ut(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Yt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Rt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Xt(e,t,n){if(t!=null&&(t=``+Rt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Rt(n)}function Zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ae(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Rt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Vt(e)}function Qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $t=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function en(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||$t.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function tn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&en(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&en(e,o,t[o])}function nn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var rn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),an=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function on(e){return an.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function sn(){}var cn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var un=null,dn=null;function fn(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Kt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Gt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));Kt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ht(r)}break a;case`textarea`:Xt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Yt(e,!!n.multiple,t,!1)}}}var pn=!1;function M(e,t,n){if(pn)return e(t,n);pn=!0;try{return e(t)}finally{if(pn=!1,(un!==null||dn!==null)&&(bu(),un&&(t=un,e=dn,dn=un=null,fn(t),e)))for(t=0;t<e.length;t++)fn(e[t])}}function mn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var hn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(hn)try{var N={};Object.defineProperty(N,"passive",{get:function(){gn=!0}}),window.addEventListener(`test`,N,N),window.removeEventListener(`test`,N,N)}catch{gn=!1}var _n=null,vn=null,yn=null;function bn(){if(yn)return yn;var e,t=vn,n=t.length,r,i=`value`in _n?_n.value:_n.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return yn=i.slice(e,1<r?1-r:void 0)}function xn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Sn(){return!0}function Cn(){return!1}function wn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Sn:Cn,this.isPropagationStopped=Cn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Sn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Sn)},persist:function(){},isPersistent:Sn}),t}var Tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},En=wn(Tn),Dn=f({},Tn,{view:0,detail:0}),On=wn(Dn),kn,An,jn,Mn=f({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Un,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==jn&&(jn&&e.type===`mousemove`?(kn=e.screenX-jn.screenX,An=e.screenY-jn.screenY):An=kn=0,jn=e),kn)},movementY:function(e){return`movementY`in e?e.movementY:An}}),Nn=wn(Mn),Pn=wn(f({},Mn,{dataTransfer:0})),Fn=wn(f({},Dn,{relatedTarget:0})),In=wn(f({},Tn,{animationName:0,elapsedTime:0,pseudoElement:0})),Ln=wn(f({},Tn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Rn=wn(f({},Tn,{data:0})),zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Bn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Vn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vn[e])?!!t[e]:!1}function Un(){return Hn}var Wn=wn(f({},Dn,{key:function(e){if(e.key){var t=zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=xn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Bn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Un,charCode:function(e){return e.type===`keypress`?xn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?xn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Gn=wn(f({},Mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Kn=wn(f({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Un})),qn=wn(f({},Tn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Jn=wn(f({},Mn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Yn=wn(f({},Tn,{newState:0,oldState:0})),Xn=[9,13,27,32],Zn=hn&&`CompositionEvent`in window,Qn=null;hn&&`documentMode`in document&&(Qn=document.documentMode);var $n=hn&&`TextEvent`in window&&!Qn,er=hn&&(!Zn||Qn&&8<Qn&&11>=Qn),tr=` `,nr=!1;function rr(e,t){switch(e){case`keyup`:return Xn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ir(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ar=!1;function or(e,t){switch(e){case`compositionend`:return ir(t);case`keypress`:return t.which===32?(nr=!0,tr):null;case`textInput`:return e=t.data,e===tr&&nr?null:e;default:return null}}function sr(e,t){if(ar)return e===`compositionend`||!Zn&&rr(e,t)?(e=bn(),yn=vn=_n=null,ar=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return er&&t.locale!==`ko`?null:t.data;default:return null}}var cr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function lr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!cr[e.type]:t===`textarea`}function ur(e,t,n,r){un?dn?dn.push(r):dn=[r]:un=r,t=Ed(t,`onChange`),0<t.length&&(n=new En(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var dr=null,fr=null;function pr(e){yd(e,0)}function mr(e){if(Ht(wt(e)))return e}function hr(e,t){if(e===`change`)return t}var gr=!1;if(hn){var _r;if(hn){var vr=`oninput`in document;if(!vr){var yr=document.createElement(`div`);yr.setAttribute(`oninput`,`return;`),vr=typeof yr.oninput==`function`}_r=vr}else _r=!1;gr=_r&&(!document.documentMode||9<document.documentMode)}function br(){dr&&(dr.detachEvent(`onpropertychange`,xr),fr=dr=null)}function xr(e){if(e.propertyName===`value`&&mr(fr)){var t=[];ur(t,fr,e,ln(e)),M(pr,t)}}function Sr(e,t,n){e===`focusin`?(br(),dr=t,fr=n,dr.attachEvent(`onpropertychange`,xr)):e===`focusout`&&br()}function Cr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return mr(fr)}function wr(e,t){if(e===`click`)return mr(t)}function Tr(e,t){if(e===`input`||e===`change`)return mr(t)}function Er(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Dr=typeof Object.is==`function`?Object.is:Er;function Or(e,t){if(Dr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!De.call(t,i)||!Dr(e[i],t[i]))return!1}return!0}function kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ar(e,t){var n=kr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=kr(n)}}function jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ut(e.document)}return t}function Nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Pr=hn&&`documentMode`in document&&11>=document.documentMode,Fr=null,Ir=null,Lr=null,Rr=!1;function zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rr||Fr==null||Fr!==Ut(r)||(r=Fr,`selectionStart`in r&&Nr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Lr&&Or(Lr,r)||(Lr=r,r=Ed(Ir,`onSelect`),0<r.length&&(t=new En(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Fr)))}function Br(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Vr={animationend:Br(`Animation`,`AnimationEnd`),animationiteration:Br(`Animation`,`AnimationIteration`),animationstart:Br(`Animation`,`AnimationStart`),transitionrun:Br(`Transition`,`TransitionRun`),transitionstart:Br(`Transition`,`TransitionStart`),transitioncancel:Br(`Transition`,`TransitionCancel`),transitionend:Br(`Transition`,`TransitionEnd`)},Hr={},Ur={};hn&&(Ur=document.createElement(`div`).style,`AnimationEvent`in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),`TransitionEvent`in window||delete Vr.transitionend.transition);function Wr(e){if(Hr[e])return Hr[e];if(!Vr[e])return e;var t=Vr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ur)return Hr[e]=t[n];return e}var Gr=Wr(`animationend`),Kr=Wr(`animationiteration`),qr=Wr(`animationstart`),Jr=Wr(`transitionrun`),Yr=Wr(`transitionstart`),Xr=Wr(`transitioncancel`),Zr=Wr(`transitionend`),Qr=new Map,$r=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);$r.push(`scrollEnd`);function ei(e,t){Qr.set(e,t),kt(t,[e])}var ti=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ni=[],ri=0,ii=0;function ai(){for(var e=ri,t=ii=ri=0;t<e;){var n=ni[t];ni[t++]=null;var r=ni[t];ni[t++]=null;var i=ni[t];ni[t++]=null;var a=ni[t];if(ni[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&li(n,i,a)}}function oi(e,t,n,r){ni[ri++]=e,ni[ri++]=t,ni[ri++]=n,ni[ri++]=r,ii|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function si(e,t,n,r){return oi(e,t,n,r),ui(e)}function ci(e,t){return oi(e,null,null,t),ui(e)}function li(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ui(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var di={};function fi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pi(e,t,n,r){return new fi(e,t,n,r)}function mi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hi(e,t){var n=e.alternate;return n===null?(n=pi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function gi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function _i(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)mi(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=pi(31,n,t,a),e.elementType=ee,e.lanes=o,e;case _:return vi(n.children,a,o,t);case v:s=8,a|=24;break;case y:return e=pi(12,n,t,a|2),e.elementType=y,e.lanes=o,e;case C:return e=pi(13,n,t,a),e.elementType=C,e.lanes=o,e;case w:return e=pi(19,n,t,a),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=pi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function vi(e,t,n,r){return e=pi(7,e,r,t),e.lanes=n,e}function yi(e,t,n){return e=pi(6,e,null,t),e.lanes=n,e}function bi(e){var t=pi(18,null,null,0);return t.stateNode=e,t}function xi(e,t,n){return t=pi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Si=new WeakMap;function Ci(e,t){if(typeof e==`object`&&e){var n=Si.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},Si.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var wi=[],Ti=0,Ei=null,P=0,Di=[],Oi=0,ki=null,Ai=1,ji=``;function Mi(e,t){wi[Ti++]=P,wi[Ti++]=Ei,Ei=e,P=t}function Ni(e,t,n){Di[Oi++]=Ai,Di[Oi++]=ji,Di[Oi++]=ki,ki=e;var r=Ai;e=ji;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ai=1<<32-We(t)+i|n<<i|r,ji=a+e}else Ai=1<<a|n<<i|r,ji=e}function Pi(e){e.return!==null&&(Mi(e,1),Ni(e,1,0))}function Fi(e){for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,P=wi[--Ti],wi[Ti]=null;for(;e===ki;)ki=Di[--Oi],Di[Oi]=null,ji=Di[--Oi],Di[Oi]=null,Ai=Di[--Oi],Di[Oi]=null}function Ii(e,t){Di[Oi++]=Ai,Di[Oi++]=ji,Di[Oi++]=ki,Ai=t.id,ji=t.overflow,ki=e}var Li=null,F=null,I=!1,Ri=null,zi=!1,Bi=Error(i(519));function Vi(e){throw qi(Ci(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=sn),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Li=e.return;Li;)switch(Li.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Li=Li.return}}function Wi(e){if(e!==Li)return!1;if(!I)return Ui(e),I=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&F&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));F=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));F=uf(e)}else t===27?(t=F,Zd(e.type)?(e=lf,lf=null,F=e):F=t):F=Li?cf(e.stateNode.nextSibling):null;return!0}function Gi(){F=Li=null,I=!1}function Ki(){var e=Ri;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=le(null),Yi=null,Xi=null;function Zi(e,t,n){j(Ji,t._currentValue),t._currentValue=n}function Qi(e){e._currentValue=Ji.current,ue(Ji)}function $i(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ea(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),$i(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),$i(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Dr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&ea(t,e,n,r),t.flags|=262144}function na(e){for(e=e.firstContext;e!==null;){if(!Dr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){Yi=e,Xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ia(e){return oa(Yi,e)}function aa(e,t){return Yi===null&&ra(e),oa(e,t)}function oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xi===null){if(e===null)throw Error(i(308));Xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xi=Xi.next=t;return n}var sa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ca=t.unstable_scheduleCallback,la=t.unstable_NormalPriority,ua={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function da(){return{controller:new sa,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&ca(la,function(){e.controller.abort()})}var pa=null,ma=0,ha=0,ga=null;function _a(e,t){if(pa===null){var n=pa=[];ma=0,ha=dd(),ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ma++,t.then(va,va),t}function va(){if(--ma===0&&pa!==null){ga!==null&&(ga.status=`fulfilled`);var e=pa;pa=null,ha=0,ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ya(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ba=k.S;k.S=function(e,t){tu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&_a(e,t),ba!==null&&ba(e,t)};var xa=le(null);function Sa(){var e=xa.current;return e===null?K.pooledCache:e}function Ca(e,t){t===null?j(xa,xa.current):j(xa,t.pool)}function wa(){var e=Sa();return e===null?null:{parent:ua._currentValue,pool:e}}var L=Error(i(460)),Ta=Error(i(474)),Ea=Error(i(542)),Da={then:function(){}};function Oa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ka(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(sn,sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e;default:if(typeof t.status==`string`)t.then(sn,sn);else{if(e=K,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e}throw ja=t,L}}function Aa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ja=e,L):e}}var ja=null;function Ma(){if(ja===null)throw Error(i(459));var e=ja;return ja=null,e}function Na(e){if(e===L||e===Ea)throw Error(i(483))}var Pa=null,Fa=0;function Ia(e){var t=Fa;return Fa+=1,Pa===null&&(Pa=[]),ka(Pa,e,t)}function La(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ra(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function za(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=hi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=yi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===_?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&Aa(i)===t.type)?(t=a(t,n.props),La(t,n),t.return=e,t):(t=_i(n.type,n.key,n.props,null,e.mode,r),La(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=xi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=vi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=yi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=_i(t.type,t.key,t.props,null,e.mode,n),La(n,t),n.return=e,n;case g:return t=xi(t,e.mode,n),t.return=e,t;case D:return t=Aa(t),f(e,t,n)}if(ae(t)||O(t))return t=vi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ia(t),n);if(t.$$typeof===x)return f(e,aa(e,t),n);Ra(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case h:return n.key===i?l(e,t,n,r):null;case g:return n.key===i?u(e,t,n,r):null;case D:return n=Aa(n),p(e,t,n,r)}if(ae(n)||O(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ia(n),r);if(n.$$typeof===x)return p(e,t,aa(e,n),r);Ra(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case g:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Aa(r),m(e,t,n,r,i)}if(ae(r)||O(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ia(r),i);if(r.$$typeof===x)return m(e,t,n,aa(t,r),i);Ra(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),I&&Mi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return I&&Mi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),I&&Mi(i,h),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),I&&Mi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return I&&Mi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),I&&Mi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Aa(l)===r.type){n(e,r.sibling),c=a(r,o.props),La(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===_?(c=vi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=_i(o.type,o.key,o.props,null,e.mode,c),La(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=xi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Aa(o),b(e,r,o,c)}if(ae(o))return v(e,r,o,c);if(O(o)){if(l=O(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ia(o),c);if(o.$$typeof===x)return b(e,r,aa(e,o),c);Ra(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=yi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Fa=0;var i=b(e,t,n,r);return Pa=null,i}catch(t){if(t===L||t===Ea)throw t;var a=pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ba=za(!0),Va=za(!1),Ha=!1;function Ua(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ga(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ui(e),li(e,null,n),t}return oi(e,r,t,n),ui(e)}function qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function Ja(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ya=!1;function Xa(){if(Ya){var e=ga;if(e!==null)throw e}}function Za(e,t,n,r){Ya=!1;var i=e.updateQueue;Ha=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(J&p)===p:(r&p)===p){p!==0&&p===ha&&(Ya=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ha=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Kl|=o,e.lanes=o,e.memoizedState=d}}function Qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function $a(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Qa(n[e],t)}var R=le(null),z=le(0);function eo(e,t){e=Wl,j(z,e),j(R,t),Wl=e|t.baseLanes}function to(){j(z,Wl),j(R,R.current)}function no(){Wl=z.current,ue(R),ue(z)}var ro=le(null),io=null;function ao(e){var t=e.alternate;j(uo,uo.current&1),j(ro,e),io===null&&(t===null||R.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){j(uo,uo.current),j(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(j(uo,uo.current),j(ro,e),io===null&&(io=e)):co(e)}function co(){j(uo,uo.current),j(ro,ro.current)}function lo(e){ue(ro),io===e&&(io=null),ue(uo)}var uo=le(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var po=0,B=null,V=null,mo=null,ho=!1,go=!1,_o=!1,vo=0,yo=0,bo=null,xo=0;function So(){throw Error(i(321))}function Co(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dr(e[n],t[n]))return!1;return!0}function wo(e,t,n,r,i,a){return po=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Vs:Hs,_o=!1,a=n(r,i),_o=!1,go&&(a=Eo(t,n,r,i)),To(e),a}function To(e){k.H=Bs;var t=V!==null&&V.next!==null;if(po=0,mo=V=B=null,ho=!1,yo=0,bo=null,t)throw Error(i(300));e===null||H||(e=e.dependencies,e!==null&&na(e)&&(H=!0))}function Eo(e,t,n,r){B=e;var a=0;do{if(go&&(bo=null),yo=0,go=!1,25<=a)throw Error(i(301));if(a+=1,mo=V=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Us,o=t(n,r)}while(go);return o}function Do(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Po(t):t,e=e.useState()[0],(V===null?null:V.memoizedState)!==e&&(B.flags|=1024),t}function Oo(){var e=vo!==0;return vo=0,e}function ko(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ao(e){if(ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ho=!1}po=0,mo=V=B=null,go=!1,yo=vo=0,bo=null}function jo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mo===null?B.memoizedState=mo=e:mo=mo.next=e,mo}function Mo(){if(V===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=V.next;var t=mo===null?B.memoizedState:mo.next;if(t!==null)mo=t,V=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));V=e,e={memoizedState:V.memoizedState,baseState:V.baseState,baseQueue:V.baseQueue,queue:V.queue,next:null},mo===null?B.memoizedState=mo=e:mo=mo.next=e}return mo}function No(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(e){var t=yo;return yo+=1,bo===null&&(bo=[]),e=ka(bo,e,t),t=B,(mo===null?t.memoizedState:mo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Vs:Hs),e}function Fo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Po(e);if(e.$$typeof===x)return ia(e)}throw Error(i(438,String(e)))}function Io(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=No(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=te;return t.index++,n}function Lo(e,t){return typeof t==`function`?t(e):t}function Ro(e){return zo(Mo(),V,e)}function zo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(po&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ha&&(d=!0);else if((po&p)===p){u=u.next,p===ha&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,Kl|=p;f=u.action,_o&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,B.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Dr(o,e.memoizedState)&&(H=!0,d&&(n=ga,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Bo(e){var t=Mo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Dr(o,t.memoizedState)||(H=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Vo(e,t,n){var r=B,a=Mo(),o=I;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Dr((V||a).memoizedState,n);if(s&&(a.memoizedState=n,H=!0),a=a.queue,fs(Wo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||mo!==null&&mo.memoizedState.tag&1){if(r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,a,n,t),null),K===null)throw Error(i(349));o||po&127||Ho(r,t,n)}return n}function Ho(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=No(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uo(e,t,n,r){t.value=n,t.getSnapshot=r,Go(t)&&Ko(e)}function Wo(e,t,n){return n(function(){Go(t)&&Ko(e)})}function Go(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dr(e,n)}catch{return!0}}function Ko(e){var t=ci(e,2);t!==null&&hu(t,e,2)}function qo(e){var t=jo();if(typeof e==`function`){var n=e;if(e=n(),_o){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:e},t}function Jo(e,t,n,r){return e.baseState=n,zo(e,V,typeof r==`function`?r:Lo)}function Yo(e,t,n,r,a){if(Ls(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Xo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Xo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),Zo(e,t,s)}catch(n){$o(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),Zo(e,t,a)}catch(n){$o(e,t,n)}}function Zo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Qo(e,t,n)},function(n){return $o(e,t,n)}):Qo(e,t,n)}function Qo(e,t,n){t.status=`fulfilled`,t.value=n,es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Xo(e,n)))}function $o(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,es(t),t=t.next;while(t!==r)}e.action=null}function es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ts(e,t){return t}function ns(e,t){if(I){var n=K.formState;if(n!==null){a:{var r=B;if(I){if(F){b:{for(var i=F,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){F=cf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=jo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:t},n.queue=r,n=Ps.bind(null,B,r),r.dispatch=n,r=qo(!1),a=Is.bind(null,B,!1,r.queue),r=jo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Yo.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function rs(e){return is(Mo(),V,e)}function is(e,t,n){if(t=zo(e,t,ts)[0],e=Ro(Lo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Po(t)}catch(e){throw e===L?Ea:e}else r=t;t=Mo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,ss(9,{destroy:void 0},as.bind(null,i,n),null)),[r,a,e]}function as(e,t){e.action=t}function os(e){var t=Mo(),n=V;if(n!==null)return is(t,n,e);Mo(),t=t.memoizedState,n=Mo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ss(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=No(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function cs(){return Mo().memoizedState}function ls(e,t,n,r){var i=jo();B.flags|=e,i.memoizedState=ss(1|t,{destroy:void 0},n,r===void 0?null:r)}function us(e,t,n,r){var i=Mo();r=r===void 0?null:r;var a=i.memoizedState.inst;V!==null&&r!==null&&Co(r,V.memoizedState.deps)?i.memoizedState=ss(t,a,n,r):(B.flags|=e,i.memoizedState=ss(1|t,a,n,r))}function ds(e,t){ls(8390656,8,e,t)}function fs(e,t){us(2048,8,e,t)}function ps(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=No(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ms(e){var t=Mo().memoizedState;return ps({ref:t,nextImpl:e}),function(){if(G&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function hs(e,t){return us(4,2,e,t)}function gs(e,t){return us(4,4,e,t)}function _s(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vs(e,t,n){n=n==null?null:n.concat([e]),us(4,4,_s.bind(null,t,e),n)}function ys(){}function bs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Co(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Co(t,r[1]))return r[0];if(r=e(),_o){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Ss(e,t,n){return n===void 0||po&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),B.lanes|=e,Kl|=e,n)}function Cs(e,t,n,r){return Dr(n,t)?n:R.current===null?!(po&42)||po&1073741824&&!(J&261930)?(H=!0,e.memoizedState=n):(e=mu(),B.lanes|=e,Kl|=e,t):(e=Ss(e,n,r),Dr(e,t)||(H=!0),e)}function ws(e,t,n,r,i){var a=A.p;A.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,Is(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,ya(c,r),pu(e)):Fs(e,t,r,pu(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function Ts(){}function Es(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ds(e).queue;ws(e,a,t,oe,n===null?Ts:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},pu())}function ks(){return ia(Qf)}function As(){return Mo().memoizedState}function js(){return Mo().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ga(n);var r=Ka(t,e,n);r!==null&&(hu(r,t,n),qa(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=si(e,t,n,r),n!==null&&(hu(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,pu())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Dr(s,o))return oi(e,t,i,0),K===null&&ai(),!1}catch{}if(n=si(e,t,i,r),n!==null)return hu(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(i(479))}else t=si(e,n,r,2),t!==null&&hu(t,e,2)}function Ls(e){var t=e.alternate;return e===B||t!==null&&t===B}function Rs(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Bs={readContext:ia,use:Fo,useCallback:So,useContext:So,useEffect:So,useImperativeHandle:So,useLayoutEffect:So,useInsertionEffect:So,useMemo:So,useReducer:So,useRef:So,useState:So,useDebugValue:So,useDeferredValue:So,useTransition:So,useSyncExternalStore:So,useId:So,useHostTransitionStatus:So,useFormState:So,useActionState:So,useOptimistic:So,useMemoCache:So,useCacheRefresh:So};Bs.useEffectEvent=So;var Vs={readContext:ia,use:Fo,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var r=e();if(_o){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=jo();if(n!==void 0){var i=n(t);if(_o){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ps.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(jo(),e,t)},useTransition:function(){var e=qo(!1);return e=ws.bind(null,B,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=jo();if(I){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),K===null)throw Error(i(349));J&127||Ho(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ds(Wo.bind(null,r,o,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,o,n,t),null),n},useId:function(){var e=jo(),t=K.identifierPrefix;if(I){var n=ji,r=Ai;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ks,useFormState:ns,useActionState:ns,useOptimistic:function(e){var t=jo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Is.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:Io,useCacheRefresh:function(){return jo().memoizedState=Ms.bind(null,B)},useEffectEvent:function(e){var t=jo(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Hs={readContext:ia,use:Fo,useCallback:bs,useContext:ia,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Ro,useRef:cs,useState:function(){return Ro(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){return Cs(Mo(),V.memoizedState,e,t)},useTransition:function(){var e=Ro(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){return Jo(Mo(),V,e,t)},useMemoCache:Io,useCacheRefresh:js};Hs.useEffectEvent=ms;var Us={readContext:ia,use:Fo,useCallback:bs,useContext:ia,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Bo,useRef:cs,useState:function(){return Bo(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){var n=Mo();return V===null?Ss(n,e,t):Cs(n,V.memoizedState,e,t)},useTransition:function(){var e=Bo(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:os,useActionState:os,useOptimistic:function(e,t){var n=Mo();return V===null?(n.baseState=e,[e,n.queue.dispatch]):Jo(n,V,e,t)},useMemoCache:Io,useCacheRefresh:js};Us.useEffectEvent=ms;function Ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ga(r);i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(hu(t,e,r),qa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ga(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(hu(t,e,r),qa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Ga(n);r.tag=2,t!=null&&(r.callback=t),t=Ka(e,r,n),t!==null&&(hu(t,e,n),qa(t,e,n))}};function Ks(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Or(n,r)||!Or(i,a):!0}function qs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gs.enqueueReplaceState(t,t.state,null)}function Js(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ys(e){ti(e)}function Xs(e){console.error(e)}function Zs(e){ti(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){return n=Ga(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=Ga(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ta(t,n,a,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?Du():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(I)return t=ro.current,t===null?(r!==Bi&&(t=Error(i(423),{cause:r}),qi(Ci(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ci(r,n),a=ec(e.stateNode,r,a),Ja(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Bi&&(e=Error(i(422),{cause:r}),qi(Ci(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ci(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=Ci(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ec(n.stateNode,r,e),Ja(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=tc(a),nc(a,e,n,r),Ja(n,a),!1}n=n.return}while(n!==null);return!1}var ic=Error(i(461)),H=!1;function ac(e,t,n,r){t.child=e===null?Va(t,null,n,r):Ba(t,e.child,n,r)}function oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ra(t),r=wo(e,t,n,o,a,i),s=Oo(),e!==null&&!H?(ko(e,t,i),Ac(e,t,i)):(I&&s&&Pi(t),t.flags|=1,ac(e,t,r,i),t.child)}function sc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!mi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,cc(e,t,a,r,i)):(e=_i(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Or:n,n(o,r)&&e.ref===t.ref)return Ac(e,t,i)}return t.flags|=1,e=hi(a,r),e.ref=t.ref,e.return=t,t.child=e}function cc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Or(a,r)&&e.ref===t.ref)if(H=!1,t.pendingProps=r=a,jc(e,i))e.flags&131072&&(H=!0);else return t.lanes=e.lanes,Ac(e,t,i)}return gc(e,t,n,r,i)}function lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return dc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ca(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,dc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ca(t,null),to(),co(t)):(Ca(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return ac(e,t,i,n),t.child}function uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dc(e,t,n,r,i){var a=Sa();return a=a===null?null:{parent:ua._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ca(t,null),to(),so(t),e!==null&&ta(e,t,r,!0),t.childLanes=i,null}function fc(e,t){return t=Tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pc(e,t,n){return Ba(t,e.child,null,n),e=fc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function mc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(I){if(r.mode===`hidden`)return e=fc(t,r),t.lanes=536870912,uc(null,e);if(oo(t),(e=F)?(e=rf(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ki===null?null:{id:Ai,overflow:ji},retryLane:536870912,hydrationErrors:null},n=bi(e),n.return=t,t.child=n,Li=t,F=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),a)if(t.flags&256)t.flags&=-257,t=pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(H||ta(e,t,n,!1),a=(n&e.childLanes)!==0,H||a){if(r=K,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ci(e,s),hu(r,e,s),ic;Du(),t=pc(e,t,n)}else e=o.treeContext,F=cf(s.nextSibling),Li=t,I=!0,Ri=null,zi=!1,e!==null&&Ii(t,e),t=fc(t,r),t.flags|=4096;return t}return e=hi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gc(e,t,n,r,i){return ra(t),n=wo(e,t,n,r,void 0,i),r=Oo(),e!==null&&!H?(ko(e,t,i),Ac(e,t,i)):(I&&r&&Pi(t),t.flags|=1,ac(e,t,n,i),t.child)}function _c(e,t,n,r,i,a){return ra(t),t.updateQueue=null,n=Eo(t,r,n,i),To(e),r=Oo(),e!==null&&!H?(ko(e,t,a),Ac(e,t,a)):(I&&r&&Pi(t),t.flags|=1,ac(e,t,n,a),t.child)}function vc(e,t,n,r,i){if(ra(t),t.stateNode===null){var a=di,o=n.contextType;typeof o==`object`&&o&&(a=ia(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Gs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ua(t),o=n.contextType,a.context=typeof o==`object`&&o?ia(o):di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ws(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Gs.enqueueReplaceState(a,a.state,null),Za(t,r,a,i),Xa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=di,typeof u==`object`&&u&&(o=ia(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&qs(t,a,r,o),Ha=!1;var f=t.memoizedState;a.state=f,Za(t,r,a,i),Xa(),l=t.memoizedState,s||f!==l||Ha?(typeof d==`function`&&(Ws(t,n,d,r),l=t.memoizedState),(c=Ha||Ks(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Wa(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=di,typeof l==`object`&&l&&(c=ia(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&qs(t,a,r,c),Ha=!1,f=t.memoizedState,a.state=f,Za(t,r,a,i),Xa();var p=t.memoizedState;o!==d||f!==p||Ha||e!==null&&e.dependencies!==null&&na(e.dependencies)?(typeof s==`function`&&(Ws(t,n,s,r),p=t.memoizedState),(u=Ha||Ks(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&na(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,hc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ba(t,e.child,null,i),t.child=Ba(t,null,n,i)):ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ac(e,t,i),e}function yc(e,t,n,r){return Gi(),t.flags|=256,ac(e,t,n,r),t.child}var bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:wa()}}function Sc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function Cc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(uo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(I){if(a?ao(t):co(t),(e=F)?(e=rf(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ki===null?null:{id:Ai,overflow:ji},retryLane:536870912,hydrationErrors:null},n=bi(e),n.return=t,t.child=n,Li=t,F=null)):e=null,e===null)throw Vi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(co(t),a=t.mode,c=Tc({mode:`hidden`,children:c},a),r=vi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(null,r)):(ao(t),wc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=Ec(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,a=t.mode,r=Tc({mode:`visible`,children:r.children},a),c=vi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ba(t,e.child,null,n),r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,t=uc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=Ec(e,t,n)}else if(H||ta(e,t,n,!1),s=(n&e.childLanes)!==0,H||s){if(s=K,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ci(e,r),hu(s,e,r),ic;af(c)||Du(),t=Ec(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,F=cf(c.nextSibling),Li=t,I=!0,Ri=null,zi=!1,e!==null&&Ii(t,e),t=wc(t,r.children),t.flags|=4096);return t}return a?(co(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=hi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=vi(c,a,n,null),c.flags|=2):c=hi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,uc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=xc(n):(a=c.cachePool,a===null?a=wa():(l=ua._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=hi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function wc(e,t){return t=Tc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Tc(e,t){return e=pi(22,e,null,t),e.lanes=0,e}function Ec(e,t,n){return Ba(t,e.child,null,n),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$i(e.return,t,n)}function Oc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function kc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,j(uo,o),ac(e,t,r,n),r=I?P:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dc(e,n,t);else if(e.tag===19)Dc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Oc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Oc(t,!0,n,null,a,r);break;case`together`:Oc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=hi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&na(e))):!0}function Mc(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),Zi(t,ua,e.memoizedState.cache),Gi();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:Zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=Ac(e,t,n),e===null?null:e.sibling):Cc(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return kc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),j(uo,uo.current),r)break;return null;case 22:return t.lanes=0,lc(e,t,n,t.pendingProps);case 24:Zi(t,ua,e.memoizedState.cache)}return Ac(e,t,n)}function Nc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)H=!0;else{if(!jc(e,n)&&!(t.flags&128))return H=!1,Mc(e,t,n);H=!!(e.flags&131072)}else H=!1,I&&t.flags&1048576&&Ni(t,P,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Aa(t.elementType),t.type=e,typeof e==`function`)mi(e)?(r=Js(e,r),t.tag=1,t=vc(null,t,e,r,n)):(t.tag=0,t=gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===S){t.tag=11,t=oc(null,t,e,r,n);break a}else if(a===E){t.tag=14,t=sc(null,t,e,r,n);break a}}throw t=ie(e)||e,Error(i(306,t,``))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Js(r,t.pendingProps),vc(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Wa(e,t),Za(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Zi(t,ua,r),r!==o.cache&&ea(t,[ua],n,!0),Xa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=yc(e,t,r,n);break a}else if(r!==a){a=Ci(Error(i(424)),t),qi(a),t=yc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(F=cf(e.firstChild),Li=t,I=!0,Ri=null,zi=!0,n=Va(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===a){t=Ac(e,t,n);break a}ac(e,t,r,n)}t=t.child}return t;case 26:return hc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:I||(n=t.type,e=t.pendingProps,r=Bd(pe.current).createElement(n),r[pt]=t,r[mt]=e,Pd(r,n,e),Et(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&I&&(r=t.stateNode=ff(t.type,t.pendingProps,pe.current),Li=t,zi=!0,a=F,Zd(t.type)?(lf=a,F=cf(r.firstChild)):F=a),ac(e,t,t.pendingProps.children,n),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((a=r=F)&&(r=tf(r,t.type,t.pendingProps,zi),r===null?a=!1:(t.stateNode=r,Li=t,F=cf(r.firstChild),zi=!1,a=!0)),a||Vi(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=wo(e,t,Do,null,null,n),Qf._currentValue=a),hc(e,t),ac(e,t,r,n),t.child;case 6:return e===null&&I&&((e=n=F)&&(n=nf(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Li=t,F=null,e=!0)),e||Vi(t)),null;case 13:return Cc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ba(t,null,r,n):ac(e,t,r,n),t.child;case 11:return oc(e,t,t.type,t.pendingProps,n);case 7:return ac(e,t,t.pendingProps,n),t.child;case 8:return ac(e,t,t.pendingProps.children,n),t.child;case 12:return ac(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Zi(t,t.type,r.value),ac(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ra(t),a=ia(a),r=r(a),t.flags|=1,ac(e,t,r,n),t.child;case 14:return sc(e,t,t.type,t.pendingProps,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 19:return kc(e,t,n);case 31:return mc(e,t,n);case 22:return lc(e,t,n,t.pendingProps);case 24:return ra(t),r=ia(ua),e===null?(a=Sa(),a===null&&(a=K,o=da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ua(t),Zi(t,ua,a)):((e.lanes&n)!==0&&(Wa(e,t),Za(t,null,null,n),Xa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Zi(t,ua,r),r!==a.cache&&ea(t,[ua],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Zi(t,ua,r))),ac(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Pc(e){e.flags|=4}function Fc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw ja=Da,Ta}else e.flags&=-16777217}function Ic(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw ja=Da,Ta}function Lc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,Xl|=t)}function Rc(e,t){if(!I)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function U(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function zc(e,t,n){var r=t.pendingProps;switch(Fi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return U(t),null;case 1:return U(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qi(ua),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Pc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),U(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Pc(t),o===null?(U(t),Fc(t,a,null,r,n)):(U(t),Ic(t,o))):o?o===e.memoizedState?(U(t),t.flags&=-16777217):(Pc(t),U(t),Ic(t,o)):(e=e.memoizedProps,e!==r&&Pc(t),U(t),Fc(t,a,e,r,n)),null;case 27:if(ye(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return U(t),null}e=de.current,Wi(t)?Hi(t,e):(e=ff(a,r,n),t.stateNode=e,Pc(t))}return U(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return U(t),null}if(o=de.current,Wi(t))Hi(t,o);else{var s=Bd(pe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return U(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Li,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Vi(t,!0)}else e=Bd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return U(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return U(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lc(t,t.updateQueue),U(t),null);case 4:return ge(),e===null&&Sd(t.stateNode.containerInfo),U(t),null;case 10:return Qi(t.type),U(t),null;case 19:if(ue(uo),r=t.memoizedState,r===null)return U(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Rc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gi(n,e),n=n.sibling;return j(uo,uo.current&1|2),I&&Mi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>X&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!I)return U(t),null}else 2*Me()-r.renderingStartTime>X&&n!==536870912&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(U(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=uo.current,j(uo,a?n&1|2:n&1),I&&Mi(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(U(t),t.subtreeFlags&6&&(t.flags|=8192)):U(t),n=t.updateQueue,n!==null&&Lc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ue(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),U(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Bc(e,t){switch(Fi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(uo),null;case 4:return ge(),null;case 10:return Qi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&ue(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function Vc(e,t){switch(Fi(t),t.tag){case 3:Qi(ua),ge();break;case 26:case 27:case 5:ye(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:ue(uo);break;case 10:Qi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&ue(xa);break;case 24:Qi(ua)}}function Hc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Uc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{$a(t,n)}catch(t){Z(e,e.return,t)}}}function Gc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Kc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Jc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[mt]=t}catch(t){Z(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[pt]=e,t[mt]=n}catch(t){Z(e,e.return,t)}}var tl=!1,nl=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Rd=sp,e=Mr(e),Nr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Js(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,al=e;break}al=t.return}}function sl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:xl(e,n),r&4&&Hc(5,n);break;case 1:if(xl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Wc(n),r&512&&Kc(n,n.return);break;case 3:if(xl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{$a(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&el(n);case 26:case 5:xl(e,n),t===null&&r&4&&Jc(n),r&512&&Kc(n,n.return);break;case 12:xl(e,n);break;case 31:xl(e,n),r&4&&fl(e,n);break;case 13:xl(e,n),r&4&&pl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||tl,!r){t=t!==null&&t.memoizedState!==null||nl,i=tl;var a=nl;tl=r,(nl=t)&&!a?Cl(e,n,(n.subtreeFlags&8772)!=0):xl(e,n),tl=i,nl=a}break;case 30:break;default:xl(e,n)}}function cl(e){var t=e.alternate;t!==null&&(e.alternate=null,cl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var W=null,ll=!1;function ul(e,t,n){for(n=n.child;n!==null;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:nl||qc(n,t),ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:nl||qc(n,t);var r=W,i=ll;Zd(n.type)&&(W=n.stateNode,ll=!1),ul(e,t,n),pf(n.stateNode),W=r,ll=i;break;case 5:nl||qc(n,t);case 6:if(r=W,i=ll,W=null,ul(e,t,n),W=r,ll=i,W!==null)if(ll)try{(W.nodeType===9?W.body:W.nodeName===`HTML`?W.ownerDocument.body:W).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{W.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:W!==null&&(ll?(e=W,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(W,n.stateNode));break;case 4:r=W,i=ll,W=n.stateNode.containerInfo,ll=!0,ul(e,t,n),W=r,ll=i;break;case 0:case 11:case 14:case 15:Uc(2,n,t),nl||Uc(4,n,t),ul(e,t,n);break;case 1:nl||(qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Gc(n,t,r)),ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:nl=(r=nl)||n.memoizedState!==null,ul(e,t,n),nl=r;break;default:ul(e,t,n)}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function ml(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new il),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new il),t;default:throw Error(i(435,e.tag))}}function hl(e,t){var n=ml(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function gl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){W=c.stateNode,ll=!1;break a}break;case 5:W=c.stateNode,ll=!1;break a;case 3:case 4:W=c.stateNode.containerInfo,ll=!0;break a}c=c.return}if(W===null)throw Error(i(160));dl(o,s,a),W=null,ll=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vl(t,e),t=t.sibling}var _l=null;function vl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gl(t,e),yl(e),r&4&&(Uc(3,e,e.return),Hc(3,e),Uc(5,e,e.return));break;case 1:gl(t,e),yl(e),r&512&&(nl||n===null||qc(n,n.return)),r&64&&tl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=_l;if(gl(t,e),yl(e),r&512&&(nl||n===null||qc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[bt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[pt]=e,Et(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Yc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:gl(t,e),yl(e),r&512&&(nl||n===null||qc(n,n.return)),n!==null&&r&4&&Yc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gl(t,e),yl(e),r&512&&(nl||n===null||qc(n,n.return)),e.flags&32){a=e.stateNode;try{Qt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Yc(e,a,n===null?a:n.memoizedProps)),r&1024&&(rl=!0);break;case 6:if(gl(t,e),yl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,a=_l,_l=gf(t.containerInfo),gl(t,e),_l=a,yl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}rl&&(rl=!1,bl(e));break;case 4:r=_l,_l=gf(e.stateNode.containerInfo),gl(t,e),yl(e),_l=r;break;case 12:gl(t,e),yl(e);break;case 31:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 13:gl(t,e),yl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=tl,d=nl;if(tl=u||a,nl=d||l,gl(t,e),nl=d,tl=u,yl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||tl||nl||Sl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,hl(e,n))));break;case 19:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 30:break;case 21:break;default:gl(t,e),yl(e)}}function yl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;$c(e,Zc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Qt(o,``),n.flags&=-33),$c(e,Zc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Qc(e,Zc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sl(e,t.alternate,t),t=t.sibling}function Sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Uc(4,t,t.return),Sl(t);break;case 1:qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Gc(t,t.return,n),Sl(t);break;case 27:pf(t.stateNode);case 26:case 5:qc(t,t.return),Sl(t);break;case 22:t.memoizedState===null&&Sl(t);break;case 30:Sl(t);break;default:Sl(t)}e=e.sibling}}function Cl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(i,a,n),Hc(4,a);break;case 1:if(Cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Qa(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Wc(a),Kc(a,a.return);break;case 27:el(a);case 26:case 5:Cl(i,a,n),n&&r===null&&o&4&&Jc(a),Kc(a,a.return);break;case 12:Cl(i,a,n);break;case 31:Cl(i,a,n),n&&o&4&&fl(i,a);break;case 13:Cl(i,a,n),n&&o&4&&pl(i,a);break;case 22:a.memoizedState===null&&Cl(i,a,n),Kc(a,a.return);break;case 30:break;default:Cl(i,a,n)}t=t.sibling}}function wl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&fa(n))}function Tl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e))}function El(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dl(e,t,n,r),t=t.sibling}function Dl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:El(e,t,n,r),i&2048&&Hc(9,t);break;case 1:El(e,t,n,r);break;case 3:El(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e)));break;case 12:if(i&2048){El(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else El(e,t,n,r);break;case 31:El(e,t,n,r);break;case 13:El(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?El(e,t,n,r):(a._visibility|=2,Ol(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?El(e,t,n,r):kl(e,t),i&2048&&wl(o,t);break;case 24:El(e,t,n,r),i&2048&&Tl(t.alternate,t);break;default:El(e,t,n,r)}}function Ol(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ol(a,o,s,c,i),Hc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ol(a,o,s,c,i)):u._visibility&2?Ol(a,o,s,c,i):kl(a,o),i&&l&2048&&wl(o.alternate,o);break;case 24:Ol(a,o,s,c,i),i&&l&2048&&Tl(o.alternate,o);break;default:Ol(a,o,s,c,i)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:kl(n,r),i&2048&&wl(r.alternate,r);break;case 24:kl(n,r),i&2048&&Tl(r.alternate,r);break;default:kl(n,r)}t=t.sibling}}var Al=8192;function jl(e,t,n){if(e.subtreeFlags&Al)for(e=e.child;e!==null;)Ml(e,t,n),e=e.sibling}function Ml(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&Al&&e.memoizedState!==null&&Gf(n,_l,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,n);break;case 3:case 4:var r=_l;_l=gf(e.stateNode.containerInfo),jl(e,t,n),_l=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Al,Al=16777216,jl(e,t,n),Al=r):jl(e,t,n));break;default:jl(e,t,n)}}function Nl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Ll(r,e)}Nl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fl(e),e=e.sibling}function Fl(e){switch(e.tag){case 0:case 11:case 15:Pl(e),e.flags&2048&&Uc(9,e,e.return);break;case 3:Pl(e);break;case 12:Pl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Il(e)):Pl(e);break;default:Pl(e)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Ll(r,e)}Nl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Uc(8,t,t.return),Il(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Il(t));break;default:Il(t)}e=e.sibling}}function Ll(e,t){for(;al!==null;){var n=al;switch(n.tag){case 0:case 11:case 15:Uc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,al=r;else a:for(n=e;al!==null;){r=al;var i=r.sibling,a=r.return;if(cl(r),r===n){al=null;break a}if(i!==null){i.return=a,al=i;break a}al=a}}}var Rl={getCacheForType:function(e){var t=ia(ua),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ia(ua).controller.signal}},zl=typeof WeakMap==`function`?WeakMap:Map,G=0,K=null,q=null,J=0,Y=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,X=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return G&2&&J!==0?J&-J:k.T===null?ut():dd()}function mu(){if(Yl===0)if(!(J&536870912)||I){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),Yl=e}else Yl=536870912;return e=ro.current,e!==null&&(e.flags|=32),Yl}function hu(e,t,n){(e===K&&(Y===2||Y===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,J,Yl,!1)),rt(e,n),(!(G&2)||e!==K)&&(e===K&&(!(G&2)&&(ql|=n),Gl===4&&yu(e,J,Yl,!1)),rd(e))}function gu(e,t,n){if(G&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||$e(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Hl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-Me(),10<a)){if(yu(r,t,Yl,!Vl),Qe(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Ql,nu,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),a);break a}_u(r,n,Ql,nu,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sn},Ml(t,a,d);var m=(a&62914560)===a?eu-Me():(a&4194048)===a?tu-Me():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Dr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function bu(){return G&6?!0:(id(0,!1),!1)}function xu(){if(q!==null){if(Y===0)var e=q.return;else e=q,Xi=Yi=null,Ao(e),Pa=null,Fa=0,e=q;for(;e!==null;)Vc(e.alternate,e),e=e.return;q=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),K=e,q=n=hi(e.current,null),J=t,Y=0,Bl=null,Vl=!1,Hl=$e(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,ai(),n}function Cu(e,t){B=null,k.H=Bs,t===L||t===Ea?(t=Ma(),Y=3):t===Ta?(t=Ma(),Y=4):Y=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,q===null&&(Gl=1,Qs(e,Ci(t,e.current)))}function wu(){var e=ro.current;return e===null?!0:(J&4194048)===J?io===null:(J&62914560)===J||J&536870912?e===io:!1}function Tu(){var e=k.H;return k.H=Bs,e===null?Bs:e}function Eu(){var e=k.A;return k.A=Rl,e}function Du(){Gl=4,Vl||(J&4194048)!==J&&ro.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||K===null||yu(K,J,Yl,!1)}function Ou(e,t,n){var r=G;G|=2;var i=Tu(),a=Eu();(K!==e||J!==t)&&(nu=null,Su(e,t)),t=!1;var o=Gl;a:do try{if(Y!==0&&q!==null){var s=q,c=Bl;switch(Y){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=Y;if(Y=0,Bl=null,Pu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=Y,Y=0,Bl=null,Pu(e,s,c,l)}}ku(),o=Gl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Xi=Yi=null,G=r,k.H=i,k.A=a,q===null&&(K=null,J=0,ai()),o}function ku(){for(;q!==null;)Mu(q)}function Au(e,t){var n=G;G|=2;var r=Tu(),a=Eu();K!==e||J!==t?(nu=null,X=Me()+500,Su(e,t)):Hl=$e(e,t);a:do try{if(Y!==0&&q!==null){t=q;var o=Bl;b:switch(Y){case 1:Y=0,Bl=null,Pu(e,t,o,1);break;case 2:case 9:if(Oa(o)){Y=0,Bl=null,Nu(t);break}t=function(){Y!==2&&Y!==9||K!==e||(Y=7),rd(e)},o.then(t,t);break a;case 3:Y=7;break a;case 4:Y=5;break a;case 7:Oa(o)?(Y=0,Bl=null,Nu(t)):(Y=0,Bl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Wf(s):c.stateNode.complete){Y=0,Bl=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,Fu(u))}break b}}Y=0,Bl=null,Pu(e,t,o,5);break;case 6:Y=0,Bl=null,Pu(e,t,o,6);break;case 8:xu(),Gl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Xi=Yi=null,k.H=r,k.A=a,G=n,q===null?(K=null,J=0,ai(),Gl):0}function ju(){for(;q!==null&&!Ae();)Mu(q)}function Mu(e){var t=Nc(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Fu(e):q=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_c(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=_c(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:Ao(t);default:Vc(n,t),t=q=gi(t,Wl),t=Nc(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Fu(e):q=t}function Pu(e,t,n,r){Xi=Yi=null,Ao(t),Pa=null,Fa=0;var i=t.return;try{if(rc(e,i,t,n,J)){Gl=1,Qs(e,Ci(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;Gl=1,Qs(e,Ci(n,e.current)),q=null;return}t.flags&32768?(I||r===1?e=!0:Hl||J&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Vl);return}e=t.return;var n=zc(t.alternate,t,Wl);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);Gl===0&&(Gl=5)}function Iu(e,t){do{var n=Bc(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);Gl=6,q=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(G&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ii,it(e,n,o,s,c,l),e===K&&(q=K=null,J=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ie,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,a=A.p,A.p=2,s=G,G|=4;try{ol(e,t,n)}finally{G=s,A.p=a,k.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=G;G|=4;try{vl(t,e);var a=zd,o=Mr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&jr(s.ownerDocument.documentElement,s)){if(c!==null&&Nr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Ar(s,h),v=Ar(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{G=i,A.p=r,k.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=G;G|=4;try{sl(e,t.alternate,t)}finally{G=i,A.p=r,k.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,je();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),lt(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=A.p,A.p=2,k.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{k.T=t,A.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=lt(su),r=k.T,a=A.p;try{A.p=32>n?32:n,k.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,G&6)throw Error(i(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,id(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{A.p=a,k.T=r,Vu(e,t)}}function Wu(e,t,n){t=Ci(n,t),t=ec(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&(rt(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=Ci(n,e),n=tc(2),r=Ka(t,n,2),r!==null&&(nc(n,r,t,e),rt(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(Gl===4||Gl===3&&(J&62914560)===J&&300>Me()-eu?!(G&2)&&Su(e,0):Jl|=n,Xl===J&&(Xl=0)),rd(e)}function qu(e,t){t===0&&(t=tt()),e=ci(e,t),e!==null&&(rt(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Oe(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=Qe(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Me(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=K,n=J,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Y===2||Y===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),lt(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Re;break;default:n=Ie}return r=cd.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=J;return r=Qe(e,e===K?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){G&6?Oe(Pe,ad):od()})}function dd(){if(nd===0){var e=ha;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:on(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new En(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Es(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Es(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<$r.length;hd++){var gd=$r[hd];ei(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}ei(Gr,`onAnimationEnd`),ei(Kr,`onAnimationIteration`),ei(qr,`onAnimationStart`),ei(`dblclick`,`onDoubleClick`),ei(`focusin`,`onFocus`),ei(`focusout`,`onBlur`),ei(Jr,`onTransitionRun`),ei(Yr,`onTransitionStart`),ei(Xr,`onTransitionCancel`),ei(Zr,`onTransitionEnd`),At(`onMouseEnter`,[`mouseout`,`mouseover`]),At(`onMouseLeave`,[`mouseout`,`mouseover`]),At(`onPointerEnter`,[`pointerout`,`pointerover`]),At(`onPointerLeave`,[`pointerout`,`pointerover`]),kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ti(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ti(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,Dt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!gn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=St(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}M(function(){var r=a,i=ln(n),s=[];a:{var c=Qr.get(e);if(c!==void 0){var l=En,u=e;switch(e){case`keypress`:if(xn(n)===0)break a;case`keydown`:case`keyup`:l=Wn;break;case`focusin`:u=`focus`,l=Fn;break;case`focusout`:u=`blur`,l=Fn;break;case`beforeblur`:case`afterblur`:l=Fn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Nn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Pn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Kn;break;case Gr:case Kr:case qr:l=In;break;case Zr:l=qn;break;case`scroll`:case`scrollend`:l=On;break;case`wheel`:l=Jn;break;case`copy`:case`cut`:case`paste`:l=Ln;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Gn;break;case`toggle`:case`beforetoggle`:l=Yn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=mn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==cn&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[ht]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?St(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Nn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Gn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:wt(l),h=u==null?c:wt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,St(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?wt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=hr;else if(lr(c))if(gr)v=Tr;else{v=Cr;var y=Sr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&nn(r.elementType)&&(v=hr):v=wr;if(v&&=v(e,r)){ur(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Jt(c,`number`,c.value)}switch(y=r?wt(r):window,e){case`focusin`:(lr(y)||y.contentEditable===`true`)&&(Fr=y,Ir=r,Lr=null);break;case`focusout`:Lr=Ir=Fr=null;break;case`mousedown`:Rr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Rr=!1,zr(s,n,i);break;case`selectionchange`:if(Pr)break;case`keydown`:case`keyup`:zr(s,n,i)}var b;if(Zn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else ar?rr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(er&&n.locale!==`ko`&&(ar||x!==`onCompositionStart`?x===`onCompositionEnd`&&ar&&(b=bn()):(_n=i,vn=`value`in _n?_n.value:_n.textContent,ar=!0)),y=Ed(r,x),0<y.length&&(x=new Rn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=ir(n),b!==null&&(x.data=b)))),(b=$n?or(e,n):sr(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Rn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=mn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=mn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=mn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=mn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
1121
- `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Qt(e,``+r);break;case`className`:It(e,`class`,r);break;case`tabIndex`:It(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:It(e,n,r);break;case`style`:tn(e,r,o);break;case`data`:if(t!==`object`){It(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=on(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Ft(e,`popover`,r);break;case`xlinkActuate`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ft(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=rn.get(n)||n,Ft(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:tn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Qt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ft(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Yt(e,!!r,n,!0):Yt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}Zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Kt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Yt(e,!!n,n?[]:``,!1):Yt(e,!!n,t,!0)):Yt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}Xt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=A.d;A.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Os(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Tt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Et(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Tt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Et(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Tt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Et(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=pe.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Gt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Et(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Gt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,Et(a),a):(r=n,(a=mf.get(o))&&(r=f({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[pt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:x,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=pi(3,null,null,t),e.current=a,a.stateNode=e,t=da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ua(a),e}function tp(e){return e?(e=di,e):di}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ga(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ka(e,r,t),n!==null&&(hu(n,e,t),qa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ci(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=ct(t);var n=ci(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=2,up(e,t,n,r)}finally{A.p=a,k.T=i}}function lp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=8,up(e,t,n,r)}finally{A.p=a,k.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}rd(a),!(G&6)&&(X=Me()+500,id(0,!1))}}break;case 31:case 13:s=ci(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=ln(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=St(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ct(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=St(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,dt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=Ct(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Es(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[ht]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(i(527,Lp,`19.2.7`));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ve=zp.inject(Rp),He=zp}catch{}}e.hydrateRoot=function(e,t,n){if(!a(e))throw Error(i(299));var r=!1,o=``,s=Ys,c=Xs,l=Zs,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=ep(e,1,!0,t,n??null,r,o,u,s,c,l,Pp),t.context=tp(null),n=t.current,r=pu(),r=ct(r),o=Ga(r),o.callback=null,Ka(n,o,r),n=r,t.current.lanes=n,rt(t,n),rd(t),e[ht]=t.current,Sd(e),new Ip(t)}}));(0,i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=uC()}))().hydrateRoot)(document,(0,R.jsx)(z.StrictMode,{children:(0,R.jsx)(sC,{})}));export{Ul as $,Sh as A,Yl as B,Tx as C,Xb as D,ox as E,cu as F,q as G,zl as H,iu as I,Wl as J,G as K,X as L,lh as M,vu as N,$_ as O,gu as P,Vl as Q,$l as R,Ex as S,dx as T,K as U,Y as V,J as W,Gl as X,Hl as Y,Bl as Z,Mx as _,cS as a,el as at,Ox as b,fS as c,fo as ct,Hx as d,Dl as et,Lx as f,Px as g,Nx as h,OS as i,nl as it,xh as j,q_ as k,uS as l,Ix as m,PS as n,ll as nt,sS as o,Lo as ot,Rx as p,Rl as q,NS as r,cl as rt,aS as s,Ao as st,FS as t,Nl as tt,Ux as u,Ax as v,yx as w,Dx as x,jx as y,Zl as z};