super-time-tracker-ui 0.1.18 → 0.1.20

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 (360) hide show
  1. package/dist/standalone/next-output/BUILD_ID +1 -1
  2. package/dist/standalone/next-output/app-path-routes-manifest.json +11 -1
  3. package/dist/standalone/next-output/build-manifest.json +8 -8
  4. package/dist/standalone/next-output/prerender-manifest.json +0 -145
  5. package/dist/standalone/next-output/routes-manifest.json +60 -0
  6. package/dist/standalone/next-output/server/app/_global-error/page/build-manifest.json +5 -5
  7. package/dist/standalone/next-output/server/app/_global-error/page.js +1 -1
  8. package/dist/standalone/next-output/server/app/_global-error/page.js.nft.json +1 -1
  9. package/dist/standalone/next-output/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/dist/standalone/next-output/server/app/_global-error.html +1 -1
  11. package/dist/standalone/next-output/server/app/_global-error.rsc +8 -8
  12. package/dist/standalone/next-output/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  13. package/dist/standalone/next-output/server/app/_global-error.segments/_full.segment.rsc +8 -8
  14. package/dist/standalone/next-output/server/app/_global-error.segments/_head.segment.rsc +4 -4
  15. package/dist/standalone/next-output/server/app/_global-error.segments/_index.segment.rsc +3 -3
  16. package/dist/standalone/next-output/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/dist/standalone/next-output/server/app/_not-found/page/build-manifest.json +5 -5
  18. package/dist/standalone/next-output/server/app/_not-found/page.js +4 -3
  19. package/dist/standalone/next-output/server/app/_not-found/page.js.nft.json +1 -1
  20. package/dist/standalone/next-output/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/dist/standalone/next-output/server/app/api/backup/route.js +1 -2
  22. package/dist/standalone/next-output/server/app/api/backup/route.js.nft.json +1 -1
  23. package/dist/standalone/next-output/server/app/api/entry/route.js +2 -2
  24. package/dist/standalone/next-output/server/app/api/entry/route.js.nft.json +1 -1
  25. package/dist/standalone/next-output/server/app/api/note/route.js +1 -1
  26. package/dist/standalone/next-output/server/app/api/note/route.js.nft.json +1 -1
  27. package/dist/standalone/next-output/server/app/api/sheet/active/route/app-paths-manifest.json +3 -0
  28. package/dist/standalone/next-output/server/app/api/sheet/active/route/build-manifest.json +9 -0
  29. package/dist/standalone/next-output/server/app/api/sheet/active/route/server-reference-manifest.json +4 -0
  30. package/dist/standalone/next-output/server/app/api/sheet/active/route.js +7 -0
  31. package/dist/standalone/next-output/server/app/api/sheet/active/route.js.nft.json +1 -0
  32. package/dist/standalone/next-output/server/app/api/sheet/active/route_client-reference-manifest.js +3 -0
  33. package/dist/standalone/next-output/server/app/api/sync/import/route.js +1 -1
  34. package/dist/standalone/next-output/server/app/api/sync/import/route.js.nft.json +1 -1
  35. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route/app-paths-manifest.json +3 -0
  36. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route/build-manifest.json +9 -0
  37. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route/server-reference-manifest.json +4 -0
  38. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js +7 -0
  39. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js.nft.json +1 -0
  40. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route_client-reference-manifest.js +3 -0
  41. package/dist/standalone/next-output/server/app/api/sync/pull/route/app-paths-manifest.json +3 -0
  42. package/dist/standalone/next-output/server/app/api/sync/pull/route/build-manifest.json +9 -0
  43. package/dist/standalone/next-output/server/app/api/sync/pull/route/server-reference-manifest.json +4 -0
  44. package/dist/standalone/next-output/server/app/api/sync/pull/route.js +7 -0
  45. package/dist/standalone/next-output/server/app/api/sync/pull/route.js.nft.json +1 -0
  46. package/dist/standalone/next-output/server/app/api/sync/pull/route_client-reference-manifest.js +3 -0
  47. package/dist/standalone/next-output/server/app/api/sync/push/route/app-paths-manifest.json +3 -0
  48. package/dist/standalone/next-output/server/app/api/sync/push/route/build-manifest.json +9 -0
  49. package/dist/standalone/next-output/server/app/api/sync/push/route/server-reference-manifest.json +4 -0
  50. package/dist/standalone/next-output/server/app/api/sync/push/route.js +7 -0
  51. package/dist/standalone/next-output/server/app/api/sync/push/route.js.nft.json +1 -0
  52. package/dist/standalone/next-output/server/app/api/sync/push/route_client-reference-manifest.js +3 -0
  53. package/dist/standalone/next-output/server/app/api/sync/status/route/app-paths-manifest.json +3 -0
  54. package/dist/standalone/next-output/server/app/api/sync/status/route/build-manifest.json +9 -0
  55. package/dist/standalone/next-output/server/app/api/sync/status/route/server-reference-manifest.json +4 -0
  56. package/dist/standalone/next-output/server/app/api/sync/status/route.js +7 -0
  57. package/dist/standalone/next-output/server/app/api/sync/status/route.js.nft.json +1 -0
  58. package/dist/standalone/next-output/server/app/api/sync/status/route_client-reference-manifest.js +3 -0
  59. package/dist/standalone/next-output/server/app/api/tags/route.js +1 -2
  60. package/dist/standalone/next-output/server/app/api/tags/route.js.nft.json +1 -1
  61. package/dist/standalone/next-output/server/app/api/ui-preferences/merge-on-load/route/app-paths-manifest.json +3 -0
  62. package/dist/standalone/next-output/server/app/api/ui-preferences/merge-on-load/route/build-manifest.json +9 -0
  63. package/dist/standalone/next-output/server/app/api/ui-preferences/merge-on-load/route/server-reference-manifest.json +4 -0
  64. package/dist/standalone/next-output/server/app/api/ui-preferences/merge-on-load/route.js +7 -0
  65. package/dist/standalone/next-output/server/app/api/ui-preferences/merge-on-load/route.js.nft.json +1 -0
  66. package/dist/standalone/next-output/server/app/api/ui-preferences/merge-on-load/route_client-reference-manifest.js +3 -0
  67. package/dist/standalone/next-output/server/app/api/ui-preferences/route.js +1 -1
  68. package/dist/standalone/next-output/server/app/api/ui-preferences/route.js.nft.json +1 -1
  69. package/dist/standalone/next-output/server/app/auth/callback/route.js +1 -1
  70. package/dist/standalone/next-output/server/app/auth/callback/route.js.nft.json +1 -1
  71. package/dist/standalone/next-output/server/app/login/page/build-manifest.json +5 -5
  72. package/dist/standalone/next-output/server/app/login/page.js +4 -3
  73. package/dist/standalone/next-output/server/app/login/page.js.nft.json +1 -1
  74. package/dist/standalone/next-output/server/app/login/page_client-reference-manifest.js +1 -1
  75. package/dist/standalone/next-output/server/app/page/build-manifest.json +5 -5
  76. package/dist/standalone/next-output/server/app/page.js +5 -4
  77. package/dist/standalone/next-output/server/app/page.js.nft.json +1 -1
  78. package/dist/standalone/next-output/server/app/page_client-reference-manifest.js +1 -1
  79. package/dist/standalone/next-output/server/app/register/page/app-paths-manifest.json +3 -0
  80. package/dist/standalone/next-output/server/app/register/page/build-manifest.json +17 -0
  81. package/dist/standalone/next-output/server/app/register/page/next-font-manifest.json +11 -0
  82. package/dist/standalone/next-output/server/app/register/page/react-loadable-manifest.json +1 -0
  83. package/dist/standalone/next-output/server/app/register/page/server-reference-manifest.json +4 -0
  84. package/dist/standalone/next-output/server/app/register/page.js +15 -0
  85. package/dist/standalone/next-output/server/app/register/page.js.nft.json +1 -0
  86. package/dist/standalone/next-output/server/app/register/page_client-reference-manifest.js +3 -0
  87. package/dist/standalone/next-output/server/app/reporting/page/build-manifest.json +5 -5
  88. package/dist/standalone/next-output/server/app/reporting/page.js +5 -5
  89. package/dist/standalone/next-output/server/app/reporting/page.js.nft.json +1 -1
  90. package/dist/standalone/next-output/server/app/reporting/page_client-reference-manifest.js +1 -1
  91. package/dist/standalone/next-output/server/app/settings/cloud-sync/page/app-paths-manifest.json +3 -0
  92. package/dist/standalone/next-output/server/app/settings/cloud-sync/page/build-manifest.json +17 -0
  93. package/dist/standalone/next-output/server/app/settings/cloud-sync/page/next-font-manifest.json +11 -0
  94. package/dist/standalone/next-output/server/app/settings/cloud-sync/page/react-loadable-manifest.json +1 -0
  95. package/dist/standalone/next-output/server/app/settings/cloud-sync/page/server-reference-manifest.json +4 -0
  96. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js +15 -0
  97. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js.nft.json +1 -0
  98. package/dist/standalone/next-output/server/app/settings/cloud-sync/page_client-reference-manifest.js +3 -0
  99. package/dist/standalone/next-output/server/app/settings/data/page/build-manifest.json +5 -5
  100. package/dist/standalone/next-output/server/app/settings/data/page.js +5 -4
  101. package/dist/standalone/next-output/server/app/settings/data/page.js.nft.json +1 -1
  102. package/dist/standalone/next-output/server/app/settings/data/page_client-reference-manifest.js +1 -1
  103. package/dist/standalone/next-output/server/app/settings/display/page/build-manifest.json +5 -5
  104. package/dist/standalone/next-output/server/app/settings/display/page.js +4 -3
  105. package/dist/standalone/next-output/server/app/settings/display/page.js.nft.json +1 -1
  106. package/dist/standalone/next-output/server/app/settings/display/page_client-reference-manifest.js +1 -1
  107. package/dist/standalone/next-output/server/app/settings/page/build-manifest.json +5 -5
  108. package/dist/standalone/next-output/server/app/settings/page.js +5 -5
  109. package/dist/standalone/next-output/server/app/settings/page.js.nft.json +1 -1
  110. package/dist/standalone/next-output/server/app/settings/page_client-reference-manifest.js +1 -1
  111. package/dist/standalone/next-output/server/app/settings/tags/page/build-manifest.json +5 -5
  112. package/dist/standalone/next-output/server/app/settings/tags/page.js +5 -5
  113. package/dist/standalone/next-output/server/app/settings/tags/page.js.nft.json +1 -1
  114. package/dist/standalone/next-output/server/app/settings/tags/page_client-reference-manifest.js +1 -1
  115. package/dist/standalone/next-output/server/app/sheets/page/app-paths-manifest.json +3 -0
  116. package/dist/standalone/next-output/server/app/sheets/page/build-manifest.json +17 -0
  117. package/dist/standalone/next-output/server/app/sheets/page/next-font-manifest.json +11 -0
  118. package/dist/standalone/next-output/server/app/sheets/page/react-loadable-manifest.json +1 -0
  119. package/dist/standalone/next-output/server/app/sheets/page/server-reference-manifest.json +4 -0
  120. package/dist/standalone/next-output/server/app/sheets/page.js +15 -0
  121. package/dist/standalone/next-output/server/app/sheets/page.js.nft.json +1 -0
  122. package/dist/standalone/next-output/server/app/sheets/page_client-reference-manifest.js +3 -0
  123. package/dist/standalone/next-output/server/app/today/page/app-paths-manifest.json +3 -0
  124. package/dist/standalone/next-output/server/app/today/page/build-manifest.json +17 -0
  125. package/dist/standalone/next-output/server/app/today/page/next-font-manifest.json +11 -0
  126. package/dist/standalone/next-output/server/app/today/page/react-loadable-manifest.json +1 -0
  127. package/dist/standalone/next-output/server/app/today/page/server-reference-manifest.json +4 -0
  128. package/dist/standalone/next-output/server/app/today/page.js +15 -0
  129. package/dist/standalone/next-output/server/app/today/page.js.nft.json +1 -0
  130. package/dist/standalone/next-output/server/app/today/page_client-reference-manifest.js +3 -0
  131. package/dist/standalone/next-output/server/app-paths-manifest.json +11 -1
  132. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0-~y~9m._.js +1 -1
  133. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0.tfxy.._.js +1 -1
  134. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__02~w0lb._.js +3 -0
  135. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__045he4k._.js +3 -0
  136. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06efo~9._.js +3 -0
  137. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__09bkv_j._.js +1 -1
  138. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0bflmy0._.js +3 -0
  139. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0cbimu4._.js +3 -0
  140. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0e3._t7._.js +1 -1
  141. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0goaz9z._.js +3 -0
  142. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0i1baam._.js +3 -0
  143. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0mnx_nu._.js +3 -0
  144. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0szq3qr._.js +3 -0
  145. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0uvo97t._.js +1 -1
  146. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0wzuxc6._.js +3 -0
  147. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0xb8jjk._.js +1 -1
  148. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__118xfg0._.js +3 -0
  149. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__11e-p11._.js +1 -1
  150. package/dist/standalone/next-output/server/chunks/_0--hi7m._.js +6 -6
  151. package/dist/standalone/next-output/server/chunks/_0_wbuqv._.js +6 -6
  152. package/dist/standalone/next-output/server/chunks/{_0vzosja._.js → _0rz1whw._.js} +2 -2
  153. package/dist/standalone/next-output/server/chunks/_13eeory._.js +5 -5
  154. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_sheet_active_route_actions_0vwkhw..js +3 -0
  155. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_sync_merge-on-load_route_actions_0yu2xg-.js +3 -0
  156. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_sync_pull_route_actions_0zi~i0m.js +3 -0
  157. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_sync_push_route_actions_0sag.tp.js +3 -0
  158. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_sync_status_route_actions_0zvttty.js +3 -0
  159. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_ui-preferences_merge-on-load_route_actions_06ep~.j.js +3 -0
  160. package/dist/standalone/next-output/server/chunks/ssr/0elt_date-fns_format_0j.rx2u.js +3 -0
  161. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_0pyvy-l._.js +6 -0
  162. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_04bpslp._.js +1 -1
  163. package/dist/standalone/next-output/server/chunks/ssr/{0z~i_next_dist_0u6ij0z._.js → 0z~i_next_dist_0kux32m._.js} +2 -2
  164. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0-2k5eh.js +1 -1
  165. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0-6~y~c.js +4 -0
  166. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0194h-6.js +1 -1
  167. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_03p53oc.js +4 -0
  168. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_040c8th.js +1 -1
  169. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_04kdnd9.js +1 -1
  170. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_08fopnn.js +4 -0
  171. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0eyb0.j.js +1 -1
  172. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0gpy3lz.js +1 -1
  173. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0pw4c6_.js +1 -1
  174. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0r_137h.js +1 -1
  175. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0wy5eu6.js +4 -0
  176. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_12a781y.js +1 -1
  177. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__04et1.j._.js +3 -0
  178. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__04rw9_a._.js +3 -0
  179. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0f.je14._.js +3 -0
  180. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0ljly6c._.js +3 -0
  181. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0p74awc._.js → [root-of-the-server]__0n8s9zq._.js} +2 -2
  182. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0q7e6b0._.js +3 -0
  183. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0rf.8qg._.js +3 -0
  184. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0s84deg._.js +3 -0
  185. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0sh_dni._.js +3 -0
  186. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0tynjfp._.js +3 -0
  187. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0ue-tr6._.js +3 -0
  188. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0wmfvtj._.js +3 -0
  189. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__12q4x7c._.js → [root-of-the-server]__0ygx8l9._.js} +2 -2
  190. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0zxgb-a._.js +3 -0
  191. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0~rrg79._.js +3 -0
  192. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__11qrqnz._.js +3 -0
  193. package/dist/standalone/next-output/server/chunks/ssr/_0-ov5_n._.js +3 -0
  194. package/dist/standalone/next-output/server/chunks/ssr/_00x~ete._.js +3 -0
  195. package/dist/standalone/next-output/server/chunks/ssr/{0z~i_next_dist_0s-rnzm._.js → _073x~fa._.js} +2 -2
  196. package/dist/standalone/next-output/server/chunks/ssr/_0_aptb7._.js +3 -0
  197. package/dist/standalone/next-output/server/chunks/ssr/_0axgv9-._.js +3 -0
  198. package/dist/standalone/next-output/server/chunks/ssr/_0bs7t.7._.js +3 -0
  199. package/dist/standalone/next-output/server/chunks/ssr/_0bu5pcm._.js +3 -0
  200. package/dist/standalone/next-output/server/chunks/ssr/_0cxipsf._.js +3 -0
  201. package/dist/standalone/next-output/server/chunks/ssr/_0dj7qxj._.js +3 -0
  202. package/dist/standalone/next-output/server/chunks/ssr/{_0ekhh25._.js → _0k06nbl._.js} +9 -9
  203. package/dist/standalone/next-output/server/chunks/ssr/_0ld3xfd._.js +3 -0
  204. package/dist/standalone/next-output/server/chunks/ssr/_0ls83bx._.js +3 -0
  205. package/dist/standalone/next-output/server/chunks/ssr/_0p4r3~t._.js +3 -0
  206. package/dist/standalone/next-output/server/chunks/ssr/_0s1f~0y._.js +1 -1
  207. package/dist/standalone/next-output/server/chunks/ssr/_0su4mzm._.js +3 -0
  208. package/dist/standalone/next-output/server/chunks/ssr/_0thins~._.js +3 -0
  209. package/dist/standalone/next-output/server/chunks/ssr/_0v9l~2y._.js +3 -0
  210. package/dist/standalone/next-output/server/chunks/ssr/_0ycs85o._.js +3 -0
  211. package/dist/standalone/next-output/server/chunks/ssr/_0zk9gtm._.js +3 -0
  212. package/dist/standalone/next-output/server/chunks/ssr/_113zjr0._.js +3 -0
  213. package/dist/standalone/next-output/server/chunks/ssr/{_03kx6a3._.js → _11amno3._.js} +8 -8
  214. package/dist/standalone/next-output/server/chunks/ssr/_11d2qve._.js +3 -0
  215. package/dist/standalone/next-output/server/chunks/ssr/_next-internal_server_app_register_page_actions_0zq7ka0.js +3 -0
  216. package/dist/standalone/next-output/server/chunks/ssr/_next-internal_server_app_settings_cloud-sync_page_actions_0ld6e8p.js +3 -0
  217. package/dist/standalone/next-output/server/chunks/ssr/_next-internal_server_app_sheets_page_actions_0cqf0.l.js +3 -0
  218. package/dist/standalone/next-output/server/chunks/ssr/_next-internal_server_app_today_page_actions_0of2-iy.js +3 -0
  219. package/dist/standalone/next-output/server/chunks/ssr/components_109-aj4._.js +1 -1
  220. package/dist/standalone/next-output/server/chunks/ssr/components_reporting-view_tsx_0-0ofcv._.js +1 -1
  221. package/dist/standalone/next-output/server/chunks/ssr/components_tracker-app_tsx_0qs9.7y._.js +1 -1
  222. package/dist/standalone/next-output/server/chunks/ssr/lib_0c0z4q-._.js +3 -0
  223. package/dist/standalone/next-output/server/chunks/ssr/{0z~i_next_dist_client_components_0247lue._.js → node_modules__pnpm_0u1tjhh._.js} +2 -2
  224. package/dist/standalone/next-output/server/edge/chunks/[root-of-the-server]__0t9u~vh._.js +7 -7
  225. package/dist/standalone/next-output/server/middleware-build-manifest.js +8 -8
  226. package/dist/standalone/next-output/server/middleware-manifest.json +1 -1
  227. package/dist/standalone/next-output/server/next-font-manifest.js +1 -1
  228. package/dist/standalone/next-output/server/next-font-manifest.json +16 -0
  229. package/dist/standalone/next-output/server/pages/500.html +1 -1
  230. package/dist/standalone/next-output/server/pages-manifest.json +0 -1
  231. package/dist/standalone/next-output/static/chunks/02h6za.al3c7p.js +1 -0
  232. package/dist/standalone/next-output/static/chunks/04_2jzw-uhhu0.js +2 -0
  233. package/dist/standalone/next-output/static/chunks/04niua5h~-1f..js +1 -0
  234. package/dist/standalone/next-output/static/chunks/06u43x9tl391w.js +1 -0
  235. package/dist/standalone/next-output/static/chunks/0a5y_udluz6e6.js +1 -0
  236. package/dist/standalone/next-output/static/chunks/0b0a23hps.ate.js +4 -0
  237. package/dist/standalone/next-output/static/chunks/0bly.8gr9nkdz.js +1 -0
  238. package/dist/standalone/next-output/static/chunks/0i8_d5-g6pduc.css +3 -0
  239. package/dist/standalone/next-output/static/chunks/{0koldw9zjijry.js → 0jcqig-f5dwq7.js} +2 -2
  240. package/dist/standalone/next-output/static/chunks/0ker2ur7q6j6n.js +1 -0
  241. package/dist/standalone/next-output/static/chunks/{0n~v8~rri7~t2.js → 0lgo02csmvyps.js} +1 -1
  242. package/dist/standalone/next-output/static/chunks/0l~uil8w-ewlm.js +1 -0
  243. package/dist/standalone/next-output/static/chunks/0uik_f_e6e0e6.js +1 -0
  244. package/dist/standalone/next-output/static/chunks/0uxm1dlh.6xck.js +1 -0
  245. package/dist/standalone/next-output/static/chunks/0vm3.l6rc2kie.js +1 -0
  246. package/dist/standalone/next-output/static/chunks/0xo5n.1q2uz95.js +1 -0
  247. package/dist/standalone/next-output/static/chunks/0yi4m~~80yeqj.js +1 -0
  248. package/dist/standalone/next-output/static/chunks/0z9uuysy9qb.4.js +1 -0
  249. package/dist/standalone/next-output/static/chunks/10_mtmf57jsww.js +1 -0
  250. package/dist/standalone/next-output/static/chunks/10c83.nq801k1.js +1 -0
  251. package/dist/standalone/next-output/static/chunks/{0.jsu2wyaii~1.js → 12rxdn65.z_85.js} +12 -12
  252. package/dist/standalone/next-output/static/chunks/15xhm5fbzvyag.js +1 -0
  253. package/dist/standalone/next-output/static/chunks/18adan1jcwejd.js +1 -0
  254. package/dist/standalone/next-output/static/chunks/{turbopack-0st0r~j~gn7ke.js → turbopack-00m4i0dy4on-a.js} +1 -1
  255. package/dist/standalone/package.json +1 -1
  256. package/package.json +1 -1
  257. package/dist/standalone/next-output/server/app/_not-found.html +0 -1
  258. package/dist/standalone/next-output/server/app/_not-found.meta +0 -16
  259. package/dist/standalone/next-output/server/app/_not-found.rsc +0 -25
  260. package/dist/standalone/next-output/server/app/_not-found.segments/_full.segment.rsc +0 -25
  261. package/dist/standalone/next-output/server/app/_not-found.segments/_head.segment.rsc +0 -6
  262. package/dist/standalone/next-output/server/app/_not-found.segments/_index.segment.rsc +0 -10
  263. package/dist/standalone/next-output/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +0 -5
  264. package/dist/standalone/next-output/server/app/_not-found.segments/_not-found.segment.rsc +0 -5
  265. package/dist/standalone/next-output/server/app/_not-found.segments/_tree.segment.rsc +0 -2
  266. package/dist/standalone/next-output/server/app/reporting.html +0 -1
  267. package/dist/standalone/next-output/server/app/reporting.meta +0 -15
  268. package/dist/standalone/next-output/server/app/reporting.rsc +0 -29
  269. package/dist/standalone/next-output/server/app/reporting.segments/_full.segment.rsc +0 -29
  270. package/dist/standalone/next-output/server/app/reporting.segments/_head.segment.rsc +0 -6
  271. package/dist/standalone/next-output/server/app/reporting.segments/_index.segment.rsc +0 -10
  272. package/dist/standalone/next-output/server/app/reporting.segments/_tree.segment.rsc +0 -4
  273. package/dist/standalone/next-output/server/app/reporting.segments/reporting/__PAGE__.segment.rsc +0 -6
  274. package/dist/standalone/next-output/server/app/reporting.segments/reporting.segment.rsc +0 -5
  275. package/dist/standalone/next-output/server/app/settings/data.html +0 -1
  276. package/dist/standalone/next-output/server/app/settings/data.meta +0 -16
  277. package/dist/standalone/next-output/server/app/settings/data.rsc +0 -35
  278. package/dist/standalone/next-output/server/app/settings/data.segments/_full.segment.rsc +0 -35
  279. package/dist/standalone/next-output/server/app/settings/data.segments/_head.segment.rsc +0 -6
  280. package/dist/standalone/next-output/server/app/settings/data.segments/_index.segment.rsc +0 -10
  281. package/dist/standalone/next-output/server/app/settings/data.segments/_tree.segment.rsc +0 -4
  282. package/dist/standalone/next-output/server/app/settings/data.segments/settings/data/__PAGE__.segment.rsc +0 -11
  283. package/dist/standalone/next-output/server/app/settings/data.segments/settings/data.segment.rsc +0 -5
  284. package/dist/standalone/next-output/server/app/settings/data.segments/settings.segment.rsc +0 -5
  285. package/dist/standalone/next-output/server/app/settings/display.html +0 -1
  286. package/dist/standalone/next-output/server/app/settings/display.meta +0 -16
  287. package/dist/standalone/next-output/server/app/settings/display.rsc +0 -44
  288. package/dist/standalone/next-output/server/app/settings/display.segments/_full.segment.rsc +0 -44
  289. package/dist/standalone/next-output/server/app/settings/display.segments/_head.segment.rsc +0 -6
  290. package/dist/standalone/next-output/server/app/settings/display.segments/_index.segment.rsc +0 -10
  291. package/dist/standalone/next-output/server/app/settings/display.segments/_tree.segment.rsc +0 -4
  292. package/dist/standalone/next-output/server/app/settings/display.segments/settings/display/__PAGE__.segment.rsc +0 -21
  293. package/dist/standalone/next-output/server/app/settings/display.segments/settings/display.segment.rsc +0 -5
  294. package/dist/standalone/next-output/server/app/settings/display.segments/settings.segment.rsc +0 -5
  295. package/dist/standalone/next-output/server/app/settings/tags.html +0 -1
  296. package/dist/standalone/next-output/server/app/settings/tags.meta +0 -16
  297. package/dist/standalone/next-output/server/app/settings/tags.rsc +0 -30
  298. package/dist/standalone/next-output/server/app/settings/tags.segments/_full.segment.rsc +0 -30
  299. package/dist/standalone/next-output/server/app/settings/tags.segments/_head.segment.rsc +0 -6
  300. package/dist/standalone/next-output/server/app/settings/tags.segments/_index.segment.rsc +0 -10
  301. package/dist/standalone/next-output/server/app/settings/tags.segments/_tree.segment.rsc +0 -4
  302. package/dist/standalone/next-output/server/app/settings/tags.segments/settings/tags/__PAGE__.segment.rsc +0 -6
  303. package/dist/standalone/next-output/server/app/settings/tags.segments/settings/tags.segment.rsc +0 -5
  304. package/dist/standalone/next-output/server/app/settings/tags.segments/settings.segment.rsc +0 -5
  305. package/dist/standalone/next-output/server/app/settings.html +0 -1
  306. package/dist/standalone/next-output/server/app/settings.meta +0 -15
  307. package/dist/standalone/next-output/server/app/settings.rsc +0 -35
  308. package/dist/standalone/next-output/server/app/settings.segments/_full.segment.rsc +0 -35
  309. package/dist/standalone/next-output/server/app/settings.segments/_head.segment.rsc +0 -6
  310. package/dist/standalone/next-output/server/app/settings.segments/_index.segment.rsc +0 -10
  311. package/dist/standalone/next-output/server/app/settings.segments/_tree.segment.rsc +0 -4
  312. package/dist/standalone/next-output/server/app/settings.segments/settings/__PAGE__.segment.rsc +0 -12
  313. package/dist/standalone/next-output/server/app/settings.segments/settings.segment.rsc +0 -5
  314. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__00yo3_1._.js +0 -3
  315. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__05eq9_g._.js +0 -3
  316. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__061y6pa._.js +0 -3
  317. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0ai1p94._.js +0 -3
  318. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0p1kxjf._.js +0 -3
  319. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0z09g1h._.js +0 -3
  320. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__00t2myd._.js +0 -3
  321. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__070_uw2._.js +0 -3
  322. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0c4ohc.._.js +0 -3
  323. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0mjp16u._.js +0 -3
  324. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0rtwdhy._.js +0 -3
  325. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0ucb5c~._.js +0 -3
  326. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0x2t88.._.js +0 -3
  327. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__108je_d._.js +0 -3
  328. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__10jikzl._.js +0 -3
  329. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__13dr511._.js +0 -3
  330. package/dist/standalone/next-output/server/chunks/ssr/_00.2r03._.js +0 -3
  331. package/dist/standalone/next-output/server/chunks/ssr/_01xe83y._.js +0 -64
  332. package/dist/standalone/next-output/server/chunks/ssr/_06yb2en._.js +0 -3
  333. package/dist/standalone/next-output/server/chunks/ssr/_0iqbilg._.js +0 -64
  334. package/dist/standalone/next-output/server/chunks/ssr/_0kvm6av._.js +0 -6
  335. package/dist/standalone/next-output/server/chunks/ssr/_0l_p-.k._.js +0 -3
  336. package/dist/standalone/next-output/server/chunks/ssr/_0li90xb._.js +0 -3
  337. package/dist/standalone/next-output/server/chunks/ssr/_0okkb_~._.js +0 -3
  338. package/dist/standalone/next-output/server/chunks/ssr/_0qowa2d._.js +0 -3
  339. package/dist/standalone/next-output/server/chunks/ssr/_0x1bw~i._.js +0 -3
  340. package/dist/standalone/next-output/server/chunks/ssr/_0zabe_~._.js +0 -3
  341. package/dist/standalone/next-output/server/pages/404.html +0 -1
  342. package/dist/standalone/next-output/static/chunks/0-0w4ml~c22t..js +0 -1
  343. package/dist/standalone/next-output/static/chunks/01mevzl3z5cgt.js +0 -1
  344. package/dist/standalone/next-output/static/chunks/05161-t.3egqv.js +0 -4
  345. package/dist/standalone/next-output/static/chunks/0708yw9dysifo.js +0 -2
  346. package/dist/standalone/next-output/static/chunks/0aohgkyesjriz.js +0 -1
  347. package/dist/standalone/next-output/static/chunks/0bcmkbb2bxpr-.js +0 -1
  348. package/dist/standalone/next-output/static/chunks/0bym88q-qlydb.js +0 -1
  349. package/dist/standalone/next-output/static/chunks/0e8tmpq~qz.dz.js +0 -1
  350. package/dist/standalone/next-output/static/chunks/0g7b1~gza1y3a.js +0 -1
  351. package/dist/standalone/next-output/static/chunks/0h-q8kc3tbcj8.js +0 -1
  352. package/dist/standalone/next-output/static/chunks/0js9~7rlpndqf.js +0 -1
  353. package/dist/standalone/next-output/static/chunks/0uezeykgodd86.js +0 -1
  354. package/dist/standalone/next-output/static/chunks/0xvqo8vfg40zk.js +0 -1
  355. package/dist/standalone/next-output/static/chunks/11y-z.w7p8i8a.css +0 -3
  356. package/dist/standalone/next-output/static/chunks/12v1sx2j-is-9.js +0 -1
  357. package/dist/standalone/next-output/static/chunks/13pryy_qphr.u.js +0 -1
  358. /package/dist/standalone/next-output/static/{xfRBlnU13styXnCBd60jn → b-GDdUy-cIcWNA_TGvVQz}/_buildManifest.js +0 -0
  359. /package/dist/standalone/next-output/static/{xfRBlnU13styXnCBd60jn → b-GDdUy-cIcWNA_TGvVQz}/_clientMiddlewareManifest.js +0 -0
  360. /package/dist/standalone/next-output/static/{xfRBlnU13styXnCBd60jn → b-GDdUy-cIcWNA_TGvVQz}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["chunks/[root-of-the-server]__0t9u~vh._.js",44962,(e,t,r)=>{},5701,(e,t,r)=>{"use strict";var n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o={},l={RequestCookies:()=>g,ResponseCookies:()=>m,parseCookie:()=>h,parseSetCookie:()=>d,stringifyCookie:()=>c};for(var u in l)n(o,u,{get:l[u],enumerable:!0});function c(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function h(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,s]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=s?s:"true"))}catch{}}return t}function d(e){if(!e)return;let[[t,r],...n]=h(e),{domain:s,expires:i,httponly:a,maxage:o,path:l,samesite:u,secure:c,partitioned:d,priority:g}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var m,b,y={name:t,value:decodeURIComponent(r),domain:s,...i&&{expires:new Date(i)},...a&&{httpOnly:!0},..."string"==typeof o&&{maxAge:Number(o)},path:l,...u&&{sameSite:p.includes(m=(m=u).toLowerCase())?m:void 0},...c&&{secure:!0},...g&&{priority:f.includes(b=(b=g).toLowerCase())?b:void 0},...d&&{partitioned:!0}};let e={};for(let t in y)y[t]&&(e[t]=y[t]);return e}}t.exports=((e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))a.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(o=s(t,l))||o.enumerable});return e})(n({},"__esModule",{value:!0}),o);var p=["strict","lax","none"],f=["low","medium","high"],g=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t)for(const[e,r]of h(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>c(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>c(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},m=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;const s=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(const e of Array.isArray(s)?s:function(e){if(!e)return[];var t,r,n,s,i,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,i=!1;l();)if(","===(r=e.charAt(o))){for(n=o,o+=1,l(),s=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(i=!0,o=s,a.push(e.substring(t,n)),t=o):o=n+1}else o+=1;(!i||o>=e.length)&&a.push(e.substring(t,e.length))}return a}(s)){const t=d(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,s=this._parsed;return s.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=c(r);t.append("set-cookie",e)}}(s,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join("; ")}}},42856,(e,t,r)=>{(()=>{"use strict";let r,n,s,i,a;var o,l,u,c,h,d,p,f,g,m,b,y,v,w,_,E,k={491:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;let n=r(223),s=r(172),i=r(930),a="context",o=new n.NoopContextManager;class l{static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalContextManager(e){return(0,s.registerGlobal)(a,e,i.DiagAPI.instance())}active(){return this._getContextManager().active()}with(e,t,r,...n){return this._getContextManager().with(e,t,r,...n)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return(0,s.getGlobal)(a)||o}disable(){this._getContextManager().disable(),(0,s.unregisterGlobal)(a,i.DiagAPI.instance())}}t.ContextAPI=l},930:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;let n=r(56),s=r(912),i=r(957),a=r(172);class o{constructor(){function e(e){return function(...t){let r=(0,a.getGlobal)("diag");if(r)return r[e](...t)}}const t=this;t.setLogger=(e,r={logLevel:i.DiagLogLevel.INFO})=>{var n,o,l;if(e===t){let e=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!=(n=e.stack)?n:e.message),!1}"number"==typeof r&&(r={logLevel:r});let u=(0,a.getGlobal)("diag"),c=(0,s.createLogLevelDiagLogger)(null!=(o=r.logLevel)?o:i.DiagLogLevel.INFO,e);if(u&&!r.suppressOverrideMessage){let e=null!=(l=Error().stack)?l:"<failed to generate stacktrace>";u.warn(`Current logger will be overwritten from ${e}`),c.warn(`Current logger will overwrite one already registered from ${e}`)}return(0,a.registerGlobal)("diag",c,t,!0)},t.disable=()=>{(0,a.unregisterGlobal)("diag",t)},t.createComponentLogger=e=>new n.DiagComponentLogger(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}static instance(){return this._instance||(this._instance=new o),this._instance}}t.DiagAPI=o},653:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;let n=r(660),s=r(172),i=r(930),a="metrics";class o{static getInstance(){return this._instance||(this._instance=new o),this._instance}setGlobalMeterProvider(e){return(0,s.registerGlobal)(a,e,i.DiagAPI.instance())}getMeterProvider(){return(0,s.getGlobal)(a)||n.NOOP_METER_PROVIDER}getMeter(e,t,r){return this.getMeterProvider().getMeter(e,t,r)}disable(){(0,s.unregisterGlobal)(a,i.DiagAPI.instance())}}t.MetricsAPI=o},181:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;let n=r(172),s=r(874),i=r(194),a=r(277),o=r(369),l=r(930),u="propagation",c=new s.NoopTextMapPropagator;class h{constructor(){this.createBaggage=o.createBaggage,this.getBaggage=a.getBaggage,this.getActiveBaggage=a.getActiveBaggage,this.setBaggage=a.setBaggage,this.deleteBaggage=a.deleteBaggage}static getInstance(){return this._instance||(this._instance=new h),this._instance}setGlobalPropagator(e){return(0,n.registerGlobal)(u,e,l.DiagAPI.instance())}inject(e,t,r=i.defaultTextMapSetter){return this._getGlobalPropagator().inject(e,t,r)}extract(e,t,r=i.defaultTextMapGetter){return this._getGlobalPropagator().extract(e,t,r)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,n.unregisterGlobal)(u,l.DiagAPI.instance())}_getGlobalPropagator(){return(0,n.getGlobal)(u)||c}}t.PropagationAPI=h},997:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;let n=r(172),s=r(846),i=r(139),a=r(607),o=r(930),l="trace";class u{constructor(){this._proxyTracerProvider=new s.ProxyTracerProvider,this.wrapSpanContext=i.wrapSpanContext,this.isSpanContextValid=i.isSpanContextValid,this.deleteSpan=a.deleteSpan,this.getSpan=a.getSpan,this.getActiveSpan=a.getActiveSpan,this.getSpanContext=a.getSpanContext,this.setSpan=a.setSpan,this.setSpanContext=a.setSpanContext}static getInstance(){return this._instance||(this._instance=new u),this._instance}setGlobalTracerProvider(e){let t=(0,n.registerGlobal)(l,this._proxyTracerProvider,o.DiagAPI.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return(0,n.getGlobal)(l)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){(0,n.unregisterGlobal)(l,o.DiagAPI.instance()),this._proxyTracerProvider=new s.ProxyTracerProvider}}t.TraceAPI=u},277:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;let n=r(491),s=(0,r(780).createContextKey)("OpenTelemetry Baggage Key");function i(e){return e.getValue(s)||void 0}t.getBaggage=i,t.getActiveBaggage=function(){return i(n.ContextAPI.getInstance().active())},t.setBaggage=function(e,t){return e.setValue(s,t)},t.deleteBaggage=function(e){return e.deleteValue(s)}},993:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class r{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries()).map(([e,t])=>[e,t])}setEntry(e,t){let n=new r(this._entries);return n._entries.set(e,t),n}removeEntry(e){let t=new r(this._entries);return t._entries.delete(e),t}removeEntries(...e){let t=new r(this._entries);for(let r of e)t._entries.delete(r);return t}clear(){return new r}}t.BaggageImpl=r},830:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")},369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;let n=r(930),s=r(993),i=r(830),a=n.DiagAPI.instance();t.createBaggage=function(e={}){return new s.BaggageImpl(new Map(Object.entries(e)))},t.baggageEntryMetadataFromString=function(e){return"string"!=typeof e&&(a.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:i.baggageEntryMetadataSymbol,toString:()=>e}}},67:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0,t.context=r(491).ContextAPI.getInstance()},223:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;let n=r(780);t.NoopContextManager=class{active(){return n.ROOT_CONTEXT}with(e,t,r,...n){return t.call(r,...n)}bind(e,t){return t}enable(){return this}disable(){return this}}},780:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0,t.createContextKey=function(e){return Symbol.for(e)};class r{constructor(e){const t=this;t._currentContext=e?new Map(e):new Map,t.getValue=e=>t._currentContext.get(e),t.setValue=(e,n)=>{let s=new r(t._currentContext);return s._currentContext.set(e,n),s},t.deleteValue=e=>{let n=new r(t._currentContext);return n._currentContext.delete(e),n}}}t.ROOT_CONTEXT=new r},506:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0,t.diag=r(930).DiagAPI.instance()},56:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;let n=r(172);function s(e,t,r){let s=(0,n.getGlobal)("diag");if(s)return r.unshift(t),s[e](...r)}t.DiagComponentLogger=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return s("debug",this._namespace,e)}error(...e){return s("error",this._namespace,e)}info(...e){return s("info",this._namespace,e)}warn(...e){return s("warn",this._namespace,e)}verbose(...e){return s("verbose",this._namespace,e)}}},972:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;let r=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];t.DiagConsoleLogger=class{constructor(){for(let e=0;e<r.length;e++)this[r[e].n]=function(e){return function(...t){if(console){let r=console[e];if("function"!=typeof r&&(r=console.log),"function"==typeof r)return r.apply(console,t)}}}(r[e].c)}}},912:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;let n=r(957);t.createLogLevelDiagLogger=function(e,t){function r(r,n){let s=t[r];return"function"==typeof s&&e>=n?s.bind(t):function(){}}return e<n.DiagLogLevel.NONE?e=n.DiagLogLevel.NONE:e>n.DiagLogLevel.ALL&&(e=n.DiagLogLevel.ALL),t=t||{},{error:r("error",n.DiagLogLevel.ERROR),warn:r("warn",n.DiagLogLevel.WARN),info:r("info",n.DiagLogLevel.INFO),debug:r("debug",n.DiagLogLevel.DEBUG),verbose:r("verbose",n.DiagLogLevel.VERBOSE)}}},957:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0,(r=t.DiagLogLevel||(t.DiagLogLevel={}))[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"},172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;let n=r(200),s=r(521),i=r(130),a=s.VERSION.split(".")[0],o=Symbol.for(`opentelemetry.js.api.${a}`),l=n._globalThis;t.registerGlobal=function(e,t,r,n=!1){var i;let a=l[o]=null!=(i=l[o])?i:{version:s.VERSION};if(!n&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(t.stack||t.message),!1}if(a.version!==s.VERSION){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${s.VERSION}`);return r.error(t.stack||t.message),!1}return a[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${s.VERSION}.`),!0},t.getGlobal=function(e){var t,r;let n=null==(t=l[o])?void 0:t.version;if(n&&(0,i.isCompatible)(n))return null==(r=l[o])?void 0:r[e]},t.unregisterGlobal=function(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${s.VERSION}.`);let r=l[o];r&&delete r[e]}},130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;let n=r(521),s=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function i(e){let t=new Set([e]),r=new Set,n=e.match(s);if(!n)return()=>!1;let i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=i.prerelease)return function(t){return t===e};function a(e){return r.add(e),!1}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;let n=e.match(s);if(!n)return a(e);let o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=o.prerelease||i.major!==o.major)return a(e);if(0===i.major)return i.minor===o.minor&&i.patch<=o.patch?(t.add(e),!0):a(e);return i.minor<=o.minor?(t.add(e),!0):a(e)}}t._makeCompatibilityCheck=i,t.isCompatible=i(n.VERSION)},886:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0,t.metrics=r(653).MetricsAPI.getInstance()},901:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0,(r=t.ValueType||(t.ValueType={}))[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"},102:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class r{createHistogram(e,r){return t.NOOP_HISTOGRAM_METRIC}createCounter(e,r){return t.NOOP_COUNTER_METRIC}createUpDownCounter(e,r){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(e,r){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(e,r){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(e,r){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}}t.NoopMeter=r;class n{}t.NoopMetric=n;class s extends n{add(e,t){}}t.NoopCounterMetric=s;class i extends n{add(e,t){}}t.NoopUpDownCounterMetric=i;class a extends n{record(e,t){}}t.NoopHistogramMetric=a;class o{addCallback(e){}removeCallback(e){}}t.NoopObservableMetric=o;class l extends o{}t.NoopObservableCounterMetric=l;class u extends o{}t.NoopObservableGaugeMetric=u;class c extends o{}t.NoopObservableUpDownCounterMetric=c,t.NOOP_METER=new r,t.NOOP_COUNTER_METRIC=new s,t.NOOP_HISTOGRAM_METRIC=new a,t.NOOP_UP_DOWN_COUNTER_METRIC=new i,t.NOOP_OBSERVABLE_COUNTER_METRIC=new l,t.NOOP_OBSERVABLE_GAUGE_METRIC=new u,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new c,t.createNoopMeter=function(){return t.NOOP_METER}},660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;let n=r(102);class s{getMeter(e,t,r){return n.NOOP_METER}}t.NoopMeterProvider=s,t.NOOP_METER_PROVIDER=new s},200:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(46),t)},651:(t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r._globalThis=void 0,r._globalThis="object"==typeof globalThis?globalThis:e.g},46:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(651),t)},939:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0,t.propagation=r(181).PropagationAPI.getInstance()},874:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0,t.NoopTextMapPropagator=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}},194:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,t){if(null!=e)return e[t]},keys:e=>null==e?[]:Object.keys(e)},t.defaultTextMapSetter={set(e,t,r){null!=e&&(e[t]=r)}}},845:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0,t.trace=r(997).TraceAPI.getInstance()},403:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;let n=r(476);t.NonRecordingSpan=class{constructor(e=n.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}},614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;let n=r(491),s=r(607),i=r(403),a=r(139),o=n.ContextAPI.getInstance();t.NoopTracer=class{startSpan(e,t,r=o.active()){var n;if(null==t?void 0:t.root)return new i.NonRecordingSpan;let l=r&&(0,s.getSpanContext)(r);return"object"==typeof(n=l)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&(0,a.isSpanContextValid)(l)?new i.NonRecordingSpan(l):new i.NonRecordingSpan}startActiveSpan(e,t,r,n){let i,a,l;if(arguments.length<2)return;2==arguments.length?l=t:3==arguments.length?(i=t,l=r):(i=t,a=r,l=n);let u=null!=a?a:o.active(),c=this.startSpan(e,i,u),h=(0,s.setSpan)(u,c);return o.with(h,l,void 0,c)}}},124:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;let n=r(614);t.NoopTracerProvider=class{getTracer(e,t,r){return new n.NoopTracer}}},125:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;let n=new(r(614)).NoopTracer;t.ProxyTracer=class{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}startSpan(e,t,r){return this._getTracer().startSpan(e,t,r)}startActiveSpan(e,t,r,n){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):n}}},846:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;let n=r(125),s=new(r(124)).NoopTracerProvider;t.ProxyTracerProvider=class{getTracer(e,t,r){var s;return null!=(s=this.getDelegateTracer(e,t,r))?s:new n.ProxyTracer(this,e,t,r)}getDelegate(){var e;return null!=(e=this._delegate)?e:s}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,r){var n;return null==(n=this._delegate)?void 0:n.getTracer(e,t,r)}}},996:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0,(r=t.SamplingDecision||(t.SamplingDecision={}))[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"},607:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;let n=r(780),s=r(403),i=r(491),a=(0,n.createContextKey)("OpenTelemetry Context Key SPAN");function o(e){return e.getValue(a)||void 0}function l(e,t){return e.setValue(a,t)}t.getSpan=o,t.getActiveSpan=function(){return o(i.ContextAPI.getInstance().active())},t.setSpan=l,t.deleteSpan=function(e){return e.deleteValue(a)},t.setSpanContext=function(e,t){return l(e,new s.NonRecordingSpan(t))},t.getSpanContext=function(e){var t;return null==(t=o(e))?void 0:t.spanContext()}},325:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;let n=r(564);class s{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){!(e.length>512)&&(this._internalState=e.split(",").reverse().reduce((e,t)=>{let r=t.trim(),s=r.indexOf("=");if(-1!==s){let i=r.slice(0,s),a=r.slice(s+1,t.length);(0,n.validateKey)(i)&&(0,n.validateValue)(a)&&e.set(i,a)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new s;return e._internalState=new Map(this._internalState),e}}t.TraceStateImpl=s},564:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;let r="[_0-9a-z-*/]",n=`[a-z]${r}{0,255}`,s=`[a-z0-9]${r}{0,240}@[a-z]${r}{0,13}`,i=RegExp(`^(?:${n}|${s})$`),a=/^[ -~]{0,255}[!-~]$/,o=/,|=/;t.validateKey=function(e){return i.test(e)},t.validateValue=function(e){return a.test(e)&&!o.test(e)}},98:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;let n=r(325);t.createTraceState=function(e){return new n.TraceStateImpl(e)}},476:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;let n=r(475);t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:n.TraceFlags.NONE}},357:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0,(r=t.SpanKind||(t.SpanKind={}))[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"},139:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;let n=r(476),s=r(403),i=/^([0-9a-f]{32})$/i,a=/^[0-9a-f]{16}$/i;function o(e){return i.test(e)&&e!==n.INVALID_TRACEID}function l(e){return a.test(e)&&e!==n.INVALID_SPANID}t.isValidTraceId=o,t.isValidSpanId=l,t.isSpanContextValid=function(e){return o(e.traceId)&&l(e.spanId)},t.wrapSpanContext=function(e){return new s.NonRecordingSpan(e)}},847:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0,(r=t.SpanStatusCode||(t.SpanStatusCode={}))[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"},475:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0,(r=t.TraceFlags||(t.TraceFlags={}))[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"},521:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.6.0"}},S={};function T(e){var t=S[e];if(void 0!==t)return t.exports;var r=S[e]={exports:{}},n=!0;try{k[e].call(r.exports,r,r.exports,T),n=!1}finally{n&&delete S[e]}return r.exports}T.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/@opentelemetry/api/";var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.trace=R.propagation=R.metrics=R.diag=R.context=R.INVALID_SPAN_CONTEXT=R.INVALID_TRACEID=R.INVALID_SPANID=R.isValidSpanId=R.isValidTraceId=R.isSpanContextValid=R.createTraceState=R.TraceFlags=R.SpanStatusCode=R.SpanKind=R.SamplingDecision=R.ProxyTracerProvider=R.ProxyTracer=R.defaultTextMapSetter=R.defaultTextMapGetter=R.ValueType=R.createNoopMeter=R.DiagLogLevel=R.DiagConsoleLogger=R.ROOT_CONTEXT=R.createContextKey=R.baggageEntryMetadataFromString=void 0,o=T(369),Object.defineProperty(R,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return o.baggageEntryMetadataFromString}}),l=T(780),Object.defineProperty(R,"createContextKey",{enumerable:!0,get:function(){return l.createContextKey}}),Object.defineProperty(R,"ROOT_CONTEXT",{enumerable:!0,get:function(){return l.ROOT_CONTEXT}}),u=T(972),Object.defineProperty(R,"DiagConsoleLogger",{enumerable:!0,get:function(){return u.DiagConsoleLogger}}),c=T(957),Object.defineProperty(R,"DiagLogLevel",{enumerable:!0,get:function(){return c.DiagLogLevel}}),h=T(102),Object.defineProperty(R,"createNoopMeter",{enumerable:!0,get:function(){return h.createNoopMeter}}),d=T(901),Object.defineProperty(R,"ValueType",{enumerable:!0,get:function(){return d.ValueType}}),p=T(194),Object.defineProperty(R,"defaultTextMapGetter",{enumerable:!0,get:function(){return p.defaultTextMapGetter}}),Object.defineProperty(R,"defaultTextMapSetter",{enumerable:!0,get:function(){return p.defaultTextMapSetter}}),f=T(125),Object.defineProperty(R,"ProxyTracer",{enumerable:!0,get:function(){return f.ProxyTracer}}),g=T(846),Object.defineProperty(R,"ProxyTracerProvider",{enumerable:!0,get:function(){return g.ProxyTracerProvider}}),m=T(996),Object.defineProperty(R,"SamplingDecision",{enumerable:!0,get:function(){return m.SamplingDecision}}),b=T(357),Object.defineProperty(R,"SpanKind",{enumerable:!0,get:function(){return b.SpanKind}}),y=T(847),Object.defineProperty(R,"SpanStatusCode",{enumerable:!0,get:function(){return y.SpanStatusCode}}),v=T(475),Object.defineProperty(R,"TraceFlags",{enumerable:!0,get:function(){return v.TraceFlags}}),w=T(98),Object.defineProperty(R,"createTraceState",{enumerable:!0,get:function(){return w.createTraceState}}),_=T(139),Object.defineProperty(R,"isSpanContextValid",{enumerable:!0,get:function(){return _.isSpanContextValid}}),Object.defineProperty(R,"isValidTraceId",{enumerable:!0,get:function(){return _.isValidTraceId}}),Object.defineProperty(R,"isValidSpanId",{enumerable:!0,get:function(){return _.isValidSpanId}}),E=T(476),Object.defineProperty(R,"INVALID_SPANID",{enumerable:!0,get:function(){return E.INVALID_SPANID}}),Object.defineProperty(R,"INVALID_TRACEID",{enumerable:!0,get:function(){return E.INVALID_TRACEID}}),Object.defineProperty(R,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return E.INVALID_SPAN_CONTEXT}}),r=T(67),Object.defineProperty(R,"context",{enumerable:!0,get:function(){return r.context}}),n=T(506),Object.defineProperty(R,"diag",{enumerable:!0,get:function(){return n.diag}}),s=T(886),Object.defineProperty(R,"metrics",{enumerable:!0,get:function(){return s.metrics}}),i=T(939),Object.defineProperty(R,"propagation",{enumerable:!0,get:function(){return i.propagation}}),a=T(845),Object.defineProperty(R,"trace",{enumerable:!0,get:function(){return a.trace}}),R.default={context:r.context,diag:n.diag,metrics:s.metrics,propagation:i.propagation,trace:a.trace},t.exports=R})()},94151,(e,t,r)=>{(()=>{"use strict";"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/cookie/");var e,r,n,s,i={};i.parse=function(t,r){if("string"!=typeof t)throw TypeError("argument str must be a string");for(var s={},i=t.split(n),a=(r||{}).decode||e,o=0;o<i.length;o++){var l=i[o],u=l.indexOf("=");if(!(u<0)){var c=l.substr(0,u).trim(),h=l.substr(++u,l.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),void 0==s[c]&&(s[c]=function(e,t){try{return t(e)}catch(t){return e}}(h,a))}}return s},i.serialize=function(e,t,n){var i=n||{},a=i.encode||r;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!s.test(e))throw TypeError("argument name is invalid");var o=a(t);if(o&&!s.test(o))throw TypeError("argument val is invalid");var l=e+"="+o;if(null!=i.maxAge){var u=i.maxAge-0;if(isNaN(u)||!isFinite(u))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(u)}if(i.domain){if(!s.test(i.domain))throw TypeError("option domain is invalid");l+="; Domain="+i.domain}if(i.path){if(!s.test(i.path))throw TypeError("option path is invalid");l+="; Path="+i.path}if(i.expires){if("function"!=typeof i.expires.toUTCString)throw TypeError("option expires is invalid");l+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(l+="; HttpOnly"),i.secure&&(l+="; Secure"),i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l},e=decodeURIComponent,r=encodeURIComponent,n=/; */,s=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,t.exports=i})()},10636,(e,t,r)=>{(()=>{"use strict";let e,r,n,s,i;var a={993:e=>{var t=Object.prototype.hasOwnProperty,r="~";function n(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw TypeError("The listener must be a function");var o=new s(n,i||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),o.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,i=n.length,a=Array(i);s<i;s++)a[s]=n[s].fn;return a},o.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,s,i,a){var o=r?r+e:e;if(!this._events[o])return!1;var l,u,c=this._events[o],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,s),!0;case 5:return c.fn.call(c.context,t,n,s,i),!0;case 6:return c.fn.call(c.context,t,n,s,i,a),!0}for(u=1,l=Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,p=c.length;for(u=0;u<p;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,s);break;default:if(!l)for(d=1,l=Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},o.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,n,s){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||s&&!o.once||n&&o.context!==n||a(this,i);else{for(var l=0,u=[],c=o.length;l<c;l++)(o[l].fn!==t||s&&!o[l].once||n&&o[l].context!==n)&&u.push(o[l]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o},213:e=>{e.exports=(e,t)=>(t=t||(()=>{}),e.then(e=>new Promise(e=>{e(t())}).then(()=>e),e=>new Promise(e=>{e(t())}).then(()=>{throw e})))},574:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=0,s=e.length;for(;s>0;){let i=s/2|0,a=n+i;0>=r(e[a],t)?(n=++a,s-=i+1):s=i}return n}},821:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});let n=r(574);t.default=class{constructor(){this._queue=[]}enqueue(e,t){let r={priority:(t=Object.assign({priority:0},t)).priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority)return void this._queue.push(r);let s=n.default(this._queue,r,(e,t)=>t.priority-e.priority);this._queue.splice(s,0,r)}dequeue(){let e=this._queue.shift();return null==e?void 0:e.run}filter(e){return this._queue.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this._queue.length}}},816:(e,t,r)=>{let n=r(213);class s extends Error{constructor(e){super(e),this.name="TimeoutError"}}let i=(e,t,r)=>new Promise((i,a)=>{if("number"!=typeof t||t<0)throw TypeError("Expected `milliseconds` to be a positive number");if(t===1/0)return void i(e);let o=setTimeout(()=>{if("function"==typeof r){try{i(r())}catch(e){a(e)}return}let n="string"==typeof r?r:`Promise timed out after ${t} milliseconds`,o=r instanceof Error?r:new s(n);"function"==typeof e.cancel&&e.cancel(),a(o)},t);n(e.then(i,a),()=>{clearTimeout(o)})});e.exports=i,e.exports.default=i,e.exports.TimeoutError=s}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}},n=!0;try{a[e](r,r.exports,l),n=!1}finally{n&&delete o[e]}return r.exports}l.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/p-queue/";var u={};Object.defineProperty(u,"__esModule",{value:!0}),e=l(993),r=l(816),n=l(821),s=()=>{},i=new r.TimeoutError,u.default=class extends e{constructor(e){var t,r,i,a;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=s,this._resolveIdle=s,!("number"==typeof(e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},e)).intervalCap&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!=(r=null==(t=e.intervalCap)?void 0:t.toString())?r:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!=(a=null==(i=e.interval)?void 0:i.toString())?a:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=!0===e.throwOnTimeout,this._isPaused=!1===e.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=s,0===this._pendingCount&&(this._resolveIdle(),this._resolveIdle=s,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let e=Date.now();if(void 0===this._intervalId){let t=this._intervalEnd-e;if(!(t<0))return void 0===this._timeoutId&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},t)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let t=this._queue.dequeue();return!!t&&(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!("number"==typeof e&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,t={}){return new Promise((n,s)=>{let a=async()=>{this._pendingCount++,this._intervalCount++;try{let a=void 0===this._timeout&&void 0===t.timeout?e():r.default(Promise.resolve(e()),void 0===t.timeout?this._timeout:t.timeout,()=>{(void 0===t.throwOnTimeout?this._throwOnTimeout:t.throwOnTimeout)&&s(i)});n(await a)}catch(e){s(e)}this._next()};this._queue.enqueue(a,t),this._tryToStartAnother(),this.emit("add")})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this._isPaused&&(this._isPaused=!1,this._processQueue()),this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise(e=>{let t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}})}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise(e=>{let t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}})}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}},t.exports=u})()},51615,(e,t,r)=>{t.exports=e.x("node:buffer",()=>require("node:buffer"))},78500,(e,t,r)=>{t.exports=e.x("node:async_hooks",()=>require("node:async_hooks"))},29748,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={getTestReqInfo:function(){return l},withRequest:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=new(e.r(78500)).AsyncLocalStorage;function a(e,t){let r=t.header(e,"next-test-proxy-port");if(!r)return;let n=t.url(e);return{url:n,proxyPort:Number(r),testData:t.header(e,"next-test-data")||""}}function o(e,t,r){let n=a(e,t);return n?i.run(n,r):r()}function l(e,t){let r=i.getStore();return r||(e&&t?a(e,t):void 0)}},44084,(e,t,r)=>{"use strict";var n=e.i(51615);Object.defineProperty(r,"__esModule",{value:!0});var s={handleFetch:function(){return u},interceptFetch:function(){return c},reader:function(){return o}};for(var i in s)Object.defineProperty(r,i,{enumerable:!0,get:s[i]});let a=e.r(29748),o={url:e=>e.url,header:(e,t)=>e.headers.get(t)};async function l(e,t){let{url:r,method:s,headers:i,body:a,cache:o,credentials:l,integrity:u,mode:c,redirect:h,referrer:d,referrerPolicy:p}=t;return{testData:e,api:"fetch",request:{url:r,method:s,headers:[...Array.from(i),["next-test-stack",function(){let e=(Error().stack??"").split("\n");for(let t=1;t<e.length;t++)if(e[t].length>0){e=e.slice(t);break}return(e=(e=(e=e.filter(e=>!e.includes("/next/dist/"))).slice(0,5)).map(e=>e.replace("webpack-internal:///(rsc)/","").trim())).join(" ")}()]],body:a?n.Buffer.from(await t.arrayBuffer()).toString("base64"):null,cache:o,credentials:l,integrity:u,mode:c,redirect:h,referrer:d,referrerPolicy:p}}}async function u(e,t){let r=(0,a.getTestReqInfo)(t,o);if(!r)return e(t);let{testData:s,proxyPort:i}=r,u=await l(s,t),c=await e(`http://localhost:${i}`,{method:"POST",body:JSON.stringify(u),next:{internal:!0}});if(!c.ok)throw Object.defineProperty(Error(`Proxy request failed: ${c.status}`),"__NEXT_ERROR_CODE",{value:"E146",enumerable:!1,configurable:!0});let h=await c.json(),{api:d}=h;switch(d){case"continue":return e(t);case"abort":case"unhandled":throw Object.defineProperty(Error(`Proxy request aborted [${t.method} ${t.url}]`),"__NEXT_ERROR_CODE",{value:"E145",enumerable:!1,configurable:!0});case"fetch":return function(e){let{status:t,headers:r,body:s}=e.response;return new Response(s?n.Buffer.from(s,"base64"):null,{status:t,headers:new Headers(r)})}(h);default:return d}}function c(t){return e.g.fetch=function(e,r){var n;return(null==r||null==(n=r.next)?void 0:n.internal)?t(e,r):u(t,new Request(e,r))},()=>{e.g.fetch=t}}},47679,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={interceptTestApis:function(){return o},wrapRequestHandler:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(29748),a=e.r(44084);function o(){return(0,a.interceptFetch)(e.g.fetch)}function l(e){return(t,r)=>(0,i.withRequest)(t,a.reader,()=>e(t,r))}},28084,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",s=0,i=-1,a=0,o=0;o<=e.length;++o){if(o<e.length)r=e.charCodeAt(o);else if(47===r)break;else r=47;if(47===r){if(i===o-1||1===a);else if(i!==o-1&&2===a){if(n.length<2||2!==s||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2)){if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",s=0):s=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),i=o,a=0;continue}}else if(2===n.length||1===n.length){n="",s=0,i=o,a=0;continue}}t&&(n.length>0?n+="/..":n="..",s=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),s=o-i-1;i=o,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n,s="",i=!1,a=arguments.length-1;a>=-1&&!i;a--)a>=0?n=arguments[a]:(void 0===e&&(e=""),n=e),t(n),0!==n.length&&(s=n+"/"+s,i=47===n.charCodeAt(0));if(s=r(s,!i),i)if(s.length>0)return"/"+s;else return"/";return s.length>0?s:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),s=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&s&&(e+="/"),n)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var s=arguments[r];t(s),s.length>0&&(void 0===e?e=s:e+="/"+s)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var s=1;s<e.length&&47===e.charCodeAt(s);++s);for(var i=e.length,a=i-s,o=1;o<r.length&&47===r.charCodeAt(o);++o);for(var l=r.length-o,u=a<l?a:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===r.charCodeAt(o+h))return r.slice(o+h+1);else if(0===h)return r.slice(o+h)}else a>u&&(47===e.charCodeAt(s+h)?c=h:0===h&&(c=0));break}var d=e.charCodeAt(s+h);if(d!==r.charCodeAt(o+h))break;47===d&&(c=h)}var p="";for(h=s+c+1;h<=i;++h)(h===i||47===e.charCodeAt(h))&&(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(o+c):(o+=c,47===r.charCodeAt(o)&&++o,r.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,s=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!i){s=a;break}}else i=!1;return -1===s?n?"/":".":n&&1===s?"//":e.slice(0,s)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var n,s=0,i=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var o=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!a){s=n+1;break}}else -1===l&&(a=!1,l=n+1),o>=0&&(u===r.charCodeAt(o)?-1==--o&&(i=n):(o=-1,i=l))}return s===i?i=l:-1===i&&(i=e.length),e.slice(s,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){s=n+1;break}}else -1===i&&(a=!1,i=n+1);return -1===i?"":e.slice(s,i)},extname:function(e){t(e);for(var r=-1,n=0,s=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(47===l){if(!i){n=o+1;break}continue}-1===s&&(i=!1,s=o+1),46===l?-1===r?r=o:1!==a&&(a=1):-1!==r&&(a=-1)}return -1===r||-1===s||0===a||1===a&&r===s-1&&r===n+1?"":e.slice(r,s)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var s=e.charCodeAt(0),i=47===s;i?(n.root="/",r=1):r=0;for(var a=-1,o=0,l=-1,u=!0,c=e.length-1,h=0;c>=r;--c){if(47===(s=e.charCodeAt(c))){if(!u){o=c+1;break}continue}-1===l&&(u=!1,l=c+1),46===s?-1===a?a=c:1!==h&&(h=1):-1!==a&&(h=-1)}return -1===a||-1===l||0===h||1===h&&a===l-1&&a===o+1?-1!==l&&(0===o&&i?n.base=n.name=e.slice(1,l):n.base=n.name=e.slice(o,l)):(0===o&&i?(n.name=e.slice(1,a),n.base=e.slice(1,l)):(n.name=e.slice(o,a),n.base=e.slice(o,l)),n.ext=e.slice(a,l)),o>0?n.dir=e.slice(0,o-1):i&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n}},r={};function n(t){var s=r[t];if(void 0!==s)return s.exports;var i=r[t]={exports:{}},a=!0;try{e[t](i,i.exports,n),a=!1}finally{a&&delete r[t]}return i.exports}n.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=n(114)}()},15246,(e,t,r)=>{t.exports=e.r(28084)},63261,(e,t,r)=>{(()=>{"use strict";"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-to-regexp/");var e={};(()=>{function t(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"===n||"+"===n||"?"===n){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if("\\"===n){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if("{"===n){t.push({type:"OPEN",index:r,value:e[r++]});continue}if("}"===n){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(":"===n){for(var s="",i=r+1;i<e.length;){var a=e.charCodeAt(i);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){s+=e[i++];continue}break}if(!s)throw TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:s}),r=i;continue}if("("===n){var o=1,l="",i=r+1;if("?"===e[i])throw TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<e.length;){if("\\"===e[i]){l+=e[i++]+e[i++];continue}if(")"===e[i]){if(0==--o){i++;break}}else if("("===e[i]&&(o++,"?"!==e[i+1]))throw TypeError("Capturing groups are not allowed at ".concat(i));l+=e[i++]}if(o)throw TypeError("Unbalanced pattern at ".concat(r));if(!l)throw TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:l}),r=i;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,i=void 0===n?"./":n,a=t.delimiter,o=void 0===a?"/#?":a,l=[],u=0,c=0,h="",d=function(e){if(c<r.length&&r[c].type===e)return r[c++].value},p=function(e){var t=d(e);if(void 0!==t)return t;var n=r[c],s=n.type,i=n.index;throw TypeError("Unexpected ".concat(s," at ").concat(i,", expected ").concat(e))},f=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},g=function(e){for(var t=0;t<o.length;t++){var r=o[t];if(e.indexOf(r)>-1)return!0}return!1},m=function(e){var t=l[l.length-1],r=e||(t&&"string"==typeof t?t:"");if(t&&!r)throw TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!r||g(r)?"[^".concat(s(o),"]+?"):"(?:(?!".concat(s(r),")[^").concat(s(o),"])+?")};c<r.length;){var b=d("CHAR"),y=d("NAME"),v=d("PATTERN");if(y||v){var w=b||"";-1===i.indexOf(w)&&(h+=w,w=""),h&&(l.push(h),h=""),l.push({name:y||u++,prefix:w,suffix:"",pattern:v||m(w),modifier:d("MODIFIER")||""});continue}var _=b||d("ESCAPED_CHAR");if(_){h+=_;continue}if(h&&(l.push(h),h=""),d("OPEN")){var w=f(),E=d("NAME")||"",k=d("PATTERN")||"",S=f();p("CLOSE"),l.push({name:E||(k?u++:""),pattern:E&&!k?m(w):k,prefix:w,suffix:S,modifier:d("MODIFIER")||""});continue}p("END")}return l}function r(e,t){void 0===t&&(t={});var r=i(t),n=t.encode,s=void 0===n?function(e){return e}:n,a=t.validate,o=void 0===a||a,l=e.map(function(e){if("object"==typeof e)return new RegExp("^(?:".concat(e.pattern,")$"),r)});return function(t){for(var r="",n=0;n<e.length;n++){var i=e[n];if("string"==typeof i){r+=i;continue}var a=t?t[i.name]:void 0,u="?"===i.modifier||"*"===i.modifier,c="*"===i.modifier||"+"===i.modifier;if(Array.isArray(a)){if(!c)throw TypeError('Expected "'.concat(i.name,'" to not repeat, but got an array'));if(0===a.length){if(u)continue;throw TypeError('Expected "'.concat(i.name,'" to not be empty'))}for(var h=0;h<a.length;h++){var d=s(a[h],i);if(o&&!l[n].test(d))throw TypeError('Expected all "'.concat(i.name,'" to match "').concat(i.pattern,'", but got "').concat(d,'"'));r+=i.prefix+d+i.suffix}continue}if("string"==typeof a||"number"==typeof a){var d=s(String(a),i);if(o&&!l[n].test(d))throw TypeError('Expected "'.concat(i.name,'" to match "').concat(i.pattern,'", but got "').concat(d,'"'));r+=i.prefix+d+i.suffix;continue}if(!u){var p=c?"an array":"a string";throw TypeError('Expected "'.concat(i.name,'" to be ').concat(p))}}return r}}function n(e,t,r){void 0===r&&(r={});var n=r.decode,s=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var i=n[0],a=n.index,o=Object.create(null),l=1;l<n.length;l++)!function(e){if(void 0!==n[e]){var r=t[e-1];"*"===r.modifier||"+"===r.modifier?o[r.name]=n[e].split(r.prefix+r.suffix).map(function(e){return s(e,r)}):o[r.name]=s(n[e],r)}}(l);return{path:i,index:a,params:o}}}function s(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function i(e){return e&&e.sensitive?"":"i"}function a(e,t,r){void 0===r&&(r={});for(var n=r.strict,a=void 0!==n&&n,o=r.start,l=r.end,u=r.encode,c=void 0===u?function(e){return e}:u,h=r.delimiter,d=r.endsWith,p="[".concat(s(void 0===d?"":d),"]|$"),f="[".concat(s(void 0===h?"/#?":h),"]"),g=void 0===o||o?"^":"",m=0;m<e.length;m++){var b=e[m];if("string"==typeof b)g+=s(c(b));else{var y=s(c(b.prefix)),v=s(c(b.suffix));if(b.pattern)if(t&&t.push(b),y||v)if("+"===b.modifier||"*"===b.modifier){var w="*"===b.modifier?"?":"";g+="(?:".concat(y,"((?:").concat(b.pattern,")(?:").concat(v).concat(y,"(?:").concat(b.pattern,"))*)").concat(v,")").concat(w)}else g+="(?:".concat(y,"(").concat(b.pattern,")").concat(v,")").concat(b.modifier);else{if("+"===b.modifier||"*"===b.modifier)throw TypeError('Can not repeat "'.concat(b.name,'" without a prefix and suffix'));g+="(".concat(b.pattern,")").concat(b.modifier)}else g+="(?:".concat(y).concat(v,")").concat(b.modifier)}}if(void 0===l||l)a||(g+="".concat(f,"?")),g+=r.endsWith?"(?=".concat(p,")"):"$";else{var _=e[e.length-1],E="string"==typeof _?f.indexOf(_[_.length-1])>-1:void 0===_;a||(g+="(?:".concat(f,"(?=").concat(p,"))?")),E||(g+="(?=".concat(f,"|").concat(p,")"))}return new RegExp(g,i(r))}function o(e,r,n){if(e instanceof RegExp){var s;if(!r)return e;for(var l=/\((?:\?<(.*?)>)?(?!\?)/g,u=0,c=l.exec(e.source);c;)r.push({name:c[1]||u++,prefix:"",suffix:"",modifier:"",pattern:""}),c=l.exec(e.source);return e}return Array.isArray(e)?(s=e.map(function(e){return o(e,r,n).source}),new RegExp("(?:".concat(s.join("|"),")"),i(n))):a(t(e,n),r,n)}Object.defineProperty(e,"__esModule",{value:!0}),e.pathToRegexp=e.tokensToRegexp=e.regexpToFunction=e.match=e.tokensToFunction=e.compile=e.parse=void 0,e.parse=t,e.compile=function(e,n){return r(t(e,n),n)},e.tokensToFunction=r,e.match=function(e,t){var r=[];return n(o(e,r,t),r,t)},e.regexpToFunction=n,e.tokensToRegexp=a,e.pathToRegexp=o})(),t.exports=e})()},27645,(e,t,r)=>{var n={226:function(t,r){!function(n){"use strict";var s="function",i="undefined",a="object",o="string",l="major",u="model",c="name",h="type",d="vendor",p="version",f="architecture",g="console",m="mobile",b="tablet",y="smarttv",v="wearable",w="embedded",_="Amazon",E="Apple",k="ASUS",S="BlackBerry",T="Browser",R="Chrome",O="Firefox",x="Google",C="Huawei",P="Microsoft",A="Motorola",I="Opera",N="Samsung",j="Sharp",$="Sony",D="Xiaomi",L="Zebra",U="Facebook",M="Chromium OS",B="Mac OS",q=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},H=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},F=function(e,t){return typeof e===o&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},G=function(e,t){if(typeof e===o)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,350)},W=function(e,t){for(var r,n,i,o,l,u,c=0;c<t.length&&!l;){var h=t[c],d=t[c+1];for(r=n=0;r<h.length&&!l&&h[r];)if(l=h[r++].exec(e))for(i=0;i<d.length;i++)u=l[++n],typeof(o=d[i])===a&&o.length>0?2===o.length?typeof o[1]==s?this[o[0]]=o[1].call(this,u):this[o[0]]=o[1]:3===o.length?typeof o[1]!==s||o[1].exec&&o[1].test?this[o[0]]=u?u.replace(o[1],o[2]):void 0:this[o[0]]=u?o[1].call(this,u,o[2]):void 0:4===o.length&&(this[o[0]]=u?o[3].call(this,u.replace(o[1],o[2])):void 0):this[o]=u||void 0;c+=2}},z=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(F(t[r][n],e))return"?"===r?void 0:r}else if(F(t[r],e))return"?"===r?void 0:r;return e},K={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,I+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[c,I]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UC"+T]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+T],p],[/\bfocus\/([\w\.]+)/i],[p,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI "+T]],[/fxios\/([-\w\.]+)/i],[p,[c,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+T]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+T],p],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,U],p],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,R+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android "+T]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,p],[/(cobalt)\/([\w\.]+)/i],[c,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,V]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,N],[h,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,N],[h,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[d,E],[h,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,E],[h,b]],[/(macintosh);/i],[u,[d,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,j],[h,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,C],[h,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,C],[h,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,D],[h,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,D],[h,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,"OPPO"],[h,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[h,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[h,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,A],[h,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,A],[h,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,"LG"],[h,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,"LG"],[h,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[h,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[h,m]],[/(pixel c)\b/i],[u,[d,x],[h,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,x],[h,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,$],[h,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,$],[h,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[h,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,_],[h,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,_],[h,m]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[h,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,S],[h,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,k],[h,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,k],[h,m]],[/(nexus 9)/i],[u,[d,"HTC"],[h,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[h,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[h,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[h,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[h,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[h,b]],[/(surface duo)/i],[u,[d,P],[h,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[h,m]],[/(u304aa)/i],[u,[d,"AT&T"],[h,m]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[h,m]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[h,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[h,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[h,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[h,b]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[h,b]],[/\b(k88) b/i],[u,[d,"ZTE"],[h,b]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[h,m]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[h,m]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[h,b]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[h,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[h,b]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[h,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[h,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[h,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[h,m]],[/\b(ph-1) /i],[u,[d,"Essential"],[h,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[h,b]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[h,b]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[h,b]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[h,b]],[/(sprint) (\w+)/i],[d,u,[h,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,P],[h,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,L],[h,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,L],[h,m]],[/smart-tv.+(samsung)/i],[d,[h,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,N],[h,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,"LG"],[h,y]],[/(apple) ?tv/i],[d,[u,E+" TV"],[h,y]],[/crkey/i],[[u,R+"cast"],[d,x],[h,y]],[/droid.+aft(\w)( bui|\))/i],[u,[d,_],[h,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,j],[h,y]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,$],[h,y]],[/(mitv-\w{5}) bui/i],[u,[d,D],[h,y]],[/Hbbtv.*(technisat) (.*);/i],[d,u,[h,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,G],[u,G],[h,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[h,g]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[h,g]],[/(playstation [345portablevi]+)/i],[u,[d,$],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,P],[h,g]],[/((pebble))app/i],[d,u,[h,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[d,E],[h,v]],[/droid.+; (glass) \d/i],[u,[d,x],[h,v]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,L],[h,v]],[/(quest( 2| pro)?)/i],[u,[d,U],[h,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[h,w]],[/(aeobc)\b/i],[u,[d,_],[h,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[h,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[h,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,m]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[p,z,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[p,z,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,B],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[c,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,M],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,p]]},X=function(e,t){if(typeof e===a&&(t=e,e=void 0),!(this instanceof X))return new X(e,t).getResult();var r=typeof n!==i&&n.navigator?n.navigator:void 0,g=e||(r&&r.userAgent?r.userAgent:""),y=r&&r.userAgentData?r.userAgentData:void 0,v=t?q(J,t):J,w=r&&r.userAgent==g;return this.getBrowser=function(){var e,t={};return t[c]=void 0,t[p]=void 0,W.call(t,g,v.browser),t[l]=typeof(e=t[p])===o?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,w&&r&&r.brave&&typeof r.brave.isBrave==s&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[f]=void 0,W.call(e,g,v.cpu),e},this.getDevice=function(){var e={};return e[d]=void 0,e[u]=void 0,e[h]=void 0,W.call(e,g,v.device),w&&!e[h]&&y&&y.mobile&&(e[h]=m),w&&"Macintosh"==e[u]&&r&&typeof r.standalone!==i&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[u]="iPad",e[h]=b),e},this.getEngine=function(){var e={};return e[c]=void 0,e[p]=void 0,W.call(e,g,v.engine),e},this.getOS=function(){var e={};return e[c]=void 0,e[p]=void 0,W.call(e,g,v.os),w&&!e[c]&&y&&"Unknown"!=y.platform&&(e[c]=y.platform.replace(/chrome os/i,M).replace(/macos/i,B)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(e){return g=typeof e===o&&e.length>350?G(e,350):e,this},this.setUA(g),this};if(X.VERSION="1.0.35",X.BROWSER=H([c,p,l]),X.CPU=H([f]),X.DEVICE=H([u,d,h,g,m,y,b,v,w]),X.ENGINE=X.OS=H([c,p]),typeof r!==i)t.exports&&(r=t.exports=X),r.UAParser=X;else if(typeof define===s&&define.amd)e.r,void 0!==X&&e.v(X);else typeof n!==i&&(n.UAParser=X);var Y=typeof n!==i&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var Q=new X;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)Y.ua[r]=t[r]}}}(this)}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},a=!0;try{n[e].call(r.exports,r,r.exports,i),a=!1}finally{a&&delete s[e]}return r.exports}i.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/ua-parser-js/",t.exports=i(226)},70874,(e,t,r)=>{"use strict";var n={H:null,A:null};function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}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."}var i=Array.isArray;function a(){}var o=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),y=Symbol.iterator,v=Object.prototype.hasOwnProperty,w=Object.assign;function _(e,t,r){var n=r.ref;return{$$typeof:o,type:e,key:t,ref:void 0!==n?n:null,props:r}}function E(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var k=/\/+/g;function S(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function T(e,t,r){if(null==e)return e;var n=[],u=0;return!function e(t,r,n,u,c){var h,d,p,f=typeof t;("undefined"===f||"boolean"===f)&&(t=null);var m=!1;if(null===t)m=!0;else switch(f){case"bigint":case"string":case"number":m=!0;break;case"object":switch(t.$$typeof){case o:case l:m=!0;break;case g:return e((m=t._init)(t._payload),r,n,u,c)}}if(m)return c=c(t),m=""===u?"."+S(t,0):u,i(c)?(n="",null!=m&&(n=m.replace(k,"$&/")+"/"),e(c,r,n,"",function(e){return e})):null!=c&&(E(c)&&(h=c,d=n+(null==c.key||t&&t.key===c.key?"":(""+c.key).replace(k,"$&/")+"/")+m,c=_(h.type,d,h.props)),r.push(c)),1;m=0;var b=""===u?".":u+":";if(i(t))for(var v=0;v<t.length;v++)f=b+S(u=t[v],v),m+=e(u,r,n,f,c);else if("function"==typeof(v=null===(p=t)||"object"!=typeof p?null:"function"==typeof(p=y&&p[y]||p["@@iterator"])?p:null))for(t=v.call(t),v=0;!(u=t.next()).done;)f=b+S(u=u.value,v++),m+=e(u,r,n,f,c);else if("object"===f){if("function"==typeof t.then)return e(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(a,a):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(t),r,n,u,c);throw Error(s(31,"[object Object]"===(r=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":r))}return m}(e,n,"","",function(e){return t.call(r,e,u++)}),n}function R(e){if(-1===e._status){var t=(0,e._result)();t.then(function(r){(0===e._status||-1===e._status)&&(e._status=1,e._result=r,void 0===t.status&&(t.status="fulfilled",t.value=r))},function(r){(0===e._status||-1===e._status)&&(e._status=2,e._result=r,void 0===t.status&&(t.status="rejected",t.reason=r))}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}function O(){return new WeakMap}function x(){return{s:0,v:void 0,o:null,p:null}}r.Activity=m,r.Children={map:T,forEach:function(e,t,r){T(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error(s(143));return e}},r.Fragment=u,r.Profiler=h,r.StrictMode=c,r.Suspense=p,r.ViewTransition=b,r.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,r.cache=function(e){return function(){var t=n.A;if(!t)return e.apply(null,arguments);var r=t.getCacheForType(O);void 0===(t=r.get(e))&&(t=x(),r.set(e,t)),r=0;for(var s=arguments.length;r<s;r++){var i=arguments[r];if("function"==typeof i||"object"==typeof i&&null!==i){var a=t.o;null===a&&(t.o=a=new WeakMap),void 0===(t=a.get(i))&&(t=x(),a.set(i,t))}else null===(a=t.p)&&(t.p=a=new Map),void 0===(t=a.get(i))&&(t=x(),a.set(i,t))}if(1===t.s)return t.v;if(2===t.s)throw t.v;try{var o=e.apply(null,arguments);return(r=t).s=1,r.v=o}catch(e){throw(o=t).s=2,o.v=e,e}}},r.cacheSignal=function(){var e=n.A;return e?e.cacheSignal():null},r.captureOwnerStack=function(){return null},r.cloneElement=function(e,t,r){if(null==e)throw Error(s(267,e));var n=w({},e.props),i=e.key;if(null!=t)for(a in void 0!==t.key&&(i=""+t.key),t)v.call(t,a)&&"key"!==a&&"__self"!==a&&"__source"!==a&&("ref"!==a||void 0!==t.ref)&&(n[a]=t[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];n.children=o}return _(e.type,i,n)},r.createElement=function(e,t,r){var n,s={},i=null;if(null!=t)for(n in void 0!==t.key&&(i=""+t.key),t)v.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(s[n]=t[n]);var a=arguments.length-2;if(1===a)s.children=r;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];s.children=o}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===s[n]&&(s[n]=a[n]);return _(e,i,s)},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:d,render:e}},r.isValidElement=E,r.lazy=function(e){return{$$typeof:g,_payload:{_status:-1,_result:e},_init:R}},r.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},r.use=function(e){return n.H.use(e)},r.useCallback=function(e,t){return n.H.useCallback(e,t)},r.useDebugValue=function(){},r.useId=function(){return n.H.useId()},r.useMemo=function(e,t){return n.H.useMemo(e,t)},r.version="19.3.0-canary-3f0b9e61-20260317"},29580,(e,t,r)=>{"use strict";t.exports=e.r(70874)},59692,(e,t,r)=>{"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.parseCookie=h,r.parse=h,r.stringifyCookie=function(e,t){let r=t?.encode||encodeURIComponent,n=[];for(let t of Object.keys(e)){let a=e[t];if(void 0===a)continue;if(!s.test(t))throw TypeError(`cookie name is invalid: ${t}`);let o=r(a);if(!i.test(o))throw TypeError(`cookie val is invalid: ${a}`);n.push(`${t}=${o}`)}return n.join("; ")},r.stringifySetCookie=d,r.serialize=d,r.parseSetCookie=function(e,t){let r=t?.decode||m,n=e.length,s=p(e,0,n),i=f(e,0,s),a=-1===i?{name:"",value:r(g(e,0,s))}:{name:g(e,0,i),value:r(g(e,i+1,s))},o=s+1;for(;o<n;){let t=p(e,o,n),r=f(e,o,t),s=-1===r?g(e,o,t):g(e,o,r),i=-1===r?void 0:g(e,r+1,t);switch(s.toLowerCase()){case"httponly":a.httpOnly=!0;break;case"secure":a.secure=!0;break;case"partitioned":a.partitioned=!0;break;case"domain":a.domain=i;break;case"path":a.path=i;break;case"max-age":i&&l.test(i)&&(a.maxAge=Number(i));break;case"expires":if(!i)break;let u=new Date(i);Number.isFinite(u.valueOf())&&(a.expires=u);break;case"priority":if(!i)break;let c=i.toLowerCase();("low"===c||"medium"===c||"high"===c)&&(a.priority=c);break;case"samesite":if(!i)break;let h=i.toLowerCase();("lax"===h||"strict"===h||"none"===h)&&(a.sameSite=h)}o=t+1}return a},r.stringifySetCookie=d,r.serialize=d;let s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,l=/^-?\d+$/,u=Object.prototype.toString,c=((n=function(){}).prototype=Object.create(null),n);function h(e,t){let r=new c,n=e.length;if(n<2)return r;let s=t?.decode||m,i=0;do{let t=f(e,i,n);if(-1===t)break;let a=p(e,i,n);if(t>a){i=e.lastIndexOf(";",t-1)+1;continue}let o=g(e,i,t);void 0===r[o]&&(r[o]=s(g(e,t+1,a))),i=a+1}while(i<n)return r}function d(e,t,r){let n="object"==typeof e?e:{...r,name:e,value:String(t)},l=("object"==typeof t?t:r)?.encode||encodeURIComponent;if(!s.test(n.name))throw TypeError(`argument name is invalid: ${n.name}`);let c=n.value?l(n.value):"";if(!i.test(c))throw TypeError(`argument val is invalid: ${n.value}`);let h=n.name+"="+c;if(void 0!==n.maxAge){if(!Number.isInteger(n.maxAge))throw TypeError(`option maxAge is invalid: ${n.maxAge}`);h+="; Max-Age="+n.maxAge}if(n.domain){if(!a.test(n.domain))throw TypeError(`option domain is invalid: ${n.domain}`);h+="; Domain="+n.domain}if(n.path){if(!o.test(n.path))throw TypeError(`option path is invalid: ${n.path}`);h+="; Path="+n.path}if(n.expires){var d;if(d=n.expires,"[object Date]"!==u.call(d)||!Number.isFinite(n.expires.valueOf()))throw TypeError(`option expires is invalid: ${n.expires}`);h+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(h+="; HttpOnly"),n.secure&&(h+="; Secure"),n.partitioned&&(h+="; Partitioned"),n.priority)switch("string"==typeof n.priority?n.priority.toLowerCase():void 0){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw TypeError(`option sameSite is invalid: ${n.sameSite}`)}return h}function p(e,t,r){let n=e.indexOf(";",t);return -1===n?r:n}function f(e,t,r){let n=e.indexOf("=",t);return n<r?n:-1}function g(e,t,r){let n=t,s=r;do{let t=e.charCodeAt(n);if(32!==t&&9!==t)break}while(++n<s)for(;s>n;){let t=e.charCodeAt(s-1);if(32!==t&&9!==t)break;s--}return e.slice(n,s)}function m(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},94826,e=>{"use strict";let t,r,n,s,i;async function a(){return"_ENTRIES"in globalThis&&_ENTRIES.middleware_instrumentation&&await _ENTRIES.middleware_instrumentation}e.i(44962);let o=null;async function l(){if("phase-production-build"===process.env.NEXT_PHASE)return;o||(o=a());let e=await o;if(null==e?void 0:e.register)try{await e.register()}catch(e){throw e.message=`An error occurred while loading instrumentation hook: ${e.message}`,e}}async function u(...e){let t=await a();try{var r;await (null==t||null==(r=t.onRequestError)?void 0:r.call(t,...e))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}let c=null;function h(){return c||(c=l()),c}function d(e){return`The edge runtime does not support Node.js '${e}' module.
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["chunks/[root-of-the-server]__0t9u~vh._.js",44962,(e,t,r)=>{},5701,(e,t,r)=>{"use strict";var n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o={},l={RequestCookies:()=>g,ResponseCookies:()=>m,parseCookie:()=>h,parseSetCookie:()=>d,stringifyCookie:()=>c};for(var u in l)n(o,u,{get:l[u],enumerable:!0});function c(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function h(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,s]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=s?s:"true"))}catch{}}return t}function d(e){if(!e)return;let[[t,r],...n]=h(e),{domain:s,expires:i,httponly:a,maxage:o,path:l,samesite:u,secure:c,partitioned:d,priority:g}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var m,b,y={name:t,value:decodeURIComponent(r),domain:s,...i&&{expires:new Date(i)},...a&&{httpOnly:!0},..."string"==typeof o&&{maxAge:Number(o)},path:l,...u&&{sameSite:p.includes(m=(m=u).toLowerCase())?m:void 0},...c&&{secure:!0},...g&&{priority:f.includes(b=(b=g).toLowerCase())?b:void 0},...d&&{partitioned:!0}};let e={};for(let t in y)y[t]&&(e[t]=y[t]);return e}}t.exports=((e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))a.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(o=s(t,l))||o.enumerable});return e})(n({},"__esModule",{value:!0}),o);var p=["strict","lax","none"],f=["low","medium","high"],g=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t)for(const[e,r]of h(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>c(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>c(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},m=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;const s=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(const e of Array.isArray(s)?s:function(e){if(!e)return[];var t,r,n,s,i,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,i=!1;l();)if(","===(r=e.charAt(o))){for(n=o,o+=1,l(),s=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(i=!0,o=s,a.push(e.substring(t,n)),t=o):o=n+1}else o+=1;(!i||o>=e.length)&&a.push(e.substring(t,e.length))}return a}(s)){const t=d(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,s=this._parsed;return s.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=c(r);t.append("set-cookie",e)}}(s,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join("; ")}}},42856,(e,t,r)=>{(()=>{"use strict";let r,n,s,i,a;var o,l,u,c,h,d,p,f,g,m,b,y,v,w,_,E,k={491:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;let n=r(223),s=r(172),i=r(930),a="context",o=new n.NoopContextManager;class l{static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalContextManager(e){return(0,s.registerGlobal)(a,e,i.DiagAPI.instance())}active(){return this._getContextManager().active()}with(e,t,r,...n){return this._getContextManager().with(e,t,r,...n)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return(0,s.getGlobal)(a)||o}disable(){this._getContextManager().disable(),(0,s.unregisterGlobal)(a,i.DiagAPI.instance())}}t.ContextAPI=l},930:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;let n=r(56),s=r(912),i=r(957),a=r(172);class o{constructor(){function e(e){return function(...t){let r=(0,a.getGlobal)("diag");if(r)return r[e](...t)}}const t=this;t.setLogger=(e,r={logLevel:i.DiagLogLevel.INFO})=>{var n,o,l;if(e===t){let e=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!=(n=e.stack)?n:e.message),!1}"number"==typeof r&&(r={logLevel:r});let u=(0,a.getGlobal)("diag"),c=(0,s.createLogLevelDiagLogger)(null!=(o=r.logLevel)?o:i.DiagLogLevel.INFO,e);if(u&&!r.suppressOverrideMessage){let e=null!=(l=Error().stack)?l:"<failed to generate stacktrace>";u.warn(`Current logger will be overwritten from ${e}`),c.warn(`Current logger will overwrite one already registered from ${e}`)}return(0,a.registerGlobal)("diag",c,t,!0)},t.disable=()=>{(0,a.unregisterGlobal)("diag",t)},t.createComponentLogger=e=>new n.DiagComponentLogger(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}static instance(){return this._instance||(this._instance=new o),this._instance}}t.DiagAPI=o},653:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;let n=r(660),s=r(172),i=r(930),a="metrics";class o{static getInstance(){return this._instance||(this._instance=new o),this._instance}setGlobalMeterProvider(e){return(0,s.registerGlobal)(a,e,i.DiagAPI.instance())}getMeterProvider(){return(0,s.getGlobal)(a)||n.NOOP_METER_PROVIDER}getMeter(e,t,r){return this.getMeterProvider().getMeter(e,t,r)}disable(){(0,s.unregisterGlobal)(a,i.DiagAPI.instance())}}t.MetricsAPI=o},181:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;let n=r(172),s=r(874),i=r(194),a=r(277),o=r(369),l=r(930),u="propagation",c=new s.NoopTextMapPropagator;class h{constructor(){this.createBaggage=o.createBaggage,this.getBaggage=a.getBaggage,this.getActiveBaggage=a.getActiveBaggage,this.setBaggage=a.setBaggage,this.deleteBaggage=a.deleteBaggage}static getInstance(){return this._instance||(this._instance=new h),this._instance}setGlobalPropagator(e){return(0,n.registerGlobal)(u,e,l.DiagAPI.instance())}inject(e,t,r=i.defaultTextMapSetter){return this._getGlobalPropagator().inject(e,t,r)}extract(e,t,r=i.defaultTextMapGetter){return this._getGlobalPropagator().extract(e,t,r)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,n.unregisterGlobal)(u,l.DiagAPI.instance())}_getGlobalPropagator(){return(0,n.getGlobal)(u)||c}}t.PropagationAPI=h},997:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;let n=r(172),s=r(846),i=r(139),a=r(607),o=r(930),l="trace";class u{constructor(){this._proxyTracerProvider=new s.ProxyTracerProvider,this.wrapSpanContext=i.wrapSpanContext,this.isSpanContextValid=i.isSpanContextValid,this.deleteSpan=a.deleteSpan,this.getSpan=a.getSpan,this.getActiveSpan=a.getActiveSpan,this.getSpanContext=a.getSpanContext,this.setSpan=a.setSpan,this.setSpanContext=a.setSpanContext}static getInstance(){return this._instance||(this._instance=new u),this._instance}setGlobalTracerProvider(e){let t=(0,n.registerGlobal)(l,this._proxyTracerProvider,o.DiagAPI.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return(0,n.getGlobal)(l)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){(0,n.unregisterGlobal)(l,o.DiagAPI.instance()),this._proxyTracerProvider=new s.ProxyTracerProvider}}t.TraceAPI=u},277:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;let n=r(491),s=(0,r(780).createContextKey)("OpenTelemetry Baggage Key");function i(e){return e.getValue(s)||void 0}t.getBaggage=i,t.getActiveBaggage=function(){return i(n.ContextAPI.getInstance().active())},t.setBaggage=function(e,t){return e.setValue(s,t)},t.deleteBaggage=function(e){return e.deleteValue(s)}},993:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class r{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries()).map(([e,t])=>[e,t])}setEntry(e,t){let n=new r(this._entries);return n._entries.set(e,t),n}removeEntry(e){let t=new r(this._entries);return t._entries.delete(e),t}removeEntries(...e){let t=new r(this._entries);for(let r of e)t._entries.delete(r);return t}clear(){return new r}}t.BaggageImpl=r},830:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")},369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;let n=r(930),s=r(993),i=r(830),a=n.DiagAPI.instance();t.createBaggage=function(e={}){return new s.BaggageImpl(new Map(Object.entries(e)))},t.baggageEntryMetadataFromString=function(e){return"string"!=typeof e&&(a.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:i.baggageEntryMetadataSymbol,toString:()=>e}}},67:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0,t.context=r(491).ContextAPI.getInstance()},223:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;let n=r(780);t.NoopContextManager=class{active(){return n.ROOT_CONTEXT}with(e,t,r,...n){return t.call(r,...n)}bind(e,t){return t}enable(){return this}disable(){return this}}},780:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0,t.createContextKey=function(e){return Symbol.for(e)};class r{constructor(e){const t=this;t._currentContext=e?new Map(e):new Map,t.getValue=e=>t._currentContext.get(e),t.setValue=(e,n)=>{let s=new r(t._currentContext);return s._currentContext.set(e,n),s},t.deleteValue=e=>{let n=new r(t._currentContext);return n._currentContext.delete(e),n}}}t.ROOT_CONTEXT=new r},506:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0,t.diag=r(930).DiagAPI.instance()},56:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;let n=r(172);function s(e,t,r){let s=(0,n.getGlobal)("diag");if(s)return r.unshift(t),s[e](...r)}t.DiagComponentLogger=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return s("debug",this._namespace,e)}error(...e){return s("error",this._namespace,e)}info(...e){return s("info",this._namespace,e)}warn(...e){return s("warn",this._namespace,e)}verbose(...e){return s("verbose",this._namespace,e)}}},972:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;let r=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];t.DiagConsoleLogger=class{constructor(){for(let e=0;e<r.length;e++)this[r[e].n]=function(e){return function(...t){if(console){let r=console[e];if("function"!=typeof r&&(r=console.log),"function"==typeof r)return r.apply(console,t)}}}(r[e].c)}}},912:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;let n=r(957);t.createLogLevelDiagLogger=function(e,t){function r(r,n){let s=t[r];return"function"==typeof s&&e>=n?s.bind(t):function(){}}return e<n.DiagLogLevel.NONE?e=n.DiagLogLevel.NONE:e>n.DiagLogLevel.ALL&&(e=n.DiagLogLevel.ALL),t=t||{},{error:r("error",n.DiagLogLevel.ERROR),warn:r("warn",n.DiagLogLevel.WARN),info:r("info",n.DiagLogLevel.INFO),debug:r("debug",n.DiagLogLevel.DEBUG),verbose:r("verbose",n.DiagLogLevel.VERBOSE)}}},957:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0,(r=t.DiagLogLevel||(t.DiagLogLevel={}))[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"},172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;let n=r(200),s=r(521),i=r(130),a=s.VERSION.split(".")[0],o=Symbol.for(`opentelemetry.js.api.${a}`),l=n._globalThis;t.registerGlobal=function(e,t,r,n=!1){var i;let a=l[o]=null!=(i=l[o])?i:{version:s.VERSION};if(!n&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(t.stack||t.message),!1}if(a.version!==s.VERSION){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${s.VERSION}`);return r.error(t.stack||t.message),!1}return a[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${s.VERSION}.`),!0},t.getGlobal=function(e){var t,r;let n=null==(t=l[o])?void 0:t.version;if(n&&(0,i.isCompatible)(n))return null==(r=l[o])?void 0:r[e]},t.unregisterGlobal=function(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${s.VERSION}.`);let r=l[o];r&&delete r[e]}},130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;let n=r(521),s=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function i(e){let t=new Set([e]),r=new Set,n=e.match(s);if(!n)return()=>!1;let i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=i.prerelease)return function(t){return t===e};function a(e){return r.add(e),!1}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;let n=e.match(s);if(!n)return a(e);let o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=o.prerelease||i.major!==o.major)return a(e);if(0===i.major)return i.minor===o.minor&&i.patch<=o.patch?(t.add(e),!0):a(e);return i.minor<=o.minor?(t.add(e),!0):a(e)}}t._makeCompatibilityCheck=i,t.isCompatible=i(n.VERSION)},886:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0,t.metrics=r(653).MetricsAPI.getInstance()},901:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0,(r=t.ValueType||(t.ValueType={}))[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"},102:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class r{createHistogram(e,r){return t.NOOP_HISTOGRAM_METRIC}createCounter(e,r){return t.NOOP_COUNTER_METRIC}createUpDownCounter(e,r){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(e,r){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(e,r){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(e,r){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}}t.NoopMeter=r;class n{}t.NoopMetric=n;class s extends n{add(e,t){}}t.NoopCounterMetric=s;class i extends n{add(e,t){}}t.NoopUpDownCounterMetric=i;class a extends n{record(e,t){}}t.NoopHistogramMetric=a;class o{addCallback(e){}removeCallback(e){}}t.NoopObservableMetric=o;class l extends o{}t.NoopObservableCounterMetric=l;class u extends o{}t.NoopObservableGaugeMetric=u;class c extends o{}t.NoopObservableUpDownCounterMetric=c,t.NOOP_METER=new r,t.NOOP_COUNTER_METRIC=new s,t.NOOP_HISTOGRAM_METRIC=new a,t.NOOP_UP_DOWN_COUNTER_METRIC=new i,t.NOOP_OBSERVABLE_COUNTER_METRIC=new l,t.NOOP_OBSERVABLE_GAUGE_METRIC=new u,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new c,t.createNoopMeter=function(){return t.NOOP_METER}},660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;let n=r(102);class s{getMeter(e,t,r){return n.NOOP_METER}}t.NoopMeterProvider=s,t.NOOP_METER_PROVIDER=new s},200:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(46),t)},651:(t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r._globalThis=void 0,r._globalThis="object"==typeof globalThis?globalThis:e.g},46:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(651),t)},939:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0,t.propagation=r(181).PropagationAPI.getInstance()},874:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0,t.NoopTextMapPropagator=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}},194:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,t){if(null!=e)return e[t]},keys:e=>null==e?[]:Object.keys(e)},t.defaultTextMapSetter={set(e,t,r){null!=e&&(e[t]=r)}}},845:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0,t.trace=r(997).TraceAPI.getInstance()},403:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;let n=r(476);t.NonRecordingSpan=class{constructor(e=n.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}},614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;let n=r(491),s=r(607),i=r(403),a=r(139),o=n.ContextAPI.getInstance();t.NoopTracer=class{startSpan(e,t,r=o.active()){var n;if(null==t?void 0:t.root)return new i.NonRecordingSpan;let l=r&&(0,s.getSpanContext)(r);return"object"==typeof(n=l)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&(0,a.isSpanContextValid)(l)?new i.NonRecordingSpan(l):new i.NonRecordingSpan}startActiveSpan(e,t,r,n){let i,a,l;if(arguments.length<2)return;2==arguments.length?l=t:3==arguments.length?(i=t,l=r):(i=t,a=r,l=n);let u=null!=a?a:o.active(),c=this.startSpan(e,i,u),h=(0,s.setSpan)(u,c);return o.with(h,l,void 0,c)}}},124:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;let n=r(614);t.NoopTracerProvider=class{getTracer(e,t,r){return new n.NoopTracer}}},125:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;let n=new(r(614)).NoopTracer;t.ProxyTracer=class{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}startSpan(e,t,r){return this._getTracer().startSpan(e,t,r)}startActiveSpan(e,t,r,n){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):n}}},846:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;let n=r(125),s=new(r(124)).NoopTracerProvider;t.ProxyTracerProvider=class{getTracer(e,t,r){var s;return null!=(s=this.getDelegateTracer(e,t,r))?s:new n.ProxyTracer(this,e,t,r)}getDelegate(){var e;return null!=(e=this._delegate)?e:s}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,r){var n;return null==(n=this._delegate)?void 0:n.getTracer(e,t,r)}}},996:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0,(r=t.SamplingDecision||(t.SamplingDecision={}))[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"},607:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;let n=r(780),s=r(403),i=r(491),a=(0,n.createContextKey)("OpenTelemetry Context Key SPAN");function o(e){return e.getValue(a)||void 0}function l(e,t){return e.setValue(a,t)}t.getSpan=o,t.getActiveSpan=function(){return o(i.ContextAPI.getInstance().active())},t.setSpan=l,t.deleteSpan=function(e){return e.deleteValue(a)},t.setSpanContext=function(e,t){return l(e,new s.NonRecordingSpan(t))},t.getSpanContext=function(e){var t;return null==(t=o(e))?void 0:t.spanContext()}},325:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;let n=r(564);class s{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){!(e.length>512)&&(this._internalState=e.split(",").reverse().reduce((e,t)=>{let r=t.trim(),s=r.indexOf("=");if(-1!==s){let i=r.slice(0,s),a=r.slice(s+1,t.length);(0,n.validateKey)(i)&&(0,n.validateValue)(a)&&e.set(i,a)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new s;return e._internalState=new Map(this._internalState),e}}t.TraceStateImpl=s},564:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;let r="[_0-9a-z-*/]",n=`[a-z]${r}{0,255}`,s=`[a-z0-9]${r}{0,240}@[a-z]${r}{0,13}`,i=RegExp(`^(?:${n}|${s})$`),a=/^[ -~]{0,255}[!-~]$/,o=/,|=/;t.validateKey=function(e){return i.test(e)},t.validateValue=function(e){return a.test(e)&&!o.test(e)}},98:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;let n=r(325);t.createTraceState=function(e){return new n.TraceStateImpl(e)}},476:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;let n=r(475);t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:n.TraceFlags.NONE}},357:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0,(r=t.SpanKind||(t.SpanKind={}))[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"},139:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;let n=r(476),s=r(403),i=/^([0-9a-f]{32})$/i,a=/^[0-9a-f]{16}$/i;function o(e){return i.test(e)&&e!==n.INVALID_TRACEID}function l(e){return a.test(e)&&e!==n.INVALID_SPANID}t.isValidTraceId=o,t.isValidSpanId=l,t.isSpanContextValid=function(e){return o(e.traceId)&&l(e.spanId)},t.wrapSpanContext=function(e){return new s.NonRecordingSpan(e)}},847:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0,(r=t.SpanStatusCode||(t.SpanStatusCode={}))[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"},475:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0,(r=t.TraceFlags||(t.TraceFlags={}))[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"},521:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.6.0"}},S={};function T(e){var t=S[e];if(void 0!==t)return t.exports;var r=S[e]={exports:{}},n=!0;try{k[e].call(r.exports,r,r.exports,T),n=!1}finally{n&&delete S[e]}return r.exports}T.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/@opentelemetry/api/";var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.trace=R.propagation=R.metrics=R.diag=R.context=R.INVALID_SPAN_CONTEXT=R.INVALID_TRACEID=R.INVALID_SPANID=R.isValidSpanId=R.isValidTraceId=R.isSpanContextValid=R.createTraceState=R.TraceFlags=R.SpanStatusCode=R.SpanKind=R.SamplingDecision=R.ProxyTracerProvider=R.ProxyTracer=R.defaultTextMapSetter=R.defaultTextMapGetter=R.ValueType=R.createNoopMeter=R.DiagLogLevel=R.DiagConsoleLogger=R.ROOT_CONTEXT=R.createContextKey=R.baggageEntryMetadataFromString=void 0,o=T(369),Object.defineProperty(R,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return o.baggageEntryMetadataFromString}}),l=T(780),Object.defineProperty(R,"createContextKey",{enumerable:!0,get:function(){return l.createContextKey}}),Object.defineProperty(R,"ROOT_CONTEXT",{enumerable:!0,get:function(){return l.ROOT_CONTEXT}}),u=T(972),Object.defineProperty(R,"DiagConsoleLogger",{enumerable:!0,get:function(){return u.DiagConsoleLogger}}),c=T(957),Object.defineProperty(R,"DiagLogLevel",{enumerable:!0,get:function(){return c.DiagLogLevel}}),h=T(102),Object.defineProperty(R,"createNoopMeter",{enumerable:!0,get:function(){return h.createNoopMeter}}),d=T(901),Object.defineProperty(R,"ValueType",{enumerable:!0,get:function(){return d.ValueType}}),p=T(194),Object.defineProperty(R,"defaultTextMapGetter",{enumerable:!0,get:function(){return p.defaultTextMapGetter}}),Object.defineProperty(R,"defaultTextMapSetter",{enumerable:!0,get:function(){return p.defaultTextMapSetter}}),f=T(125),Object.defineProperty(R,"ProxyTracer",{enumerable:!0,get:function(){return f.ProxyTracer}}),g=T(846),Object.defineProperty(R,"ProxyTracerProvider",{enumerable:!0,get:function(){return g.ProxyTracerProvider}}),m=T(996),Object.defineProperty(R,"SamplingDecision",{enumerable:!0,get:function(){return m.SamplingDecision}}),b=T(357),Object.defineProperty(R,"SpanKind",{enumerable:!0,get:function(){return b.SpanKind}}),y=T(847),Object.defineProperty(R,"SpanStatusCode",{enumerable:!0,get:function(){return y.SpanStatusCode}}),v=T(475),Object.defineProperty(R,"TraceFlags",{enumerable:!0,get:function(){return v.TraceFlags}}),w=T(98),Object.defineProperty(R,"createTraceState",{enumerable:!0,get:function(){return w.createTraceState}}),_=T(139),Object.defineProperty(R,"isSpanContextValid",{enumerable:!0,get:function(){return _.isSpanContextValid}}),Object.defineProperty(R,"isValidTraceId",{enumerable:!0,get:function(){return _.isValidTraceId}}),Object.defineProperty(R,"isValidSpanId",{enumerable:!0,get:function(){return _.isValidSpanId}}),E=T(476),Object.defineProperty(R,"INVALID_SPANID",{enumerable:!0,get:function(){return E.INVALID_SPANID}}),Object.defineProperty(R,"INVALID_TRACEID",{enumerable:!0,get:function(){return E.INVALID_TRACEID}}),Object.defineProperty(R,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return E.INVALID_SPAN_CONTEXT}}),r=T(67),Object.defineProperty(R,"context",{enumerable:!0,get:function(){return r.context}}),n=T(506),Object.defineProperty(R,"diag",{enumerable:!0,get:function(){return n.diag}}),s=T(886),Object.defineProperty(R,"metrics",{enumerable:!0,get:function(){return s.metrics}}),i=T(939),Object.defineProperty(R,"propagation",{enumerable:!0,get:function(){return i.propagation}}),a=T(845),Object.defineProperty(R,"trace",{enumerable:!0,get:function(){return a.trace}}),R.default={context:r.context,diag:n.diag,metrics:s.metrics,propagation:i.propagation,trace:a.trace},t.exports=R})()},94151,(e,t,r)=>{(()=>{"use strict";"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/cookie/");var e,r,n,s,i={};i.parse=function(t,r){if("string"!=typeof t)throw TypeError("argument str must be a string");for(var s={},i=t.split(n),a=(r||{}).decode||e,o=0;o<i.length;o++){var l=i[o],u=l.indexOf("=");if(!(u<0)){var c=l.substr(0,u).trim(),h=l.substr(++u,l.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),void 0==s[c]&&(s[c]=function(e,t){try{return t(e)}catch(t){return e}}(h,a))}}return s},i.serialize=function(e,t,n){var i=n||{},a=i.encode||r;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!s.test(e))throw TypeError("argument name is invalid");var o=a(t);if(o&&!s.test(o))throw TypeError("argument val is invalid");var l=e+"="+o;if(null!=i.maxAge){var u=i.maxAge-0;if(isNaN(u)||!isFinite(u))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(u)}if(i.domain){if(!s.test(i.domain))throw TypeError("option domain is invalid");l+="; Domain="+i.domain}if(i.path){if(!s.test(i.path))throw TypeError("option path is invalid");l+="; Path="+i.path}if(i.expires){if("function"!=typeof i.expires.toUTCString)throw TypeError("option expires is invalid");l+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(l+="; HttpOnly"),i.secure&&(l+="; Secure"),i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l},e=decodeURIComponent,r=encodeURIComponent,n=/; */,s=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,t.exports=i})()},10636,(e,t,r)=>{(()=>{"use strict";let e,r,n,s,i;var a={993:e=>{var t=Object.prototype.hasOwnProperty,r="~";function n(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw TypeError("The listener must be a function");var o=new s(n,i||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),o.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,i=n.length,a=Array(i);s<i;s++)a[s]=n[s].fn;return a},o.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,s,i,a){var o=r?r+e:e;if(!this._events[o])return!1;var l,u,c=this._events[o],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,s),!0;case 5:return c.fn.call(c.context,t,n,s,i),!0;case 6:return c.fn.call(c.context,t,n,s,i,a),!0}for(u=1,l=Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,p=c.length;for(u=0;u<p;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,s);break;default:if(!l)for(d=1,l=Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},o.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,n,s){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||s&&!o.once||n&&o.context!==n||a(this,i);else{for(var l=0,u=[],c=o.length;l<c;l++)(o[l].fn!==t||s&&!o[l].once||n&&o[l].context!==n)&&u.push(o[l]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o},213:e=>{e.exports=(e,t)=>(t=t||(()=>{}),e.then(e=>new Promise(e=>{e(t())}).then(()=>e),e=>new Promise(e=>{e(t())}).then(()=>{throw e})))},574:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=0,s=e.length;for(;s>0;){let i=s/2|0,a=n+i;0>=r(e[a],t)?(n=++a,s-=i+1):s=i}return n}},821:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});let n=r(574);t.default=class{constructor(){this._queue=[]}enqueue(e,t){let r={priority:(t=Object.assign({priority:0},t)).priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority)return void this._queue.push(r);let s=n.default(this._queue,r,(e,t)=>t.priority-e.priority);this._queue.splice(s,0,r)}dequeue(){let e=this._queue.shift();return null==e?void 0:e.run}filter(e){return this._queue.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this._queue.length}}},816:(e,t,r)=>{let n=r(213);class s extends Error{constructor(e){super(e),this.name="TimeoutError"}}let i=(e,t,r)=>new Promise((i,a)=>{if("number"!=typeof t||t<0)throw TypeError("Expected `milliseconds` to be a positive number");if(t===1/0)return void i(e);let o=setTimeout(()=>{if("function"==typeof r){try{i(r())}catch(e){a(e)}return}let n="string"==typeof r?r:`Promise timed out after ${t} milliseconds`,o=r instanceof Error?r:new s(n);"function"==typeof e.cancel&&e.cancel(),a(o)},t);n(e.then(i,a),()=>{clearTimeout(o)})});e.exports=i,e.exports.default=i,e.exports.TimeoutError=s}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}},n=!0;try{a[e](r,r.exports,l),n=!1}finally{n&&delete o[e]}return r.exports}l.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/p-queue/";var u={};Object.defineProperty(u,"__esModule",{value:!0}),e=l(993),r=l(816),n=l(821),s=()=>{},i=new r.TimeoutError,u.default=class extends e{constructor(e){var t,r,i,a;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=s,this._resolveIdle=s,!("number"==typeof(e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},e)).intervalCap&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!=(r=null==(t=e.intervalCap)?void 0:t.toString())?r:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!=(a=null==(i=e.interval)?void 0:i.toString())?a:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=!0===e.throwOnTimeout,this._isPaused=!1===e.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=s,0===this._pendingCount&&(this._resolveIdle(),this._resolveIdle=s,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let e=Date.now();if(void 0===this._intervalId){let t=this._intervalEnd-e;if(!(t<0))return void 0===this._timeoutId&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},t)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let t=this._queue.dequeue();return!!t&&(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!("number"==typeof e&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,t={}){return new Promise((n,s)=>{let a=async()=>{this._pendingCount++,this._intervalCount++;try{let a=void 0===this._timeout&&void 0===t.timeout?e():r.default(Promise.resolve(e()),void 0===t.timeout?this._timeout:t.timeout,()=>{(void 0===t.throwOnTimeout?this._throwOnTimeout:t.throwOnTimeout)&&s(i)});n(await a)}catch(e){s(e)}this._next()};this._queue.enqueue(a,t),this._tryToStartAnother(),this.emit("add")})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this._isPaused&&(this._isPaused=!1,this._processQueue()),this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise(e=>{let t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}})}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise(e=>{let t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}})}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}},t.exports=u})()},51615,(e,t,r)=>{t.exports=e.x("node:buffer",()=>require("node:buffer"))},78500,(e,t,r)=>{t.exports=e.x("node:async_hooks",()=>require("node:async_hooks"))},29748,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={getTestReqInfo:function(){return l},withRequest:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=new(e.r(78500)).AsyncLocalStorage;function a(e,t){let r=t.header(e,"next-test-proxy-port");if(!r)return;let n=t.url(e);return{url:n,proxyPort:Number(r),testData:t.header(e,"next-test-data")||""}}function o(e,t,r){let n=a(e,t);return n?i.run(n,r):r()}function l(e,t){let r=i.getStore();return r||(e&&t?a(e,t):void 0)}},44084,(e,t,r)=>{"use strict";var n=e.i(51615);Object.defineProperty(r,"__esModule",{value:!0});var s={handleFetch:function(){return u},interceptFetch:function(){return c},reader:function(){return o}};for(var i in s)Object.defineProperty(r,i,{enumerable:!0,get:s[i]});let a=e.r(29748),o={url:e=>e.url,header:(e,t)=>e.headers.get(t)};async function l(e,t){let{url:r,method:s,headers:i,body:a,cache:o,credentials:l,integrity:u,mode:c,redirect:h,referrer:d,referrerPolicy:p}=t;return{testData:e,api:"fetch",request:{url:r,method:s,headers:[...Array.from(i),["next-test-stack",function(){let e=(Error().stack??"").split("\n");for(let t=1;t<e.length;t++)if(e[t].length>0){e=e.slice(t);break}return(e=(e=(e=e.filter(e=>!e.includes("/next/dist/"))).slice(0,5)).map(e=>e.replace("webpack-internal:///(rsc)/","").trim())).join(" ")}()]],body:a?n.Buffer.from(await t.arrayBuffer()).toString("base64"):null,cache:o,credentials:l,integrity:u,mode:c,redirect:h,referrer:d,referrerPolicy:p}}}async function u(e,t){let r=(0,a.getTestReqInfo)(t,o);if(!r)return e(t);let{testData:s,proxyPort:i}=r,u=await l(s,t),c=await e(`http://localhost:${i}`,{method:"POST",body:JSON.stringify(u),next:{internal:!0}});if(!c.ok)throw Object.defineProperty(Error(`Proxy request failed: ${c.status}`),"__NEXT_ERROR_CODE",{value:"E146",enumerable:!1,configurable:!0});let h=await c.json(),{api:d}=h;switch(d){case"continue":return e(t);case"abort":case"unhandled":throw Object.defineProperty(Error(`Proxy request aborted [${t.method} ${t.url}]`),"__NEXT_ERROR_CODE",{value:"E145",enumerable:!1,configurable:!0});case"fetch":return function(e){let{status:t,headers:r,body:s}=e.response;return new Response(s?n.Buffer.from(s,"base64"):null,{status:t,headers:new Headers(r)})}(h);default:return d}}function c(t){return e.g.fetch=function(e,r){var n;return(null==r||null==(n=r.next)?void 0:n.internal)?t(e,r):u(t,new Request(e,r))},()=>{e.g.fetch=t}}},47679,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={interceptTestApis:function(){return o},wrapRequestHandler:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(29748),a=e.r(44084);function o(){return(0,a.interceptFetch)(e.g.fetch)}function l(e){return(t,r)=>(0,i.withRequest)(t,a.reader,()=>e(t,r))}},28084,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",s=0,i=-1,a=0,o=0;o<=e.length;++o){if(o<e.length)r=e.charCodeAt(o);else if(47===r)break;else r=47;if(47===r){if(i===o-1||1===a);else if(i!==o-1&&2===a){if(n.length<2||2!==s||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2)){if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",s=0):s=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),i=o,a=0;continue}}else if(2===n.length||1===n.length){n="",s=0,i=o,a=0;continue}}t&&(n.length>0?n+="/..":n="..",s=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),s=o-i-1;i=o,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n,s="",i=!1,a=arguments.length-1;a>=-1&&!i;a--)a>=0?n=arguments[a]:(void 0===e&&(e=""),n=e),t(n),0!==n.length&&(s=n+"/"+s,i=47===n.charCodeAt(0));if(s=r(s,!i),i)if(s.length>0)return"/"+s;else return"/";return s.length>0?s:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),s=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&s&&(e+="/"),n)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var s=arguments[r];t(s),s.length>0&&(void 0===e?e=s:e+="/"+s)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var s=1;s<e.length&&47===e.charCodeAt(s);++s);for(var i=e.length,a=i-s,o=1;o<r.length&&47===r.charCodeAt(o);++o);for(var l=r.length-o,u=a<l?a:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===r.charCodeAt(o+h))return r.slice(o+h+1);else if(0===h)return r.slice(o+h)}else a>u&&(47===e.charCodeAt(s+h)?c=h:0===h&&(c=0));break}var d=e.charCodeAt(s+h);if(d!==r.charCodeAt(o+h))break;47===d&&(c=h)}var p="";for(h=s+c+1;h<=i;++h)(h===i||47===e.charCodeAt(h))&&(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(o+c):(o+=c,47===r.charCodeAt(o)&&++o,r.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,s=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!i){s=a;break}}else i=!1;return -1===s?n?"/":".":n&&1===s?"//":e.slice(0,s)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var n,s=0,i=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var o=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!a){s=n+1;break}}else -1===l&&(a=!1,l=n+1),o>=0&&(u===r.charCodeAt(o)?-1==--o&&(i=n):(o=-1,i=l))}return s===i?i=l:-1===i&&(i=e.length),e.slice(s,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){s=n+1;break}}else -1===i&&(a=!1,i=n+1);return -1===i?"":e.slice(s,i)},extname:function(e){t(e);for(var r=-1,n=0,s=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(47===l){if(!i){n=o+1;break}continue}-1===s&&(i=!1,s=o+1),46===l?-1===r?r=o:1!==a&&(a=1):-1!==r&&(a=-1)}return -1===r||-1===s||0===a||1===a&&r===s-1&&r===n+1?"":e.slice(r,s)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var s=e.charCodeAt(0),i=47===s;i?(n.root="/",r=1):r=0;for(var a=-1,o=0,l=-1,u=!0,c=e.length-1,h=0;c>=r;--c){if(47===(s=e.charCodeAt(c))){if(!u){o=c+1;break}continue}-1===l&&(u=!1,l=c+1),46===s?-1===a?a=c:1!==h&&(h=1):-1!==a&&(h=-1)}return -1===a||-1===l||0===h||1===h&&a===l-1&&a===o+1?-1!==l&&(0===o&&i?n.base=n.name=e.slice(1,l):n.base=n.name=e.slice(o,l)):(0===o&&i?(n.name=e.slice(1,a),n.base=e.slice(1,l)):(n.name=e.slice(o,a),n.base=e.slice(o,l)),n.ext=e.slice(a,l)),o>0?n.dir=e.slice(0,o-1):i&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n}},r={};function n(t){var s=r[t];if(void 0!==s)return s.exports;var i=r[t]={exports:{}},a=!0;try{e[t](i,i.exports,n),a=!1}finally{a&&delete r[t]}return i.exports}n.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=n(114)}()},15246,(e,t,r)=>{t.exports=e.r(28084)},63261,(e,t,r)=>{(()=>{"use strict";"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-to-regexp/");var e={};(()=>{function t(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"===n||"+"===n||"?"===n){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if("\\"===n){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if("{"===n){t.push({type:"OPEN",index:r,value:e[r++]});continue}if("}"===n){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(":"===n){for(var s="",i=r+1;i<e.length;){var a=e.charCodeAt(i);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){s+=e[i++];continue}break}if(!s)throw TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:s}),r=i;continue}if("("===n){var o=1,l="",i=r+1;if("?"===e[i])throw TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<e.length;){if("\\"===e[i]){l+=e[i++]+e[i++];continue}if(")"===e[i]){if(0==--o){i++;break}}else if("("===e[i]&&(o++,"?"!==e[i+1]))throw TypeError("Capturing groups are not allowed at ".concat(i));l+=e[i++]}if(o)throw TypeError("Unbalanced pattern at ".concat(r));if(!l)throw TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:l}),r=i;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,i=void 0===n?"./":n,a=t.delimiter,o=void 0===a?"/#?":a,l=[],u=0,c=0,h="",d=function(e){if(c<r.length&&r[c].type===e)return r[c++].value},p=function(e){var t=d(e);if(void 0!==t)return t;var n=r[c],s=n.type,i=n.index;throw TypeError("Unexpected ".concat(s," at ").concat(i,", expected ").concat(e))},f=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},g=function(e){for(var t=0;t<o.length;t++){var r=o[t];if(e.indexOf(r)>-1)return!0}return!1},m=function(e){var t=l[l.length-1],r=e||(t&&"string"==typeof t?t:"");if(t&&!r)throw TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!r||g(r)?"[^".concat(s(o),"]+?"):"(?:(?!".concat(s(r),")[^").concat(s(o),"])+?")};c<r.length;){var b=d("CHAR"),y=d("NAME"),v=d("PATTERN");if(y||v){var w=b||"";-1===i.indexOf(w)&&(h+=w,w=""),h&&(l.push(h),h=""),l.push({name:y||u++,prefix:w,suffix:"",pattern:v||m(w),modifier:d("MODIFIER")||""});continue}var _=b||d("ESCAPED_CHAR");if(_){h+=_;continue}if(h&&(l.push(h),h=""),d("OPEN")){var w=f(),E=d("NAME")||"",k=d("PATTERN")||"",S=f();p("CLOSE"),l.push({name:E||(k?u++:""),pattern:E&&!k?m(w):k,prefix:w,suffix:S,modifier:d("MODIFIER")||""});continue}p("END")}return l}function r(e,t){void 0===t&&(t={});var r=i(t),n=t.encode,s=void 0===n?function(e){return e}:n,a=t.validate,o=void 0===a||a,l=e.map(function(e){if("object"==typeof e)return new RegExp("^(?:".concat(e.pattern,")$"),r)});return function(t){for(var r="",n=0;n<e.length;n++){var i=e[n];if("string"==typeof i){r+=i;continue}var a=t?t[i.name]:void 0,u="?"===i.modifier||"*"===i.modifier,c="*"===i.modifier||"+"===i.modifier;if(Array.isArray(a)){if(!c)throw TypeError('Expected "'.concat(i.name,'" to not repeat, but got an array'));if(0===a.length){if(u)continue;throw TypeError('Expected "'.concat(i.name,'" to not be empty'))}for(var h=0;h<a.length;h++){var d=s(a[h],i);if(o&&!l[n].test(d))throw TypeError('Expected all "'.concat(i.name,'" to match "').concat(i.pattern,'", but got "').concat(d,'"'));r+=i.prefix+d+i.suffix}continue}if("string"==typeof a||"number"==typeof a){var d=s(String(a),i);if(o&&!l[n].test(d))throw TypeError('Expected "'.concat(i.name,'" to match "').concat(i.pattern,'", but got "').concat(d,'"'));r+=i.prefix+d+i.suffix;continue}if(!u){var p=c?"an array":"a string";throw TypeError('Expected "'.concat(i.name,'" to be ').concat(p))}}return r}}function n(e,t,r){void 0===r&&(r={});var n=r.decode,s=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var i=n[0],a=n.index,o=Object.create(null),l=1;l<n.length;l++)!function(e){if(void 0!==n[e]){var r=t[e-1];"*"===r.modifier||"+"===r.modifier?o[r.name]=n[e].split(r.prefix+r.suffix).map(function(e){return s(e,r)}):o[r.name]=s(n[e],r)}}(l);return{path:i,index:a,params:o}}}function s(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function i(e){return e&&e.sensitive?"":"i"}function a(e,t,r){void 0===r&&(r={});for(var n=r.strict,a=void 0!==n&&n,o=r.start,l=r.end,u=r.encode,c=void 0===u?function(e){return e}:u,h=r.delimiter,d=r.endsWith,p="[".concat(s(void 0===d?"":d),"]|$"),f="[".concat(s(void 0===h?"/#?":h),"]"),g=void 0===o||o?"^":"",m=0;m<e.length;m++){var b=e[m];if("string"==typeof b)g+=s(c(b));else{var y=s(c(b.prefix)),v=s(c(b.suffix));if(b.pattern)if(t&&t.push(b),y||v)if("+"===b.modifier||"*"===b.modifier){var w="*"===b.modifier?"?":"";g+="(?:".concat(y,"((?:").concat(b.pattern,")(?:").concat(v).concat(y,"(?:").concat(b.pattern,"))*)").concat(v,")").concat(w)}else g+="(?:".concat(y,"(").concat(b.pattern,")").concat(v,")").concat(b.modifier);else{if("+"===b.modifier||"*"===b.modifier)throw TypeError('Can not repeat "'.concat(b.name,'" without a prefix and suffix'));g+="(".concat(b.pattern,")").concat(b.modifier)}else g+="(?:".concat(y).concat(v,")").concat(b.modifier)}}if(void 0===l||l)a||(g+="".concat(f,"?")),g+=r.endsWith?"(?=".concat(p,")"):"$";else{var _=e[e.length-1],E="string"==typeof _?f.indexOf(_[_.length-1])>-1:void 0===_;a||(g+="(?:".concat(f,"(?=").concat(p,"))?")),E||(g+="(?=".concat(f,"|").concat(p,")"))}return new RegExp(g,i(r))}function o(e,r,n){if(e instanceof RegExp){var s;if(!r)return e;for(var l=/\((?:\?<(.*?)>)?(?!\?)/g,u=0,c=l.exec(e.source);c;)r.push({name:c[1]||u++,prefix:"",suffix:"",modifier:"",pattern:""}),c=l.exec(e.source);return e}return Array.isArray(e)?(s=e.map(function(e){return o(e,r,n).source}),new RegExp("(?:".concat(s.join("|"),")"),i(n))):a(t(e,n),r,n)}Object.defineProperty(e,"__esModule",{value:!0}),e.pathToRegexp=e.tokensToRegexp=e.regexpToFunction=e.match=e.tokensToFunction=e.compile=e.parse=void 0,e.parse=t,e.compile=function(e,n){return r(t(e,n),n)},e.tokensToFunction=r,e.match=function(e,t){var r=[];return n(o(e,r,t),r,t)},e.regexpToFunction=n,e.tokensToRegexp=a,e.pathToRegexp=o})(),t.exports=e})()},27645,(e,t,r)=>{var n={226:function(t,r){!function(n){"use strict";var s="function",i="undefined",a="object",o="string",l="major",u="model",c="name",h="type",d="vendor",p="version",f="architecture",g="console",m="mobile",b="tablet",y="smarttv",v="wearable",w="embedded",_="Amazon",E="Apple",k="ASUS",S="BlackBerry",T="Browser",R="Chrome",O="Firefox",x="Google",C="Huawei",P="Microsoft",A="Motorola",I="Opera",j="Samsung",N="Sharp",$="Sony",D="Xiaomi",L="Zebra",U="Facebook",M="Chromium OS",q="Mac OS",B=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},H=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},F=function(e,t){return typeof e===o&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===o)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,350)},G=function(e,t){for(var r,n,i,o,l,u,c=0;c<t.length&&!l;){var h=t[c],d=t[c+1];for(r=n=0;r<h.length&&!l&&h[r];)if(l=h[r++].exec(e))for(i=0;i<d.length;i++)u=l[++n],typeof(o=d[i])===a&&o.length>0?2===o.length?typeof o[1]==s?this[o[0]]=o[1].call(this,u):this[o[0]]=o[1]:3===o.length?typeof o[1]!==s||o[1].exec&&o[1].test?this[o[0]]=u?u.replace(o[1],o[2]):void 0:this[o[0]]=u?o[1].call(this,u,o[2]):void 0:4===o.length&&(this[o[0]]=u?o[3].call(this,u.replace(o[1],o[2])):void 0):this[o]=u||void 0;c+=2}},z=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(F(t[r][n],e))return"?"===r?void 0:r}else if(F(t[r],e))return"?"===r?void 0:r;return e},K={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,I+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[c,I]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UC"+T]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+T],p],[/\bfocus\/([\w\.]+)/i],[p,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI "+T]],[/fxios\/([-\w\.]+)/i],[p,[c,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+T]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+T],p],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,U],p],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,R+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android "+T]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,p],[/(cobalt)\/([\w\.]+)/i],[c,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,V]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,j],[h,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,j],[h,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[d,E],[h,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,E],[h,b]],[/(macintosh);/i],[u,[d,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,N],[h,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,C],[h,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,C],[h,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,D],[h,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,D],[h,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,"OPPO"],[h,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[h,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[h,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,A],[h,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,A],[h,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,"LG"],[h,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,"LG"],[h,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[h,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[h,m]],[/(pixel c)\b/i],[u,[d,x],[h,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,x],[h,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,$],[h,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,$],[h,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[h,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,_],[h,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,_],[h,m]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[h,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,S],[h,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,k],[h,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,k],[h,m]],[/(nexus 9)/i],[u,[d,"HTC"],[h,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[h,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[h,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[h,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[h,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[h,b]],[/(surface duo)/i],[u,[d,P],[h,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[h,m]],[/(u304aa)/i],[u,[d,"AT&T"],[h,m]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[h,m]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[h,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[h,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[h,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[h,b]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[h,b]],[/\b(k88) b/i],[u,[d,"ZTE"],[h,b]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[h,m]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[h,m]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[h,b]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[h,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[h,b]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[h,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[h,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[h,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[h,m]],[/\b(ph-1) /i],[u,[d,"Essential"],[h,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[h,b]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[h,b]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[h,b]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[h,b]],[/(sprint) (\w+)/i],[d,u,[h,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,P],[h,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,L],[h,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,L],[h,m]],[/smart-tv.+(samsung)/i],[d,[h,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,j],[h,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,"LG"],[h,y]],[/(apple) ?tv/i],[d,[u,E+" TV"],[h,y]],[/crkey/i],[[u,R+"cast"],[d,x],[h,y]],[/droid.+aft(\w)( bui|\))/i],[u,[d,_],[h,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,N],[h,y]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,$],[h,y]],[/(mitv-\w{5}) bui/i],[u,[d,D],[h,y]],[/Hbbtv.*(technisat) (.*);/i],[d,u,[h,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,W],[u,W],[h,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[h,g]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[h,g]],[/(playstation [345portablevi]+)/i],[u,[d,$],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,P],[h,g]],[/((pebble))app/i],[d,u,[h,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[d,E],[h,v]],[/droid.+; (glass) \d/i],[u,[d,x],[h,v]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,L],[h,v]],[/(quest( 2| pro)?)/i],[u,[d,U],[h,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[h,w]],[/(aeobc)\b/i],[u,[d,_],[h,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[h,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[h,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,m]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[p,z,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[p,z,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,q],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[c,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,M],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,p]]},X=function(e,t){if(typeof e===a&&(t=e,e=void 0),!(this instanceof X))return new X(e,t).getResult();var r=typeof n!==i&&n.navigator?n.navigator:void 0,g=e||(r&&r.userAgent?r.userAgent:""),y=r&&r.userAgentData?r.userAgentData:void 0,v=t?B(J,t):J,w=r&&r.userAgent==g;return this.getBrowser=function(){var e,t={};return t[c]=void 0,t[p]=void 0,G.call(t,g,v.browser),t[l]=typeof(e=t[p])===o?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,w&&r&&r.brave&&typeof r.brave.isBrave==s&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[f]=void 0,G.call(e,g,v.cpu),e},this.getDevice=function(){var e={};return e[d]=void 0,e[u]=void 0,e[h]=void 0,G.call(e,g,v.device),w&&!e[h]&&y&&y.mobile&&(e[h]=m),w&&"Macintosh"==e[u]&&r&&typeof r.standalone!==i&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[u]="iPad",e[h]=b),e},this.getEngine=function(){var e={};return e[c]=void 0,e[p]=void 0,G.call(e,g,v.engine),e},this.getOS=function(){var e={};return e[c]=void 0,e[p]=void 0,G.call(e,g,v.os),w&&!e[c]&&y&&"Unknown"!=y.platform&&(e[c]=y.platform.replace(/chrome os/i,M).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(e){return g=typeof e===o&&e.length>350?W(e,350):e,this},this.setUA(g),this};if(X.VERSION="1.0.35",X.BROWSER=H([c,p,l]),X.CPU=H([f]),X.DEVICE=H([u,d,h,g,m,y,b,v,w]),X.ENGINE=X.OS=H([c,p]),typeof r!==i)t.exports&&(r=t.exports=X),r.UAParser=X;else if(typeof define===s&&define.amd)e.r,void 0!==X&&e.v(X);else typeof n!==i&&(n.UAParser=X);var Y=typeof n!==i&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var Q=new X;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)Y.ua[r]=t[r]}}}(this)}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},a=!0;try{n[e].call(r.exports,r,r.exports,i),a=!1}finally{a&&delete s[e]}return r.exports}i.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.29.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/ua-parser-js/",t.exports=i(226)},70874,(e,t,r)=>{"use strict";var n={H:null,A:null};function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}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."}var i=Array.isArray;function a(){}var o=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),y=Symbol.iterator,v=Object.prototype.hasOwnProperty,w=Object.assign;function _(e,t,r){var n=r.ref;return{$$typeof:o,type:e,key:t,ref:void 0!==n?n:null,props:r}}function E(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var k=/\/+/g;function S(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function T(e,t,r){if(null==e)return e;var n=[],u=0;return!function e(t,r,n,u,c){var h,d,p,f=typeof t;("undefined"===f||"boolean"===f)&&(t=null);var m=!1;if(null===t)m=!0;else switch(f){case"bigint":case"string":case"number":m=!0;break;case"object":switch(t.$$typeof){case o:case l:m=!0;break;case g:return e((m=t._init)(t._payload),r,n,u,c)}}if(m)return c=c(t),m=""===u?"."+S(t,0):u,i(c)?(n="",null!=m&&(n=m.replace(k,"$&/")+"/"),e(c,r,n,"",function(e){return e})):null!=c&&(E(c)&&(h=c,d=n+(null==c.key||t&&t.key===c.key?"":(""+c.key).replace(k,"$&/")+"/")+m,c=_(h.type,d,h.props)),r.push(c)),1;m=0;var b=""===u?".":u+":";if(i(t))for(var v=0;v<t.length;v++)f=b+S(u=t[v],v),m+=e(u,r,n,f,c);else if("function"==typeof(v=null===(p=t)||"object"!=typeof p?null:"function"==typeof(p=y&&p[y]||p["@@iterator"])?p:null))for(t=v.call(t),v=0;!(u=t.next()).done;)f=b+S(u=u.value,v++),m+=e(u,r,n,f,c);else if("object"===f){if("function"==typeof t.then)return e(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(a,a):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(t),r,n,u,c);throw Error(s(31,"[object Object]"===(r=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":r))}return m}(e,n,"","",function(e){return t.call(r,e,u++)}),n}function R(e){if(-1===e._status){var t=(0,e._result)();t.then(function(r){(0===e._status||-1===e._status)&&(e._status=1,e._result=r,void 0===t.status&&(t.status="fulfilled",t.value=r))},function(r){(0===e._status||-1===e._status)&&(e._status=2,e._result=r,void 0===t.status&&(t.status="rejected",t.reason=r))}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}function O(){return new WeakMap}function x(){return{s:0,v:void 0,o:null,p:null}}r.Activity=m,r.Children={map:T,forEach:function(e,t,r){T(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error(s(143));return e}},r.Fragment=u,r.Profiler=h,r.StrictMode=c,r.Suspense=p,r.ViewTransition=b,r.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,r.cache=function(e){return function(){var t=n.A;if(!t)return e.apply(null,arguments);var r=t.getCacheForType(O);void 0===(t=r.get(e))&&(t=x(),r.set(e,t)),r=0;for(var s=arguments.length;r<s;r++){var i=arguments[r];if("function"==typeof i||"object"==typeof i&&null!==i){var a=t.o;null===a&&(t.o=a=new WeakMap),void 0===(t=a.get(i))&&(t=x(),a.set(i,t))}else null===(a=t.p)&&(t.p=a=new Map),void 0===(t=a.get(i))&&(t=x(),a.set(i,t))}if(1===t.s)return t.v;if(2===t.s)throw t.v;try{var o=e.apply(null,arguments);return(r=t).s=1,r.v=o}catch(e){throw(o=t).s=2,o.v=e,e}}},r.cacheSignal=function(){var e=n.A;return e?e.cacheSignal():null},r.captureOwnerStack=function(){return null},r.cloneElement=function(e,t,r){if(null==e)throw Error(s(267,e));var n=w({},e.props),i=e.key;if(null!=t)for(a in void 0!==t.key&&(i=""+t.key),t)v.call(t,a)&&"key"!==a&&"__self"!==a&&"__source"!==a&&("ref"!==a||void 0!==t.ref)&&(n[a]=t[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];n.children=o}return _(e.type,i,n)},r.createElement=function(e,t,r){var n,s={},i=null;if(null!=t)for(n in void 0!==t.key&&(i=""+t.key),t)v.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(s[n]=t[n]);var a=arguments.length-2;if(1===a)s.children=r;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];s.children=o}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===s[n]&&(s[n]=a[n]);return _(e,i,s)},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:d,render:e}},r.isValidElement=E,r.lazy=function(e){return{$$typeof:g,_payload:{_status:-1,_result:e},_init:R}},r.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},r.use=function(e){return n.H.use(e)},r.useCallback=function(e,t){return n.H.useCallback(e,t)},r.useDebugValue=function(){},r.useId=function(){return n.H.useId()},r.useMemo=function(e,t){return n.H.useMemo(e,t)},r.version="19.3.0-canary-3f0b9e61-20260317"},29580,(e,t,r)=>{"use strict";t.exports=e.r(70874)},59692,(e,t,r)=>{"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.parseCookie=h,r.parse=h,r.stringifyCookie=function(e,t){let r=t?.encode||encodeURIComponent,n=[];for(let t of Object.keys(e)){let a=e[t];if(void 0===a)continue;if(!s.test(t))throw TypeError(`cookie name is invalid: ${t}`);let o=r(a);if(!i.test(o))throw TypeError(`cookie val is invalid: ${a}`);n.push(`${t}=${o}`)}return n.join("; ")},r.stringifySetCookie=d,r.serialize=d,r.parseSetCookie=function(e,t){let r=t?.decode||m,n=e.length,s=p(e,0,n),i=f(e,0,s),a=-1===i?{name:"",value:r(g(e,0,s))}:{name:g(e,0,i),value:r(g(e,i+1,s))},o=s+1;for(;o<n;){let t=p(e,o,n),r=f(e,o,t),s=-1===r?g(e,o,t):g(e,o,r),i=-1===r?void 0:g(e,r+1,t);switch(s.toLowerCase()){case"httponly":a.httpOnly=!0;break;case"secure":a.secure=!0;break;case"partitioned":a.partitioned=!0;break;case"domain":a.domain=i;break;case"path":a.path=i;break;case"max-age":i&&l.test(i)&&(a.maxAge=Number(i));break;case"expires":if(!i)break;let u=new Date(i);Number.isFinite(u.valueOf())&&(a.expires=u);break;case"priority":if(!i)break;let c=i.toLowerCase();("low"===c||"medium"===c||"high"===c)&&(a.priority=c);break;case"samesite":if(!i)break;let h=i.toLowerCase();("lax"===h||"strict"===h||"none"===h)&&(a.sameSite=h)}o=t+1}return a},r.stringifySetCookie=d,r.serialize=d;let s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,l=/^-?\d+$/,u=Object.prototype.toString,c=((n=function(){}).prototype=Object.create(null),n);function h(e,t){let r=new c,n=e.length;if(n<2)return r;let s=t?.decode||m,i=0;do{let t=f(e,i,n);if(-1===t)break;let a=p(e,i,n);if(t>a){i=e.lastIndexOf(";",t-1)+1;continue}let o=g(e,i,t);void 0===r[o]&&(r[o]=s(g(e,t+1,a))),i=a+1}while(i<n)return r}function d(e,t,r){let n="object"==typeof e?e:{...r,name:e,value:String(t)},l=("object"==typeof t?t:r)?.encode||encodeURIComponent;if(!s.test(n.name))throw TypeError(`argument name is invalid: ${n.name}`);let c=n.value?l(n.value):"";if(!i.test(c))throw TypeError(`argument val is invalid: ${n.value}`);let h=n.name+"="+c;if(void 0!==n.maxAge){if(!Number.isInteger(n.maxAge))throw TypeError(`option maxAge is invalid: ${n.maxAge}`);h+="; Max-Age="+n.maxAge}if(n.domain){if(!a.test(n.domain))throw TypeError(`option domain is invalid: ${n.domain}`);h+="; Domain="+n.domain}if(n.path){if(!o.test(n.path))throw TypeError(`option path is invalid: ${n.path}`);h+="; Path="+n.path}if(n.expires){var d;if(d=n.expires,"[object Date]"!==u.call(d)||!Number.isFinite(n.expires.valueOf()))throw TypeError(`option expires is invalid: ${n.expires}`);h+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(h+="; HttpOnly"),n.secure&&(h+="; Secure"),n.partitioned&&(h+="; Partitioned"),n.priority)switch("string"==typeof n.priority?n.priority.toLowerCase():void 0){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw TypeError(`option sameSite is invalid: ${n.sameSite}`)}return h}function p(e,t,r){let n=e.indexOf(";",t);return -1===n?r:n}function f(e,t,r){let n=e.indexOf("=",t);return n<r?n:-1}function g(e,t,r){let n=t,s=r;do{let t=e.charCodeAt(n);if(32!==t&&9!==t)break}while(++n<s)for(;s>n;){let t=e.charCodeAt(s-1);if(32!==t&&9!==t)break;s--}return e.slice(n,s)}function m(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},94826,e=>{"use strict";let t,r,n,s,i;async function a(){return"_ENTRIES"in globalThis&&_ENTRIES.middleware_instrumentation&&await _ENTRIES.middleware_instrumentation}e.i(44962);let o=null;async function l(){if("phase-production-build"===process.env.NEXT_PHASE)return;o||(o=a());let e=await o;if(null==e?void 0:e.register)try{await e.register()}catch(e){throw e.message=`An error occurred while loading instrumentation hook: ${e.message}`,e}}async function u(...e){let t=await a();try{var r;await (null==t||null==(r=t.onRequestError)?void 0:r.call(t,...e))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}let c=null;function h(){return c||(c=l()),c}function d(e){return`The edge runtime does not support Node.js '${e}' module.
2
2
  Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`}process!==e.g.process&&(process.env=e.g.process.env,e.g.process=process);try{Object.defineProperty(globalThis,"__import_unsupported",{value:function(e){let t=new Proxy(function(){},{get(t,r){if("then"===r)return{};throw Object.defineProperty(Error(d(e)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})},construct(){throw Object.defineProperty(Error(d(e)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})},apply(r,n,s){if("function"==typeof s[0])return s[0](t);throw Object.defineProperty(Error(d(e)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}});return new Proxy({},{get:()=>t})},enumerable:!1,configurable:!1})}catch{}h();class p extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form:
3
3
 
4
4
  export function middleware(request, event) {
@@ -6,12 +6,12 @@ Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`}proces
6
6
  }
7
7
 
8
8
  Read more: https://nextjs.org/docs/messages/middleware-new-signature
9
- `)}}class f extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class g extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}let m="x-prerender-revalidate",b=".meta",y="x-next-cache-tags",v="x-next-revalidated-tags",w="_N_T_",_={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"};function E(e){var t,r,n,s,i,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,i=!1;l();)if(","===(r=e.charAt(o))){for(n=o,o+=1,l(),s=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(i=!0,o=s,a.push(e.substring(t,n)),t=o):o=n+1}else o+=1;(!i||o>=e.length)&&a.push(e.substring(t,e.length))}return a}function k(e){let t={},r=[];if(e)for(let[n,s]of e.entries())"set-cookie"===n.toLowerCase()?(r.push(...E(s)),t[n]=1===r.length?r[0]:r):t[n]=s;return t}function S(e){try{return String(new URL(String(e)))}catch(t){throw Object.defineProperty(Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t}),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}({..._,GROUP:{builtinReact:[_.reactServerComponents,_.actionBrowser],serverOnly:[_.reactServerComponents,_.actionBrowser,_.instrument,_.middleware],neutralTarget:[_.apiNode,_.apiEdge],clientOnly:[_.serverSideRendering,_.appPagesBrowser],bundled:[_.reactServerComponents,_.actionBrowser,_.serverSideRendering,_.appPagesBrowser,_.shared,_.instrument,_.middleware],appPages:[_.reactServerComponents,_.serverSideRendering,_.appPagesBrowser,_.actionBrowser]}});let T=Symbol("response"),R=Symbol("passThrough"),O=Symbol("waitUntil");class x{constructor(e,t){this[R]=!1,this[O]=t?{kind:"external",function:t}:{kind:"internal",promises:[]}}respondWith(e){this[T]||(this[T]=Promise.resolve(e))}passThroughOnException(){this[R]=!0}waitUntil(e){if("external"===this[O].kind)return(0,this[O].function)(e);this[O].promises.push(e)}}class C extends x{constructor(e){var t;super(e.request,null==(t=e.context)?void 0:t.waitUntil),this.sourcePage=e.page}get request(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}function P(e){return e.replace(/\/$/,"")||"/"}function A(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r<t);return n||t>-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}function I(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:s}=A(e);return`${t}${r}${n}${s}`}function N(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:s}=A(e);return`${r}${t}${n}${s}`}function j(e,t){if("string"!=typeof e)return!1;let{pathname:r}=A(e);return r===t||r.startsWith(t+"/")}let $=new WeakMap;function D(e,t){let r;if(!t)return{pathname:e};let n=$.get(t);n||(n=t.map(e=>e.toLowerCase()),$.set(t,n));let s=e.split("/",2);if(!s[1])return{pathname:e};let i=s[1].toLowerCase(),a=n.indexOf(i);return a<0?{pathname:e}:(r=t[a],{pathname:e=e.slice(r.length+1)||"/",detectedLocale:r})}let L=/^(?:127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)$/;function U(e,t){let r=new URL(String(e),t&&String(t));return L.test(r.hostname)&&(r.hostname="localhost"),r}let M=Symbol("NextURLInternal");class B{constructor(e,t,r){let n,s;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,s=r||{}):s=r||t||{},this[M]={url:U(e,n??s.base),options:s,basePath:""},this.analyze()}analyze(){var e,t,r,n,s;let i=function(e,t){let{basePath:r,i18n:n,trailingSlash:s}=t.nextConfig??{},i={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):s};r&&j(i.pathname,r)&&(i.pathname=function(e,t){if(!j(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:`/${r}`}(i.pathname,r),i.basePath=r);let a=i.pathname;if(i.pathname.startsWith("/_next/data/")&&i.pathname.endsWith(".json")){let e=i.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/");i.buildId=e[0],a="index"!==e[1]?`/${e.slice(1).join("/")}`:"/",!0===t.parseData&&(i.pathname=a)}if(n){let e=t.i18nProvider?t.i18nProvider.analyze(i.pathname):D(i.pathname,n.locales);i.locale=e.detectedLocale,i.pathname=e.pathname??i.pathname,!e.detectedLocale&&i.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(a):D(a,n.locales)).detectedLocale&&(i.locale=e.detectedLocale)}return i}(this[M].url.pathname,{nextConfig:this[M].options.nextConfig,parseData:!0,i18nProvider:this[M].options.i18nProvider}),a=function(e,t){let r;if(t?.host&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}(this[M].url,this[M].options.headers);this[M].domainLocale=this[M].options.i18nProvider?this[M].options.i18nProvider.detectDomainLocale(a):function(e,t,r){if(e){for(let n of(r&&(r=r.toLowerCase()),e))if(t===n.domain?.split(":",1)[0].toLowerCase()||r===n.defaultLocale.toLowerCase()||n.locales?.some(e=>e.toLowerCase()===r))return n}}(null==(t=this[M].options.nextConfig)||null==(e=t.i18n)?void 0:e.domains,a);let o=(null==(r=this[M].domainLocale)?void 0:r.defaultLocale)||(null==(s=this[M].options.nextConfig)||null==(n=s.i18n)?void 0:n.defaultLocale);this[M].url.pathname=i.pathname,this[M].defaultLocale=o,this[M].basePath=i.basePath??"",this[M].buildId=i.buildId,this[M].locale=i.locale??o,this[M].trailingSlash=i.trailingSlash}formatPathname(){var e;let t;return t=function(e,t,r,n){if(!t||t===r)return e;let s=e.toLowerCase();return!n&&(j(s,"/api")||j(s,`/${t.toLowerCase()}`))?e:I(e,`/${t}`)}((e={basePath:this[M].basePath,buildId:this[M].buildId,defaultLocale:this[M].options.forceLocale?void 0:this[M].defaultLocale,locale:this[M].locale,pathname:this[M].url.pathname,trailingSlash:this[M].trailingSlash}).pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix),(e.buildId||!e.trailingSlash)&&(t=P(t)),e.buildId&&(t=N(I(t,`/_next/data/${e.buildId}`),"/"===e.pathname?"index.json":".json")),t=I(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:N(t,"/"):P(t)}formatSearch(){return this[M].url.search}get buildId(){return this[M].buildId}set buildId(e){this[M].buildId=e}get locale(){return this[M].locale??""}set locale(e){var t,r;if(!this[M].locale||!(null==(r=this[M].options.nextConfig)||null==(t=r.i18n)?void 0:t.locales.includes(e)))throw Object.defineProperty(TypeError(`The NextURL configuration includes no locale "${e}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[M].locale=e}get defaultLocale(){return this[M].defaultLocale}get domainLocale(){return this[M].domainLocale}get searchParams(){return this[M].url.searchParams}get host(){return this[M].url.host}set host(e){this[M].url.host=e}get hostname(){return this[M].url.hostname}set hostname(e){this[M].url.hostname=e}get port(){return this[M].url.port}set port(e){this[M].url.port=e}get protocol(){return this[M].url.protocol}set protocol(e){this[M].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[M].url=U(e),this.analyze()}get origin(){return this[M].url.origin}get pathname(){return this[M].url.pathname}set pathname(e){this[M].url.pathname=e}get hash(){return this[M].url.hash}set hash(e){this[M].url.hash=e}get search(){return this[M].url.search}set search(e){this[M].url.search=e}get password(){return this[M].url.password}set password(e){this[M].url.password=e}get username(){return this[M].url.username}set username(e){this[M].url.username=e}get basePath(){return this[M].basePath}set basePath(e){this[M].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new B(String(this),this[M].options)}}var q,H,F,V,G,W,z,K,J,X,Y,Q,Z,ee,et,er,en,es,ei,ea,eo,el,eu,ec,eh,ed,ep,ef=e.i(5701);let eg=Symbol("internal request");class em extends Request{constructor(e,t={}){const r="string"!=typeof e&&"url"in e?e.url:String(e);S(r),e instanceof Request?super(e,t):super(r,t);const n=new B(r,{headers:k(this.headers),nextConfig:t.nextConfig});this[eg]={cookies:new ef.RequestCookies(this.headers),nextUrl:n,url:n.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[eg].cookies}get nextUrl(){return this[eg].nextUrl}get page(){throw new f}get ua(){throw new g}get url(){return this[eg].url}}class eb{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}let ey=Symbol("internal response"),ev=new Set([301,302,303,307,308]);function ew(e,t){var r;if(null==e||null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});let r=[];for(let[n,s]of e.request.headers)t.set("x-middleware-request-"+n,s),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class e_ extends Response{constructor(e,t={}){super(e,t);const r=this.headers,n=new Proxy(new ef.ResponseCookies(r),{get(e,n,s){switch(n){case"delete":case"set":return(...s)=>{let i=Reflect.apply(e[n],e,s),a=new Headers(r);return i instanceof ef.ResponseCookies&&r.set("x-middleware-set-cookie",i.getAll().map(e=>(0,ef.stringifyCookie)(e)).join(",")),ew(t,a),i};default:return eb.get(e,n,s)}}});this[ey]={cookies:n,url:t.url?new B(t.url,{headers:k(r),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[ey].cookies}static json(e,t){let r=Response.json(e,t);return new e_(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!ev.has(r))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});let n="object"==typeof t?t:{},s=new Headers(null==n?void 0:n.headers);return s.set("Location",S(e)),new e_(null,{...n,headers:s,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",S(e)),ew(t,r),new e_(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),ew(e,t),new e_(null,{...e,headers:t})}}function eE(e,t){let r="string"==typeof t?new URL(t):t,n=new URL(e,t),s=n.origin===r.origin;return{url:s?n.toString().slice(r.origin.length):n.toString(),isRelative:s}}let ek="next-router-prefetch",eS=["rsc","next-router-state-tree",ek,"next-hmr-refresh","next-router-segment-prefetch"],eT="_rsc";function eR(e){return e.startsWith("/")?e:`/${e}`}function eO(e){return eR(e.split("/").reduce((e,t,r,n)=>t?"("===t[0]&&t.endsWith(")")||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:`${e}/${t}`:e,""))}class ex extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new ex}}class eC extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,n){if("symbol"==typeof r)return eb.get(t,r,n);let s=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===s);if(void 0!==i)return eb.get(t,i,n)},set(t,r,n,s){if("symbol"==typeof r)return eb.set(t,r,n,s);let i=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===i);return eb.set(t,a??r,n,s)},has(t,r){if("symbol"==typeof r)return eb.has(t,r);let n=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0!==s&&eb.has(t,s)},deleteProperty(t,r){if("symbol"==typeof r)return eb.deleteProperty(t,r);let n=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0===s||eb.deleteProperty(t,s)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return ex.callable;default:return eb.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new eC(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}let eP=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class eA{disable(){throw eP}getStore(){}run(){throw eP}exit(){throw eP}enterWith(){throw eP}static bind(e){return e}}let eI="u">typeof globalThis&&globalThis.AsyncLocalStorage;function eN(){return eI?new eI:new eA}let ej=eN();class e$ extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new e$}}class eD{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return e$.callable;default:return eb.get(e,t,r)}}})}}let eL=Symbol.for("next.mutated.cookies");class eU{static wrap(e,t){let r=new ef.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let n=[],s=new Set,i=()=>{let e=ej.getStore();if(e&&(e.pathWasRevalidated=1),n=r.getAll().filter(e=>s.has(e.name)),t){let e=[];for(let t of n){let r=new ef.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}},a=new Proxy(r,{get(e,t,r){switch(t){case eL:return n;case"delete":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.delete(...t),a}finally{i()}};case"set":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t),a}finally{i()}};default:return eb.get(e,t,r)}}});return a}}function eM(e,t){if("action"!==e.phase)throw new e$}var eB=((q=eB||{}).handleRequest="BaseServer.handleRequest",q.run="BaseServer.run",q.pipe="BaseServer.pipe",q.getStaticHTML="BaseServer.getStaticHTML",q.render="BaseServer.render",q.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",q.renderToResponse="BaseServer.renderToResponse",q.renderToHTML="BaseServer.renderToHTML",q.renderError="BaseServer.renderError",q.renderErrorToResponse="BaseServer.renderErrorToResponse",q.renderErrorToHTML="BaseServer.renderErrorToHTML",q.render404="BaseServer.render404",q),eq=((H=eq||{}).loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",H.loadComponents="LoadComponents.loadComponents",H),eH=((F=eH||{}).getRequestHandler="NextServer.getRequestHandler",F.getRequestHandlerWithMetadata="NextServer.getRequestHandlerWithMetadata",F.getServer="NextServer.getServer",F.getServerRequestHandler="NextServer.getServerRequestHandler",F.createServer="createServer.createServer",F),eF=((V=eF||{}).compression="NextNodeServer.compression",V.getBuildId="NextNodeServer.getBuildId",V.createComponentTree="NextNodeServer.createComponentTree",V.clientComponentLoading="NextNodeServer.clientComponentLoading",V.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",V.generateStaticRoutes="NextNodeServer.generateStaticRoutes",V.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",V.generatePublicRoutes="NextNodeServer.generatePublicRoutes",V.generateImageRoutes="NextNodeServer.generateImageRoutes.route",V.sendRenderResult="NextNodeServer.sendRenderResult",V.proxyRequest="NextNodeServer.proxyRequest",V.runApi="NextNodeServer.runApi",V.render="NextNodeServer.render",V.renderHTML="NextNodeServer.renderHTML",V.imageOptimizer="NextNodeServer.imageOptimizer",V.getPagePath="NextNodeServer.getPagePath",V.getRoutesManifest="NextNodeServer.getRoutesManifest",V.findPageComponents="NextNodeServer.findPageComponents",V.getFontManifest="NextNodeServer.getFontManifest",V.getServerComponentManifest="NextNodeServer.getServerComponentManifest",V.getRequestHandler="NextNodeServer.getRequestHandler",V.renderToHTML="NextNodeServer.renderToHTML",V.renderError="NextNodeServer.renderError",V.renderErrorToHTML="NextNodeServer.renderErrorToHTML",V.render404="NextNodeServer.render404",V.startResponse="NextNodeServer.startResponse",V.route="route",V.onProxyReq="onProxyReq",V.apiResolver="apiResolver",V.internalFetch="internalFetch",V),eV=((G=eV||{}).startServer="startServer.startServer",G),eG=((W=eG||{}).getServerSideProps="Render.getServerSideProps",W.getStaticProps="Render.getStaticProps",W.renderToString="Render.renderToString",W.renderDocument="Render.renderDocument",W.createBodyResult="Render.createBodyResult",W),eW=((z=eW||{}).renderToString="AppRender.renderToString",z.renderToReadableStream="AppRender.renderToReadableStream",z.getBodyResult="AppRender.getBodyResult",z.fetch="AppRender.fetch",z),ez=((K=ez||{}).executeRoute="Router.executeRoute",K),eK=((J=eK||{}).runHandler="Node.runHandler",J),eJ=((X=eJ||{}).runHandler="AppRouteRouteHandlers.runHandler",X),eX=((Y=eX||{}).generateMetadata="ResolveMetadata.generateMetadata",Y.generateViewport="ResolveMetadata.generateViewport",Y),eY=((Q=eY||{}).execute="Middleware.execute",Q);let eQ=new Set(["Middleware.execute","BaseServer.handleRequest","Render.getServerSideProps","Render.getStaticProps","AppRender.fetch","AppRender.getBodyResult","Render.renderDocument","Node.runHandler","AppRouteRouteHandlers.runHandler","ResolveMetadata.generateMetadata","ResolveMetadata.generateViewport","NextNodeServer.createComponentTree","NextNodeServer.findPageComponents","NextNodeServer.getLayoutOrPageModule","NextNodeServer.startResponse","NextNodeServer.clientComponentLoading"]),eZ=new Set(["NextNodeServer.findPageComponents","NextNodeServer.createComponentTree","NextNodeServer.clientComponentLoading"]);function e0(e){return null!==e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then}let e1=process.env.NEXT_OTEL_PERFORMANCE_PREFIX,{context:e2,propagation:e4,trace:e3,SpanStatusCode:e6,SpanKind:e5,ROOT_CONTEXT:e9}=t=e.r(42856);class e8 extends Error{constructor(e,t){super(),this.bubble=e,this.result=t}}let e7=(e,t)=>{"object"==typeof t&&null!==t&&t instanceof e8&&t.bubble?e.setAttribute("next.bubble",!0):(t&&(e.recordException(t),e.setAttribute("error.type",t.name)),e.setStatus({code:e6.ERROR,message:null==t?void 0:t.message})),e.end()},te=new Map,tt=t.createContextKey("next.rootSpanId"),tr=0,tn={set(e,t,r){e.push({key:t,value:r})}},ts=(i=new class e{getTracerInstance(){return e3.getTracer("next.js","0.0.1")}getContext(){return e2}getTracePropagationData(){let e=e2.active(),t=[];return e4.inject(e,t,tn),t}getActiveScopeSpan(){return e3.getSpan(null==e2?void 0:e2.active())}withPropagatedContext(e,t,r,n=!1){let s=e2.active();if(n){let n=e4.extract(e9,e,r);if(e3.getSpanContext(n))return e2.with(n,t);let i=e4.extract(s,e,r);return e2.with(i,t)}if(e3.getSpanContext(s))return t();let i=e4.extract(s,e,r);return e2.with(i,t)}trace(...e){let[t,r,n]=e,{fn:s,options:i}="function"==typeof r?{fn:r,options:{}}:{fn:n,options:{...r}},a=i.spanName??t;if(!eQ.has(t)&&"1"!==process.env.NEXT_OTEL_VERBOSE||i.hideSpan)return s();let o=this.getSpanContext((null==i?void 0:i.parentSpan)??this.getActiveScopeSpan());o||(o=(null==e2?void 0:e2.active())??e9);let l=o.getValue(tt),u="number"!=typeof l||!te.has(l),c=tr++;return i.attributes={"next.span_name":a,"next.span_type":t,...i.attributes},e2.with(o.setValue(tt,c),()=>this.getTracerInstance().startActiveSpan(a,i,e=>{let r;e1&&t&&eZ.has(t)&&(r="performance"in globalThis&&"measure"in performance?globalThis.performance.now():void 0);let n=!1,a=()=>{!n&&(n=!0,te.delete(c),r&&performance.measure(`${e1}:next-${(t.split(".").pop()||"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}`,{start:r,end:performance.now()}))};if(u&&te.set(c,new Map(Object.entries(i.attributes??{}))),s.length>1)try{return s(e,t=>e7(e,t))}catch(t){throw e7(e,t),t}finally{a()}try{let t=s(e);if(e0(t))return t.then(t=>(e.end(),t)).catch(t=>{throw e7(e,t),t}).finally(a);return e.end(),a(),t}catch(t){throw e7(e,t),a(),t}}))}wrap(...e){let t=this,[r,n,s]=3===e.length?e:[e[0],{},e[1]];return eQ.has(r)||"1"===process.env.NEXT_OTEL_VERBOSE?function(){let e=n;"function"==typeof e&&"function"==typeof s&&(e=e.apply(this,arguments));let i=arguments.length-1,a=arguments[i];if("function"!=typeof a)return t.trace(r,e,()=>s.apply(this,arguments));{let n=t.getContext().bind(e2.active(),a);return t.trace(r,e,(e,t)=>(arguments[i]=function(e){return null==t||t(e),n.apply(this,arguments)},s.apply(this,arguments)))}}:s}startSpan(...e){let[t,r]=e,n=this.getSpanContext((null==r?void 0:r.parentSpan)??this.getActiveScopeSpan());return this.getTracerInstance().startSpan(t,r,n)}getSpanContext(e){return e?e3.setSpan(e2.active(),e):void 0}getRootSpanAttributes(){let e=e2.active().getValue(tt);return te.get(e)}setRootSpanAttribute(e,t){let r=e2.active().getValue(tt),n=te.get(r);n&&!n.has(e)&&n.set(e,t)}withSpan(e,t){let r=e3.setSpan(e2.active(),e);return e2.with(r,t)}},()=>i),ti="__prerender_bypass";Symbol("__next_preview_data"),Symbol(ti);class ta{constructor(e,t,r,n){var s;const i=e&&function(e,t){let r=eC.from(e.headers);return{isOnDemandRevalidate:r.get(m)===t.previewModeId,revalidateOnlyGenerated:r.has("x-prerender-revalidate-if-generated")}}(t,e).isOnDemandRevalidate,a=null==(s=r.get(ti))?void 0:s.value;this._isEnabled=!!(!i&&a&&e&&a===e.previewModeId),this._previewModeId=null==e?void 0:e.previewModeId,this._mutableCookies=n}get isEnabled(){return this._isEnabled}enable(){if(!this._previewModeId)throw Object.defineProperty(Error("Invariant: previewProps missing previewModeId this should never happen"),"__NEXT_ERROR_CODE",{value:"E93",enumerable:!1,configurable:!0});this._mutableCookies.set({name:ti,value:this._previewModeId,httpOnly:!0,sameSite:"none",secure:!0,path:"/"}),this._isEnabled=!0}disable(){this._mutableCookies.set({name:ti,value:"",httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:new Date(0)}),this._isEnabled=!1}}function to(e,t){if("x-middleware-set-cookie"in e.headers&&"string"==typeof e.headers["x-middleware-set-cookie"]){let r=e.headers["x-middleware-set-cookie"],n=new Headers;for(let e of E(r))n.append("set-cookie",e);for(let e of new ef.ResponseCookies(n).getAll())t.set(e)}}let tl=eN();function tu(e){switch(e.type){case"prerender":case"prerender-runtime":case"prerender-ppr":case"prerender-client":case"validation-client":return e.prerenderResumeDataCache;case"request":if(e.prerenderResumeDataCache)return e.prerenderResumeDataCache;case"prerender-legacy":case"cache":case"private-cache":case"unstable-cache":case"generate-static-params":return null;default:return e}}var tc=e.i(10636);class th extends Error{constructor(e,t){super(`Invariant: ${e.endsWith(".")?e:e+"."} This is a bug in Next.js.`,t),this.name="InvariantError"}}var td=e.i(51615);process.env.NEXT_PRIVATE_DEBUG_CACHE,Symbol.for("@next/cache-handlers");let tp=Symbol.for("@next/cache-handlers-map"),tf=Symbol.for("@next/cache-handlers-set"),tg=globalThis;function tm(){if(tg[tp])return tg[tp].entries()}async function tb(e,t){if(!e)return t();let r=ty(e);try{return await t()}finally{var n,s,i,a;let t,o,l,u,c=(n=r,s=ty(e),t=new Set(n.pendingRevalidatedTags.map(e=>{let t="object"==typeof e.profile?JSON.stringify(e.profile):e.profile||"";return`${e.tag}:${t}`})),o=new Set(n.pendingRevalidateWrites),{pendingRevalidatedTags:s.pendingRevalidatedTags.filter(e=>{let r="object"==typeof e.profile?JSON.stringify(e.profile):e.profile||"";return!t.has(`${e.tag}:${r}`)}),pendingRevalidates:Object.fromEntries(Object.entries(s.pendingRevalidates).filter(([e])=>!(e in n.pendingRevalidates))),pendingRevalidateWrites:s.pendingRevalidateWrites.filter(e=>!o.has(e))});await (i=e,l=[],(u=(null==(a=c)?void 0:a.pendingRevalidatedTags)??i.pendingRevalidatedTags??[]).length>0&&l.push(tv(u,i.incrementalCache,i)),l.push(...Object.values((null==a?void 0:a.pendingRevalidates)??i.pendingRevalidates??{})),l.push(...(null==a?void 0:a.pendingRevalidateWrites)??i.pendingRevalidateWrites??[]),0!==l.length&&Promise.all(l).then(()=>void 0))}}function ty(e){return{pendingRevalidatedTags:e.pendingRevalidatedTags?[...e.pendingRevalidatedTags]:[],pendingRevalidates:{...e.pendingRevalidates},pendingRevalidateWrites:e.pendingRevalidateWrites?[...e.pendingRevalidateWrites]:[]}}async function tv(e,t,r){if(0===e.length)return;let n=function(){if(tg[tf])return tg[tf].values()}(),s=[],i=new Map;for(let t of e){let e,r=t.profile;for(let[t]of i)if("string"==typeof t&&"string"==typeof r&&t===r||"object"==typeof t&&"object"==typeof r&&JSON.stringify(t)===JSON.stringify(r)||t===r){e=t;break}let n=e||r;i.has(n)||i.set(n,[]),i.get(n).push(t.tag)}for(let[e,o]of i){let i;if(e){let t;if("object"==typeof e)t=e;else if("string"==typeof e){var a;if(!(t=null==r||null==(a=r.cacheLifeProfiles)?void 0:a[e]))throw Object.defineProperty(Error(`Invalid profile provided "${e}" must be configured under cacheLife in next.config or be "max"`),"__NEXT_ERROR_CODE",{value:"E873",enumerable:!1,configurable:!0})}t&&(i={expire:t.expire})}for(let t of n||[])e?s.push(null==t.updateTags?void 0:t.updateTags.call(t,o,i)):s.push(null==t.updateTags?void 0:t.updateTags.call(t,o));t&&s.push(t.revalidateTag(o,i))}await Promise.all(s)}let tw=eN();class t_{constructor({waitUntil:e,onClose:t,onTaskError:r}){this.workUnitStores=new Set,this.waitUntil=e,this.onClose=t,this.onTaskError=r,this.callbackQueue=new tc.default,this.callbackQueue.pause()}after(e){if(e0(e))this.waitUntil||tE(),this.waitUntil(e.catch(e=>this.reportTaskError("promise",e)));else if("function"==typeof e)this.addCallback(e);else throw Object.defineProperty(Error("`after()`: Argument must be a promise or a function"),"__NEXT_ERROR_CODE",{value:"E50",enumerable:!1,configurable:!0})}addCallback(e){var t;this.waitUntil||tE();let r=tl.getStore();r&&this.workUnitStores.add(r);let n=tw.getStore(),s=n?n.rootTaskSpawnPhase:null==r?void 0:r.phase;this.runCallbacksOnClosePromise||(this.runCallbacksOnClosePromise=this.runCallbacksOnClose(),this.waitUntil(this.runCallbacksOnClosePromise));let i=(t=async()=>{try{await tw.run({rootTaskSpawnPhase:s},()=>e())}catch(e){this.reportTaskError("function",e)}},eI?eI.bind(t):eA.bind(t));this.callbackQueue.add(i)}async runCallbacksOnClose(){return await new Promise(e=>this.onClose(e)),this.runCallbacks()}async runCallbacks(){if(0===this.callbackQueue.size)return;for(let e of this.workUnitStores)e.phase="after";let e=ej.getStore();if(!e)throw Object.defineProperty(new th("Missing workStore in AfterContext.runCallbacks"),"__NEXT_ERROR_CODE",{value:"E547",enumerable:!1,configurable:!0});return tb(e,()=>(this.callbackQueue.start(),this.callbackQueue.onIdle()))}reportTaskError(e,t){if(console.error("promise"===e?"A promise passed to `after()` rejected:":"An error occurred in a function passed to `after()`:",t),this.onTaskError)try{null==this.onTaskError||this.onTaskError.call(this,t)}catch(e){console.error(Object.defineProperty(new th("`onTaskError` threw while handling an error thrown from an `after` task",{cause:e}),"__NEXT_ERROR_CODE",{value:"E569",enumerable:!1,configurable:!0}))}}}function tE(){throw Object.defineProperty(Error("`after()` will not work correctly, because `waitUntil` is not available in the current environment."),"__NEXT_ERROR_CODE",{value:"E91",enumerable:!1,configurable:!0})}function tk(e){let t,r={then:(n,s)=>(t||(t=Promise.resolve(e())),t.then(e=>{r.value=e}).catch(()=>{}),t.then(n,s))};return r}class tS{onClose(e){if(this.isClosed)throw Object.defineProperty(Error("Cannot subscribe to a closed CloseController"),"__NEXT_ERROR_CODE",{value:"E365",enumerable:!1,configurable:!0});this.target.addEventListener("close",e),this.listeners++}dispatchClose(){if(this.isClosed)throw Object.defineProperty(Error("Cannot close a CloseController multiple times"),"__NEXT_ERROR_CODE",{value:"E229",enumerable:!1,configurable:!0});this.listeners>0&&this.target.dispatchEvent(new Event("close")),this.isClosed=!0}constructor(){this.target=new EventTarget,this.listeners=0,this.isClosed=!1}}function tT(){return{previewModeId:process.env.__NEXT_PREVIEW_MODE_ID||"",previewModeSigningKey:process.env.__NEXT_PREVIEW_MODE_SIGNING_KEY||"",previewModeEncryptionKey:process.env.__NEXT_PREVIEW_MODE_ENCRYPTION_KEY||""}}let tR=Symbol.for("@next/request-context");async function tO(e,t,r){let n=new Set;for(let t of(e=>{let t=["/layout"];if(e.startsWith("/")){let r=e.split("/");for(let e=1;e<r.length+1;e++){let n=r.slice(0,e).join("/");n&&(n.endsWith("/page")||n.endsWith("/route")||(n=`${n}${!n.endsWith("/")?"/":""}layout`),t.push(n))}}return t})(e))t=`${w}${t}`,n.add(t);if(t&&(!r||0===r.size)){let e=`${w}${t}`;n.add(e)}n.has(`${w}/`)&&n.add(`${w}/index`),n.has(`${w}/index`)&&n.add(`${w}/`);let s=Array.from(n);return{tags:s,expirationsByCacheKind:function(e){let t=new Map,r=tm();if(r)for(let[n,s]of r)"getExpiration"in s&&t.set(n,tk(async()=>s.getExpiration(e)));return t}(s)}}let tx=Symbol.for("NextInternalRequestMeta");class tC extends em{constructor(e){super(e.input,e.init),this.sourcePage=e.page}get request(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}waitUntil(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}let tP={keys:e=>Array.from(e.keys()),get:(e,t)=>e.get(t)??void 0},tA=(e,t)=>ts().withPropagatedContext(e.headers,t,tP),tI=!1;async function tN(t){var r,n,s,i,a;let o,l,u,c,d;!function(){if(!tI&&(tI=!0,"true"===process.env.NEXT_PRIVATE_TEST_PROXY)){let{interceptTestApis:t,wrapRequestHandler:r}=e.r(47679);t(),tA=r(tA)}}(),await h();let p=void 0!==globalThis.__BUILD_MANIFEST;t.request.url=t.request.url.replace(/\.rsc($|\?)/,"$1");let f=t.bypassNextUrl?new URL(t.request.url):new B(t.request.url,{headers:t.request.headers,nextConfig:t.request.nextConfig});for(let e of[...f.searchParams.keys()]){let t=f.searchParams.getAll(e),r=function(e){for(let t of["nxtP","nxtI"])if(e!==t&&e.startsWith(t))return e.substring(t.length);return null}(e);if(r){for(let e of(f.searchParams.delete(r),t))f.searchParams.append(r,e);f.searchParams.delete(e)}}let g=process.env.__NEXT_BUILD_ID||"";"buildId"in f&&(g=f.buildId||"",f.buildId="");let m=function(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}(t.request.headers),b=m.has("x-nextjs-data"),y="1"===m.get("rsc");b&&"/index"===f.pathname&&(f.pathname="/");let v=new Map;if(!p)for(let e of eS){let t=m.get(e);null!==t&&(v.set(e,t),m.delete(e))}let w=f.searchParams.get(eT),_=new tC({page:t.page,input:((c=(u="string"==typeof f)?new URL(f):f).searchParams.delete(eT),u?c.toString():c).toString(),init:{body:t.request.body,headers:m,method:t.request.method,nextConfig:t.request.nextConfig,signal:t.request.signal}});t.request.requestMeta&&(a=t.request.requestMeta,_[tx]=a),b&&Object.defineProperty(_,"__isData",{enumerable:!1,value:!0}),!globalThis.__incrementalCacheShared&&t.IncrementalCache&&(globalThis.__incrementalCache=new t.IncrementalCache({CurCacheHandler:t.incrementalCacheHandler,minimalMode:!0,fetchCacheKeyPrefix:"",dev:!1,requestHeaders:t.request.headers,getPrerenderManifest:()=>({version:-1,routes:{},dynamicRoutes:{},notFoundRoutes:[],preview:tT()})}));let E=t.request.waitUntil??(null==(r=null==(d=globalThis[tR])?void 0:d.get())?void 0:r.waitUntil),k=new C({request:_,page:t.page,context:E?{waitUntil:E}:void 0});if((o=await tA(_,()=>{if("/middleware"===t.page||"/src/middleware"===t.page||"/proxy"===t.page||"/src/proxy"===t.page){let e=k.waitUntil.bind(k),r=new tS;return ts().trace(eY.execute,{spanName:`middleware ${_.method}`,attributes:{"http.target":_.nextUrl.pathname,"http.method":_.method}},async()=>{try{var n,s,i,a,o,u;let c=tT(),h=await tO("/",_.nextUrl.pathname,null),d=(o=_.nextUrl,u=e=>{l=e},function(e,t,r,n,s,i,a,o,l,u){function c(e){r&&r.setHeader("Set-Cookie",e)}let h={};return{type:"request",phase:e,implicitTags:i,url:{pathname:n.pathname,search:n.search??""},rootParams:s,get headers(){return h.headers||(h.headers=function(e){let t=eC.from(e);for(let e of eS)t.delete(e);return eC.seal(t)}(t.headers)),h.headers},get cookies(){if(!h.cookies){let e=new ef.RequestCookies(eC.from(t.headers));to(t,e),h.cookies=eD.seal(e)}return h.cookies},set cookies(value){h.cookies=value},get mutableCookies(){if(!h.mutableCookies){var d,p;let e,n=(d=t.headers,p=a||(r?c:void 0),e=new ef.RequestCookies(eC.from(d)),eU.wrap(e,p));to(t,n),h.mutableCookies=n}return h.mutableCookies},get userspaceMutableCookies(){if(!h.userspaceMutableCookies){var f;let e;f=this,h.userspaceMutableCookies=e=new Proxy(f.mutableCookies,{get(t,r,n){switch(r){case"delete":return function(...r){return eM(f,"cookies().delete"),t.delete(...r),e};case"set":return function(...r){return eM(f,"cookies().set"),t.set(...r),e};default:return eb.get(t,r,n)}}})}return h.userspaceMutableCookies},get draftMode(){return h.draftMode||(h.draftMode=new ta(o,t,this.cookies,this.mutableCookies)),h.draftMode},renderResumeDataCache:null,isHmrRefresh:l,serverComponentsHmrCache:u||globalThis.__serverComponentsHmrCache,fallbackParams:null}}("action",_,void 0,o,{},h,u,c,!1,void 0)),p=function({page:e,renderOpts:t,isPrefetchRequest:r,buildId:n,deploymentId:s,previouslyRevalidatedTags:i,nonce:a}){let o=!t.shouldWaitOnAllReady&&!t.supportsDynamicResponse&&!t.isDraftMode&&!t.isPossibleServerAction,l=o&&(!!process.env.NEXT_DEBUG_BUILD||"1"===process.env.NEXT_SSG_FETCH_METRICS),u={isStaticGeneration:o,page:e,route:eO(e),incrementalCache:t.incrementalCache||globalThis.__incrementalCache,cacheLifeProfiles:t.cacheLifeProfiles,isBuildTimePrerendering:t.isBuildTimePrerendering,fetchCache:t.fetchCache,isOnDemandRevalidate:t.isOnDemandRevalidate,isDraftMode:t.isDraftMode,isPrefetchRequest:r,buildId:n,deploymentId:s,reactLoadableManifest:(null==t?void 0:t.reactLoadableManifest)||{},assetPrefix:(null==t?void 0:t.assetPrefix)||"",nonce:a,afterContext:function(e){let{waitUntil:t,onClose:r,onAfterTaskError:n}=e;return new t_({waitUntil:t,onClose:r,onTaskError:n})}(t),cacheComponentsEnabled:t.cacheComponents,previouslyRevalidatedTags:i,refreshTagsByCacheKind:function(){let e=new Map,t=tm();if(t)for(let[r,n]of t)"refreshTags"in n&&e.set(r,tk(async()=>n.refreshTags()));return e}(),runInCleanSnapshot:eI?eI.snapshot():function(e,...t){return e(...t)},shouldTrackFetchMetrics:l,reactServerErrorsByDigest:new Map};return t.store=u,u}({page:"/",renderOpts:{cacheLifeProfiles:null==(s=t.request.nextConfig)||null==(n=s.experimental)?void 0:n.cacheLife,cacheComponents:!1,experimental:{isRoutePPREnabled:!1,authInterrupts:!!(null==(a=t.request.nextConfig)||null==(i=a.experimental)?void 0:i.authInterrupts)},supportsDynamicResponse:!0,waitUntil:e,onClose:r.onClose.bind(r),onAfterTaskError:void 0},isPrefetchRequest:"1"===_.headers.get(ek),buildId:g??"",deploymentId:!1??"",previouslyRevalidatedTags:[]});return await ej.run(p,()=>tl.run(d,t.handler,_,k))}finally{setTimeout(()=>{r.dispatchClose()},0)}})}return t.handler(_,k)}))&&!(o instanceof Response))throw Object.defineProperty(TypeError("Expected an instance of Response to be returned"),"__NEXT_ERROR_CODE",{value:"E567",enumerable:!1,configurable:!0});o&&l&&o.headers.set("set-cookie",l);let S=null==o?void 0:o.headers.get("x-middleware-rewrite");if(o&&S&&(y||!p)){let e=new B(S,{forceLocale:!0,headers:t.request.headers,nextConfig:t.request.nextConfig});p||e.host!==_.nextUrl.host||(e.buildId=g||e.buildId,o.headers.set("x-middleware-rewrite",String(e)));let{url:r,isRelative:a}=eE(e.toString(),f.toString());!p&&b&&o.headers.set("x-nextjs-rewrite",r);let l=!a&&(null==(i=t.request.nextConfig)||null==(s=i.experimental)||null==(n=s.clientParamParsingOrigins)?void 0:n.some(t=>new RegExp(t).test(e.origin)));y&&(a||l)&&(f.pathname!==e.pathname&&o.headers.set("x-nextjs-rewritten-path",e.pathname),f.search!==e.search&&o.headers.set("x-nextjs-rewritten-query",e.search.slice(1)))}if(o&&S&&y&&w){let e=new URL(S);e.searchParams.has(eT)||(e.searchParams.set(eT,w),o.headers.set("x-middleware-rewrite",e.toString()))}let T=null==o?void 0:o.headers.get("Location");if(o&&T&&!p){let e=new B(T,{forceLocale:!1,headers:t.request.headers,nextConfig:t.request.nextConfig});o=new Response(o.body,o),e.host===f.host&&(e.buildId=g||e.buildId,o.headers.set("Location",eE(e,f).url)),b&&(o.headers.delete("Location"),o.headers.set("x-nextjs-redirect",eE(e.toString(),f.toString()).url))}let R=o||e_.next(),x=R.headers.get("x-middleware-override-headers"),P=[];if(x){for(let[e,t]of v)R.headers.set(`x-middleware-request-${e}`,t),P.push(e);P.length>0&&R.headers.set("x-middleware-override-headers",x+","+P.join(","))}return{response:R,waitUntil:("internal"===k[O].kind?Promise.all(k[O].promises).then(()=>{}):void 0)??Promise.resolve(),fetchMetrics:_.fetchMetrics}}class tj{constructor(){let e,t;this.promise=new Promise((r,n)=>{e=r,t=n}),this.resolve=e,this.reject=t}}class t${constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class tD{constructor(){this.prev=null,this.next=null}}class tL{constructor(e,t,r){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.onEvict=r,this.head=new tD,this.tail=new tD,this.head.next=this.tail,this.tail.prev=this.head}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){let e=this.tail.prev;return this.removeNode(e),e}set(e,t){let r=(null==this.calculateSize?void 0:this.calculateSize.call(this,t))??1;if(r<=0)throw Object.defineProperty(Error(`LRUCache: calculateSize returned ${r}, but size must be > 0. Items with size 0 would never be evicted, causing unbounded cache growth.`),"__NEXT_ERROR_CODE",{value:"E1045",enumerable:!1,configurable:!0});if(r>this.maxSize)return console.warn("Single item size exceeds maxSize"),!1;let n=this.cache.get(e);if(n)n.data=t,this.totalSize=this.totalSize-n.size+r,n.size=r,this.moveToHead(n);else{let n=new t$(e,t,r);this.cache.set(e,n),this.addToHead(n),this.totalSize+=r}for(;this.totalSize>this.maxSize&&this.cache.size>0;){let e=this.removeTail();this.cache.delete(e.key),this.totalSize-=e.size,null==this.onEvict||this.onEvict.call(this,e.key,e.data)}return!0}has(e){return this.cache.has(e)}get(e){let t=this.cache.get(e);if(t)return this.moveToHead(t),t.data}*[Symbol.iterator](){let e=this.head.next;for(;e&&e!==this.tail;){let t=e;yield[t.key,t.data],e=e.next}}remove(e){let t=this.cache.get(e);t&&(this.removeNode(t),this.cache.delete(e),this.totalSize-=t.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}let{env:tU,stdout:tM}=(null==(eo=globalThis)?void 0:eo.process)??{},tB=tU&&!tU.NO_COLOR&&(tU.FORCE_COLOR||(null==tM?void 0:tM.isTTY)&&!tU.CI&&"dumb"!==tU.TERM),tq=(e,t,r,n)=>{let s=e.substring(0,n)+r,i=e.substring(n+t.length),a=i.indexOf(t);return~a?s+tq(i,t,r,a):s+i},tH=(e,t,r=e)=>tB?n=>{let s=""+n,i=s.indexOf(t,e.length);return~i?e+tq(s,t,r,i)+t:e+s+t}:String,tF=tH("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m");tH("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),tH("\x1b[3m","\x1b[23m"),tH("\x1b[4m","\x1b[24m"),tH("\x1b[7m","\x1b[27m"),tH("\x1b[8m","\x1b[28m"),tH("\x1b[9m","\x1b[29m"),tH("\x1b[30m","\x1b[39m");let tV=tH("\x1b[31m","\x1b[39m"),tG=tH("\x1b[32m","\x1b[39m"),tW=tH("\x1b[33m","\x1b[39m");tH("\x1b[34m","\x1b[39m");let tz=tH("\x1b[35m","\x1b[39m");tH("\x1b[38;2;173;127;168m","\x1b[39m"),tH("\x1b[36m","\x1b[39m");let tK=tH("\x1b[37m","\x1b[39m");tH("\x1b[90m","\x1b[39m"),tH("\x1b[40m","\x1b[49m"),tH("\x1b[41m","\x1b[49m"),tH("\x1b[42m","\x1b[49m"),tH("\x1b[43m","\x1b[49m"),tH("\x1b[44m","\x1b[49m"),tH("\x1b[45m","\x1b[49m"),tH("\x1b[46m","\x1b[49m"),tH("\x1b[47m","\x1b[49m"),tK(tF("○")),tV(tF("⨯")),tW(tF("⚠")),tK(tF(" ")),tG(tF("✓")),tz(tF("»")),new tL(1e4,e=>e.length),new tL(1e4,e=>e.length);var tJ=((Z={}).APP_PAGE="APP_PAGE",Z.APP_ROUTE="APP_ROUTE",Z.PAGES="PAGES",Z.FETCH="FETCH",Z.REDIRECT="REDIRECT",Z.IMAGE="IMAGE",Z),tX=((ee={}).APP_PAGE="APP_PAGE",ee.APP_ROUTE="APP_ROUTE",ee.PAGES="PAGES",ee.FETCH="FETCH",ee.IMAGE="IMAGE",ee);function tY(){}new TextEncoder;let tQ=new TextEncoder;function tZ(e){return new ReadableStream({start(t){t.enqueue(tQ.encode(e)),t.close()}})}function t0(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}async function t1(e,t){let r=new TextDecoder("utf-8",{fatal:!0}),n="";for await(let s of e){if(null==t?void 0:t.aborted)return n;n+=r.decode(s,{stream:!0})}return n+r.decode()}let t2="ResponseAborted";class t4 extends Error{constructor(...e){super(...e),this.name=t2}}let t3=0,t6=0,t5=0;function t9(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===t2}async function t8(e,t,r){try{let n,{errored:s,destroyed:i}=t;if(s||i)return;let a=(n=new AbortController,t.once("close",()=>{t.writableFinished||n.abort(new t4)}),n),o=function(e,t){let r=!1,n=new tj;function s(){n.resolve()}e.on("drain",s),e.once("close",()=>{e.off("drain",s),n.resolve()});let i=new tj;return e.once("finish",()=>{i.resolve()}),new WritableStream({write:async t=>{if(!r){if(r=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let e=function(e={}){let t=0===t3?void 0:{clientComponentLoadStart:t3,clientComponentLoadTimes:t6,clientComponentLoadCount:t5};return e.reset&&(t3=0,t6=0,t5=0),t}();e&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:e.clientComponentLoadStart,end:e.clientComponentLoadStart+e.clientComponentLoadTimes})}e.flushHeaders(),ts().trace(eF.startResponse,{spanName:"start response"},()=>void 0)}try{let r=e.write(t);"flush"in e&&"function"==typeof e.flush&&e.flush(),r||(await n.promise,n=new tj)}catch(t){throw e.end(),Object.defineProperty(Error("failed to write chunk to response",{cause:t}),"__NEXT_ERROR_CODE",{value:"E321",enumerable:!1,configurable:!0})}},abort:t=>{e.writableFinished||e.destroy(t)},close:async()=>{if(t&&await t,!e.writableFinished)return e.end(),i.promise}})}(t,r);await e.pipeTo(o,{signal:a.signal})}catch(e){if(t9(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class t7{static #e=this.EMPTY=new t7(null,{metadata:{},contentType:null});static fromStatic(e,t){return new t7(e,{metadata:{},contentType:t})}constructor(e,{contentType:t,waitUntil:r,metadata:n}){this.response=e,this.contentType=t,this.metadata=n,this.waitUntil=r}assignMetadata(e){Object.assign(this.metadata,e)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(e=!1){if(null===this.response)return"";if("string"!=typeof this.response){if(!e)throw Object.defineProperty(new th("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return t1(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?tZ(this.response):td.Buffer.isBuffer(this.response)?t0(this.response):Array.isArray(this.response)?function(...e){if(0===e.length)return new ReadableStream({start(e){e.close()}});if(1===e.length)return e[0];let{readable:t,writable:r}=new TransformStream,n=e[0].pipeTo(r,{preventClose:!0}),s=1;for(;s<e.length-1;s++){let t=e[s];n=n.then(()=>t.pipeTo(r,{preventClose:!0}))}let i=e[s];return(n=n.then(()=>i.pipeTo(r))).catch(tY),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[tZ(this.response)]:Array.isArray(this.response)?this.response:td.Buffer.isBuffer(this.response)?[t0(this.response)]:[this.response]}pipeThrough(e){this.response=this.readable.pipeThrough(e)}unshift(e){this.response=this.coerce(),this.response.unshift(e)}push(e){this.response=this.coerce(),this.response.push(e)}async pipeTo(e){try{await this.readable.pipeTo(e,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await e.close()}catch(t){if(t9(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await t8(this.readable,e,this.waitUntil)}}function re(e,t){if(!e)return t;let r=parseInt(e,10);return Number.isFinite(r)&&r>0?r:t}re(process.env.NEXT_PRIVATE_RESPONSE_CACHE_TTL,1e4),re(process.env.NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE,150);var rt=e.i(15246);let rr=new Map,rn=(e,t)=>{for(let r of e){let e=rr.get(r),n=null==e?void 0:e.expired;if("number"==typeof n&&n<=Date.now()&&n>t)return!0}return!1},rs=(e,t)=>{for(let r of e){let e=rr.get(r),n=(null==e?void 0:e.stale)??0;if("number"==typeof n&&n>t)return!0}return!1};class ri{constructor(e){this.fs=e,this.tasks=[]}findOrCreateTask(e){for(let t of this.tasks)if(t[0]===e)return t;let t=this.fs.mkdir(e);t.catch(()=>{});let r=[e,t,[]];return this.tasks.push(r),r}append(e,t){let r=this.findOrCreateTask(rt.default.dirname(e)),n=r[1].then(()=>this.fs.writeFile(e,t));n.catch(()=>{}),r[2].push(n)}wait(){return Promise.all(this.tasks.flatMap(e=>e[2]))}}function ra(e){return(null==e?void 0:e.length)||0}class ro{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor(e){this.fs=e.fs,this.flushToDisk=e.flushToDisk,this.serverDistDir=e.serverDistDir,this.revalidatedTags=e.revalidatedTags,e.maxMemoryCacheSize?ro.memoryCache?ro.debug&&console.log("FileSystemCache: memory store already initialized"):(ro.debug&&console.log("FileSystemCache: using memory store for fetch cache"),ro.memoryCache=function(e){return r||(r=new tL(e,function({value:e}){var t,r;if(!e)return 25;if(e.kind===tJ.REDIRECT)return JSON.stringify(e.props).length;if(e.kind===tJ.IMAGE)throw Object.defineProperty(Error("invariant image should not be incremental-cache"),"__NEXT_ERROR_CODE",{value:"E501",enumerable:!1,configurable:!0});if(e.kind===tJ.FETCH)return JSON.stringify(e.data||"").length;if(e.kind===tJ.APP_ROUTE)return e.body.length;return e.kind===tJ.APP_PAGE?Math.max(1,e.html.length+ra(e.rscData)+((null==(r=e.postponed)?void 0:r.length)||0)+function(e){if(!e)return 0;let t=0;for(let[r,n]of e)t+=r.length+ra(n);return t}(e.segmentData)):e.html.length+((null==(t=JSON.stringify(e.pageData))?void 0:t.length)||0)})),r}(e.maxMemoryCacheSize)):ro.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(e,t){if(e="string"==typeof e?[e]:e,ro.debug&&console.log("FileSystemCache: revalidateTag",e,t),0===e.length)return;let r=Date.now();for(let n of e){let e=rr.get(n)||{};if(t){let s={...e};s.stale=r,void 0!==t.expire&&(s.expired=r+1e3*t.expire),rr.set(n,s)}else rr.set(n,{...e,expired:r})}}async get(...e){var t,r,n,s,i,a;let[o,l]=e,{kind:u}=l,c=null==(t=ro.memoryCache)?void 0:t.get(o);if(ro.debug&&(u===tX.FETCH?console.log("FileSystemCache: get",o,l.tags,u,!!c):console.log("FileSystemCache: get",o,u,!!c)),(null==c||null==(r=c.value)?void 0:r.kind)===tJ.APP_PAGE||(null==c||null==(n=c.value)?void 0:n.kind)===tJ.APP_ROUTE||(null==c||null==(s=c.value)?void 0:s.kind)===tJ.PAGES){let e=null==(a=c.value.headers)?void 0:a[y];if("string"==typeof e){let t=e.split(",");if(t.length>0&&rn(t,c.lastModified))return ro.debug&&console.log("FileSystemCache: expired tags",t),null}}else if((null==c||null==(i=c.value)?void 0:i.kind)===tJ.FETCH){let e=l.kind===tX.FETCH?[...l.tags||[],...l.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return ro.debug&&console.log("FileSystemCache: was revalidated",e),null;if(rn(e,c.lastModified))return ro.debug&&console.log("FileSystemCache: expired tags",e),null}return c??null}async set(e,t,r){var n;if(null==(n=ro.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),ro.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let s=new ri(this.fs);if(t.kind===tJ.APP_ROUTE){let r=this.getFilePath(`${e}.body`,tX.APP_ROUTE);s.append(r,t.body);let n={headers:t.headers,status:t.status,postponed:void 0,segmentPaths:void 0,prefetchHints:void 0};s.append(r.replace(/\.body$/,b),JSON.stringify(n,null,2))}else if(t.kind===tJ.PAGES||t.kind===tJ.APP_PAGE){let n=t.kind===tJ.APP_PAGE,i=this.getFilePath(`${e}.html`,n?tX.APP_PAGE:tX.PAGES);if(s.append(i,t.html),r.fetchCache||r.isFallback||r.isRoutePPREnabled||s.append(this.getFilePath(`${e}${n?".rsc":".json"}`,n?tX.APP_PAGE:tX.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===tJ.APP_PAGE){let e;if(t.segmentData){e=[];let r=i.replace(/\.html$/,".segments");for(let[n,i]of t.segmentData){e.push(n);let t=r+n+".segment.rsc";s.append(t,i)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e,prefetchHints:void 0};s.append(i.replace(/\.html$/,b),JSON.stringify(r))}}else if(t.kind===tJ.FETCH){let n=this.getFilePath(e,tX.FETCH);s.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await s.wait()}getFilePath(e,t){switch(t){case tX.FETCH:return rt.default.join(this.serverDistDir,"..","cache","fetch-cache",e);case tX.PAGES:return rt.default.join(this.serverDistDir,"pages",e);case tX.IMAGE:case tX.APP_PAGE:case tX.APP_ROUTE:return rt.default.join(this.serverDistDir,"app",e);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${t}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1,configurable:!0})}}}let rl=["(..)(..)","(.)","(..)","(...)"],ru=/\/[^/]*\[[^/]+\][^/]*(?=\/|$)/,rc=/\/\[[^/]+\](?=\/|$)/;function rh(e){return e.replace(/(?:\/index)?\/?$/,"")||"/"}class rd{static #e=this.cacheControls=new Map;constructor(e){this.prerenderManifest=e}get(e){let t=rd.cacheControls.get(e);if(t)return t;let r=this.prerenderManifest.routes[e];if(r){let{initialRevalidateSeconds:e,initialExpireSeconds:t}=r;if(void 0!==e)return{revalidate:e,expire:t}}let n=this.prerenderManifest.dynamicRoutes[e];if(n){let{fallbackRevalidate:e,fallbackExpire:t}=n;if(void 0!==e)return{revalidate:e,expire:t}}}set(e,t){rd.cacheControls.set(e,t)}clear(){rd.cacheControls.clear()}}e.i(63261);class rp{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:s,requestHeaders:i,maxMemoryCacheSize:a,getPrerenderManifest:o,fetchCacheKeyPrefix:l,CurCacheHandler:u,allowedRevalidateHeaderKeys:c}){var h,d,p,f;this.locks=new Map,this.hasCustomCacheHandler=!!u;const g=Symbol.for("@next/cache-handlers"),b=globalThis;if(u)rp.debug&&console.log("IncrementalCache: using custom cache handler",u.name);else{const t=b[g];(null==t?void 0:t.FetchCache)?(u=t.FetchCache,rp.debug&&console.log("IncrementalCache: using global FetchCache cache handler")):e&&s&&(rp.debug&&console.log("IncrementalCache: using filesystem cache handler"),u=ro)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(a=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=t,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=n,this.requestHeaders=i,this.allowedRevalidateHeaderKeys=c,this.prerenderManifest=o(),this.cacheControls=new rd(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];i[m]===(null==(d=this.prerenderManifest)||null==(h=d.preview)?void 0:h.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=this.revalidatedTags=function(e,t){return"string"==typeof e[v]&&e["x-next-revalidate-tag-token"]===t?e[v].split(","):[]}(i,null==(f=this.prerenderManifest)||null==(p=f.preview)?void 0:p.previewModeId)),u&&(this.cacheHandler=new u({dev:t,fs:e,flushToDisk:r,serverDistDir:s,revalidatedTags:y,maxMemoryCacheSize:a,_requestHeaders:i,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let s=this.cacheControls.get(rh(e)),i=s?s.revalidate:!n&&1;return"number"==typeof i?1e3*i+t:i}_getPathname(e,t){return t?e:/^\/index(\/|$)/.test(e)&&!function(e,t=!0){return(void 0!==e.split("/").find(e=>rl.find(t=>e.startsWith(t)))&&(e=function(e){let t,r,n;for(let s of e.split("/"))if(r=rl.find(e=>s.startsWith(e))){[t,n]=e.split(r,2);break}if(!t||!r||!n)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`),"__NEXT_ERROR_CODE",{value:"E269",enumerable:!1,configurable:!0});switch(t=eO(t),r){case"(.)":n="/"===t?`/${n}`:t+"/"+n;break;case"(..)":if("/"===t)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`),"__NEXT_ERROR_CODE",{value:"E207",enumerable:!1,configurable:!0});n=t.split("/").slice(0,-1).concat(n).join("/");break;case"(...)":n="/"+n;break;case"(..)(..)":let s=t.split("/");if(s.length<=2)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`),"__NEXT_ERROR_CODE",{value:"E486",enumerable:!1,configurable:!0});n=s.slice(0,-2).concat(n).join("/");break;default:throw Object.defineProperty(Error("Invariant: unexpected marker"),"__NEXT_ERROR_CODE",{value:"E112",enumerable:!1,configurable:!0})}return{interceptingRoute:t,interceptedRoute:n}}(e).interceptedRoute),t)?rc.test(e):ru.test(e)}(e)?`/index${e}`:"/"===e?"/index":eR(e)}resetRequestCache(){var e,t;null==(t=this.cacheHandler)||null==(e=t.resetRequestCache)||e.call(t)}async lock(e){for(;;){let t=this.locks.get(e);if(rp.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new tj;return rp.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e,t){var r;return null==(r=this.cacheHandler)?void 0:r.revalidateTag(e,t)}async generateCacheKey(e,t={}){let r=[],n=new TextEncoder,s=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)r.push(s.decode(t.body)),t._ogBody=t.body;else if("function"==typeof t.body.getReader){let e=t.body,i=[];try{await e.pipeTo(new WritableStream({write(e){"string"==typeof e?(i.push(n.encode(e)),r.push(e)):(i.push(e),r.push(s.decode(e,{stream:!0})))}})),r.push(s.decode());let a=i.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),l=0;for(let e of i)o.set(e,l),l+=e.length;t._ogBody=o}catch(e){console.error("Problem reading body",e)}}else if("function"==typeof t.body.keys){let e=t.body;for(let n of(t._ogBody=t.body,new Set([...e.keys()]))){let t=e.getAll(n);r.push(`${n}=${(await Promise.all(t.map(async e=>"string"==typeof e?e:await e.text()))).join(",")}`)}}else if("function"==typeof t.body.arrayBuffer){let e=t.body,n=await e.arrayBuffer();r.push(await e.text()),t._ogBody=new Blob([n],{type:e.type})}else"string"==typeof t.body&&(r.push(t.body),t._ogBody=t.body);let i="function"==typeof(t.headers||{}).keys?Object.fromEntries(t.headers):Object.assign({},t.headers);"traceparent"in i&&delete i.traceparent,"tracestate"in i&&delete i.tracestate;let a=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",e,t.method,i,t.mode,t.redirect,t.credentials,t.referrer,t.referrerPolicy,t.integrity,t.cache,r]);{var o;let e=n.encode(a);return o=await crypto.subtle.digest("SHA-256",e),Array.prototype.map.call(new Uint8Array(o),e=>e.toString(16).padStart(2,"0")).join("")}}async get(e,t){var r,n,s,i,a,o,l;let u,c;if(t.kind===tX.FETCH){let r=tl.getStore(),n=r?function(e){switch(e.type){case"request":case"prerender":case"prerender-runtime":case"prerender-client":case"validation-client":if(e.renderResumeDataCache)return e.renderResumeDataCache;case"prerender-ppr":return e.prerenderResumeDataCache??null;case"cache":case"private-cache":case"unstable-cache":case"prerender-legacy":case"generate-static-params":return null;default:return e}}(r):null;if(n){let r=n.fetch.get(e);if((null==r?void 0:r.kind)===tJ.FETCH){let n=ej.getStore();if(![...t.tags||[],...t.softTags||[]].some(e=>{var t,r;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==n||null==(r=n.pendingRevalidatedTags)?void 0:r.some(t=>t.tag===e))}))return rp.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:r};rp.debug&&console.log("IncrementalCache: rdc:revalidated-tag",e)}else rp.debug&&console.log("IncrementalCache: rdc:miss",e)}else rp.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==tX.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===tX.FETCH);let h=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===tX.FETCH){if(!h)return null;if((null==(s=h.value)?void 0:s.kind)!==tJ.FETCH)throw Object.defineProperty(new th(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(i=h.value)?void 0:i.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=ej.getStore(),n=[...t.tags||[],...t.softTags||[]];if(n.some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.some(t=>t.tag===e))}))return rp.debug&&console.log("IncrementalCache: expired tag",e),null;let a=tl.getStore();if(a){let t=tu(a);t&&(rp.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,h.value))}let o=t.revalidate||h.value.revalidate,l=(performance.timeOrigin+performance.now()-(h.lastModified||0))/1e3>o,u=h.value.data;return rn(n,h.lastModified)?null:(rs(n,h.lastModified)&&(l=!0),{isStale:l,value:{kind:tJ.FETCH,data:u,revalidate:o}})}if((null==h||null==(n=h.value)?void 0:n.kind)===tJ.FETCH)throw Object.defineProperty(new th(`Expected cached value for cache key ${JSON.stringify(e)} not to be a ${JSON.stringify(t.kind)} kind, got "FETCH" instead.`),"__NEXT_ERROR_CODE",{value:"E652",enumerable:!1,configurable:!0});let d=null,{isFallback:p}=t,f=this.cacheControls.get(rh(e));if((null==h?void 0:h.lastModified)===-1)u=-1,c=-31536e6;else{let r=performance.timeOrigin+performance.now(),n=(null==h?void 0:h.lastModified)||r;if(void 0===(u=!1!==(c=this.calculateRevalidate(e,n,this.dev??!1,t.isFallback))&&c<r||void 0)&&((null==h||null==(a=h.value)?void 0:a.kind)===tJ.APP_PAGE||(null==h||null==(o=h.value)?void 0:o.kind)===tJ.APP_ROUTE)){let e=null==(l=h.value.headers)?void 0:l[y];if("string"==typeof e){let t=e.split(",");t.length>0&&(rn(t,n)?u=-1:rs(t,n)&&(u=!0))}}}return h&&(d={isStale:u,cacheControl:f,revalidateAfter:c,value:h.value,isFallback:p}),!h&&this.prerenderManifest.notFoundRoutes.includes(e)&&(d={isStale:u,value:null,cacheControl:f,revalidateAfter:c,isFallback:p},this.set(e,d.value,{...t,cacheControl:f})),d}async set(e,t,r){if((null==t?void 0:t.kind)===tJ.FETCH){let r=tl.getStore(),n=r?tu(r):null;n&&(rp.debug&&console.log("IncrementalCache: rdc:set",e),n.fetch.set(e,t))}if(this.disableForTestmode||this.dev&&!r.fetchCache)return;e=this._getPathname(e,r.fetchCache);let n=JSON.stringify(t).length;if(r.fetchCache&&n>2097152&&!this.hasCustomCacheHandler&&!r.isImplicitBuildTimeCache){let t=`Failed to set Next.js data cache for ${r.fetchUrl||e}, items over 2MB can not be cached (${n} bytes)`;if(this.dev)throw Object.defineProperty(Error(t),"__NEXT_ERROR_CODE",{value:"E1003",enumerable:!1,configurable:!0});console.warn(t);return}try{var s;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(rh(e),r.cacheControl),await (null==(s=this.cacheHandler)?void 0:s.set(e,t,r))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}if(e.i(27645),e.i(29580).default.unstable_postpone,!1===("Route %%% needs to bail out of prerendering at this point because it used ^^^. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error".includes("needs to bail out of prerendering at this point because it used")&&"Route %%% needs to bail out of prerendering at this point because it used ^^^. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error".includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});RegExp("\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at __next_root_layout_boundary__ \\([^\\n]*\\)"),RegExp("\\n\\s+at __next_metadata_boundary__[\\n\\s]"),RegExp("\\n\\s+at __next_viewport_boundary__[\\n\\s]"),RegExp("\\n\\s+at __next_outlet_boundary__[\\n\\s]"),RegExp("\\n\\s+at __next_instant_validation_boundary__[\\n\\s]");class rf extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class rg extends rf{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class rm extends rf{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class rb extends rf{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}(et=el||(el={})).Any="any",et.ApNortheast1="ap-northeast-1",et.ApNortheast2="ap-northeast-2",et.ApSouth1="ap-south-1",et.ApSoutheast1="ap-southeast-1",et.ApSoutheast2="ap-southeast-2",et.CaCentral1="ca-central-1",et.EuCentral1="eu-central-1",et.EuWest1="eu-west-1",et.EuWest2="eu-west-2",et.EuWest3="eu-west-3",et.SaEast1="sa-east-1",et.UsEast1="us-east-1",et.UsWest1="us-west-1",et.UsWest2="us-west-2";function ry(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)0>t.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}"function"==typeof SuppressedError&&SuppressedError;class rv{constructor(e,{headers:t={},customFetch:r,region:n=el.Any}={}){this.url=e,this.headers=t,this.region=n,this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){var t,r,n,s;return t=this,r=arguments,n=void 0,s=function*(e,t={}){var r;let n,s;try{let i,{headers:a,method:o,body:l,signal:u,timeout:c}=t,h={},{region:d}=t;d||(d=this.region);let p=new URL(`${this.url}/${e}`);d&&"any"!==d&&(h["x-region"]=d,p.searchParams.set("forceFunctionRegion",d)),l&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?"u">typeof Blob&&l instanceof Blob||l instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",i=l):"string"==typeof l?(h["Content-Type"]="text/plain",i=l):"u">typeof FormData&&l instanceof FormData?i=l:(h["Content-Type"]="application/json",i=JSON.stringify(l)):i=!l||"string"==typeof l||"u">typeof Blob&&l instanceof Blob||l instanceof ArrayBuffer||"u">typeof FormData&&l instanceof FormData?l:JSON.stringify(l);let f=u;c&&(s=new AbortController,n=setTimeout(()=>s.abort(),c),u?(f=s.signal,u.addEventListener("abort",()=>s.abort())):f=s.signal);let g=yield this.fetch(p.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:i,signal:f}).catch(e=>{throw new rg(e)}),m=g.headers.get("x-relay-error");if(m&&"true"===m)throw new rm(g);if(!g.ok)throw new rb(g);let b=(null!=(r=g.headers.get("Content-Type"))?r:"text/plain").split(";")[0].trim();return{data:"application/json"===b?yield g.json():"application/octet-stream"===b||"application/pdf"===b?yield g.blob():"text/event-stream"===b?g:"multipart/form-data"===b?yield g.formData():yield g.text(),error:null,response:g}}catch(e){return{data:null,error:e,response:e instanceof rb||e instanceof rm?e.context:void 0}}finally{n&&clearTimeout(n)}},new(n||(n=Promise))(function(e,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(a,o)}l((s=s.apply(t,r||[])).next())})}}let rw=e=>Math.min(1e3*2**e,3e4),r_=[520,503],rE=["GET","HEAD","OPTIONS"];var rk=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function rS(e,t){return new Promise(r=>{if(null==t?void 0:t.aborted)return void r();let n=setTimeout(()=>{null==t||t.removeEventListener("abort",s),r()},e);function s(){clearTimeout(n),r()}null==t||t.addEventListener("abort",s)})}var rT=class{constructor(e){var t,r,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=null!=(t=e.shouldThrowOnError)&&t,this.signal=e.signal,this.isMaybeSingle=null!=(r=e.isMaybeSingle)&&r,this.shouldStripNulls=null!=(n=e.shouldStripNulls)&&n,this.urlLengthLimit=null!=(s=e.urlLengthLimit)?s:8e3,this.retryEnabled=null==(i=e.retry)||i,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if("text/csv"===this.headers.get("Accept"))throw Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){let e=this.headers.get("Accept");"application/vnd.pgrst.object+json"===e?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):e&&"application/json"!==e||this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let n=this.fetch,s=(async()=>{let e=0;for(;;){var t,s,i,a,o;let l,u=new Headers(r.headers);e>0&&u.set("X-Retry-Count",String(e));try{l=await n(r.url.toString(),{method:r.method,headers:u,body:JSON.stringify(r.body,(e,t)=>"bigint"==typeof t?t.toString():t),signal:r.signal})}catch(t){if((null==t?void 0:t.name)==="AbortError"||(null==t?void 0:t.code)==="ABORT_ERR"||!rE.includes(r.method))throw t;if(r.retryEnabled&&e<3){let t=rw(e);e++,await rS(t,r.signal);continue}throw t}if(t=r.method,s=l.status,i=e,r.retryEnabled&&!(i>=3)&&rE.includes(t)&&r_.includes(s)&&1){let t=null!=(a=null==(o=l.headers)?void 0:o.get("Retry-After"))?a:null,n=null!==t?1e3*Math.max(0,parseInt(t,10)||0):rw(e);await l.text(),e++,await rS(n,r.signal);continue}return await r.processResponse(l)}})();return this.shouldThrowOnError||(s=s.catch(e=>{var t,r,n,s,i,a;let o="",l="",u="",c=null==e?void 0:e.cause;if(c){let t=null!=(r=null==c?void 0:c.message)?r:"",a=null!=(n=null==c?void 0:c.code)?n:"";o=`${null!=(s=null==e?void 0:e.name)?s:"FetchError"}: ${null==e?void 0:e.message}
9
+ `)}}class f extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class g extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}let m="x-prerender-revalidate",b=".meta",y="x-next-cache-tags",v="x-next-revalidated-tags",w="_N_T_",_={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"};function E(e){var t,r,n,s,i,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,i=!1;l();)if(","===(r=e.charAt(o))){for(n=o,o+=1,l(),s=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(i=!0,o=s,a.push(e.substring(t,n)),t=o):o=n+1}else o+=1;(!i||o>=e.length)&&a.push(e.substring(t,e.length))}return a}function k(e){let t={},r=[];if(e)for(let[n,s]of e.entries())"set-cookie"===n.toLowerCase()?(r.push(...E(s)),t[n]=1===r.length?r[0]:r):t[n]=s;return t}function S(e){try{return String(new URL(String(e)))}catch(t){throw Object.defineProperty(Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t}),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}({..._,GROUP:{builtinReact:[_.reactServerComponents,_.actionBrowser],serverOnly:[_.reactServerComponents,_.actionBrowser,_.instrument,_.middleware],neutralTarget:[_.apiNode,_.apiEdge],clientOnly:[_.serverSideRendering,_.appPagesBrowser],bundled:[_.reactServerComponents,_.actionBrowser,_.serverSideRendering,_.appPagesBrowser,_.shared,_.instrument,_.middleware],appPages:[_.reactServerComponents,_.serverSideRendering,_.appPagesBrowser,_.actionBrowser]}});let T=Symbol("response"),R=Symbol("passThrough"),O=Symbol("waitUntil");class x{constructor(e,t){this[R]=!1,this[O]=t?{kind:"external",function:t}:{kind:"internal",promises:[]}}respondWith(e){this[T]||(this[T]=Promise.resolve(e))}passThroughOnException(){this[R]=!0}waitUntil(e){if("external"===this[O].kind)return(0,this[O].function)(e);this[O].promises.push(e)}}class C extends x{constructor(e){var t;super(e.request,null==(t=e.context)?void 0:t.waitUntil),this.sourcePage=e.page}get request(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}function P(e){return e.replace(/\/$/,"")||"/"}function A(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r<t);return n||t>-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}function I(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:s}=A(e);return`${t}${r}${n}${s}`}function j(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:s}=A(e);return`${r}${t}${n}${s}`}function N(e,t){if("string"!=typeof e)return!1;let{pathname:r}=A(e);return r===t||r.startsWith(t+"/")}let $=new WeakMap;function D(e,t){let r;if(!t)return{pathname:e};let n=$.get(t);n||(n=t.map(e=>e.toLowerCase()),$.set(t,n));let s=e.split("/",2);if(!s[1])return{pathname:e};let i=s[1].toLowerCase(),a=n.indexOf(i);return a<0?{pathname:e}:(r=t[a],{pathname:e=e.slice(r.length+1)||"/",detectedLocale:r})}let L=/^(?:127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)$/;function U(e,t){let r=new URL(String(e),t&&String(t));return L.test(r.hostname)&&(r.hostname="localhost"),r}let M=Symbol("NextURLInternal");class q{constructor(e,t,r){let n,s;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,s=r||{}):s=r||t||{},this[M]={url:U(e,n??s.base),options:s,basePath:""},this.analyze()}analyze(){var e,t,r,n,s;let i=function(e,t){let{basePath:r,i18n:n,trailingSlash:s}=t.nextConfig??{},i={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):s};r&&N(i.pathname,r)&&(i.pathname=function(e,t){if(!N(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:`/${r}`}(i.pathname,r),i.basePath=r);let a=i.pathname;if(i.pathname.startsWith("/_next/data/")&&i.pathname.endsWith(".json")){let e=i.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/");i.buildId=e[0],a="index"!==e[1]?`/${e.slice(1).join("/")}`:"/",!0===t.parseData&&(i.pathname=a)}if(n){let e=t.i18nProvider?t.i18nProvider.analyze(i.pathname):D(i.pathname,n.locales);i.locale=e.detectedLocale,i.pathname=e.pathname??i.pathname,!e.detectedLocale&&i.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(a):D(a,n.locales)).detectedLocale&&(i.locale=e.detectedLocale)}return i}(this[M].url.pathname,{nextConfig:this[M].options.nextConfig,parseData:!0,i18nProvider:this[M].options.i18nProvider}),a=function(e,t){let r;if(t?.host&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}(this[M].url,this[M].options.headers);this[M].domainLocale=this[M].options.i18nProvider?this[M].options.i18nProvider.detectDomainLocale(a):function(e,t,r){if(e){for(let n of(r&&(r=r.toLowerCase()),e))if(t===n.domain?.split(":",1)[0].toLowerCase()||r===n.defaultLocale.toLowerCase()||n.locales?.some(e=>e.toLowerCase()===r))return n}}(null==(t=this[M].options.nextConfig)||null==(e=t.i18n)?void 0:e.domains,a);let o=(null==(r=this[M].domainLocale)?void 0:r.defaultLocale)||(null==(s=this[M].options.nextConfig)||null==(n=s.i18n)?void 0:n.defaultLocale);this[M].url.pathname=i.pathname,this[M].defaultLocale=o,this[M].basePath=i.basePath??"",this[M].buildId=i.buildId,this[M].locale=i.locale??o,this[M].trailingSlash=i.trailingSlash}formatPathname(){var e;let t;return t=function(e,t,r,n){if(!t||t===r)return e;let s=e.toLowerCase();return!n&&(N(s,"/api")||N(s,`/${t.toLowerCase()}`))?e:I(e,`/${t}`)}((e={basePath:this[M].basePath,buildId:this[M].buildId,defaultLocale:this[M].options.forceLocale?void 0:this[M].defaultLocale,locale:this[M].locale,pathname:this[M].url.pathname,trailingSlash:this[M].trailingSlash}).pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix),(e.buildId||!e.trailingSlash)&&(t=P(t)),e.buildId&&(t=j(I(t,`/_next/data/${e.buildId}`),"/"===e.pathname?"index.json":".json")),t=I(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:j(t,"/"):P(t)}formatSearch(){return this[M].url.search}get buildId(){return this[M].buildId}set buildId(e){this[M].buildId=e}get locale(){return this[M].locale??""}set locale(e){var t,r;if(!this[M].locale||!(null==(r=this[M].options.nextConfig)||null==(t=r.i18n)?void 0:t.locales.includes(e)))throw Object.defineProperty(TypeError(`The NextURL configuration includes no locale "${e}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[M].locale=e}get defaultLocale(){return this[M].defaultLocale}get domainLocale(){return this[M].domainLocale}get searchParams(){return this[M].url.searchParams}get host(){return this[M].url.host}set host(e){this[M].url.host=e}get hostname(){return this[M].url.hostname}set hostname(e){this[M].url.hostname=e}get port(){return this[M].url.port}set port(e){this[M].url.port=e}get protocol(){return this[M].url.protocol}set protocol(e){this[M].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[M].url=U(e),this.analyze()}get origin(){return this[M].url.origin}get pathname(){return this[M].url.pathname}set pathname(e){this[M].url.pathname=e}get hash(){return this[M].url.hash}set hash(e){this[M].url.hash=e}get search(){return this[M].url.search}set search(e){this[M].url.search=e}get password(){return this[M].url.password}set password(e){this[M].url.password=e}get username(){return this[M].url.username}set username(e){this[M].url.username=e}get basePath(){return this[M].basePath}set basePath(e){this[M].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new q(String(this),this[M].options)}}var B,H,F,V,W,G,z,K,J,X,Y,Q,Z,ee,et,er,en,es,ei,ea,eo,el,eu,ec,eh,ed,ep,ef=e.i(5701);let eg=Symbol("internal request");class em extends Request{constructor(e,t={}){const r="string"!=typeof e&&"url"in e?e.url:String(e);S(r),e instanceof Request?super(e,t):super(r,t);const n=new q(r,{headers:k(this.headers),nextConfig:t.nextConfig});this[eg]={cookies:new ef.RequestCookies(this.headers),nextUrl:n,url:n.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[eg].cookies}get nextUrl(){return this[eg].nextUrl}get page(){throw new f}get ua(){throw new g}get url(){return this[eg].url}}class eb{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}let ey=Symbol("internal response"),ev=new Set([301,302,303,307,308]);function ew(e,t){var r;if(null==e||null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});let r=[];for(let[n,s]of e.request.headers)t.set("x-middleware-request-"+n,s),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class e_ extends Response{constructor(e,t={}){super(e,t);const r=this.headers,n=new Proxy(new ef.ResponseCookies(r),{get(e,n,s){switch(n){case"delete":case"set":return(...s)=>{let i=Reflect.apply(e[n],e,s),a=new Headers(r);return i instanceof ef.ResponseCookies&&r.set("x-middleware-set-cookie",i.getAll().map(e=>(0,ef.stringifyCookie)(e)).join(",")),ew(t,a),i};default:return eb.get(e,n,s)}}});this[ey]={cookies:n,url:t.url?new q(t.url,{headers:k(r),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[ey].cookies}static json(e,t){let r=Response.json(e,t);return new e_(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!ev.has(r))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});let n="object"==typeof t?t:{},s=new Headers(null==n?void 0:n.headers);return s.set("Location",S(e)),new e_(null,{...n,headers:s,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",S(e)),ew(t,r),new e_(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),ew(e,t),new e_(null,{...e,headers:t})}}function eE(e,t){let r="string"==typeof t?new URL(t):t,n=new URL(e,t),s=n.origin===r.origin;return{url:s?n.toString().slice(r.origin.length):n.toString(),isRelative:s}}let ek="next-router-prefetch",eS=["rsc","next-router-state-tree",ek,"next-hmr-refresh","next-router-segment-prefetch"],eT="_rsc";function eR(e){return e.startsWith("/")?e:`/${e}`}function eO(e){return eR(e.split("/").reduce((e,t,r,n)=>t?"("===t[0]&&t.endsWith(")")||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:`${e}/${t}`:e,""))}class ex extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new ex}}class eC extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,n){if("symbol"==typeof r)return eb.get(t,r,n);let s=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===s);if(void 0!==i)return eb.get(t,i,n)},set(t,r,n,s){if("symbol"==typeof r)return eb.set(t,r,n,s);let i=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===i);return eb.set(t,a??r,n,s)},has(t,r){if("symbol"==typeof r)return eb.has(t,r);let n=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0!==s&&eb.has(t,s)},deleteProperty(t,r){if("symbol"==typeof r)return eb.deleteProperty(t,r);let n=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0===s||eb.deleteProperty(t,s)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return ex.callable;default:return eb.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new eC(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}let eP=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class eA{disable(){throw eP}getStore(){}run(){throw eP}exit(){throw eP}enterWith(){throw eP}static bind(e){return e}}let eI="u">typeof globalThis&&globalThis.AsyncLocalStorage;function ej(){return eI?new eI:new eA}let eN=ej();class e$ extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new e$}}class eD{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return e$.callable;default:return eb.get(e,t,r)}}})}}let eL=Symbol.for("next.mutated.cookies");class eU{static wrap(e,t){let r=new ef.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let n=[],s=new Set,i=()=>{let e=eN.getStore();if(e&&(e.pathWasRevalidated=1),n=r.getAll().filter(e=>s.has(e.name)),t){let e=[];for(let t of n){let r=new ef.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}},a=new Proxy(r,{get(e,t,r){switch(t){case eL:return n;case"delete":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.delete(...t),a}finally{i()}};case"set":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t),a}finally{i()}};default:return eb.get(e,t,r)}}});return a}}function eM(e,t){if("action"!==e.phase)throw new e$}var eq=((B=eq||{}).handleRequest="BaseServer.handleRequest",B.run="BaseServer.run",B.pipe="BaseServer.pipe",B.getStaticHTML="BaseServer.getStaticHTML",B.render="BaseServer.render",B.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",B.renderToResponse="BaseServer.renderToResponse",B.renderToHTML="BaseServer.renderToHTML",B.renderError="BaseServer.renderError",B.renderErrorToResponse="BaseServer.renderErrorToResponse",B.renderErrorToHTML="BaseServer.renderErrorToHTML",B.render404="BaseServer.render404",B),eB=((H=eB||{}).loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",H.loadComponents="LoadComponents.loadComponents",H),eH=((F=eH||{}).getRequestHandler="NextServer.getRequestHandler",F.getRequestHandlerWithMetadata="NextServer.getRequestHandlerWithMetadata",F.getServer="NextServer.getServer",F.getServerRequestHandler="NextServer.getServerRequestHandler",F.createServer="createServer.createServer",F),eF=((V=eF||{}).compression="NextNodeServer.compression",V.getBuildId="NextNodeServer.getBuildId",V.createComponentTree="NextNodeServer.createComponentTree",V.clientComponentLoading="NextNodeServer.clientComponentLoading",V.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",V.generateStaticRoutes="NextNodeServer.generateStaticRoutes",V.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",V.generatePublicRoutes="NextNodeServer.generatePublicRoutes",V.generateImageRoutes="NextNodeServer.generateImageRoutes.route",V.sendRenderResult="NextNodeServer.sendRenderResult",V.proxyRequest="NextNodeServer.proxyRequest",V.runApi="NextNodeServer.runApi",V.render="NextNodeServer.render",V.renderHTML="NextNodeServer.renderHTML",V.imageOptimizer="NextNodeServer.imageOptimizer",V.getPagePath="NextNodeServer.getPagePath",V.getRoutesManifest="NextNodeServer.getRoutesManifest",V.findPageComponents="NextNodeServer.findPageComponents",V.getFontManifest="NextNodeServer.getFontManifest",V.getServerComponentManifest="NextNodeServer.getServerComponentManifest",V.getRequestHandler="NextNodeServer.getRequestHandler",V.renderToHTML="NextNodeServer.renderToHTML",V.renderError="NextNodeServer.renderError",V.renderErrorToHTML="NextNodeServer.renderErrorToHTML",V.render404="NextNodeServer.render404",V.startResponse="NextNodeServer.startResponse",V.route="route",V.onProxyReq="onProxyReq",V.apiResolver="apiResolver",V.internalFetch="internalFetch",V),eV=((W=eV||{}).startServer="startServer.startServer",W),eW=((G=eW||{}).getServerSideProps="Render.getServerSideProps",G.getStaticProps="Render.getStaticProps",G.renderToString="Render.renderToString",G.renderDocument="Render.renderDocument",G.createBodyResult="Render.createBodyResult",G),eG=((z=eG||{}).renderToString="AppRender.renderToString",z.renderToReadableStream="AppRender.renderToReadableStream",z.getBodyResult="AppRender.getBodyResult",z.fetch="AppRender.fetch",z),ez=((K=ez||{}).executeRoute="Router.executeRoute",K),eK=((J=eK||{}).runHandler="Node.runHandler",J),eJ=((X=eJ||{}).runHandler="AppRouteRouteHandlers.runHandler",X),eX=((Y=eX||{}).generateMetadata="ResolveMetadata.generateMetadata",Y.generateViewport="ResolveMetadata.generateViewport",Y),eY=((Q=eY||{}).execute="Middleware.execute",Q);let eQ=new Set(["Middleware.execute","BaseServer.handleRequest","Render.getServerSideProps","Render.getStaticProps","AppRender.fetch","AppRender.getBodyResult","Render.renderDocument","Node.runHandler","AppRouteRouteHandlers.runHandler","ResolveMetadata.generateMetadata","ResolveMetadata.generateViewport","NextNodeServer.createComponentTree","NextNodeServer.findPageComponents","NextNodeServer.getLayoutOrPageModule","NextNodeServer.startResponse","NextNodeServer.clientComponentLoading"]),eZ=new Set(["NextNodeServer.findPageComponents","NextNodeServer.createComponentTree","NextNodeServer.clientComponentLoading"]);function e0(e){return null!==e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then}let e1=process.env.NEXT_OTEL_PERFORMANCE_PREFIX,{context:e2,propagation:e4,trace:e3,SpanStatusCode:e6,SpanKind:e5,ROOT_CONTEXT:e9}=t=e.r(42856);class e8 extends Error{constructor(e,t){super(),this.bubble=e,this.result=t}}let e7=(e,t)=>{"object"==typeof t&&null!==t&&t instanceof e8&&t.bubble?e.setAttribute("next.bubble",!0):(t&&(e.recordException(t),e.setAttribute("error.type",t.name)),e.setStatus({code:e6.ERROR,message:null==t?void 0:t.message})),e.end()},te=new Map,tt=t.createContextKey("next.rootSpanId"),tr=0,tn={set(e,t,r){e.push({key:t,value:r})}},ts=(i=new class e{getTracerInstance(){return e3.getTracer("next.js","0.0.1")}getContext(){return e2}getTracePropagationData(){let e=e2.active(),t=[];return e4.inject(e,t,tn),t}getActiveScopeSpan(){return e3.getSpan(null==e2?void 0:e2.active())}withPropagatedContext(e,t,r,n=!1){let s=e2.active();if(n){let n=e4.extract(e9,e,r);if(e3.getSpanContext(n))return e2.with(n,t);let i=e4.extract(s,e,r);return e2.with(i,t)}if(e3.getSpanContext(s))return t();let i=e4.extract(s,e,r);return e2.with(i,t)}trace(...e){let[t,r,n]=e,{fn:s,options:i}="function"==typeof r?{fn:r,options:{}}:{fn:n,options:{...r}},a=i.spanName??t;if(!eQ.has(t)&&"1"!==process.env.NEXT_OTEL_VERBOSE||i.hideSpan)return s();let o=this.getSpanContext((null==i?void 0:i.parentSpan)??this.getActiveScopeSpan());o||(o=(null==e2?void 0:e2.active())??e9);let l=o.getValue(tt),u="number"!=typeof l||!te.has(l),c=tr++;return i.attributes={"next.span_name":a,"next.span_type":t,...i.attributes},e2.with(o.setValue(tt,c),()=>this.getTracerInstance().startActiveSpan(a,i,e=>{let r;e1&&t&&eZ.has(t)&&(r="performance"in globalThis&&"measure"in performance?globalThis.performance.now():void 0);let n=!1,a=()=>{!n&&(n=!0,te.delete(c),r&&performance.measure(`${e1}:next-${(t.split(".").pop()||"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}`,{start:r,end:performance.now()}))};if(u&&te.set(c,new Map(Object.entries(i.attributes??{}))),s.length>1)try{return s(e,t=>e7(e,t))}catch(t){throw e7(e,t),t}finally{a()}try{let t=s(e);if(e0(t))return t.then(t=>(e.end(),t)).catch(t=>{throw e7(e,t),t}).finally(a);return e.end(),a(),t}catch(t){throw e7(e,t),a(),t}}))}wrap(...e){let t=this,[r,n,s]=3===e.length?e:[e[0],{},e[1]];return eQ.has(r)||"1"===process.env.NEXT_OTEL_VERBOSE?function(){let e=n;"function"==typeof e&&"function"==typeof s&&(e=e.apply(this,arguments));let i=arguments.length-1,a=arguments[i];if("function"!=typeof a)return t.trace(r,e,()=>s.apply(this,arguments));{let n=t.getContext().bind(e2.active(),a);return t.trace(r,e,(e,t)=>(arguments[i]=function(e){return null==t||t(e),n.apply(this,arguments)},s.apply(this,arguments)))}}:s}startSpan(...e){let[t,r]=e,n=this.getSpanContext((null==r?void 0:r.parentSpan)??this.getActiveScopeSpan());return this.getTracerInstance().startSpan(t,r,n)}getSpanContext(e){return e?e3.setSpan(e2.active(),e):void 0}getRootSpanAttributes(){let e=e2.active().getValue(tt);return te.get(e)}setRootSpanAttribute(e,t){let r=e2.active().getValue(tt),n=te.get(r);n&&!n.has(e)&&n.set(e,t)}withSpan(e,t){let r=e3.setSpan(e2.active(),e);return e2.with(r,t)}},()=>i),ti="__prerender_bypass";Symbol("__next_preview_data"),Symbol(ti);class ta{constructor(e,t,r,n){var s;const i=e&&function(e,t){let r=eC.from(e.headers);return{isOnDemandRevalidate:r.get(m)===t.previewModeId,revalidateOnlyGenerated:r.has("x-prerender-revalidate-if-generated")}}(t,e).isOnDemandRevalidate,a=null==(s=r.get(ti))?void 0:s.value;this._isEnabled=!!(!i&&a&&e&&a===e.previewModeId),this._previewModeId=null==e?void 0:e.previewModeId,this._mutableCookies=n}get isEnabled(){return this._isEnabled}enable(){if(!this._previewModeId)throw Object.defineProperty(Error("Invariant: previewProps missing previewModeId this should never happen"),"__NEXT_ERROR_CODE",{value:"E93",enumerable:!1,configurable:!0});this._mutableCookies.set({name:ti,value:this._previewModeId,httpOnly:!0,sameSite:"none",secure:!0,path:"/"}),this._isEnabled=!0}disable(){this._mutableCookies.set({name:ti,value:"",httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:new Date(0)}),this._isEnabled=!1}}function to(e,t){if("x-middleware-set-cookie"in e.headers&&"string"==typeof e.headers["x-middleware-set-cookie"]){let r=e.headers["x-middleware-set-cookie"],n=new Headers;for(let e of E(r))n.append("set-cookie",e);for(let e of new ef.ResponseCookies(n).getAll())t.set(e)}}let tl=ej();function tu(e){switch(e.type){case"prerender":case"prerender-runtime":case"prerender-ppr":case"prerender-client":case"validation-client":return e.prerenderResumeDataCache;case"request":if(e.prerenderResumeDataCache)return e.prerenderResumeDataCache;case"prerender-legacy":case"cache":case"private-cache":case"unstable-cache":case"generate-static-params":return null;default:return e}}var tc=e.i(10636);class th extends Error{constructor(e,t){super(`Invariant: ${e.endsWith(".")?e:e+"."} This is a bug in Next.js.`,t),this.name="InvariantError"}}var td=e.i(51615);process.env.NEXT_PRIVATE_DEBUG_CACHE,Symbol.for("@next/cache-handlers");let tp=Symbol.for("@next/cache-handlers-map"),tf=Symbol.for("@next/cache-handlers-set"),tg=globalThis;function tm(){if(tg[tp])return tg[tp].entries()}async function tb(e,t){if(!e)return t();let r=ty(e);try{return await t()}finally{var n,s,i,a;let t,o,l,u,c=(n=r,s=ty(e),t=new Set(n.pendingRevalidatedTags.map(e=>{let t="object"==typeof e.profile?JSON.stringify(e.profile):e.profile||"";return`${e.tag}:${t}`})),o=new Set(n.pendingRevalidateWrites),{pendingRevalidatedTags:s.pendingRevalidatedTags.filter(e=>{let r="object"==typeof e.profile?JSON.stringify(e.profile):e.profile||"";return!t.has(`${e.tag}:${r}`)}),pendingRevalidates:Object.fromEntries(Object.entries(s.pendingRevalidates).filter(([e])=>!(e in n.pendingRevalidates))),pendingRevalidateWrites:s.pendingRevalidateWrites.filter(e=>!o.has(e))});await (i=e,l=[],(u=(null==(a=c)?void 0:a.pendingRevalidatedTags)??i.pendingRevalidatedTags??[]).length>0&&l.push(tv(u,i.incrementalCache,i)),l.push(...Object.values((null==a?void 0:a.pendingRevalidates)??i.pendingRevalidates??{})),l.push(...(null==a?void 0:a.pendingRevalidateWrites)??i.pendingRevalidateWrites??[]),0!==l.length&&Promise.all(l).then(()=>void 0))}}function ty(e){return{pendingRevalidatedTags:e.pendingRevalidatedTags?[...e.pendingRevalidatedTags]:[],pendingRevalidates:{...e.pendingRevalidates},pendingRevalidateWrites:e.pendingRevalidateWrites?[...e.pendingRevalidateWrites]:[]}}async function tv(e,t,r){if(0===e.length)return;let n=function(){if(tg[tf])return tg[tf].values()}(),s=[],i=new Map;for(let t of e){let e,r=t.profile;for(let[t]of i)if("string"==typeof t&&"string"==typeof r&&t===r||"object"==typeof t&&"object"==typeof r&&JSON.stringify(t)===JSON.stringify(r)||t===r){e=t;break}let n=e||r;i.has(n)||i.set(n,[]),i.get(n).push(t.tag)}for(let[e,o]of i){let i;if(e){let t;if("object"==typeof e)t=e;else if("string"==typeof e){var a;if(!(t=null==r||null==(a=r.cacheLifeProfiles)?void 0:a[e]))throw Object.defineProperty(Error(`Invalid profile provided "${e}" must be configured under cacheLife in next.config or be "max"`),"__NEXT_ERROR_CODE",{value:"E873",enumerable:!1,configurable:!0})}t&&(i={expire:t.expire})}for(let t of n||[])e?s.push(null==t.updateTags?void 0:t.updateTags.call(t,o,i)):s.push(null==t.updateTags?void 0:t.updateTags.call(t,o));t&&s.push(t.revalidateTag(o,i))}await Promise.all(s)}let tw=ej();class t_{constructor({waitUntil:e,onClose:t,onTaskError:r}){this.workUnitStores=new Set,this.waitUntil=e,this.onClose=t,this.onTaskError=r,this.callbackQueue=new tc.default,this.callbackQueue.pause()}after(e){if(e0(e))this.waitUntil||tE(),this.waitUntil(e.catch(e=>this.reportTaskError("promise",e)));else if("function"==typeof e)this.addCallback(e);else throw Object.defineProperty(Error("`after()`: Argument must be a promise or a function"),"__NEXT_ERROR_CODE",{value:"E50",enumerable:!1,configurable:!0})}addCallback(e){var t;this.waitUntil||tE();let r=tl.getStore();r&&this.workUnitStores.add(r);let n=tw.getStore(),s=n?n.rootTaskSpawnPhase:null==r?void 0:r.phase;this.runCallbacksOnClosePromise||(this.runCallbacksOnClosePromise=this.runCallbacksOnClose(),this.waitUntil(this.runCallbacksOnClosePromise));let i=(t=async()=>{try{await tw.run({rootTaskSpawnPhase:s},()=>e())}catch(e){this.reportTaskError("function",e)}},eI?eI.bind(t):eA.bind(t));this.callbackQueue.add(i)}async runCallbacksOnClose(){return await new Promise(e=>this.onClose(e)),this.runCallbacks()}async runCallbacks(){if(0===this.callbackQueue.size)return;for(let e of this.workUnitStores)e.phase="after";let e=eN.getStore();if(!e)throw Object.defineProperty(new th("Missing workStore in AfterContext.runCallbacks"),"__NEXT_ERROR_CODE",{value:"E547",enumerable:!1,configurable:!0});return tb(e,()=>(this.callbackQueue.start(),this.callbackQueue.onIdle()))}reportTaskError(e,t){if(console.error("promise"===e?"A promise passed to `after()` rejected:":"An error occurred in a function passed to `after()`:",t),this.onTaskError)try{null==this.onTaskError||this.onTaskError.call(this,t)}catch(e){console.error(Object.defineProperty(new th("`onTaskError` threw while handling an error thrown from an `after` task",{cause:e}),"__NEXT_ERROR_CODE",{value:"E569",enumerable:!1,configurable:!0}))}}}function tE(){throw Object.defineProperty(Error("`after()` will not work correctly, because `waitUntil` is not available in the current environment."),"__NEXT_ERROR_CODE",{value:"E91",enumerable:!1,configurable:!0})}function tk(e){let t,r={then:(n,s)=>(t||(t=Promise.resolve(e())),t.then(e=>{r.value=e}).catch(()=>{}),t.then(n,s))};return r}class tS{onClose(e){if(this.isClosed)throw Object.defineProperty(Error("Cannot subscribe to a closed CloseController"),"__NEXT_ERROR_CODE",{value:"E365",enumerable:!1,configurable:!0});this.target.addEventListener("close",e),this.listeners++}dispatchClose(){if(this.isClosed)throw Object.defineProperty(Error("Cannot close a CloseController multiple times"),"__NEXT_ERROR_CODE",{value:"E229",enumerable:!1,configurable:!0});this.listeners>0&&this.target.dispatchEvent(new Event("close")),this.isClosed=!0}constructor(){this.target=new EventTarget,this.listeners=0,this.isClosed=!1}}function tT(){return{previewModeId:process.env.__NEXT_PREVIEW_MODE_ID||"",previewModeSigningKey:process.env.__NEXT_PREVIEW_MODE_SIGNING_KEY||"",previewModeEncryptionKey:process.env.__NEXT_PREVIEW_MODE_ENCRYPTION_KEY||""}}let tR=Symbol.for("@next/request-context");async function tO(e,t,r){let n=new Set;for(let t of(e=>{let t=["/layout"];if(e.startsWith("/")){let r=e.split("/");for(let e=1;e<r.length+1;e++){let n=r.slice(0,e).join("/");n&&(n.endsWith("/page")||n.endsWith("/route")||(n=`${n}${!n.endsWith("/")?"/":""}layout`),t.push(n))}}return t})(e))t=`${w}${t}`,n.add(t);if(t&&(!r||0===r.size)){let e=`${w}${t}`;n.add(e)}n.has(`${w}/`)&&n.add(`${w}/index`),n.has(`${w}/index`)&&n.add(`${w}/`);let s=Array.from(n);return{tags:s,expirationsByCacheKind:function(e){let t=new Map,r=tm();if(r)for(let[n,s]of r)"getExpiration"in s&&t.set(n,tk(async()=>s.getExpiration(e)));return t}(s)}}let tx=Symbol.for("NextInternalRequestMeta");class tC extends em{constructor(e){super(e.input,e.init),this.sourcePage=e.page}get request(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}waitUntil(){throw Object.defineProperty(new p({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}let tP={keys:e=>Array.from(e.keys()),get:(e,t)=>e.get(t)??void 0},tA=(e,t)=>ts().withPropagatedContext(e.headers,t,tP),tI=!1;async function tj(t){var r,n,s,i,a;let o,l,u,c,d;!function(){if(!tI&&(tI=!0,"true"===process.env.NEXT_PRIVATE_TEST_PROXY)){let{interceptTestApis:t,wrapRequestHandler:r}=e.r(47679);t(),tA=r(tA)}}(),await h();let p=void 0!==globalThis.__BUILD_MANIFEST;t.request.url=t.request.url.replace(/\.rsc($|\?)/,"$1");let f=t.bypassNextUrl?new URL(t.request.url):new q(t.request.url,{headers:t.request.headers,nextConfig:t.request.nextConfig});for(let e of[...f.searchParams.keys()]){let t=f.searchParams.getAll(e),r=function(e){for(let t of["nxtP","nxtI"])if(e!==t&&e.startsWith(t))return e.substring(t.length);return null}(e);if(r){for(let e of(f.searchParams.delete(r),t))f.searchParams.append(r,e);f.searchParams.delete(e)}}let g=process.env.__NEXT_BUILD_ID||"";"buildId"in f&&(g=f.buildId||"",f.buildId="");let m=function(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}(t.request.headers),b=m.has("x-nextjs-data"),y="1"===m.get("rsc");b&&"/index"===f.pathname&&(f.pathname="/");let v=new Map;if(!p)for(let e of eS){let t=m.get(e);null!==t&&(v.set(e,t),m.delete(e))}let w=f.searchParams.get(eT),_=new tC({page:t.page,input:((c=(u="string"==typeof f)?new URL(f):f).searchParams.delete(eT),u?c.toString():c).toString(),init:{body:t.request.body,headers:m,method:t.request.method,nextConfig:t.request.nextConfig,signal:t.request.signal}});t.request.requestMeta&&(a=t.request.requestMeta,_[tx]=a),b&&Object.defineProperty(_,"__isData",{enumerable:!1,value:!0}),!globalThis.__incrementalCacheShared&&t.IncrementalCache&&(globalThis.__incrementalCache=new t.IncrementalCache({CurCacheHandler:t.incrementalCacheHandler,minimalMode:!0,fetchCacheKeyPrefix:"",dev:!1,requestHeaders:t.request.headers,getPrerenderManifest:()=>({version:-1,routes:{},dynamicRoutes:{},notFoundRoutes:[],preview:tT()})}));let E=t.request.waitUntil??(null==(r=null==(d=globalThis[tR])?void 0:d.get())?void 0:r.waitUntil),k=new C({request:_,page:t.page,context:E?{waitUntil:E}:void 0});if((o=await tA(_,()=>{if("/middleware"===t.page||"/src/middleware"===t.page||"/proxy"===t.page||"/src/proxy"===t.page){let e=k.waitUntil.bind(k),r=new tS;return ts().trace(eY.execute,{spanName:`middleware ${_.method}`,attributes:{"http.target":_.nextUrl.pathname,"http.method":_.method}},async()=>{try{var n,s,i,a,o,u;let c=tT(),h=await tO("/",_.nextUrl.pathname,null),d=(o=_.nextUrl,u=e=>{l=e},function(e,t,r,n,s,i,a,o,l,u){function c(e){r&&r.setHeader("Set-Cookie",e)}let h={};return{type:"request",phase:e,implicitTags:i,url:{pathname:n.pathname,search:n.search??""},rootParams:s,get headers(){return h.headers||(h.headers=function(e){let t=eC.from(e);for(let e of eS)t.delete(e);return eC.seal(t)}(t.headers)),h.headers},get cookies(){if(!h.cookies){let e=new ef.RequestCookies(eC.from(t.headers));to(t,e),h.cookies=eD.seal(e)}return h.cookies},set cookies(value){h.cookies=value},get mutableCookies(){if(!h.mutableCookies){var d,p;let e,n=(d=t.headers,p=a||(r?c:void 0),e=new ef.RequestCookies(eC.from(d)),eU.wrap(e,p));to(t,n),h.mutableCookies=n}return h.mutableCookies},get userspaceMutableCookies(){if(!h.userspaceMutableCookies){var f;let e;f=this,h.userspaceMutableCookies=e=new Proxy(f.mutableCookies,{get(t,r,n){switch(r){case"delete":return function(...r){return eM(f,"cookies().delete"),t.delete(...r),e};case"set":return function(...r){return eM(f,"cookies().set"),t.set(...r),e};default:return eb.get(t,r,n)}}})}return h.userspaceMutableCookies},get draftMode(){return h.draftMode||(h.draftMode=new ta(o,t,this.cookies,this.mutableCookies)),h.draftMode},renderResumeDataCache:null,isHmrRefresh:l,serverComponentsHmrCache:u||globalThis.__serverComponentsHmrCache,fallbackParams:null}}("action",_,void 0,o,{},h,u,c,!1,void 0)),p=function({page:e,renderOpts:t,isPrefetchRequest:r,buildId:n,deploymentId:s,previouslyRevalidatedTags:i,nonce:a}){let o=!t.shouldWaitOnAllReady&&!t.supportsDynamicResponse&&!t.isDraftMode&&!t.isPossibleServerAction,l=o&&(!!process.env.NEXT_DEBUG_BUILD||"1"===process.env.NEXT_SSG_FETCH_METRICS),u={isStaticGeneration:o,page:e,route:eO(e),incrementalCache:t.incrementalCache||globalThis.__incrementalCache,cacheLifeProfiles:t.cacheLifeProfiles,isBuildTimePrerendering:t.isBuildTimePrerendering,fetchCache:t.fetchCache,isOnDemandRevalidate:t.isOnDemandRevalidate,isDraftMode:t.isDraftMode,isPrefetchRequest:r,buildId:n,deploymentId:s,reactLoadableManifest:(null==t?void 0:t.reactLoadableManifest)||{},assetPrefix:(null==t?void 0:t.assetPrefix)||"",nonce:a,afterContext:function(e){let{waitUntil:t,onClose:r,onAfterTaskError:n}=e;return new t_({waitUntil:t,onClose:r,onTaskError:n})}(t),cacheComponentsEnabled:t.cacheComponents,previouslyRevalidatedTags:i,refreshTagsByCacheKind:function(){let e=new Map,t=tm();if(t)for(let[r,n]of t)"refreshTags"in n&&e.set(r,tk(async()=>n.refreshTags()));return e}(),runInCleanSnapshot:eI?eI.snapshot():function(e,...t){return e(...t)},shouldTrackFetchMetrics:l,reactServerErrorsByDigest:new Map};return t.store=u,u}({page:"/",renderOpts:{cacheLifeProfiles:null==(s=t.request.nextConfig)||null==(n=s.experimental)?void 0:n.cacheLife,cacheComponents:!1,experimental:{isRoutePPREnabled:!1,authInterrupts:!!(null==(a=t.request.nextConfig)||null==(i=a.experimental)?void 0:i.authInterrupts)},supportsDynamicResponse:!0,waitUntil:e,onClose:r.onClose.bind(r),onAfterTaskError:void 0},isPrefetchRequest:"1"===_.headers.get(ek),buildId:g??"",deploymentId:!1??"",previouslyRevalidatedTags:[]});return await eN.run(p,()=>tl.run(d,t.handler,_,k))}finally{setTimeout(()=>{r.dispatchClose()},0)}})}return t.handler(_,k)}))&&!(o instanceof Response))throw Object.defineProperty(TypeError("Expected an instance of Response to be returned"),"__NEXT_ERROR_CODE",{value:"E567",enumerable:!1,configurable:!0});o&&l&&o.headers.set("set-cookie",l);let S=null==o?void 0:o.headers.get("x-middleware-rewrite");if(o&&S&&(y||!p)){let e=new q(S,{forceLocale:!0,headers:t.request.headers,nextConfig:t.request.nextConfig});p||e.host!==_.nextUrl.host||(e.buildId=g||e.buildId,o.headers.set("x-middleware-rewrite",String(e)));let{url:r,isRelative:a}=eE(e.toString(),f.toString());!p&&b&&o.headers.set("x-nextjs-rewrite",r);let l=!a&&(null==(i=t.request.nextConfig)||null==(s=i.experimental)||null==(n=s.clientParamParsingOrigins)?void 0:n.some(t=>new RegExp(t).test(e.origin)));y&&(a||l)&&(f.pathname!==e.pathname&&o.headers.set("x-nextjs-rewritten-path",e.pathname),f.search!==e.search&&o.headers.set("x-nextjs-rewritten-query",e.search.slice(1)))}if(o&&S&&y&&w){let e=new URL(S);e.searchParams.has(eT)||(e.searchParams.set(eT,w),o.headers.set("x-middleware-rewrite",e.toString()))}let T=null==o?void 0:o.headers.get("Location");if(o&&T&&!p){let e=new q(T,{forceLocale:!1,headers:t.request.headers,nextConfig:t.request.nextConfig});o=new Response(o.body,o),e.host===f.host&&(e.buildId=g||e.buildId,o.headers.set("Location",eE(e,f).url)),b&&(o.headers.delete("Location"),o.headers.set("x-nextjs-redirect",eE(e.toString(),f.toString()).url))}let R=o||e_.next(),x=R.headers.get("x-middleware-override-headers"),P=[];if(x){for(let[e,t]of v)R.headers.set(`x-middleware-request-${e}`,t),P.push(e);P.length>0&&R.headers.set("x-middleware-override-headers",x+","+P.join(","))}return{response:R,waitUntil:("internal"===k[O].kind?Promise.all(k[O].promises).then(()=>{}):void 0)??Promise.resolve(),fetchMetrics:_.fetchMetrics}}class tN{constructor(){let e,t;this.promise=new Promise((r,n)=>{e=r,t=n}),this.resolve=e,this.reject=t}}class t${constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class tD{constructor(){this.prev=null,this.next=null}}class tL{constructor(e,t,r){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.onEvict=r,this.head=new tD,this.tail=new tD,this.head.next=this.tail,this.tail.prev=this.head}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){let e=this.tail.prev;return this.removeNode(e),e}set(e,t){let r=(null==this.calculateSize?void 0:this.calculateSize.call(this,t))??1;if(r<=0)throw Object.defineProperty(Error(`LRUCache: calculateSize returned ${r}, but size must be > 0. Items with size 0 would never be evicted, causing unbounded cache growth.`),"__NEXT_ERROR_CODE",{value:"E1045",enumerable:!1,configurable:!0});if(r>this.maxSize)return console.warn("Single item size exceeds maxSize"),!1;let n=this.cache.get(e);if(n)n.data=t,this.totalSize=this.totalSize-n.size+r,n.size=r,this.moveToHead(n);else{let n=new t$(e,t,r);this.cache.set(e,n),this.addToHead(n),this.totalSize+=r}for(;this.totalSize>this.maxSize&&this.cache.size>0;){let e=this.removeTail();this.cache.delete(e.key),this.totalSize-=e.size,null==this.onEvict||this.onEvict.call(this,e.key,e.data)}return!0}has(e){return this.cache.has(e)}get(e){let t=this.cache.get(e);if(t)return this.moveToHead(t),t.data}*[Symbol.iterator](){let e=this.head.next;for(;e&&e!==this.tail;){let t=e;yield[t.key,t.data],e=e.next}}remove(e){let t=this.cache.get(e);t&&(this.removeNode(t),this.cache.delete(e),this.totalSize-=t.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}let{env:tU,stdout:tM}=(null==(eo=globalThis)?void 0:eo.process)??{},tq=tU&&!tU.NO_COLOR&&(tU.FORCE_COLOR||(null==tM?void 0:tM.isTTY)&&!tU.CI&&"dumb"!==tU.TERM),tB=(e,t,r,n)=>{let s=e.substring(0,n)+r,i=e.substring(n+t.length),a=i.indexOf(t);return~a?s+tB(i,t,r,a):s+i},tH=(e,t,r=e)=>tq?n=>{let s=""+n,i=s.indexOf(t,e.length);return~i?e+tB(s,t,r,i)+t:e+s+t}:String,tF=tH("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m");tH("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),tH("\x1b[3m","\x1b[23m"),tH("\x1b[4m","\x1b[24m"),tH("\x1b[7m","\x1b[27m"),tH("\x1b[8m","\x1b[28m"),tH("\x1b[9m","\x1b[29m"),tH("\x1b[30m","\x1b[39m");let tV=tH("\x1b[31m","\x1b[39m"),tW=tH("\x1b[32m","\x1b[39m"),tG=tH("\x1b[33m","\x1b[39m");tH("\x1b[34m","\x1b[39m");let tz=tH("\x1b[35m","\x1b[39m");tH("\x1b[38;2;173;127;168m","\x1b[39m"),tH("\x1b[36m","\x1b[39m");let tK=tH("\x1b[37m","\x1b[39m");tH("\x1b[90m","\x1b[39m"),tH("\x1b[40m","\x1b[49m"),tH("\x1b[41m","\x1b[49m"),tH("\x1b[42m","\x1b[49m"),tH("\x1b[43m","\x1b[49m"),tH("\x1b[44m","\x1b[49m"),tH("\x1b[45m","\x1b[49m"),tH("\x1b[46m","\x1b[49m"),tH("\x1b[47m","\x1b[49m"),tK(tF("○")),tV(tF("⨯")),tG(tF("⚠")),tK(tF(" ")),tW(tF("✓")),tz(tF("»")),new tL(1e4,e=>e.length),new tL(1e4,e=>e.length);var tJ=((Z={}).APP_PAGE="APP_PAGE",Z.APP_ROUTE="APP_ROUTE",Z.PAGES="PAGES",Z.FETCH="FETCH",Z.REDIRECT="REDIRECT",Z.IMAGE="IMAGE",Z),tX=((ee={}).APP_PAGE="APP_PAGE",ee.APP_ROUTE="APP_ROUTE",ee.PAGES="PAGES",ee.FETCH="FETCH",ee.IMAGE="IMAGE",ee);function tY(){}new TextEncoder;let tQ=new TextEncoder;function tZ(e){return new ReadableStream({start(t){t.enqueue(tQ.encode(e)),t.close()}})}function t0(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}async function t1(e,t){let r=new TextDecoder("utf-8",{fatal:!0}),n="";for await(let s of e){if(null==t?void 0:t.aborted)return n;n+=r.decode(s,{stream:!0})}return n+r.decode()}let t2="ResponseAborted";class t4 extends Error{constructor(...e){super(...e),this.name=t2}}let t3=0,t6=0,t5=0;function t9(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===t2}async function t8(e,t,r){try{let n,{errored:s,destroyed:i}=t;if(s||i)return;let a=(n=new AbortController,t.once("close",()=>{t.writableFinished||n.abort(new t4)}),n),o=function(e,t){let r=!1,n=new tN;function s(){n.resolve()}e.on("drain",s),e.once("close",()=>{e.off("drain",s),n.resolve()});let i=new tN;return e.once("finish",()=>{i.resolve()}),new WritableStream({write:async t=>{if(!r){if(r=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let e=function(e={}){let t=0===t3?void 0:{clientComponentLoadStart:t3,clientComponentLoadTimes:t6,clientComponentLoadCount:t5};return e.reset&&(t3=0,t6=0,t5=0),t}();e&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:e.clientComponentLoadStart,end:e.clientComponentLoadStart+e.clientComponentLoadTimes})}e.flushHeaders(),ts().trace(eF.startResponse,{spanName:"start response"},()=>void 0)}try{let r=e.write(t);"flush"in e&&"function"==typeof e.flush&&e.flush(),r||(await n.promise,n=new tN)}catch(t){throw e.end(),Object.defineProperty(Error("failed to write chunk to response",{cause:t}),"__NEXT_ERROR_CODE",{value:"E321",enumerable:!1,configurable:!0})}},abort:t=>{e.writableFinished||e.destroy(t)},close:async()=>{if(t&&await t,!e.writableFinished)return e.end(),i.promise}})}(t,r);await e.pipeTo(o,{signal:a.signal})}catch(e){if(t9(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class t7{static #e=this.EMPTY=new t7(null,{metadata:{},contentType:null});static fromStatic(e,t){return new t7(e,{metadata:{},contentType:t})}constructor(e,{contentType:t,waitUntil:r,metadata:n}){this.response=e,this.contentType=t,this.metadata=n,this.waitUntil=r}assignMetadata(e){Object.assign(this.metadata,e)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(e=!1){if(null===this.response)return"";if("string"!=typeof this.response){if(!e)throw Object.defineProperty(new th("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return t1(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?tZ(this.response):td.Buffer.isBuffer(this.response)?t0(this.response):Array.isArray(this.response)?function(...e){if(0===e.length)return new ReadableStream({start(e){e.close()}});if(1===e.length)return e[0];let{readable:t,writable:r}=new TransformStream,n=e[0].pipeTo(r,{preventClose:!0}),s=1;for(;s<e.length-1;s++){let t=e[s];n=n.then(()=>t.pipeTo(r,{preventClose:!0}))}let i=e[s];return(n=n.then(()=>i.pipeTo(r))).catch(tY),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[tZ(this.response)]:Array.isArray(this.response)?this.response:td.Buffer.isBuffer(this.response)?[t0(this.response)]:[this.response]}pipeThrough(e){this.response=this.readable.pipeThrough(e)}unshift(e){this.response=this.coerce(),this.response.unshift(e)}push(e){this.response=this.coerce(),this.response.push(e)}async pipeTo(e){try{await this.readable.pipeTo(e,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await e.close()}catch(t){if(t9(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await t8(this.readable,e,this.waitUntil)}}function re(e,t){if(!e)return t;let r=parseInt(e,10);return Number.isFinite(r)&&r>0?r:t}re(process.env.NEXT_PRIVATE_RESPONSE_CACHE_TTL,1e4),re(process.env.NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE,150);var rt=e.i(15246);let rr=new Map,rn=(e,t)=>{for(let r of e){let e=rr.get(r),n=null==e?void 0:e.expired;if("number"==typeof n&&n<=Date.now()&&n>t)return!0}return!1},rs=(e,t)=>{for(let r of e){let e=rr.get(r),n=(null==e?void 0:e.stale)??0;if("number"==typeof n&&n>t)return!0}return!1};class ri{constructor(e){this.fs=e,this.tasks=[]}findOrCreateTask(e){for(let t of this.tasks)if(t[0]===e)return t;let t=this.fs.mkdir(e);t.catch(()=>{});let r=[e,t,[]];return this.tasks.push(r),r}append(e,t){let r=this.findOrCreateTask(rt.default.dirname(e)),n=r[1].then(()=>this.fs.writeFile(e,t));n.catch(()=>{}),r[2].push(n)}wait(){return Promise.all(this.tasks.flatMap(e=>e[2]))}}function ra(e){return(null==e?void 0:e.length)||0}class ro{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor(e){this.fs=e.fs,this.flushToDisk=e.flushToDisk,this.serverDistDir=e.serverDistDir,this.revalidatedTags=e.revalidatedTags,e.maxMemoryCacheSize?ro.memoryCache?ro.debug&&console.log("FileSystemCache: memory store already initialized"):(ro.debug&&console.log("FileSystemCache: using memory store for fetch cache"),ro.memoryCache=function(e){return r||(r=new tL(e,function({value:e}){var t,r;if(!e)return 25;if(e.kind===tJ.REDIRECT)return JSON.stringify(e.props).length;if(e.kind===tJ.IMAGE)throw Object.defineProperty(Error("invariant image should not be incremental-cache"),"__NEXT_ERROR_CODE",{value:"E501",enumerable:!1,configurable:!0});if(e.kind===tJ.FETCH)return JSON.stringify(e.data||"").length;if(e.kind===tJ.APP_ROUTE)return e.body.length;return e.kind===tJ.APP_PAGE?Math.max(1,e.html.length+ra(e.rscData)+((null==(r=e.postponed)?void 0:r.length)||0)+function(e){if(!e)return 0;let t=0;for(let[r,n]of e)t+=r.length+ra(n);return t}(e.segmentData)):e.html.length+((null==(t=JSON.stringify(e.pageData))?void 0:t.length)||0)})),r}(e.maxMemoryCacheSize)):ro.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(e,t){if(e="string"==typeof e?[e]:e,ro.debug&&console.log("FileSystemCache: revalidateTag",e,t),0===e.length)return;let r=Date.now();for(let n of e){let e=rr.get(n)||{};if(t){let s={...e};s.stale=r,void 0!==t.expire&&(s.expired=r+1e3*t.expire),rr.set(n,s)}else rr.set(n,{...e,expired:r})}}async get(...e){var t,r,n,s,i,a;let[o,l]=e,{kind:u}=l,c=null==(t=ro.memoryCache)?void 0:t.get(o);if(ro.debug&&(u===tX.FETCH?console.log("FileSystemCache: get",o,l.tags,u,!!c):console.log("FileSystemCache: get",o,u,!!c)),(null==c||null==(r=c.value)?void 0:r.kind)===tJ.APP_PAGE||(null==c||null==(n=c.value)?void 0:n.kind)===tJ.APP_ROUTE||(null==c||null==(s=c.value)?void 0:s.kind)===tJ.PAGES){let e=null==(a=c.value.headers)?void 0:a[y];if("string"==typeof e){let t=e.split(",");if(t.length>0&&rn(t,c.lastModified))return ro.debug&&console.log("FileSystemCache: expired tags",t),null}}else if((null==c||null==(i=c.value)?void 0:i.kind)===tJ.FETCH){let e=l.kind===tX.FETCH?[...l.tags||[],...l.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return ro.debug&&console.log("FileSystemCache: was revalidated",e),null;if(rn(e,c.lastModified))return ro.debug&&console.log("FileSystemCache: expired tags",e),null}return c??null}async set(e,t,r){var n;if(null==(n=ro.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),ro.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let s=new ri(this.fs);if(t.kind===tJ.APP_ROUTE){let r=this.getFilePath(`${e}.body`,tX.APP_ROUTE);s.append(r,t.body);let n={headers:t.headers,status:t.status,postponed:void 0,segmentPaths:void 0,prefetchHints:void 0};s.append(r.replace(/\.body$/,b),JSON.stringify(n,null,2))}else if(t.kind===tJ.PAGES||t.kind===tJ.APP_PAGE){let n=t.kind===tJ.APP_PAGE,i=this.getFilePath(`${e}.html`,n?tX.APP_PAGE:tX.PAGES);if(s.append(i,t.html),r.fetchCache||r.isFallback||r.isRoutePPREnabled||s.append(this.getFilePath(`${e}${n?".rsc":".json"}`,n?tX.APP_PAGE:tX.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===tJ.APP_PAGE){let e;if(t.segmentData){e=[];let r=i.replace(/\.html$/,".segments");for(let[n,i]of t.segmentData){e.push(n);let t=r+n+".segment.rsc";s.append(t,i)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e,prefetchHints:void 0};s.append(i.replace(/\.html$/,b),JSON.stringify(r))}}else if(t.kind===tJ.FETCH){let n=this.getFilePath(e,tX.FETCH);s.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await s.wait()}getFilePath(e,t){switch(t){case tX.FETCH:return rt.default.join(this.serverDistDir,"..","cache","fetch-cache",e);case tX.PAGES:return rt.default.join(this.serverDistDir,"pages",e);case tX.IMAGE:case tX.APP_PAGE:case tX.APP_ROUTE:return rt.default.join(this.serverDistDir,"app",e);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${t}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1,configurable:!0})}}}let rl=["(..)(..)","(.)","(..)","(...)"],ru=/\/[^/]*\[[^/]+\][^/]*(?=\/|$)/,rc=/\/\[[^/]+\](?=\/|$)/;function rh(e){return e.replace(/(?:\/index)?\/?$/,"")||"/"}class rd{static #e=this.cacheControls=new Map;constructor(e){this.prerenderManifest=e}get(e){let t=rd.cacheControls.get(e);if(t)return t;let r=this.prerenderManifest.routes[e];if(r){let{initialRevalidateSeconds:e,initialExpireSeconds:t}=r;if(void 0!==e)return{revalidate:e,expire:t}}let n=this.prerenderManifest.dynamicRoutes[e];if(n){let{fallbackRevalidate:e,fallbackExpire:t}=n;if(void 0!==e)return{revalidate:e,expire:t}}}set(e,t){rd.cacheControls.set(e,t)}clear(){rd.cacheControls.clear()}}e.i(63261);class rp{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:s,requestHeaders:i,maxMemoryCacheSize:a,getPrerenderManifest:o,fetchCacheKeyPrefix:l,CurCacheHandler:u,allowedRevalidateHeaderKeys:c}){var h,d,p,f;this.locks=new Map,this.hasCustomCacheHandler=!!u;const g=Symbol.for("@next/cache-handlers"),b=globalThis;if(u)rp.debug&&console.log("IncrementalCache: using custom cache handler",u.name);else{const t=b[g];(null==t?void 0:t.FetchCache)?(u=t.FetchCache,rp.debug&&console.log("IncrementalCache: using global FetchCache cache handler")):e&&s&&(rp.debug&&console.log("IncrementalCache: using filesystem cache handler"),u=ro)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(a=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=t,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=n,this.requestHeaders=i,this.allowedRevalidateHeaderKeys=c,this.prerenderManifest=o(),this.cacheControls=new rd(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];i[m]===(null==(d=this.prerenderManifest)||null==(h=d.preview)?void 0:h.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=this.revalidatedTags=function(e,t){return"string"==typeof e[v]&&e["x-next-revalidate-tag-token"]===t?e[v].split(","):[]}(i,null==(f=this.prerenderManifest)||null==(p=f.preview)?void 0:p.previewModeId)),u&&(this.cacheHandler=new u({dev:t,fs:e,flushToDisk:r,serverDistDir:s,revalidatedTags:y,maxMemoryCacheSize:a,_requestHeaders:i,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let s=this.cacheControls.get(rh(e)),i=s?s.revalidate:!n&&1;return"number"==typeof i?1e3*i+t:i}_getPathname(e,t){return t?e:/^\/index(\/|$)/.test(e)&&!function(e,t=!0){return(void 0!==e.split("/").find(e=>rl.find(t=>e.startsWith(t)))&&(e=function(e){let t,r,n;for(let s of e.split("/"))if(r=rl.find(e=>s.startsWith(e))){[t,n]=e.split(r,2);break}if(!t||!r||!n)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`),"__NEXT_ERROR_CODE",{value:"E269",enumerable:!1,configurable:!0});switch(t=eO(t),r){case"(.)":n="/"===t?`/${n}`:t+"/"+n;break;case"(..)":if("/"===t)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`),"__NEXT_ERROR_CODE",{value:"E207",enumerable:!1,configurable:!0});n=t.split("/").slice(0,-1).concat(n).join("/");break;case"(...)":n="/"+n;break;case"(..)(..)":let s=t.split("/");if(s.length<=2)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`),"__NEXT_ERROR_CODE",{value:"E486",enumerable:!1,configurable:!0});n=s.slice(0,-2).concat(n).join("/");break;default:throw Object.defineProperty(Error("Invariant: unexpected marker"),"__NEXT_ERROR_CODE",{value:"E112",enumerable:!1,configurable:!0})}return{interceptingRoute:t,interceptedRoute:n}}(e).interceptedRoute),t)?rc.test(e):ru.test(e)}(e)?`/index${e}`:"/"===e?"/index":eR(e)}resetRequestCache(){var e,t;null==(t=this.cacheHandler)||null==(e=t.resetRequestCache)||e.call(t)}async lock(e){for(;;){let t=this.locks.get(e);if(rp.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new tN;return rp.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e,t){var r;return null==(r=this.cacheHandler)?void 0:r.revalidateTag(e,t)}async generateCacheKey(e,t={}){let r=[],n=new TextEncoder,s=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)r.push(s.decode(t.body)),t._ogBody=t.body;else if("function"==typeof t.body.getReader){let e=t.body,i=[];try{await e.pipeTo(new WritableStream({write(e){"string"==typeof e?(i.push(n.encode(e)),r.push(e)):(i.push(e),r.push(s.decode(e,{stream:!0})))}})),r.push(s.decode());let a=i.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),l=0;for(let e of i)o.set(e,l),l+=e.length;t._ogBody=o}catch(e){console.error("Problem reading body",e)}}else if("function"==typeof t.body.keys){let e=t.body;for(let n of(t._ogBody=t.body,new Set([...e.keys()]))){let t=e.getAll(n);r.push(`${n}=${(await Promise.all(t.map(async e=>"string"==typeof e?e:await e.text()))).join(",")}`)}}else if("function"==typeof t.body.arrayBuffer){let e=t.body,n=await e.arrayBuffer();r.push(await e.text()),t._ogBody=new Blob([n],{type:e.type})}else"string"==typeof t.body&&(r.push(t.body),t._ogBody=t.body);let i="function"==typeof(t.headers||{}).keys?Object.fromEntries(t.headers):Object.assign({},t.headers);"traceparent"in i&&delete i.traceparent,"tracestate"in i&&delete i.tracestate;let a=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",e,t.method,i,t.mode,t.redirect,t.credentials,t.referrer,t.referrerPolicy,t.integrity,t.cache,r]);{var o;let e=n.encode(a);return o=await crypto.subtle.digest("SHA-256",e),Array.prototype.map.call(new Uint8Array(o),e=>e.toString(16).padStart(2,"0")).join("")}}async get(e,t){var r,n,s,i,a,o,l;let u,c;if(t.kind===tX.FETCH){let r=tl.getStore(),n=r?function(e){switch(e.type){case"request":case"prerender":case"prerender-runtime":case"prerender-client":case"validation-client":if(e.renderResumeDataCache)return e.renderResumeDataCache;case"prerender-ppr":return e.prerenderResumeDataCache??null;case"cache":case"private-cache":case"unstable-cache":case"prerender-legacy":case"generate-static-params":return null;default:return e}}(r):null;if(n){let r=n.fetch.get(e);if((null==r?void 0:r.kind)===tJ.FETCH){let n=eN.getStore();if(![...t.tags||[],...t.softTags||[]].some(e=>{var t,r;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==n||null==(r=n.pendingRevalidatedTags)?void 0:r.some(t=>t.tag===e))}))return rp.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:r};rp.debug&&console.log("IncrementalCache: rdc:revalidated-tag",e)}else rp.debug&&console.log("IncrementalCache: rdc:miss",e)}else rp.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==tX.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===tX.FETCH);let h=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===tX.FETCH){if(!h)return null;if((null==(s=h.value)?void 0:s.kind)!==tJ.FETCH)throw Object.defineProperty(new th(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(i=h.value)?void 0:i.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=eN.getStore(),n=[...t.tags||[],...t.softTags||[]];if(n.some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.some(t=>t.tag===e))}))return rp.debug&&console.log("IncrementalCache: expired tag",e),null;let a=tl.getStore();if(a){let t=tu(a);t&&(rp.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,h.value))}let o=t.revalidate||h.value.revalidate,l=(performance.timeOrigin+performance.now()-(h.lastModified||0))/1e3>o,u=h.value.data;return rn(n,h.lastModified)?null:(rs(n,h.lastModified)&&(l=!0),{isStale:l,value:{kind:tJ.FETCH,data:u,revalidate:o}})}if((null==h||null==(n=h.value)?void 0:n.kind)===tJ.FETCH)throw Object.defineProperty(new th(`Expected cached value for cache key ${JSON.stringify(e)} not to be a ${JSON.stringify(t.kind)} kind, got "FETCH" instead.`),"__NEXT_ERROR_CODE",{value:"E652",enumerable:!1,configurable:!0});let d=null,{isFallback:p}=t,f=this.cacheControls.get(rh(e));if((null==h?void 0:h.lastModified)===-1)u=-1,c=-31536e6;else{let r=performance.timeOrigin+performance.now(),n=(null==h?void 0:h.lastModified)||r;if(void 0===(u=!1!==(c=this.calculateRevalidate(e,n,this.dev??!1,t.isFallback))&&c<r||void 0)&&((null==h||null==(a=h.value)?void 0:a.kind)===tJ.APP_PAGE||(null==h||null==(o=h.value)?void 0:o.kind)===tJ.APP_ROUTE)){let e=null==(l=h.value.headers)?void 0:l[y];if("string"==typeof e){let t=e.split(",");t.length>0&&(rn(t,n)?u=-1:rs(t,n)&&(u=!0))}}}return h&&(d={isStale:u,cacheControl:f,revalidateAfter:c,value:h.value,isFallback:p}),!h&&this.prerenderManifest.notFoundRoutes.includes(e)&&(d={isStale:u,value:null,cacheControl:f,revalidateAfter:c,isFallback:p},this.set(e,d.value,{...t,cacheControl:f})),d}async set(e,t,r){if((null==t?void 0:t.kind)===tJ.FETCH){let r=tl.getStore(),n=r?tu(r):null;n&&(rp.debug&&console.log("IncrementalCache: rdc:set",e),n.fetch.set(e,t))}if(this.disableForTestmode||this.dev&&!r.fetchCache)return;e=this._getPathname(e,r.fetchCache);let n=JSON.stringify(t).length;if(r.fetchCache&&n>2097152&&!this.hasCustomCacheHandler&&!r.isImplicitBuildTimeCache){let t=`Failed to set Next.js data cache for ${r.fetchUrl||e}, items over 2MB can not be cached (${n} bytes)`;if(this.dev)throw Object.defineProperty(Error(t),"__NEXT_ERROR_CODE",{value:"E1003",enumerable:!1,configurable:!0});console.warn(t);return}try{var s;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(rh(e),r.cacheControl),await (null==(s=this.cacheHandler)?void 0:s.set(e,t,r))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}if(e.i(27645),e.i(29580).default.unstable_postpone,!1===("Route %%% needs to bail out of prerendering at this point because it used ^^^. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error".includes("needs to bail out of prerendering at this point because it used")&&"Route %%% needs to bail out of prerendering at this point because it used ^^^. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error".includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});RegExp("\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at __next_root_layout_boundary__ \\([^\\n]*\\)"),RegExp("\\n\\s+at __next_metadata_boundary__[\\n\\s]"),RegExp("\\n\\s+at __next_viewport_boundary__[\\n\\s]"),RegExp("\\n\\s+at __next_outlet_boundary__[\\n\\s]"),RegExp("\\n\\s+at __next_instant_validation_boundary__[\\n\\s]");class rf extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class rg extends rf{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class rm extends rf{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class rb extends rf{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}(et=el||(el={})).Any="any",et.ApNortheast1="ap-northeast-1",et.ApNortheast2="ap-northeast-2",et.ApSouth1="ap-south-1",et.ApSoutheast1="ap-southeast-1",et.ApSoutheast2="ap-southeast-2",et.CaCentral1="ca-central-1",et.EuCentral1="eu-central-1",et.EuWest1="eu-west-1",et.EuWest2="eu-west-2",et.EuWest3="eu-west-3",et.SaEast1="sa-east-1",et.UsEast1="us-east-1",et.UsWest1="us-west-1",et.UsWest2="us-west-2";function ry(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)0>t.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}"function"==typeof SuppressedError&&SuppressedError;class rv{constructor(e,{headers:t={},customFetch:r,region:n=el.Any}={}){this.url=e,this.headers=t,this.region=n,this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){var t,r,n,s;return t=this,r=arguments,n=void 0,s=function*(e,t={}){var r;let n,s;try{let i,{headers:a,method:o,body:l,signal:u,timeout:c}=t,h={},{region:d}=t;d||(d=this.region);let p=new URL(`${this.url}/${e}`);d&&"any"!==d&&(h["x-region"]=d,p.searchParams.set("forceFunctionRegion",d)),l&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?"u">typeof Blob&&l instanceof Blob||l instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",i=l):"string"==typeof l?(h["Content-Type"]="text/plain",i=l):"u">typeof FormData&&l instanceof FormData?i=l:(h["Content-Type"]="application/json",i=JSON.stringify(l)):i=!l||"string"==typeof l||"u">typeof Blob&&l instanceof Blob||l instanceof ArrayBuffer||"u">typeof FormData&&l instanceof FormData?l:JSON.stringify(l);let f=u;c&&(s=new AbortController,n=setTimeout(()=>s.abort(),c),u?(f=s.signal,u.addEventListener("abort",()=>s.abort())):f=s.signal);let g=yield this.fetch(p.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:i,signal:f}).catch(e=>{throw new rg(e)}),m=g.headers.get("x-relay-error");if(m&&"true"===m)throw new rm(g);if(!g.ok)throw new rb(g);let b=(null!=(r=g.headers.get("Content-Type"))?r:"text/plain").split(";")[0].trim();return{data:"application/json"===b?yield g.json():"application/octet-stream"===b||"application/pdf"===b?yield g.blob():"text/event-stream"===b?g:"multipart/form-data"===b?yield g.formData():yield g.text(),error:null,response:g}}catch(e){return{data:null,error:e,response:e instanceof rb||e instanceof rm?e.context:void 0}}finally{n&&clearTimeout(n)}},new(n||(n=Promise))(function(e,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(a,o)}l((s=s.apply(t,r||[])).next())})}}let rw=e=>Math.min(1e3*2**e,3e4),r_=[520,503],rE=["GET","HEAD","OPTIONS"];var rk=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function rS(e,t){return new Promise(r=>{if(null==t?void 0:t.aborted)return void r();let n=setTimeout(()=>{null==t||t.removeEventListener("abort",s),r()},e);function s(){clearTimeout(n),r()}null==t||t.addEventListener("abort",s)})}var rT=class{constructor(e){var t,r,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=null!=(t=e.shouldThrowOnError)&&t,this.signal=e.signal,this.isMaybeSingle=null!=(r=e.isMaybeSingle)&&r,this.shouldStripNulls=null!=(n=e.shouldStripNulls)&&n,this.urlLengthLimit=null!=(s=e.urlLengthLimit)?s:8e3,this.retryEnabled=null==(i=e.retry)||i,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if("text/csv"===this.headers.get("Accept"))throw Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){let e=this.headers.get("Accept");"application/vnd.pgrst.object+json"===e?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):e&&"application/json"!==e||this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let n=this.fetch,s=(async()=>{let e=0;for(;;){var t,s,i,a,o;let l,u=new Headers(r.headers);e>0&&u.set("X-Retry-Count",String(e));try{l=await n(r.url.toString(),{method:r.method,headers:u,body:JSON.stringify(r.body,(e,t)=>"bigint"==typeof t?t.toString():t),signal:r.signal})}catch(t){if((null==t?void 0:t.name)==="AbortError"||(null==t?void 0:t.code)==="ABORT_ERR"||!rE.includes(r.method))throw t;if(r.retryEnabled&&e<3){let t=rw(e);e++,await rS(t,r.signal);continue}throw t}if(t=r.method,s=l.status,i=e,r.retryEnabled&&!(i>=3)&&rE.includes(t)&&r_.includes(s)&&1){let t=null!=(a=null==(o=l.headers)?void 0:o.get("Retry-After"))?a:null,n=null!==t?1e3*Math.max(0,parseInt(t,10)||0):rw(e);await l.text(),e++,await rS(n,r.signal);continue}return await r.processResponse(l)}})();return this.shouldThrowOnError||(s=s.catch(e=>{var t,r,n,s,i,a;let o="",l="",u="",c=null==e?void 0:e.cause;if(c){let t=null!=(r=null==c?void 0:c.message)?r:"",a=null!=(n=null==c?void 0:c.code)?n:"";o=`${null!=(s=null==e?void 0:e.name)?s:"FetchError"}: ${null==e?void 0:e.message}
10
10
 
11
11
  Caused by: ${null!=(i=null==c?void 0:c.name)?i:"Error"}: ${t}`,a&&(o+=` (${a})`),(null==c?void 0:c.stack)&&(o+=`
12
- ${c.stack}`)}else o=null!=(a=null==e?void 0:e.stack)?a:"";let h=this.url.toString().length;return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.code)==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",h>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${h} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((null==c?void 0:c.name)==="HeadersOverflowError"||(null==c?void 0:c.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",h>this.urlLengthLimit&&(l+=`. Your request URL is ${h} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${null!=(t=null==e?void 0:e.name)?t:"FetchError"}: ${null==e?void 0:e.message}`,details:o,hint:l,code:u},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}async processResponse(e){var t,r,n;let s=null,i=null,a=null,o=e.status,l=e.statusText;if(e.ok){if("HEAD"!==this.method){let t=await e.text();""===t||(i="text/csv"===this.headers.get("Accept")||this.headers.get("Accept")&&(null==(n=this.headers.get("Accept"))?void 0:n.includes("application/vnd.pgrst.plan+text"))?t:JSON.parse(t))}let u=null==(t=this.headers.get("Prefer"))?void 0:t.match(/count=(exact|planned|estimated)/),c=null==(r=e.headers.get("content-range"))?void 0:r.split("/");u&&c&&c.length>1&&(a=parseInt(c[1])),this.isMaybeSingle&&Array.isArray(i)&&(i.length>1?(s={code:"PGRST116",details:`Results contain ${i.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},i=null,a=null,o=406,l="Not Acceptable"):i=1===i.length?i[0]:null)}else{let t=await e.text();try{s=JSON.parse(t),Array.isArray(s)&&404===e.status&&(i=[],s=null,o=200,l="OK")}catch(r){404===e.status&&""===t?(o=204,l="No Content"):s={message:t}}if(s&&this.shouldThrowOnError)throw new rk(s)}return{success:null===s,error:s,data:i,count:a,status:o,statusText:l}}returns(){return this}overrideTypes(){return this}},rR=class extends rT{select(e){let t=!1,r=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){let i=s?`${s}.order`:"order",a=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${void 0===r?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let n=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){let s=void 0===n?"offset":`${n}.offset`,i=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var a;let o=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=null!=(a=this.headers.get("Accept"))?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${o};`),this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};let rO=RegExp("[,()]");var rx=class extends rR{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&rO.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&rO.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let s="";"plain"===n?s="pl":"phrase"===n?s="ph":"websearch"===n&&(s="w");let i=void 0===r?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>void 0!==t).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},rC=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:i}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:r=!1,count:n}=null!=t?t:{},s=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!s?"":('"'===e&&(s=!s),e)).join(""),{url:a,headers:o}=this.cloneRequestState();return a.searchParams.set("select",i),n&&o.append("Prefer",`count=${n}`),new rx({method:r?"HEAD":"GET",url:a,headers:o,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;let{url:s,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),r||i.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);s.searchParams.set("columns",e.join(","))}}return new rx({method:"POST",url:s,headers:i,schema:this.schema,body:e,fetch:null!=(n=this.fetch)?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;let{url:a,headers:o}=this.cloneRequestState();if(o.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),void 0!==t&&a.searchParams.set("on_conflict",t),n&&o.append("Prefer",`count=${n}`),s||o.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set("columns",e.join(","))}}return new rx({method:"POST",url:a,headers:o,schema:this.schema,body:e,fetch:null!=(i=this.fetch)?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;let{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new rx({method:"PATCH",url:n,headers:s,schema:this.schema,body:e,fetch:null!=(r=this.fetch)?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;let{url:r,headers:n}=this.cloneRequestState();return e&&n.append("Prefer",`count=${e}`),new rx({method:"DELETE",url:r,headers:n,schema:this.schema,fetch:null!=(t=this.fetch)?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function rP(e){return(rP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function rI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rA(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=rP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=rP(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==rP(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rA(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var rN=class e{constructor(e,{headers:t={},schema:r,fetch:n,timeout:s,urlLengthLimit:i=8e3,retry:a}={}){this.url=e,this.headers=new Headers(t),this.schemaName=r,this.urlLengthLimit=i;const o=null!=n?n:globalThis.fetch;void 0!==s&&s>0?this.fetch=(e,t)=>{let r=new AbortController,n=setTimeout(()=>r.abort(),s),i=null==t?void 0:t.signal;if(i){if(i.aborted)return clearTimeout(n),o(e,t);let s=()=>{clearTimeout(n),r.abort()};return i.addEventListener("abort",s,{once:!0}),o(e,rI(rI({},t),{},{signal:r.signal})).finally(()=>{clearTimeout(n),i.removeEventListener("abort",s)})}return o(e,rI(rI({},t),{},{signal:r.signal})).finally(()=>clearTimeout(n))}:this.fetch=o,this.retry=a}from(e){if(!e||"string"!=typeof e||""===e.trim())throw Error("Invalid relation name: relation must be a non-empty string.");return new rC(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:r=!1,get:n=!1,count:s}={}){var i;let a,o,l=new URL(`${this.url}/rpc/${e}`),u=e=>null!==e&&"object"==typeof e&&(!Array.isArray(e)||e.some(u)),c=r&&Object.values(t).some(u);c?(a="POST",o=t):r||n?(a=r?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}`]).forEach(([e,t])=>{l.searchParams.append(e,t)})):(a="POST",o=t);let h=new Headers(this.headers);return c?h.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&h.set("Prefer",`count=${s}`),new rx({method:a,url:l,headers:h,schema:this.schemaName,body:o,fetch:null!=(i=this.fetch)?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};let rj=class{static detectEnvironment(){var t;if("u">typeof WebSocket)return{type:"native",wsConstructor:WebSocket};let r=globalThis;if("u">typeof globalThis&&void 0!==r.WebSocket)return{type:"native",wsConstructor:r.WebSocket};let n=e.g;if(n&&void 0!==n.WebSocket)return{type:"native",wsConstructor:n.WebSocket};if("u">typeof globalThis&&void 0!==r.WebSocketPair&&void 0===globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("u">typeof globalThis&&r.EdgeRuntime||"u">typeof navigator&&(null==(t=navigator.userAgent)?void 0:t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let s=globalThis.process;if(s){let e=s.versions;if(e&&e.node){let t=parseInt(e.node.replace(/^v/,"").split(".")[0]);return t>=22?void 0!==globalThis.WebSocket?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${t} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${t} detected without native WebSocket support.`,workaround:'For Node.js < 22, install "ws" package and provide it via the transport option:\nimport ws from "ws"\nnew RealtimeClient(url, { transport: ws })'}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`
12
+ ${c.stack}`)}else o=null!=(a=null==e?void 0:e.stack)?a:"";let h=this.url.toString().length;return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.code)==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",h>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${h} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((null==c?void 0:c.name)==="HeadersOverflowError"||(null==c?void 0:c.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",h>this.urlLengthLimit&&(l+=`. Your request URL is ${h} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${null!=(t=null==e?void 0:e.name)?t:"FetchError"}: ${null==e?void 0:e.message}`,details:o,hint:l,code:u},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}async processResponse(e){var t,r,n;let s=null,i=null,a=null,o=e.status,l=e.statusText;if(e.ok){if("HEAD"!==this.method){let t=await e.text();""===t||(i="text/csv"===this.headers.get("Accept")||this.headers.get("Accept")&&(null==(n=this.headers.get("Accept"))?void 0:n.includes("application/vnd.pgrst.plan+text"))?t:JSON.parse(t))}let u=null==(t=this.headers.get("Prefer"))?void 0:t.match(/count=(exact|planned|estimated)/),c=null==(r=e.headers.get("content-range"))?void 0:r.split("/");u&&c&&c.length>1&&(a=parseInt(c[1])),this.isMaybeSingle&&Array.isArray(i)&&(i.length>1?(s={code:"PGRST116",details:`Results contain ${i.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},i=null,a=null,o=406,l="Not Acceptable"):i=1===i.length?i[0]:null)}else{let t=await e.text();try{s=JSON.parse(t),Array.isArray(s)&&404===e.status&&(i=[],s=null,o=200,l="OK")}catch(r){404===e.status&&""===t?(o=204,l="No Content"):s={message:t}}if(s&&this.shouldThrowOnError)throw new rk(s)}return{success:null===s,error:s,data:i,count:a,status:o,statusText:l}}returns(){return this}overrideTypes(){return this}},rR=class extends rT{select(e){let t=!1,r=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){let i=s?`${s}.order`:"order",a=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${void 0===r?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let n=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){let s=void 0===n?"offset":`${n}.offset`,i=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var a;let o=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=null!=(a=this.headers.get("Accept"))?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${o};`),this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};let rO=RegExp("[,()]");var rx=class extends rR{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&rO.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&rO.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let s="";"plain"===n?s="pl":"phrase"===n?s="ph":"websearch"===n&&(s="w");let i=void 0===r?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>void 0!==t).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},rC=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:i}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:r=!1,count:n}=null!=t?t:{},s=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!s?"":('"'===e&&(s=!s),e)).join(""),{url:a,headers:o}=this.cloneRequestState();return a.searchParams.set("select",i),n&&o.append("Prefer",`count=${n}`),new rx({method:r?"HEAD":"GET",url:a,headers:o,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;let{url:s,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),r||i.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);s.searchParams.set("columns",e.join(","))}}return new rx({method:"POST",url:s,headers:i,schema:this.schema,body:e,fetch:null!=(n=this.fetch)?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;let{url:a,headers:o}=this.cloneRequestState();if(o.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),void 0!==t&&a.searchParams.set("on_conflict",t),n&&o.append("Prefer",`count=${n}`),s||o.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set("columns",e.join(","))}}return new rx({method:"POST",url:a,headers:o,schema:this.schema,body:e,fetch:null!=(i=this.fetch)?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;let{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new rx({method:"PATCH",url:n,headers:s,schema:this.schema,body:e,fetch:null!=(r=this.fetch)?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;let{url:r,headers:n}=this.cloneRequestState();return e&&n.append("Prefer",`count=${e}`),new rx({method:"DELETE",url:r,headers:n,schema:this.schema,fetch:null!=(t=this.fetch)?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function rP(e){return(rP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function rI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rA(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=rP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=rP(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==rP(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rA(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var rj=class e{constructor(e,{headers:t={},schema:r,fetch:n,timeout:s,urlLengthLimit:i=8e3,retry:a}={}){this.url=e,this.headers=new Headers(t),this.schemaName=r,this.urlLengthLimit=i;const o=null!=n?n:globalThis.fetch;void 0!==s&&s>0?this.fetch=(e,t)=>{let r=new AbortController,n=setTimeout(()=>r.abort(),s),i=null==t?void 0:t.signal;if(i){if(i.aborted)return clearTimeout(n),o(e,t);let s=()=>{clearTimeout(n),r.abort()};return i.addEventListener("abort",s,{once:!0}),o(e,rI(rI({},t),{},{signal:r.signal})).finally(()=>{clearTimeout(n),i.removeEventListener("abort",s)})}return o(e,rI(rI({},t),{},{signal:r.signal})).finally(()=>clearTimeout(n))}:this.fetch=o,this.retry=a}from(e){if(!e||"string"!=typeof e||""===e.trim())throw Error("Invalid relation name: relation must be a non-empty string.");return new rC(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:r=!1,get:n=!1,count:s}={}){var i;let a,o,l=new URL(`${this.url}/rpc/${e}`),u=e=>null!==e&&"object"==typeof e&&(!Array.isArray(e)||e.some(u)),c=r&&Object.values(t).some(u);c?(a="POST",o=t):r||n?(a=r?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}`]).forEach(([e,t])=>{l.searchParams.append(e,t)})):(a="POST",o=t);let h=new Headers(this.headers);return c?h.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&h.set("Prefer",`count=${s}`),new rx({method:a,url:l,headers:h,schema:this.schemaName,body:o,fetch:null!=(i=this.fetch)?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};let rN=class{static detectEnvironment(){var t;if("u">typeof WebSocket)return{type:"native",wsConstructor:WebSocket};let r=globalThis;if("u">typeof globalThis&&void 0!==r.WebSocket)return{type:"native",wsConstructor:r.WebSocket};let n=e.g;if(n&&void 0!==n.WebSocket)return{type:"native",wsConstructor:n.WebSocket};if("u">typeof globalThis&&void 0!==r.WebSocketPair&&void 0===globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("u">typeof globalThis&&r.EdgeRuntime||"u">typeof navigator&&(null==(t=navigator.userAgent)?void 0:t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let s=globalThis.process;if(s){let e=s.versions;if(e&&e.node){let t=parseInt(e.node.replace(/^v/,"").split(".")[0]);return t>=22?void 0!==globalThis.WebSocket?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${t} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${t} detected without native WebSocket support.`,workaround:'For Node.js < 22, install "ws" package and provide it via the transport option:\nimport ws from "ws"\nnew RealtimeClient(url, { transport: ws })'}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`
13
13
 
14
- Suggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{let e=this.detectEnvironment();return"native"===e.type||"ws"===e.type}catch(e){return!1}}},r$="2.0.0",rD="errored",rL="joined",rU={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"};class rM{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}encode(e,t){return e.event!==this.BROADCAST_EVENT||e.payload instanceof ArrayBuffer||"string"!=typeof e.payload.event?t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload])):t(this._binaryEncodeUserBroadcastPush(e))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer(null==(t=e.payload)?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,n)}_encodeJsonUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:{},s=new TextEncoder().encode(JSON.stringify(n)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(e,t,r){let n=e.topic,s=null!=(p=e.ref)?p:"",i=null!=(f=e.join_ref)?f:"",a=e.payload.event,o=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},l=0===Object.keys(o).length?"":JSON.stringify(o);if(i.length>255)throw Error(`joinRef length ${i.length} exceeds maximum of 255`);if(s.length>255)throw Error(`ref length ${s.length} exceeds maximum of 255`);if(n.length>255)throw Error(`topic length ${n.length} exceeds maximum of 255`);if(a.length>255)throw Error(`userEvent length ${a.length} exceeds maximum of 255`);if(l.length>255)throw Error(`metadata length ${l.length} exceeds maximum of 255`);let u=this.USER_BROADCAST_PUSH_META_LENGTH+i.length+s.length+n.length+a.length+l.length,c=new ArrayBuffer(this.HEADER_LENGTH+u),h=new DataView(c),d=0;h.setUint8(d++,this.KINDS.userBroadcastPush),h.setUint8(d++,i.length),h.setUint8(d++,s.length),h.setUint8(d++,n.length),h.setUint8(d++,a.length),h.setUint8(d++,l.length),h.setUint8(d++,t),Array.from(i,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(s,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(n,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(a,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(l,e=>h.setUint8(d++,e.charCodeAt(0)));var p,f,g=new Uint8Array(c.byteLength+r.byteLength);return g.set(new Uint8Array(c),0),g.set(new Uint8Array(r),c.byteLength),g.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if("string"==typeof e){let[r,n,s,i,a]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:i,payload:a})}return t({})}_binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,n)}_decodeUserBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),o=this.HEADER_LENGTH+4,l=r.decode(e.slice(o,o+n));o+=n;let u=r.decode(e.slice(o,o+s));o+=s;let c=r.decode(e.slice(o,o+i));o+=i;let h=e.slice(o,e.byteLength),d=a===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,p={type:this.BROADCAST_EVENT,event:u,payload:d};return i>0&&(p.meta=JSON.parse(c)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||(null==(t=null==e?void 0:e.constructor)?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e))):{}}}(er=eu||(eu={})).abstime="abstime",er.bool="bool",er.date="date",er.daterange="daterange",er.float4="float4",er.float8="float8",er.int2="int2",er.int4="int4",er.int4range="int4range",er.int8="int8",er.int8range="int8range",er.json="json",er.jsonb="jsonb",er.money="money",er.numeric="numeric",er.oid="oid",er.reltime="reltime",er.text="text",er.time="time",er.timestamp="timestamp",er.timestamptz="timestamptz",er.timetz="timetz",er.tsrange="tsrange",er.tstzrange="tstzrange";let rB=(e,t,r={})=>{var n;let s=null!=(n=r.skipTypes)?n:[];return t?Object.keys(t).reduce((r,n)=>(r[n]=rq(n,e,t,s),r),{}):{}},rq=(e,t,r,n)=>{let s=t.find(t=>t.name===e),i=null==s?void 0:s.type,a=r[e];return i&&!n.includes(i)?rH(i,a):rF(a)},rH=(e,t)=>{if("_"===e.charAt(0))return rz(t,e.slice(1,e.length));switch(e){case eu.bool:return rV(t);case eu.float4:case eu.float8:case eu.int2:case eu.int4:case eu.int8:case eu.numeric:case eu.oid:return rG(t);case eu.json:case eu.jsonb:return rW(t);case eu.timestamp:return rK(t);case eu.abstime:case eu.date:case eu.daterange:case eu.int4range:case eu.int8range:case eu.money:case eu.reltime:case eu.text:case eu.time:case eu.timestamptz:case eu.timetz:case eu.tsrange:case eu.tstzrange:default:return rF(t)}},rF=e=>e,rV=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},rG=e=>{if("string"==typeof e){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},rW=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},rz=(e,t)=>{if("string"!=typeof e)return e;let r=e.length-1,n=e[r];if("{"===e[0]&&"}"===n){let n,s=e.slice(1,r);try{n=JSON.parse("["+s+"]")}catch(e){n=s?s.split(","):[]}return n.map(e=>rH(t,e))}return e},rK=e=>"string"==typeof e?e.replace(" ","T"):e,rJ=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),""===t.pathname||"/"===t.pathname?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var rX=e=>"function"==typeof e?e:function(){return e},rY=("u">typeof self?self:null)||globalThis,rQ="closed",rZ="errored",r0="joined",r1="joining",r2="leaving",r4="phx_close",r3="phx_error",r6="phx_reply",r5="phx_leave",r9="websocket",r8="base64url.bearer.phx.",r7=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},ne=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},nt=class{constructor(e,t,r){this.state=rQ,this.topic=e,this.params=rX(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new r7(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new ne(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=r0,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive("error",e=>{this.state=rZ,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=rQ,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=rZ,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new r7(this,r5,rX({}),this.timeout).send(),this.state=rZ,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(r6,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(!this.joinedOnce)return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush;throw Error("tried to join multiple times. 'join' can only be called a single time per channel instance")}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=rQ,this.bindings=[]}onClose(e){this.on(r4,e)}onError(e){return this.on(r3,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>r.event!==e||void 0!==t&&t!==r.ref)}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new r7(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=r2;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(r4,"leave")},r=new r7(this,r5,rX({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic===e&&(!n||n===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=r1,this.joinPush.resend(e))}trigger(e,t,r,n){let s=this.onMessage(e,t,r,n);if(t&&!s)throw Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(n=>n.event===e&&this.filterBindings(n,t,r));for(let e=0;e<i.length;e++)i[e].callback(s,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===rQ}isErrored(){return this.state===rZ}isJoined(){return this.state===r0}isJoining(){return this.state===r1}isLeaving(){return this.state===r2}},nr=class{static request(e,t,r,n,s,i,a){if(rY.XDomainRequest){let r=new rY.XDomainRequest;return this.xdomainRequest(r,e,t,n,s,i,a)}if(rY.XMLHttpRequest){let o=new rY.XMLHttpRequest;return this.xhrRequest(o,e,t,r,n,s,i,a)}if(rY.fetch&&rY.AbortController)return this.fetchRequest(e,t,r,n,s,i,a);throw Error("No suitable XMLHttpRequest implementation found")}static fetchRequest(e,t,r,n,s,i,a){let o={method:e,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),o.signal=l.signal),rY.fetch(t,o).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>a&&a(e)).catch(e=>{"AbortError"===e.name&&i?i():a&&a(null)}),l}static xdomainRequest(e,t,r,n,s,i,a){return e.timeout=s,e.open(t,r),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,s,i,a,o){for(let[s,a]of(e.open(t,r,!0),e.timeout=i,Object.entries(n)))e.setRequestHeader(s,a);return e.onerror=()=>o&&o(null),e.onreadystatechange=()=>{4===e.readyState&&o&&o(this.parseJSON(e.responseText))},a&&(e.ontimeout=a),e.send(s),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=t?`${t}[${n}]`:n,i=e[n];"object"==typeof i?r.push(this.serialize(i,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},nn=class{constructor(e,t){t&&2===t.length&&t[1].startsWith(r8)&&(this.authToken=atob(t[1].slice(r8.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(RegExp("(.*)/"+r9),"$1/longpoll")}endpointURL(){return nr.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){let e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:r,messages:n}=e;if(410===t&&null!==this.token){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else t=0;switch(t){case 200:n.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){"string"!=typeof e&&(e=(e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let e=0;e<n;e++)t+=String.fromCharCode(r[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join("\n"),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,r){for(let e of this.reqs)e.abort();this.readyState=3;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"u">typeof CloseEvent?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,s){let i,a=()=>{this.reqs.delete(i),n()};i=nr.request(e,this.endpointURL(),t,r,this.timeout,a,e=>{this.reqs.delete(i),this.isActive()&&s(e)}),this.reqs.add(i)}},ns=class e{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,t=>{let{onJoin:r,onLeave:n,onSync:s}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,r,n),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,r,n)}),this.pendingDiffs=[],s()}),this.channel.on(n.diff,t=>{let{onJoin:r,onLeave:n,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,r,n),s())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,r,n){let s=this.clone(e),i={},a={};return this.map(s,(e,r)=>{t[e]||(a[e]=r)}),this.map(t,(e,t)=>{let r=s[e];if(r){let n=t.metas.map(e=>e.phx_ref),s=r.metas.map(e=>e.phx_ref),o=t.metas.filter(e=>0>s.indexOf(e.phx_ref)),l=r.metas.filter(e=>0>n.indexOf(e.phx_ref));o.length>0&&(i[e]=t,i[e].metas=o),l.length>0&&(a[e]=this.clone(r),a[e].metas=l)}else i[e]=t}),this.syncDiff(s,{joins:i,leaves:a},r,n)}static syncDiff(e,t,r,n){let{joins:s,leaves:i}=this.clone(t);return r||(r=function(){}),n||(n=function(){}),this.map(s,(t,n)=>{let s=e[t];if(e[t]=this.clone(n),s){let r=e[t].metas.map(e=>e.phx_ref),n=s.metas.filter(e=>0>r.indexOf(e.phx_ref));e[t].metas.unshift(...n)}r(t,s,n)}),this.map(i,(t,r)=>{let s=e[t];if(!s)return;let i=r.metas.map(e=>e.phx_ref);s.metas=s.metas.filter(e=>0>i.indexOf(e.phx_ref)),n(t,s,r),0===s.metas.length&&delete e[t]}),e}static list(e,t){return t||(t=function(e,t){return t}),this.map(e,(e,r)=>t(e,r))}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},ni={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){return e.payload.constructor===ArrayBuffer?t(this.binaryEncode(e)):t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload]))},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,s,i,a]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:s,payload:i}=e,a=this.META_LENGTH+t.length+r.length+s.length+n.length,o=new ArrayBuffer(this.HEADER_LENGTH+a),l=new DataView(o),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,t.length),l.setUint8(u++,r.length),l.setUint8(u++,s.length),l.setUint8(u++,n.length),Array.from(t,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(r,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(s,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(n,e=>l.setUint8(u++,e.charCodeAt(0)));var c=new Uint8Array(o.byteLength+i.byteLength);return c.set(new Uint8Array(o),0),c.set(new Uint8Array(i),o.byteLength),c.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,o=r.decode(e.slice(a,a+n));a+=n;let l=r.decode(e.slice(a,a+s));a+=s;let u=r.decode(e.slice(a,a+i));return a+=i,{join_ref:o,ref:null,topic:l,event:u,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(e.slice(o,o+n));o+=n;let u=r.decode(e.slice(o,o+s));o+=s;let c=r.decode(e.slice(o,o+i));o+=i;let h=r.decode(e.slice(o,o+a));return o+=a,{join_ref:l,ref:u,topic:c,event:r6,payload:{status:h,response:e.slice(o,e.byteLength)}}},decodeBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=this.HEADER_LENGTH+2,a=r.decode(e.slice(i,i+n));i+=n;let o=r.decode(e.slice(i,i+s));return i+=s,{join_ref:null,ref:null,topic:a,event:o,payload:e.slice(i,e.byteLength)}}},na=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||1e4,this.transport=t.transport||rY.WebSocket||nn,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=rY&&rY.sessionStorage}catch{}this.sessionStore=t.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=ni.encode.bind(ni),this.defaultDecoder=ni.decode.bind(ni),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==nn?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,r)=>{console.log(`${e}: ${t}`,r)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=rX(t.params||{}),this.endPoint=`${e}/${r9}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new ne(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return nn}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=nr.appendParams(nr.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=rX(e)),(!this.conn||this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==nn?this.connectWithFallback(nn,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(s=>{s.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){return e===nn?"LongPoll":e.name}transportConnect(){let e;this.connectClock++,this.closeWasClean=!1,this.authToken&&(e=["phoenix",`${r8}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){let r,n;clearTimeout(this.fallbackTimer);let s=!1,i=!0,a=this.transportName(e),o=t=>{this.log("transport",`falling back to ${a}...`,t),this.off([r,n]),i=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o("memorized");this.fallbackTimer=setTimeout(o,t),n=this.onError(e=>{this.log("transport","error",e),i&&!s&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(s=!0,!i){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,"true"),this.log("transport",`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();let n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){5!==r&&e.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r):t()}waitForSocketClosed(e,t,r=1){5===r||3===e.readyState?t():setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(r3,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>-1===e.indexOf(t))}channel(e,t={}){let r=new nt(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;this.log("push",`${t} ${r} (${i}, ${s})`,n)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef)return void this.heartbeatTimeout();this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;if(s&&s===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback("ok"===n.status?"ok":"error",e)}catch(e){this.log("error","error in heartbeat callback",e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${n.status||""} ${t} ${r} ${s&&"("+s+")"||""}`.trim(),n);for(let e=0;e<this.channels.length;e++){let a=this.channels[e];a.isMember(t,r,n,i)&&a.trigger(r,n,s,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(t){this.log("error",`error in ${e} callback`,t)}})}catch(t){this.log("error",`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class no{constructor(e,t){const r=function(e){return(null==e?void 0:e.events)&&{events:e.events}}(t);this.presence=new ns(e.getChannel(),r),this.presence.onJoin((t,r,n)=>{let s=no.onJoinPayload(t,r,n);e.getChannel().trigger("presence",s)}),this.presence.onLeave((t,r,n)=>{let s=no.onLeavePayload(t,r,n);e.getChannel().trigger("presence",s)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return no.transformState(this.presence.state)}static transformState(e){return Object.getOwnPropertyNames(e=JSON.parse(JSON.stringify(e))).reduce((t,r)=>{let n=e[r];return t[r]=nl(n),t},{})}static onJoinPayload(e,t,r){return{event:"join",key:e,currentPresences:nu(t),newPresences:nl(r)}}static onLeavePayload(e,t,r){return{event:"leave",key:e,currentPresences:nu(t),leftPresences:nl(r)}}}function nl(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function nu(e){return(null==e?void 0:e.metas)?nl(e):[]}(en=ec||(ec={})).SYNC="sync",en.JOIN="join",en.LEAVE="leave";class nc{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new no(this.channel.channelAdapter,t)}}class nh{constructor(e,t,r){const n=function(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}(r);this.channel=e.getSocket().channel(t,n),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,r){let n;try{n=this.channel.push(e,t,r)}catch(t){throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${e.event}`,e.payload())}return n}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===rL}isJoined(){return this.state===rL}isJoining(){return"joining"===this.state}isClosed(){return"closed"===this.state}isLeaving(){return"leaving"===this.state}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}(es=eh||(eh={})).ALL="*",es.INSERT="INSERT",es.UPDATE="UPDATE",es.DELETE="DELETE",(ei=ed||(ed={})).BROADCAST="broadcast",ei.PRESENCE="presence",ei.POSTGRES_CHANGES="postgres_changes",ei.SYSTEM="system",(ea=ep||(ep={})).SUBSCRIBED="SUBSCRIBED",ea.TIMED_OUT="TIMED_OUT",ea.CLOSED="CLOSED",ea.CHANNEL_ERROR="CHANNEL_ERROR";class nd{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},r){var n,s;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new nh(this.socket.socketAdapter,e,this.params),this.presence=new nc(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=rJ(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(null==(s=null==(n=this.params.config)?void 0:n.broadcast)?void 0:s.replay))throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){var r,n,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:i,presence:a,private:o}}=this.params,l=null!=(n=null==(r=this.bindings.postgres_changes)?void 0:r.map(e=>e.filter))?n:[],u=!!this.bindings[ed.PRESENCE]&&this.bindings[ed.PRESENCE].length>0||(null==(s=this.params.config.presence)?void 0:s.enabled)===!0,c={},h={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:l,private:o};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this._onError(t=>{null==e||e(ep.CHANNEL_ERROR,function(e){if(e instanceof Error)return e;if("string"==typeof e)return Error(e);if(e&&"object"==typeof e){if("number"==typeof e.code){let t="string"==typeof e.reason&&e.reason?` (${e.reason})`:"";return Error(`socket closed: ${e.code}${t}`,{cause:e})}return Error("channel error: transport failure",{cause:e})}return Error("channel error: connection lost")}(t))}),this._onClose(()=>null==e?void 0:e(ep.CLOSED)),this.updateJoinPayload(Object.assign({config:h},c)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive("ok",async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),void 0===t){null==e||e(ep.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive("error",t=>{this.state=rD;let r=Object.values(t).join(", ")||"error";null==e||e(ep.CHANNEL_ERROR,Error(r,{cause:t}))}).receive("timeout",()=>{null==e||e(ep.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var r;let n=this.bindings.postgres_changes,s=null!=(r=null==n?void 0:n.length)?r:0,i=[];for(let r=0;r<s;r++){let s=n[r],{filter:{event:a,schema:o,table:l,filter:u}}=s,c=e&&e[r];if(c&&c.event===a&&nd.isFilterValueEqual(c.schema,o)&&nd.isFilterValueEqual(c.table,l)&&nd.isFilterValueEqual(c.filter,u))i.push(Object.assign(Object.assign({},s),{id:c.id}));else{this.unsubscribe(),this.state=rD,null==t||t(ep.CHANNEL_ERROR,Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=rD&&t&&t(ep.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){let n=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=e===ed.PRESENCE||e===ed.POSTGRES_CHANGES;if(n&&s)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,r)}async httpSend(e,t,r={}){var n;if(null==t)return Promise.reject(Error("Payload is required for httpSend()"));let s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);let i={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,i,null!=(n=r.timeout)?n:this.timeout);if(202===a.status)return{success:!0};let o=a.statusText;try{let e=await a.json();o=e.error||e.message||o}catch(e){}return Promise.reject(Error(o))}async send(e,t={}){var r,n;if(this.channelAdapter.canPush()||"broadcast"!==e.type)return new Promise(r=>{var n,s,i;let a=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null==(i=null==(s=null==(n=this.params)?void 0:n.config)?void 0:s.broadcast)?void 0:i.ack)||r("ok"),a.receive("ok",()=>r("ok")),a.receive("error",()=>r("error")),a.receive("timeout",()=>r("timed out"))});{console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");let{event:s,payload:i}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);let o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:i,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,o,null!=(r=t.timeout)?r:this.timeout);return await (null==(n=e.body)?void 0:n.cancel()),e.ok?"ok":"error"}catch(e){if(e instanceof Error&&"AbortError"===e.name)return"timed out";return"error"}}}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,r){let n=new AbortController,s=setTimeout(()=>n.abort(),r),i=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:n.signal}));return clearTimeout(s),i}_on(e,t,r){let n=e.toLocaleLowerCase(),s=this.channelAdapter.on(e,r),i={type:n,filter:t,callback:r,ref:s};return this.bindings[n]?this.bindings[n].push(i):this.bindings[n]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,r)=>{var n,s,i,a,o,l,u;let c=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(c,r))return!1;let h=null==(n=this.bindings[c])?void 0:n.find(t=>t.ref===e.ref);if(!h)return!0;if(!["broadcast","presence","postgres_changes"].includes(c))return h.type.toLocaleLowerCase()===c;if("id"in h){let e=h.id,r=null==(s=h.filter)?void 0:s.event;return e&&(null==(i=t.ids)?void 0:i.includes(e))&&("*"===r||(null==r?void 0:r.toLocaleLowerCase())===(null==(a=t.data)?void 0:a.type.toLocaleLowerCase()))}{let e=null==(l=null==(o=null==h?void 0:h.filter)?void 0:o.event)?void 0:l.toLocaleLowerCase();return"*"===e||e===(null==(u=null==t?void 0:t.event)?void 0:u.toLocaleLowerCase())}})}_notThisChannelEvent(e,t){let{close:r,error:n,leave:s,join:i}=rU;return t&&[r,n,s,i].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,r)=>{if("object"==typeof t&&"ids"in t){let e=t.data,{schema:r,table:n,commit_timestamp:s,type:i,errors:a}=e;return Object.assign(Object.assign({},{schema:r,table:n,commit_timestamp:s,eventType:i,new:{},old:{},errors:a}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error("cannot copy bindings into joined channel");for(let t in e.bindings)for(let r of e.bindings[t])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=rB(e.columns,e.record)),("UPDATE"===e.type||"DELETE"===e.type)&&(t.old=rB(e.columns,e.old_record)),t}}class np{constructor(e,t){this.socket=new na(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,r,n=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),n),this.socket.disconnect(()=>{e(),s("ok")},t,r)})}push(e){this.socket.push(e)}log(e,t,r){this.socket.log(e,t,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return"connecting"==this.socket.connectionState()}isDisconnecting(){return"closing"==this.socket.connectionState()}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}let nf=[1e3,2e3,5e3,1e4],ng=`
14
+ Suggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{let e=this.detectEnvironment();return"native"===e.type||"ws"===e.type}catch(e){return!1}}},r$="2.0.0",rD="errored",rL="joined",rU={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"};class rM{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}encode(e,t){return e.event!==this.BROADCAST_EVENT||e.payload instanceof ArrayBuffer||"string"!=typeof e.payload.event?t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload])):t(this._binaryEncodeUserBroadcastPush(e))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer(null==(t=e.payload)?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,n)}_encodeJsonUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:{},s=new TextEncoder().encode(JSON.stringify(n)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(e,t,r){let n=e.topic,s=null!=(p=e.ref)?p:"",i=null!=(f=e.join_ref)?f:"",a=e.payload.event,o=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},l=0===Object.keys(o).length?"":JSON.stringify(o);if(i.length>255)throw Error(`joinRef length ${i.length} exceeds maximum of 255`);if(s.length>255)throw Error(`ref length ${s.length} exceeds maximum of 255`);if(n.length>255)throw Error(`topic length ${n.length} exceeds maximum of 255`);if(a.length>255)throw Error(`userEvent length ${a.length} exceeds maximum of 255`);if(l.length>255)throw Error(`metadata length ${l.length} exceeds maximum of 255`);let u=this.USER_BROADCAST_PUSH_META_LENGTH+i.length+s.length+n.length+a.length+l.length,c=new ArrayBuffer(this.HEADER_LENGTH+u),h=new DataView(c),d=0;h.setUint8(d++,this.KINDS.userBroadcastPush),h.setUint8(d++,i.length),h.setUint8(d++,s.length),h.setUint8(d++,n.length),h.setUint8(d++,a.length),h.setUint8(d++,l.length),h.setUint8(d++,t),Array.from(i,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(s,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(n,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(a,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(l,e=>h.setUint8(d++,e.charCodeAt(0)));var p,f,g=new Uint8Array(c.byteLength+r.byteLength);return g.set(new Uint8Array(c),0),g.set(new Uint8Array(r),c.byteLength),g.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if("string"==typeof e){let[r,n,s,i,a]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:i,payload:a})}return t({})}_binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,n)}_decodeUserBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),o=this.HEADER_LENGTH+4,l=r.decode(e.slice(o,o+n));o+=n;let u=r.decode(e.slice(o,o+s));o+=s;let c=r.decode(e.slice(o,o+i));o+=i;let h=e.slice(o,e.byteLength),d=a===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,p={type:this.BROADCAST_EVENT,event:u,payload:d};return i>0&&(p.meta=JSON.parse(c)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||(null==(t=null==e?void 0:e.constructor)?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e))):{}}}(er=eu||(eu={})).abstime="abstime",er.bool="bool",er.date="date",er.daterange="daterange",er.float4="float4",er.float8="float8",er.int2="int2",er.int4="int4",er.int4range="int4range",er.int8="int8",er.int8range="int8range",er.json="json",er.jsonb="jsonb",er.money="money",er.numeric="numeric",er.oid="oid",er.reltime="reltime",er.text="text",er.time="time",er.timestamp="timestamp",er.timestamptz="timestamptz",er.timetz="timetz",er.tsrange="tsrange",er.tstzrange="tstzrange";let rq=(e,t,r={})=>{var n;let s=null!=(n=r.skipTypes)?n:[];return t?Object.keys(t).reduce((r,n)=>(r[n]=rB(n,e,t,s),r),{}):{}},rB=(e,t,r,n)=>{let s=t.find(t=>t.name===e),i=null==s?void 0:s.type,a=r[e];return i&&!n.includes(i)?rH(i,a):rF(a)},rH=(e,t)=>{if("_"===e.charAt(0))return rz(t,e.slice(1,e.length));switch(e){case eu.bool:return rV(t);case eu.float4:case eu.float8:case eu.int2:case eu.int4:case eu.int8:case eu.numeric:case eu.oid:return rW(t);case eu.json:case eu.jsonb:return rG(t);case eu.timestamp:return rK(t);case eu.abstime:case eu.date:case eu.daterange:case eu.int4range:case eu.int8range:case eu.money:case eu.reltime:case eu.text:case eu.time:case eu.timestamptz:case eu.timetz:case eu.tsrange:case eu.tstzrange:default:return rF(t)}},rF=e=>e,rV=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},rW=e=>{if("string"==typeof e){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},rG=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},rz=(e,t)=>{if("string"!=typeof e)return e;let r=e.length-1,n=e[r];if("{"===e[0]&&"}"===n){let n,s=e.slice(1,r);try{n=JSON.parse("["+s+"]")}catch(e){n=s?s.split(","):[]}return n.map(e=>rH(t,e))}return e},rK=e=>"string"==typeof e?e.replace(" ","T"):e,rJ=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),""===t.pathname||"/"===t.pathname?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var rX=e=>"function"==typeof e?e:function(){return e},rY=("u">typeof self?self:null)||globalThis,rQ="closed",rZ="errored",r0="joined",r1="joining",r2="leaving",r4="phx_close",r3="phx_error",r6="phx_reply",r5="phx_leave",r9="websocket",r8="base64url.bearer.phx.",r7=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},ne=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},nt=class{constructor(e,t,r){this.state=rQ,this.topic=e,this.params=rX(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new r7(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new ne(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=r0,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive("error",e=>{this.state=rZ,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=rQ,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=rZ,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new r7(this,r5,rX({}),this.timeout).send(),this.state=rZ,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(r6,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(!this.joinedOnce)return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush;throw Error("tried to join multiple times. 'join' can only be called a single time per channel instance")}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=rQ,this.bindings=[]}onClose(e){this.on(r4,e)}onError(e){return this.on(r3,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>r.event!==e||void 0!==t&&t!==r.ref)}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new r7(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=r2;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(r4,"leave")},r=new r7(this,r5,rX({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic===e&&(!n||n===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=r1,this.joinPush.resend(e))}trigger(e,t,r,n){let s=this.onMessage(e,t,r,n);if(t&&!s)throw Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(n=>n.event===e&&this.filterBindings(n,t,r));for(let e=0;e<i.length;e++)i[e].callback(s,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===rQ}isErrored(){return this.state===rZ}isJoined(){return this.state===r0}isJoining(){return this.state===r1}isLeaving(){return this.state===r2}},nr=class{static request(e,t,r,n,s,i,a){if(rY.XDomainRequest){let r=new rY.XDomainRequest;return this.xdomainRequest(r,e,t,n,s,i,a)}if(rY.XMLHttpRequest){let o=new rY.XMLHttpRequest;return this.xhrRequest(o,e,t,r,n,s,i,a)}if(rY.fetch&&rY.AbortController)return this.fetchRequest(e,t,r,n,s,i,a);throw Error("No suitable XMLHttpRequest implementation found")}static fetchRequest(e,t,r,n,s,i,a){let o={method:e,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),o.signal=l.signal),rY.fetch(t,o).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>a&&a(e)).catch(e=>{"AbortError"===e.name&&i?i():a&&a(null)}),l}static xdomainRequest(e,t,r,n,s,i,a){return e.timeout=s,e.open(t,r),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,s,i,a,o){for(let[s,a]of(e.open(t,r,!0),e.timeout=i,Object.entries(n)))e.setRequestHeader(s,a);return e.onerror=()=>o&&o(null),e.onreadystatechange=()=>{4===e.readyState&&o&&o(this.parseJSON(e.responseText))},a&&(e.ontimeout=a),e.send(s),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=t?`${t}[${n}]`:n,i=e[n];"object"==typeof i?r.push(this.serialize(i,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},nn=class{constructor(e,t){t&&2===t.length&&t[1].startsWith(r8)&&(this.authToken=atob(t[1].slice(r8.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(RegExp("(.*)/"+r9),"$1/longpoll")}endpointURL(){return nr.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){let e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:r,messages:n}=e;if(410===t&&null!==this.token){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else t=0;switch(t){case 200:n.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){"string"!=typeof e&&(e=(e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let e=0;e<n;e++)t+=String.fromCharCode(r[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join("\n"),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,r){for(let e of this.reqs)e.abort();this.readyState=3;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"u">typeof CloseEvent?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,s){let i,a=()=>{this.reqs.delete(i),n()};i=nr.request(e,this.endpointURL(),t,r,this.timeout,a,e=>{this.reqs.delete(i),this.isActive()&&s(e)}),this.reqs.add(i)}},ns=class e{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,t=>{let{onJoin:r,onLeave:n,onSync:s}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,r,n),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,r,n)}),this.pendingDiffs=[],s()}),this.channel.on(n.diff,t=>{let{onJoin:r,onLeave:n,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,r,n),s())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,r,n){let s=this.clone(e),i={},a={};return this.map(s,(e,r)=>{t[e]||(a[e]=r)}),this.map(t,(e,t)=>{let r=s[e];if(r){let n=t.metas.map(e=>e.phx_ref),s=r.metas.map(e=>e.phx_ref),o=t.metas.filter(e=>0>s.indexOf(e.phx_ref)),l=r.metas.filter(e=>0>n.indexOf(e.phx_ref));o.length>0&&(i[e]=t,i[e].metas=o),l.length>0&&(a[e]=this.clone(r),a[e].metas=l)}else i[e]=t}),this.syncDiff(s,{joins:i,leaves:a},r,n)}static syncDiff(e,t,r,n){let{joins:s,leaves:i}=this.clone(t);return r||(r=function(){}),n||(n=function(){}),this.map(s,(t,n)=>{let s=e[t];if(e[t]=this.clone(n),s){let r=e[t].metas.map(e=>e.phx_ref),n=s.metas.filter(e=>0>r.indexOf(e.phx_ref));e[t].metas.unshift(...n)}r(t,s,n)}),this.map(i,(t,r)=>{let s=e[t];if(!s)return;let i=r.metas.map(e=>e.phx_ref);s.metas=s.metas.filter(e=>0>i.indexOf(e.phx_ref)),n(t,s,r),0===s.metas.length&&delete e[t]}),e}static list(e,t){return t||(t=function(e,t){return t}),this.map(e,(e,r)=>t(e,r))}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},ni={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){return e.payload.constructor===ArrayBuffer?t(this.binaryEncode(e)):t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload]))},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,s,i,a]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:s,payload:i}=e,a=this.META_LENGTH+t.length+r.length+s.length+n.length,o=new ArrayBuffer(this.HEADER_LENGTH+a),l=new DataView(o),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,t.length),l.setUint8(u++,r.length),l.setUint8(u++,s.length),l.setUint8(u++,n.length),Array.from(t,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(r,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(s,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(n,e=>l.setUint8(u++,e.charCodeAt(0)));var c=new Uint8Array(o.byteLength+i.byteLength);return c.set(new Uint8Array(o),0),c.set(new Uint8Array(i),o.byteLength),c.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,o=r.decode(e.slice(a,a+n));a+=n;let l=r.decode(e.slice(a,a+s));a+=s;let u=r.decode(e.slice(a,a+i));return a+=i,{join_ref:o,ref:null,topic:l,event:u,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(e.slice(o,o+n));o+=n;let u=r.decode(e.slice(o,o+s));o+=s;let c=r.decode(e.slice(o,o+i));o+=i;let h=r.decode(e.slice(o,o+a));return o+=a,{join_ref:l,ref:u,topic:c,event:r6,payload:{status:h,response:e.slice(o,e.byteLength)}}},decodeBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=this.HEADER_LENGTH+2,a=r.decode(e.slice(i,i+n));i+=n;let o=r.decode(e.slice(i,i+s));return i+=s,{join_ref:null,ref:null,topic:a,event:o,payload:e.slice(i,e.byteLength)}}},na=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||1e4,this.transport=t.transport||rY.WebSocket||nn,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=rY&&rY.sessionStorage}catch{}this.sessionStore=t.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=ni.encode.bind(ni),this.defaultDecoder=ni.decode.bind(ni),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==nn?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,r)=>{console.log(`${e}: ${t}`,r)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=rX(t.params||{}),this.endPoint=`${e}/${r9}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new ne(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return nn}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=nr.appendParams(nr.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=rX(e)),(!this.conn||this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==nn?this.connectWithFallback(nn,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(s=>{s.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){return e===nn?"LongPoll":e.name}transportConnect(){let e;this.connectClock++,this.closeWasClean=!1,this.authToken&&(e=["phoenix",`${r8}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){let r,n;clearTimeout(this.fallbackTimer);let s=!1,i=!0,a=this.transportName(e),o=t=>{this.log("transport",`falling back to ${a}...`,t),this.off([r,n]),i=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o("memorized");this.fallbackTimer=setTimeout(o,t),n=this.onError(e=>{this.log("transport","error",e),i&&!s&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(s=!0,!i){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,"true"),this.log("transport",`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();let n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){5!==r&&e.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r):t()}waitForSocketClosed(e,t,r=1){5===r||3===e.readyState?t():setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(r3,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>-1===e.indexOf(t))}channel(e,t={}){let r=new nt(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;this.log("push",`${t} ${r} (${i}, ${s})`,n)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef)return void this.heartbeatTimeout();this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;if(s&&s===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback("ok"===n.status?"ok":"error",e)}catch(e){this.log("error","error in heartbeat callback",e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${n.status||""} ${t} ${r} ${s&&"("+s+")"||""}`.trim(),n);for(let e=0;e<this.channels.length;e++){let a=this.channels[e];a.isMember(t,r,n,i)&&a.trigger(r,n,s,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(t){this.log("error",`error in ${e} callback`,t)}})}catch(t){this.log("error",`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class no{constructor(e,t){const r=function(e){return(null==e?void 0:e.events)&&{events:e.events}}(t);this.presence=new ns(e.getChannel(),r),this.presence.onJoin((t,r,n)=>{let s=no.onJoinPayload(t,r,n);e.getChannel().trigger("presence",s)}),this.presence.onLeave((t,r,n)=>{let s=no.onLeavePayload(t,r,n);e.getChannel().trigger("presence",s)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return no.transformState(this.presence.state)}static transformState(e){return Object.getOwnPropertyNames(e=JSON.parse(JSON.stringify(e))).reduce((t,r)=>{let n=e[r];return t[r]=nl(n),t},{})}static onJoinPayload(e,t,r){return{event:"join",key:e,currentPresences:nu(t),newPresences:nl(r)}}static onLeavePayload(e,t,r){return{event:"leave",key:e,currentPresences:nu(t),leftPresences:nl(r)}}}function nl(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function nu(e){return(null==e?void 0:e.metas)?nl(e):[]}(en=ec||(ec={})).SYNC="sync",en.JOIN="join",en.LEAVE="leave";class nc{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new no(this.channel.channelAdapter,t)}}class nh{constructor(e,t,r){const n=function(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}(r);this.channel=e.getSocket().channel(t,n),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,r){let n;try{n=this.channel.push(e,t,r)}catch(t){throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${e.event}`,e.payload())}return n}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===rL}isJoined(){return this.state===rL}isJoining(){return"joining"===this.state}isClosed(){return"closed"===this.state}isLeaving(){return"leaving"===this.state}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}(es=eh||(eh={})).ALL="*",es.INSERT="INSERT",es.UPDATE="UPDATE",es.DELETE="DELETE",(ei=ed||(ed={})).BROADCAST="broadcast",ei.PRESENCE="presence",ei.POSTGRES_CHANGES="postgres_changes",ei.SYSTEM="system",(ea=ep||(ep={})).SUBSCRIBED="SUBSCRIBED",ea.TIMED_OUT="TIMED_OUT",ea.CLOSED="CLOSED",ea.CHANNEL_ERROR="CHANNEL_ERROR";class nd{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},r){var n,s;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new nh(this.socket.socketAdapter,e,this.params),this.presence=new nc(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=rJ(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(null==(s=null==(n=this.params.config)?void 0:n.broadcast)?void 0:s.replay))throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){var r,n,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:i,presence:a,private:o}}=this.params,l=null!=(n=null==(r=this.bindings.postgres_changes)?void 0:r.map(e=>e.filter))?n:[],u=!!this.bindings[ed.PRESENCE]&&this.bindings[ed.PRESENCE].length>0||(null==(s=this.params.config.presence)?void 0:s.enabled)===!0,c={},h={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:l,private:o};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this._onError(t=>{null==e||e(ep.CHANNEL_ERROR,function(e){if(e instanceof Error)return e;if("string"==typeof e)return Error(e);if(e&&"object"==typeof e){if("number"==typeof e.code){let t="string"==typeof e.reason&&e.reason?` (${e.reason})`:"";return Error(`socket closed: ${e.code}${t}`,{cause:e})}return Error("channel error: transport failure",{cause:e})}return Error("channel error: connection lost")}(t))}),this._onClose(()=>null==e?void 0:e(ep.CLOSED)),this.updateJoinPayload(Object.assign({config:h},c)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive("ok",async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),void 0===t){null==e||e(ep.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive("error",t=>{this.state=rD;let r=Object.values(t).join(", ")||"error";null==e||e(ep.CHANNEL_ERROR,Error(r,{cause:t}))}).receive("timeout",()=>{null==e||e(ep.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var r;let n=this.bindings.postgres_changes,s=null!=(r=null==n?void 0:n.length)?r:0,i=[];for(let r=0;r<s;r++){let s=n[r],{filter:{event:a,schema:o,table:l,filter:u}}=s,c=e&&e[r];if(c&&c.event===a&&nd.isFilterValueEqual(c.schema,o)&&nd.isFilterValueEqual(c.table,l)&&nd.isFilterValueEqual(c.filter,u))i.push(Object.assign(Object.assign({},s),{id:c.id}));else{this.unsubscribe(),this.state=rD,null==t||t(ep.CHANNEL_ERROR,Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=rD&&t&&t(ep.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){let n=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=e===ed.PRESENCE||e===ed.POSTGRES_CHANGES;if(n&&s)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,r)}async httpSend(e,t,r={}){var n;if(null==t)return Promise.reject(Error("Payload is required for httpSend()"));let s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);let i={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,i,null!=(n=r.timeout)?n:this.timeout);if(202===a.status)return{success:!0};let o=a.statusText;try{let e=await a.json();o=e.error||e.message||o}catch(e){}return Promise.reject(Error(o))}async send(e,t={}){var r,n;if(this.channelAdapter.canPush()||"broadcast"!==e.type)return new Promise(r=>{var n,s,i;let a=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null==(i=null==(s=null==(n=this.params)?void 0:n.config)?void 0:s.broadcast)?void 0:i.ack)||r("ok"),a.receive("ok",()=>r("ok")),a.receive("error",()=>r("error")),a.receive("timeout",()=>r("timed out"))});{console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");let{event:s,payload:i}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);let o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:i,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,o,null!=(r=t.timeout)?r:this.timeout);return await (null==(n=e.body)?void 0:n.cancel()),e.ok?"ok":"error"}catch(e){if(e instanceof Error&&"AbortError"===e.name)return"timed out";return"error"}}}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,r){let n=new AbortController,s=setTimeout(()=>n.abort(),r),i=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:n.signal}));return clearTimeout(s),i}_on(e,t,r){let n=e.toLocaleLowerCase(),s=this.channelAdapter.on(e,r),i={type:n,filter:t,callback:r,ref:s};return this.bindings[n]?this.bindings[n].push(i):this.bindings[n]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,r)=>{var n,s,i,a,o,l,u;let c=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(c,r))return!1;let h=null==(n=this.bindings[c])?void 0:n.find(t=>t.ref===e.ref);if(!h)return!0;if(!["broadcast","presence","postgres_changes"].includes(c))return h.type.toLocaleLowerCase()===c;if("id"in h){let e=h.id,r=null==(s=h.filter)?void 0:s.event;return e&&(null==(i=t.ids)?void 0:i.includes(e))&&("*"===r||(null==r?void 0:r.toLocaleLowerCase())===(null==(a=t.data)?void 0:a.type.toLocaleLowerCase()))}{let e=null==(l=null==(o=null==h?void 0:h.filter)?void 0:o.event)?void 0:l.toLocaleLowerCase();return"*"===e||e===(null==(u=null==t?void 0:t.event)?void 0:u.toLocaleLowerCase())}})}_notThisChannelEvent(e,t){let{close:r,error:n,leave:s,join:i}=rU;return t&&[r,n,s,i].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,r)=>{if("object"==typeof t&&"ids"in t){let e=t.data,{schema:r,table:n,commit_timestamp:s,type:i,errors:a}=e;return Object.assign(Object.assign({},{schema:r,table:n,commit_timestamp:s,eventType:i,new:{},old:{},errors:a}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error("cannot copy bindings into joined channel");for(let t in e.bindings)for(let r of e.bindings[t])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=rq(e.columns,e.record)),("UPDATE"===e.type||"DELETE"===e.type)&&(t.old=rq(e.columns,e.old_record)),t}}class np{constructor(e,t){this.socket=new na(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,r,n=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),n),this.socket.disconnect(()=>{e(),s("ok")},t,r)})}push(e){this.socket.push(e)}log(e,t,r){this.socket.log(e,t,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return"connecting"==this.socket.connectionState()}isDisconnecting(){return"closing"==this.socket.connectionState()}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}let nf=[1e3,2e3,5e3,1e4],ng=`
15
15
  addEventListener("message", (e) => {
16
16
  if (e.data.event === "start") {
17
17
  setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
@@ -29,7 +29,7 @@ Option 2: Install and provide the "ws" package:
29
29
  const client = new RealtimeClient(url, {
30
30
  ...options,
31
31
  transport: ws
32
- })`);throw Error(`WebSocket not available: ${e}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return(this._cancelPendingDisconnect(),this.isDisconnecting())?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return"ok"===t&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,r){this.socketAdapter.log(e,t,r)}connectionState(){return this.socketAdapter.connectionState()||"closed"}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let r=`realtime:${e}`,n=this.getChannels().find(e=>e.topic===r);if(n)return n;{let r=new nd(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(r),r}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),0===this.channels.length&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),0===this._disconnectOnEmptyChannelsAfterMs){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,0===this.channels.length&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){null!==this._pendingDisconnectTimer&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,r=!1;if(e)t=e,r=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log("error","Error fetching access token from callback",e),t=this.accessTokenValue}else t=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let r={access_token:t,version:"realtime-js/2.106.0"};t&&e.updateJoinPayload(r),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(rU.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log("error","error waiting for auth on connect",e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,r)=>{"sent"==t&&this._setAuthSafely(),e&&e(t,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([ng],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_initializeOptions(e){var t,r,n,s,i,a,o,l,u,c,h,d;let p,f;this.worker=null!=(t=null==e?void 0:e.worker)&&t,this.accessToken=null!=(r=null==e?void 0:e.accessToken)?r:null;let g={};g.timeout=null!=(n=null==e?void 0:e.timeout)?n:1e4,g.heartbeatIntervalMs=null!=(s=null==e?void 0:e.heartbeatIntervalMs)?s:25e3,this._disconnectOnEmptyChannelsAfterMs=null!=(i=null==e?void 0:e.disconnectOnEmptyChannelsAfterMs)?i:2*(null!=(a=null==e?void 0:e.heartbeatIntervalMs)?a:25e3),g.transport=null!=(o=null==e?void 0:e.transport)?o:rj.getWebSocketConstructor(),g.params=null==e?void 0:e.params,g.logger=null==e?void 0:e.logger,g.heartbeatCallback=this._wrapHeartbeatCallback(null==e?void 0:e.heartbeatCallback),g.sessionStorage=null!=(l=null==e?void 0:e.sessionStorage)?l:function(){let e;try{if("u">typeof globalThis&&globalThis.sessionStorage)return globalThis.sessionStorage}catch(e){}return e=new Map,{get length(){return e.size},clear(){e.clear()},getItem:t=>e.has(t)?e.get(t):null,key(t){var r;return null!=(r=Array.from(e.keys())[t])?r:null},removeItem(t){e.delete(t)},setItem(t,r){e.set(t,String(r))}}}(),g.reconnectAfterMs=null!=(u=null==e?void 0:e.reconnectAfterMs)?u:e=>nf[e-1]||1e4;let m=null!=(c=null==e?void 0:e.vsn)?c:r$;switch(m){case"1.0.0":p=(e,t)=>t(JSON.stringify(e)),f=(e,t)=>t(JSON.parse(e));break;case r$:p=this.serializer.encode.bind(this.serializer),f=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${g.vsn}`)}return g.vsn=m,g.encode=null!=(h=null==e?void 0:e.encode)?h:p,g.decode=null!=(d=null==e?void 0:e.decode)?d:f,g.beforeReconnect=this._reconnectAuth.bind(this),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,g.params=Object.assign(Object.assign({},g.params),{log_level:this.logLevel})),this.worker&&(this.workerUrl=null==e?void 0:e.workerUrl,g.autoSendHeartbeat=!this.worker),g}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var nb=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown="CommitStateUnknownException"===t.icebergType||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return 404===this.status}isConflict(){return 409===this.status}isAuthenticationTimeout(){return 419===this.status}};async function ny(e){return e&&"none"!==e.type?"bearer"===e.type?{Authorization:`Bearer ${e.token}`}:"header"===e.type?{[e.name]:e.value}:"custom"===e.type?await e.getHeaders():{}:{}}function nv(e){return e.join("\x1f")}var nw=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:nv(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let r={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${nv(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${nv(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${nv(e.namespace)}`}),!0}catch(e){if(e instanceof nb&&404===e.status)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof nb&&409===e.status)return;throw e}}};function n_(e){return e.join("\x1f")}var nE=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof nb&&404===e.status)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof nb&&409===r.status)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},nk=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=function(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:a}){let o=function(e,t,r){let n=new URL(t,e);if(r)for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);return n.toString()}(e.baseUrl,n,s),l=await ny(e.auth),u=await t(o,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...l,...a},body:i?JSON.stringify(i):void 0}),c=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),d=h&&c?JSON.parse(c):c;if(!u.ok){let e=h?d:void 0,t=e?.error;throw new nb(t?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:u.status,headers:u.headers,data:d}}}}({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new nw(this.client,t),this.tableOps=new nE(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function nS(e){return(nS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function nR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nT(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=nS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=nS(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==nS(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nT(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var nO=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name="vectors"===t?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function nx(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var nC=class extends nO{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name="vectors"===n?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return nR({},super.toJSON())}},nP=class extends nO{constructor(e,t,r="storage"){super(e,r),this.name="vectors"===r?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function nA(e,t,r){let n=nR({},e),s=t.toLowerCase();for(let e of Object.keys(n))e.toLowerCase()===s&&delete n[e];return n[s]=r,n}let nI=e=>{if(Array.isArray(e))return e.map(e=>nI(e));if("function"==typeof e||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,r])=>{t[e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""))]=nI(r)}),t},nN=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.msg)return e.msg;if("string"==typeof e.message)return e.message;if("string"==typeof e.error_description)return e.error_description;if("string"==typeof e.error)return e.error;if("object"==typeof e.error&&null!==e.error){let t=e.error;if("string"==typeof t.message)return t.message}}return JSON.stringify(e)},nj=async(e,t,r,n)=>{if(null!==e&&"object"==typeof e&&"json"in e&&"function"==typeof e.json){let r=parseInt(String(e.status),10);Number.isFinite(r)||(r=500),e.json().then(e=>{let s=(null==e?void 0:e.statusCode)||(null==e?void 0:e.code)||r+"";t(new nC(nN(e),r,s,n))}).catch(()=>{let s=r+"";t(new nC(e.statusText||`HTTP ${r} error`,r,s,n))})}else t(new nP(nN(e),e,n))};async function n$(e,t,r,n,s,i,a){return new Promise((o,l)=>{e(r,((e,t,r,n)=>{let s={method:e,headers:(null==t?void 0:t.headers)||{}};if("GET"===e||"HEAD"===e||!n)return nR(nR({},s),r);if((e=>{if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)})(n)){var i;let e,r=(null==t?void 0:t.headers)||{};for(let[t,n]of Object.entries(r))"content-type"===t.toLowerCase()&&(e=n);s.headers=nA(r,"Content-Type",null!=(i=e)?i:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return(null==t?void 0:t.duplex)&&(s.duplex=t.duplex),nR(nR({},s),r)})(t,n,s,i)).then(e=>{if(!e.ok)throw e;if(null==n?void 0:n.noResolveJson)return e;if("vectors"===a){let t=e.headers.get("content-type");if("0"===e.headers.get("content-length")||204===e.status||!t||!t.includes("application/json"))return{}}return e.json()}).then(e=>o(e)).catch(e=>nj(e,l,n,a))})}function nD(e="storage"){return{get:async(t,r,n,s)=>n$(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,i)=>n$(t,"POST",r,s,i,n,e),put:async(t,r,n,s,i)=>n$(t,"PUT",r,s,i,n,e),head:async(t,r,n,s)=>n$(t,"HEAD",r,nR(nR({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,i)=>n$(t,"DELETE",r,s,i,n,e)}}let{get:nL,post:nU,put:nM,head:nB,remove:nq}=nD("storage"),nH=nD("vectors");var nF=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=function(e){let t={};for(let[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}(t),this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=nA(this.headers,e,t),this}async handleOperation(e){try{return{data:await e(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nx(e))return{data:null,error:e};throw e}}};n=Symbol.toStringTag;var nV=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[n]="StreamDownloadBuilder",this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:(await this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nx(e))return{data:null,error:e};throw e}}};s=Symbol.toStringTag;var nG=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[s]="BlobDownloadBuilder",this.promise=null}asStream(){return new nV(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:await (await this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nx(e))return{data:null,error:e};throw e}}};let nW={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},nz={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var nK=class extends nF{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var s=this;return s.handleOperation(async()=>{let i,a=nR(nR({},nz),n),o=nR(nR({},s.headers),"POST"===e&&{"x-upsert":String(a.upsert)}),l=a.metadata;if("u">typeof Blob&&r instanceof Blob?((i=new FormData).append("cacheControl",a.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",r)):"u">typeof FormData&&r instanceof FormData?((i=r).has("cacheControl")||i.append("cacheControl",a.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=r,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=s.toBase64(s.encodeMetadata(l))),("u">typeof ReadableStream&&i instanceof ReadableStream||i&&"object"==typeof i&&"pipe"in i&&"function"==typeof i.pipe)&&!a.duplex&&(a.duplex="half")),null==n?void 0:n.headers)for(let[e,t]of Object.entries(n.headers))o=nA(o,e,t);let u=s._removeEmptyFolders(t),c=s._getFinalPath(u),h=await ("PUT"==e?nM:nU)(s.fetch,`${s.url}/object/${c}`,i,nR({headers:o},(null==a?void 0:a.duplex)?{duplex:a.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;let i=s._removeEmptyFolders(e),a=s._getFinalPath(i),o=new URL(s.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",t),s.handleOperation(async()=>{let e,t=nR(nR({},nz),n),a=nR(nR({},s.headers),{"x-upsert":String(t.upsert)}),l=t.metadata;if("u">typeof Blob&&r instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),l&&e.append("metadata",s.encodeMetadata(l)),e.append("",r)):"u">typeof FormData&&r instanceof FormData?((e=r).has("cacheControl")||e.append("cacheControl",t.cacheControl),l&&!e.has("metadata")&&e.append("metadata",s.encodeMetadata(l))):(e=r,a["cache-control"]=`max-age=${t.cacheControl}`,a["content-type"]=t.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),("u">typeof ReadableStream&&e instanceof ReadableStream||e&&"object"==typeof e&&"pipe"in e&&"function"==typeof e.pipe)&&!t.duplex&&(t.duplex="half")),null==n?void 0:n.headers)for(let[e,t]of Object.entries(n.headers))a=nA(a,e,t);return{path:i,fullPath:(await nM(s.fetch,o.toString(),e,nR({headers:a},(null==t?void 0:t.duplex)?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e),s=nR({},r.headers);(null==t?void 0:t.upsert)&&(s["x-upsert"]="true");let i=await nU(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),a=new URL(r.url+i.url),o=a.searchParams.get("token");if(!o)throw new nO("No token returned by API");return{signedUrl:a.toString(),path:e,token:o}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await nU(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==r?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await nU(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==r?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e),i="object"==typeof(null==r?void 0:r.transform)&&null!==r.transform&&Object.keys(r.transform).length>0,a=await nU(n.fetch,`${n.url}/object/sign/${s}`,nR({expiresIn:t},i?{transform:r.transform}:{}),{headers:n.headers}),o=new URLSearchParams;(null==r?void 0:r.download)&&o.set("download",!0===r.download?"":r.download),(null==r?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));let l=o.toString();return{signedUrl:encodeURI(`${n.url}${a.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{let s=await nU(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),i=new URLSearchParams;(null==r?void 0:r.download)&&i.set("download",!0===r.download?"":r.download),(null==r?void 0:r.cacheNonce)!=null&&i.set("cacheNonce",String(r.cacheNonce));let a=i.toString();return s.map(e=>nR(nR({},e),{},{signedUrl:e.signedURL?encodeURI(`${n.url}${e.signedURL}${a?`&${a}`:""}`):null}))})}download(e,t,r){let n="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(s,t.transform),(null==t?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));let i=s.toString(),a=this._getFinalPath(e);return new nG(()=>nL(this.fetch,`${this.url}/${n}/${a}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},r),this.shouldThrowOnError)}async info(e){var t=this;let r=t._getFinalPath(e);return t.handleOperation(async()=>nI(await nL(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t;let r=this._getFinalPath(e);try{return await nB(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nx(e)){let r=e instanceof nC?e.status:e instanceof nP?null==(t=e.originalError)?void 0:t.status:void 0;if(void 0!==r&&[400,404].includes(r))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let r=this._getFinalPath(e),n=new URLSearchParams;(null==t?void 0:t.download)&&n.set("download",!0===t.download?"":t.download),(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(n,t.transform),(null==t?void 0:t.cacheNonce)!=null&&n.set("cacheNonce",String(t.cacheNonce));let s=n.toString(),i="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await nq(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{let s=nR(nR(nR({},nW),t),{},{prefix:e||""});return await nU(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{let n=nR({},e);return await nU(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return void 0!==td.Buffer?td.Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};let nJ={"X-Client-Info":"storage-js/2.106.0"};var nX=class extends nF{constructor(e,t={},r,n){const s=new URL(e);(null==n?void 0:n.useNewHostname)&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase.")),super(s.href.replace(/\/$/,""),nR(nR({},nJ),t),r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=t.listBucketOptionsToQueryString(e);return await nL(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await nL(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await nU(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await nM(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await nU(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nq(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){let t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},nY=class extends nF{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nJ),t),r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await nU(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=new URLSearchParams;(null==e?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(null==e?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),(null==e?void 0:e.sortColumn)&&r.set("sortColumn",e.sortColumn),(null==e?void 0:e.sortOrder)&&r.set("sortOrder",e.sortOrder),(null==e?void 0:e.search)&&r.set("search",e.search);let n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await nL(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nq(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!(!(!e||"string"!=typeof e||0===e.length||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\"))&&/^[\w!.\*'() &$@=;:+,?-]+$/.test(e)))throw new nO("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new nk({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(e,t){let r=e[t];return"function"!=typeof r?r:async(...t)=>{try{return{data:await r.apply(e,t),error:null}}catch(e){if(n)throw e;return{data:null,error:e}}}}})}},nQ=class extends nF{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nJ),{},{"Content-Type":"application/json"},t),r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await nH.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await nH.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},nZ=class extends nF{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nJ),{},{"Content-Type":"application/json"},t),r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(void 0!==e.segmentCount){if(e.segmentCount<1||e.segmentCount>16)throw Error("segmentCount must be between 1 and 16");if(void 0!==e.segmentIndex&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},n0=class extends nF{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nJ),{},{"Content-Type":"application/json"},t),r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},n1=class extends n0{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new n2(this.url,this.headers,e,this.fetch)}async createBucket(e){return super.createBucket.call(this,e)}async getBucket(e){return super.getBucket.call(this,e)}async listBuckets(e={}){return super.listBuckets.call(this,e)}async deleteBucket(e){return super.deleteBucket.call(this,e)}},n2=class extends nQ{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){return super.createIndex.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName}))}async listIndexes(e={}){return super.listIndexes.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName}))}async getIndex(e){return super.getIndex.call(this,this.vectorBucketName,e)}async deleteIndex(e){return super.deleteIndex.call(this,this.vectorBucketName,e)}index(e){return new n4(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},n4=class extends nZ{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){return super.putVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async getVectors(e){return super.getVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async listVectors(e={}){return super.listVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async queryVectors(e){return super.queryVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async deleteVectors(e){return super.deleteVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}},n3=class extends nX{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new nK(this.url,this.headers,e,this.fetch)}get vectors(){return new n1(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new nY(this.url+"/iceberg",this.headers,this.fetch)}};let n6="2.106.0",n5={"X-Client-Info":`gotrue-js/${n6}`},n9="X-Supabase-Api-Version",n8={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},n7=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;class se extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function st(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class sr extends se{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}class sn extends se{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class ss extends se{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class si extends ss{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function sa(e){return st(e)&&"AuthSessionMissingError"===e.name}class so extends ss{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class sl extends ss{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class su extends ss{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class sc extends ss{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class sh extends ss{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function sd(e){return st(e)&&"AuthRetryableFetchError"===e.name}class sp extends ss{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class sf extends ss{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}let sg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),sm=" \n\r=".split(""),sb=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<sm.length;t+=1)e[sm[t].charCodeAt(0)]=-2;for(let t=0;t<sg.length;t+=1)e[sg[t].charCodeAt(0)]=t;return e})();function sy(e,t,r){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)r(sg[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)r(sg[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function sv(e,t,r){let n=sb[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(-2===n)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function sw(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=e=>{!function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}}(e,n,r)};for(let t=0;t<e.length;t+=1)sv(e.charCodeAt(t),s,i);return t.join("")}function s_(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)sv(e.charCodeAt(t),r,n);return new Uint8Array(t)}function sE(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};return e.forEach(e=>sy(e,r,n)),sy(null,r,n),t.join("")}let sk=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),sS=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},sT=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return null}},sR=async(e,t)=>{await e.removeItem(t)};class sO{constructor(){this.promise=new sO.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function sx(e){let t=e.split(".");if(3!==t.length)throw new sf("Invalid JWT structure");for(let e=0;e<t.length;e++)if(!n7.test(t[e]))throw new sf("JWT not in base64url format");return{header:JSON.parse(sw(t[0])),payload:JSON.parse(sw(t[1])),signature:s_(t[2]),raw:{header:t[0],payload:t[1]}}}async function sC(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function sP(e){return("0"+e.toString(16)).substr(-2)}async function sA(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>String.fromCharCode(e)).join("")}async function sI(e){return"u">typeof crypto&&void 0!==crypto.subtle&&"u">typeof TextEncoder?btoa(await sA(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):(console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e)}async function sN(e,t,r=!1){let n=function(){let e=new Uint32Array(56);if("u"<typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,r="";for(let n=0;n<56;n++)r+=e.charAt(Math.floor(Math.random()*t));return r}return crypto.getRandomValues(e),Array.from(e,sP).join("")}(),s=n;r&&(s+="/recovery"),await sS(e,`${t}-code-verifier`,s);let i=await sI(n),a=n===i?"plain":"s256";return[i,a]}sO.promiseConstructor=Promise;let sj=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i,s$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function sD(e){if(!s$.test(e))throw Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function sL(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function sU(){return new Proxy({},{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"==typeof t){let e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function sM(e){return JSON.parse(JSON.stringify(e))}let sB=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.msg)return e.msg;if("string"==typeof e.message)return e.message;if("string"==typeof e.error_description)return e.error_description;if("string"==typeof e.error)return e.error}return JSON.stringify(e)},sq=[502,503,504,520,521,522,523,524,530];async function sH(e){var t;let r,n;if(!("object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json))throw new sh(sB(e),0);if(sq.includes(e.status))throw new sh(sB(e),e.status);try{r=await e.json()}catch(e){throw new sn(sB(e),e)}let s=function(e){let t=e.headers.get(n9);if(!t||!t.match(sj))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch(e){return null}}(e);if(s&&s.getTime()>=n8["2024-01-01"].timestamp&&"object"==typeof r&&r&&"string"==typeof r.code?n=r.code:"object"==typeof r&&r&&"string"==typeof r.error_code&&(n=r.error_code),n){if("weak_password"===n)throw new sp(sB(r),e.status,(null==(t=r.weak_password)?void 0:t.reasons)||[]);else if("session_not_found"===n)throw new si}else if("object"==typeof r&&r&&"object"==typeof r.weak_password&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0))throw new sp(sB(r),e.status,r.weak_password.reasons);throw new sr(sB(r),e.status||500,n)}async function sF(e,t,r,n){var s;let i=Object.assign({},null==n?void 0:n.headers);i[n9]||(i[n9]=n8["2024-01-01"].name),(null==n?void 0:n.jwt)&&(i.Authorization=`Bearer ${n.jwt}`);let a=null!=(s=null==n?void 0:n.query)?s:{};(null==n?void 0:n.redirectTo)&&(a.redirect_to=n.redirectTo);let o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await sV(e,t,r+o,{headers:i,noResolveJson:null==n?void 0:n.noResolveJson},{},null==n?void 0:n.body);return(null==n?void 0:n.xform)?null==n?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function sV(e,t,r,n,s,i){let a,o,l=(o={method:t,headers:(null==n?void 0:n.headers)||{}},"GET"===t?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==n?void 0:n.headers),o.body=JSON.stringify(i),Object.assign(Object.assign({},o),s)));try{a=await e(r,Object.assign({},l))}catch(e){throw console.error(e),new sh(sB(e),0)}if(a.ok||await sH(a),null==n?void 0:n.noResolveJson)return a;try{return await a.json()}catch(e){await sH(e)}}function sG(e){var t,r,n;let s=null;(n=e).access_token&&n.refresh_token&&n.expires_in&&(s=Object.assign({},e),e.expires_at||(s.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r)));return{data:{session:s,user:null!=(t=e.user)?t:null},error:null}}function sW(e){let t=sG(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function sz(e){var t;return{data:{user:null!=(t=e.user)?t:e},error:null}}function sK(e){return{data:e,error:null}}function sJ(e){let{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=e;return{data:{properties:{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},user:Object.assign({},ry(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]))},error:null}}function sX(e){return e}let sY=["global","local","others"];class sQ{constructor({url:e="",headers:t={},fetch:r,experimental:n}){this.url=e,this.headers=t,this.fetch=sk(r),this.experimental=null!=n?n:{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=sY[0]){if(0>sY.indexOf(t))throw Error(`@supabase/auth-js: Parameter scope must be one of ${sY.join(", ")}`);try{return await sF(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await sF(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=ry(e,["options"]),n=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(n.new_email=null==r?void 0:r.newEmail,delete n.newEmail),await sF(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:sJ,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(st(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await sF(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,n,s,i,a,o;try{let l={nextPage:null,lastPage:0,total:0},u=await sF(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:sX});if(u.error)throw u.error;let c=await u.json(),h=null!=(i=u.headers.get("x-total-count"))?i:0,d=null!=(o=null==(a=u.headers.get("link"))?void 0:a.split(","))?o:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(st(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){sD(e);try{return await sF(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){sD(e);try{return await sF(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){sD(e);try{return await sF(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){sD(e.userId);try{let{data:t,error:r}=await sF(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:r}}catch(e){if(st(e))return{data:null,error:e};throw e}}async _deleteFactor(e){sD(e.userId),sD(e.id);try{return{data:await sF(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){var t,r,n,s,i,a,o;try{let l={nextPage:null,lastPage:0,total:0},u=await sF(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:sX});if(u.error)throw u.error;let c=await u.json(),h=null!=(i=u.headers.get("x-total-count"))?i:0,d=null!=(o=null==(a=u.headers.get("link"))?void 0:a.split(","))?o:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(st(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await sF(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await sF(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await sF(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await sF(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await sF(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return(null==e?void 0:e.type)&&(t.type=e.type),await sF(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>{var t;return{data:{providers:null!=(t=null==e?void 0:e.providers)?t:[]},error:null}}})}catch(e){if(st(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await sF(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await sF(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await sF(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await sF(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){sL(this.experimental),sD(e.userId);try{return await sF(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){sL(this.experimental),sD(e.userId),sD(e.passkeyId);try{return await sF(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}}function sZ(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}globalThis;class s0 extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}function s1(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}class s2 extends Error{constructor({message:e,code:t,cause:r,name:n}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=null!=(s=null!=n?n:r instanceof Error?r.name:void 0)?s:"Unknown Error",this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class s4 extends s2{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}let s3=new class{createNewAbortSignal(){if(this.controller){let e=Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};function s6(e){if(!e)throw Error("Credential creation options are required");if("u">typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:n}=e,s=ry(e,["challenge","user","excludeCredentials"]),i=s_(t).buffer,a=Object.assign(Object.assign({},r),{id:s_(r.id).buffer}),o=Object.assign(Object.assign({},s),{challenge:i,user:a});if(n&&n.length>0){o.excludeCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];o.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:s_(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return o}function s5(e){if(!e)throw Error("Credential request options are required");if("u">typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,n=ry(e,["challenge","allowCredentials"]),s=s_(t).buffer,i=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){i.allowCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];i.allowCredentials[e]=Object.assign(Object.assign({},t),{id:s_(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return i}function s9(e){var t;return"toJSON"in e&&"function"==typeof e.toJSON?e.toJSON():{id:e.id,rawId:e.id,response:{attestationObject:sE(new Uint8Array(e.response.attestationObject)),clientDataJSON:sE(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function s8(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();let r=e.getClientExtensionResults(),n=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:sE(new Uint8Array(n.authenticatorData)),clientDataJSON:sE(new Uint8Array(n.clientDataJSON)),signature:sE(new Uint8Array(n.signature)),userHandle:n.userHandle?sE(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function s7(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}async function ie(e){try{let t=await navigator.credentials.create(e);if(!t)return{data:null,error:new s4("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new s4("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){var r,n,s;let{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new s2({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if((null==(r=i.authenticatorSelection)?void 0:r.requireResidentKey)===!0)return new s2({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});else if("conditional"===t.mediation&&(null==(n=i.authenticatorSelection)?void 0:n.userVerification)==="required")return new s2({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});else if((null==(s=i.authenticatorSelection)?void 0:s.userVerification)==="required")return new s2({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if("InvalidStateError"===e.name)return new s2({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new s2({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new s2(0===i.pubKeyCredParams.filter(e=>"public-key"===e.type).length?{message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}:{message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!s7(t))return new s2({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(i.rp.id!==t)return new s2({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new s2({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new s2({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new s2({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}async function it(e){try{let t=await navigator.credentials.get(e);if(!t)return{data:null,error:new s4("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new s4("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new s2({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new s2({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!s7(t))return new s2({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new s2({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new s2({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new s2({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}let ir={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},is={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function ii(...e){let t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),n={};for(let s of e)if(s)for(let e in s){let i=s[e];if(void 0!==i)if(Array.isArray(i))n[e]=i;else if(r(i))n[e]=i;else if(t(i)){let r=n[e];t(r)?n[e]=ii(r,i):n[e]=ii(i)}else n[e]=i}return n}class ia{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:r,signal:n},s){var i,a,o,l,u;try{let{data:c,error:h}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!c)return{data:null,error:h};let d=null!=n?n:s3.createNewAbortSignal();if("create"===c.webauthn.type){let{user:e}=c.webauthn.credential_options.publicKey;if(!e.name)if(r)e.name=`${e.id}:${r}`;else{let t=(await this.client.getUser()).data.user,r=(null==(i=null==t?void 0:t.user_metadata)?void 0:i.name)||(null==t?void 0:t.email)||(null==t?void 0:t.id)||"User";e.name=`${e.id}:${r}`}e.displayName||(e.displayName=e.name)}switch(c.webauthn.type){case"create":{let t=(a=c.webauthn.credential_options.publicKey,o=null==s?void 0:s.create,ii(ir,a,o||{})),{data:r,error:n}=await ie({publicKey:t,signal:d});if(r)return{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}case"request":{let t=(l=c.webauthn.credential_options.publicKey,u=null==s?void 0:s.request,ii(is,l,u||{})),{data:r,error:n}=await it(Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:t,signal:d}));if(r)return{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}}}catch(e){if(st(e))return{data:null,error:e};return{data:null,error:new sn("Unexpected error in challenge",e)}}}async _verify({challengeId:e,factorId:t,webauthn:r}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:t,rpOrigins:r,signal:n}={}},s){if(!t)return{data:null,error:new se("rpId is required for WebAuthn authentication")};try{1;return{data:null,error:new sn("Browser does not support WebAuthn",null)}}catch(e){if(st(e))return{data:null,error:e};return{data:null,error:new sn("Unexpected error in authenticate",e)}}}async _register({friendlyName:e,webauthn:{rpId:t,rpOrigins:r,signal:n}={}},s){if(!t)return{data:null,error:new se("rpId is required for WebAuthn registration")};try{1;return{data:null,error:new sn("Browser does not support WebAuthn",null)}}catch(e){if(st(e))return{data:null,error:e};return{data:null,error:new sn("Unexpected error in register",e)}}}}if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"u">typeof self&&(self.globalThis=self)}let io={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:n5,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function il(e,t,r){return await r()}let iu={};class ic{get jwks(){var e,t;return null!=(t=null==(e=iu[this.storageKey])?void 0:e.jwks)?t:{keys:[]}}set jwks(e){iu[this.storageKey]=Object.assign(Object.assign({},iu[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!=(t=null==(e=iu[this.storageKey])?void 0:e.cachedAt)?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){iu[this.storageKey]=Object.assign(Object.assign({},iu[this.storageKey]),{cachedAt:e})}constructor(e){var t,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const n=Object.assign(Object.assign({},io),e);this.storageKey=n.storageKey,this.instanceID=null!=(t=ic.nextInstanceID[this.storageKey])?t:0,ic.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!n.debug,"function"==typeof n.debug&&(this.logger=n.debug),this.instanceID,this.persistSession=n.persistSession,this.autoRefreshToken=n.autoRefreshToken,this.experimental=null!=(r=n.experimental)?r:{},this.admin=new sQ({url:n.url,headers:n.headers,fetch:n.fetch,experimental:this.experimental}),this.url=n.url,this.headers=n.headers,this.fetch=sk(n.fetch),this.lock=n.lock||il,this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.hasCustomAuthorizationHeader=n.hasCustomAuthorizationHeader,this.throwOnError=n.throwOnError,this.lockAcquireTimeout=n.lockAcquireTimeout,n.lock?this.lock=n.lock:(this.persistSession,this.lock=il),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new ia(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(n.storage?this.storage=n.storage:(this.memoryStorage={},this.storage=sZ(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=sZ(this.memoryStorage)),n.skipAutoInitialize||this.initialize().catch(e=>{this._debug("#initialize()","error",e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${n6}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){try{return await this._recoverAndRefresh(),{error:null}}catch(e){if(st(e))return this._returnResult({error:e});return this._returnResult({error:new sn("Unexpected error during initialization",e)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,n;try{let{data:s,error:i}=await sF(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!=(r=null==(t=null==e?void 0:e.options)?void 0:t.data)?r:{},gotrue_meta_security:{captcha_token:null==(n=null==e?void 0:e.options)?void 0:n.captchaToken}},xform:sG});if(i||!s)return this._returnResult({data:{user:null,session:null},error:i});let a=s.session,o=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){var t,r,n;try{let s;if("email"in e){let{email:r,password:n,options:i}=e,a=null,o=null;"pkce"===this.flowType&&([a,o]=await sN(this.storage,this.storageKey)),s=await sF(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==i?void 0:i.emailRedirectTo,body:{email:r,password:n,data:null!=(t=null==i?void 0:i.data)?t:{},gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:a,code_challenge_method:o},xform:sG})}else if("phone"in e){let{phone:t,password:i,options:a}=e;s=await sF(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:i,data:null!=(r=null==a?void 0:a.data)?r:{},channel:null!=(n=null==a?void 0:a.channel)?n:"sms",gotrue_meta_security:{captcha_token:null==a?void 0:a.captchaToken}},xform:sG})}else throw new sl("You must provide either an email or phone number and a password");let{data:i,error:a}=s;if(a||!i)return await sR(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});let o=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",o)),this._returnResult({data:{user:l,session:o},error:null})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if("email"in e){let{email:r,password:n,options:s}=e;t=await sF(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:sW})}else if("phone"in e){let{phone:r,password:n,options:s}=e;t=await sF(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:sW})}else throw new sl("You must provide either an email or phone number and a password");let{data:r,error:n}=t;if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!r||!r.session||!r.user){let e=new so;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:n})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){var t,r,n,s;return await this._handleProviderSignIn(e.provider,{redirectTo:null==(t=e.options)?void 0:t.redirectTo,scopes:null==(r=e.options)?void 0:r.scopes,queryParams:null==(n=e.options)?void 0:n.queryParams,skipBrowserRedirect:null==(s=e.options)?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,r,n,s,i,a,o,l,u,c,h,d;let p,f;if("message"in e)p=e.message,f=e.signature;else{let{chain:c,wallet:h,statement:g,options:m}=e;if("object"!=typeof h||!(null==m?void 0:m.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");let b=new URL(null!=(t=null==m?void 0:m.url)?t:window.location.href),y=await h.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!y||0===y.length)throw Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let v=s1(y[0]),w=null==(r=null==m?void 0:m.signInWithEthereum)?void 0:r.chainId;w||(w=parseInt(await h.request({method:"eth_chainId"}),16)),p=function(e){var t;let{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:l,resources:u,scheme:c,uri:h,version:d}=e;if(!Number.isInteger(r))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!h)throw Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if("1"!==d)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(null==(t=e.statement)?void 0:t.includes("\n"))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let p=s1(e.address),f=c?`${c}://${n}`:n,g=e.statement?`${e.statement}
32
+ })`);throw Error(`WebSocket not available: ${e}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return(this._cancelPendingDisconnect(),this.isDisconnecting())?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return"ok"===t&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,r){this.socketAdapter.log(e,t,r)}connectionState(){return this.socketAdapter.connectionState()||"closed"}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let r=`realtime:${e}`,n=this.getChannels().find(e=>e.topic===r);if(n)return n;{let r=new nd(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(r),r}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),0===this.channels.length&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),0===this._disconnectOnEmptyChannelsAfterMs){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,0===this.channels.length&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){null!==this._pendingDisconnectTimer&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,r=!1;if(e)t=e,r=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log("error","Error fetching access token from callback",e),t=this.accessTokenValue}else t=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let r={access_token:t,version:"realtime-js/2.106.0"};t&&e.updateJoinPayload(r),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(rU.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log("error","error waiting for auth on connect",e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,r)=>{"sent"==t&&this._setAuthSafely(),e&&e(t,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([ng],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_initializeOptions(e){var t,r,n,s,i,a,o,l,u,c,h,d;let p,f;this.worker=null!=(t=null==e?void 0:e.worker)&&t,this.accessToken=null!=(r=null==e?void 0:e.accessToken)?r:null;let g={};g.timeout=null!=(n=null==e?void 0:e.timeout)?n:1e4,g.heartbeatIntervalMs=null!=(s=null==e?void 0:e.heartbeatIntervalMs)?s:25e3,this._disconnectOnEmptyChannelsAfterMs=null!=(i=null==e?void 0:e.disconnectOnEmptyChannelsAfterMs)?i:2*(null!=(a=null==e?void 0:e.heartbeatIntervalMs)?a:25e3),g.transport=null!=(o=null==e?void 0:e.transport)?o:rN.getWebSocketConstructor(),g.params=null==e?void 0:e.params,g.logger=null==e?void 0:e.logger,g.heartbeatCallback=this._wrapHeartbeatCallback(null==e?void 0:e.heartbeatCallback),g.sessionStorage=null!=(l=null==e?void 0:e.sessionStorage)?l:function(){let e;try{if("u">typeof globalThis&&globalThis.sessionStorage)return globalThis.sessionStorage}catch(e){}return e=new Map,{get length(){return e.size},clear(){e.clear()},getItem:t=>e.has(t)?e.get(t):null,key(t){var r;return null!=(r=Array.from(e.keys())[t])?r:null},removeItem(t){e.delete(t)},setItem(t,r){e.set(t,String(r))}}}(),g.reconnectAfterMs=null!=(u=null==e?void 0:e.reconnectAfterMs)?u:e=>nf[e-1]||1e4;let m=null!=(c=null==e?void 0:e.vsn)?c:r$;switch(m){case"1.0.0":p=(e,t)=>t(JSON.stringify(e)),f=(e,t)=>t(JSON.parse(e));break;case r$:p=this.serializer.encode.bind(this.serializer),f=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${g.vsn}`)}return g.vsn=m,g.encode=null!=(h=null==e?void 0:e.encode)?h:p,g.decode=null!=(d=null==e?void 0:e.decode)?d:f,g.beforeReconnect=this._reconnectAuth.bind(this),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,g.params=Object.assign(Object.assign({},g.params),{log_level:this.logLevel})),this.worker&&(this.workerUrl=null==e?void 0:e.workerUrl,g.autoSendHeartbeat=!this.worker),g}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var nb=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown="CommitStateUnknownException"===t.icebergType||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return 404===this.status}isConflict(){return 409===this.status}isAuthenticationTimeout(){return 419===this.status}};async function ny(e){return e&&"none"!==e.type?"bearer"===e.type?{Authorization:`Bearer ${e.token}`}:"header"===e.type?{[e.name]:e.value}:"custom"===e.type?await e.getHeaders():{}:{}}function nv(e){return e.join("\x1f")}var nw=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:nv(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let r={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${nv(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${nv(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${nv(e.namespace)}`}),!0}catch(e){if(e instanceof nb&&404===e.status)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof nb&&409===e.status)return;throw e}}};function n_(e){return e.join("\x1f")}var nE=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${n_(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof nb&&404===e.status)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof nb&&409===r.status)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},nk=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=function(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:a}){let o=function(e,t,r){let n=new URL(t,e);if(r)for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);return n.toString()}(e.baseUrl,n,s),l=await ny(e.auth),u=await t(o,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...l,...a},body:i?JSON.stringify(i):void 0}),c=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),d=h&&c?JSON.parse(c):c;if(!u.ok){let e=h?d:void 0,t=e?.error;throw new nb(t?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:u.status,headers:u.headers,data:d}}}}({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new nw(this.client,t),this.tableOps=new nE(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function nS(e){return(nS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function nR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nT(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=nS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=nS(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==nS(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nT(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var nO=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name="vectors"===t?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function nx(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var nC=class extends nO{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name="vectors"===n?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return nR({},super.toJSON())}},nP=class extends nO{constructor(e,t,r="storage"){super(e,r),this.name="vectors"===r?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function nA(e,t,r){let n=nR({},e),s=t.toLowerCase();for(let e of Object.keys(n))e.toLowerCase()===s&&delete n[e];return n[s]=r,n}let nI=e=>{if(Array.isArray(e))return e.map(e=>nI(e));if("function"==typeof e||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,r])=>{t[e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""))]=nI(r)}),t},nj=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.msg)return e.msg;if("string"==typeof e.message)return e.message;if("string"==typeof e.error_description)return e.error_description;if("string"==typeof e.error)return e.error;if("object"==typeof e.error&&null!==e.error){let t=e.error;if("string"==typeof t.message)return t.message}}return JSON.stringify(e)},nN=async(e,t,r,n)=>{if(null!==e&&"object"==typeof e&&"json"in e&&"function"==typeof e.json){let r=parseInt(String(e.status),10);Number.isFinite(r)||(r=500),e.json().then(e=>{let s=(null==e?void 0:e.statusCode)||(null==e?void 0:e.code)||r+"";t(new nC(nj(e),r,s,n))}).catch(()=>{let s=r+"";t(new nC(e.statusText||`HTTP ${r} error`,r,s,n))})}else t(new nP(nj(e),e,n))};async function n$(e,t,r,n,s,i,a){return new Promise((o,l)=>{e(r,((e,t,r,n)=>{let s={method:e,headers:(null==t?void 0:t.headers)||{}};if("GET"===e||"HEAD"===e||!n)return nR(nR({},s),r);if((e=>{if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)})(n)){var i;let e,r=(null==t?void 0:t.headers)||{};for(let[t,n]of Object.entries(r))"content-type"===t.toLowerCase()&&(e=n);s.headers=nA(r,"Content-Type",null!=(i=e)?i:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return(null==t?void 0:t.duplex)&&(s.duplex=t.duplex),nR(nR({},s),r)})(t,n,s,i)).then(e=>{if(!e.ok)throw e;if(null==n?void 0:n.noResolveJson)return e;if("vectors"===a){let t=e.headers.get("content-type");if("0"===e.headers.get("content-length")||204===e.status||!t||!t.includes("application/json"))return{}}return e.json()}).then(e=>o(e)).catch(e=>nN(e,l,n,a))})}function nD(e="storage"){return{get:async(t,r,n,s)=>n$(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,i)=>n$(t,"POST",r,s,i,n,e),put:async(t,r,n,s,i)=>n$(t,"PUT",r,s,i,n,e),head:async(t,r,n,s)=>n$(t,"HEAD",r,nR(nR({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,i)=>n$(t,"DELETE",r,s,i,n,e)}}let{get:nL,post:nU,put:nM,head:nq,remove:nB}=nD("storage"),nH=nD("vectors");var nF=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=function(e){let t={};for(let[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}(t),this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=nA(this.headers,e,t),this}async handleOperation(e){try{return{data:await e(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nx(e))return{data:null,error:e};throw e}}};n=Symbol.toStringTag;var nV=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[n]="StreamDownloadBuilder",this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:(await this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nx(e))return{data:null,error:e};throw e}}};s=Symbol.toStringTag;var nW=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[s]="BlobDownloadBuilder",this.promise=null}asStream(){return new nV(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:await (await this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nx(e))return{data:null,error:e};throw e}}};let nG={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},nz={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var nK=class extends nF{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var s=this;return s.handleOperation(async()=>{let i,a=nR(nR({},nz),n),o=nR(nR({},s.headers),"POST"===e&&{"x-upsert":String(a.upsert)}),l=a.metadata;if("u">typeof Blob&&r instanceof Blob?((i=new FormData).append("cacheControl",a.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",r)):"u">typeof FormData&&r instanceof FormData?((i=r).has("cacheControl")||i.append("cacheControl",a.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=r,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=s.toBase64(s.encodeMetadata(l))),("u">typeof ReadableStream&&i instanceof ReadableStream||i&&"object"==typeof i&&"pipe"in i&&"function"==typeof i.pipe)&&!a.duplex&&(a.duplex="half")),null==n?void 0:n.headers)for(let[e,t]of Object.entries(n.headers))o=nA(o,e,t);let u=s._removeEmptyFolders(t),c=s._getFinalPath(u),h=await ("PUT"==e?nM:nU)(s.fetch,`${s.url}/object/${c}`,i,nR({headers:o},(null==a?void 0:a.duplex)?{duplex:a.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;let i=s._removeEmptyFolders(e),a=s._getFinalPath(i),o=new URL(s.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",t),s.handleOperation(async()=>{let e,t=nR(nR({},nz),n),a=nR(nR({},s.headers),{"x-upsert":String(t.upsert)}),l=t.metadata;if("u">typeof Blob&&r instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),l&&e.append("metadata",s.encodeMetadata(l)),e.append("",r)):"u">typeof FormData&&r instanceof FormData?((e=r).has("cacheControl")||e.append("cacheControl",t.cacheControl),l&&!e.has("metadata")&&e.append("metadata",s.encodeMetadata(l))):(e=r,a["cache-control"]=`max-age=${t.cacheControl}`,a["content-type"]=t.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),("u">typeof ReadableStream&&e instanceof ReadableStream||e&&"object"==typeof e&&"pipe"in e&&"function"==typeof e.pipe)&&!t.duplex&&(t.duplex="half")),null==n?void 0:n.headers)for(let[e,t]of Object.entries(n.headers))a=nA(a,e,t);return{path:i,fullPath:(await nM(s.fetch,o.toString(),e,nR({headers:a},(null==t?void 0:t.duplex)?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e),s=nR({},r.headers);(null==t?void 0:t.upsert)&&(s["x-upsert"]="true");let i=await nU(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),a=new URL(r.url+i.url),o=a.searchParams.get("token");if(!o)throw new nO("No token returned by API");return{signedUrl:a.toString(),path:e,token:o}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await nU(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==r?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await nU(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==r?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e),i="object"==typeof(null==r?void 0:r.transform)&&null!==r.transform&&Object.keys(r.transform).length>0,a=await nU(n.fetch,`${n.url}/object/sign/${s}`,nR({expiresIn:t},i?{transform:r.transform}:{}),{headers:n.headers}),o=new URLSearchParams;(null==r?void 0:r.download)&&o.set("download",!0===r.download?"":r.download),(null==r?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));let l=o.toString();return{signedUrl:encodeURI(`${n.url}${a.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{let s=await nU(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),i=new URLSearchParams;(null==r?void 0:r.download)&&i.set("download",!0===r.download?"":r.download),(null==r?void 0:r.cacheNonce)!=null&&i.set("cacheNonce",String(r.cacheNonce));let a=i.toString();return s.map(e=>nR(nR({},e),{},{signedUrl:e.signedURL?encodeURI(`${n.url}${e.signedURL}${a?`&${a}`:""}`):null}))})}download(e,t,r){let n="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(s,t.transform),(null==t?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));let i=s.toString(),a=this._getFinalPath(e);return new nW(()=>nL(this.fetch,`${this.url}/${n}/${a}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},r),this.shouldThrowOnError)}async info(e){var t=this;let r=t._getFinalPath(e);return t.handleOperation(async()=>nI(await nL(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t;let r=this._getFinalPath(e);try{return await nq(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nx(e)){let r=e instanceof nC?e.status:e instanceof nP?null==(t=e.originalError)?void 0:t.status:void 0;if(void 0!==r&&[400,404].includes(r))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let r=this._getFinalPath(e),n=new URLSearchParams;(null==t?void 0:t.download)&&n.set("download",!0===t.download?"":t.download),(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(n,t.transform),(null==t?void 0:t.cacheNonce)!=null&&n.set("cacheNonce",String(t.cacheNonce));let s=n.toString(),i="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await nB(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{let s=nR(nR(nR({},nG),t),{},{prefix:e||""});return await nU(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{let n=nR({},e);return await nU(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return void 0!==td.Buffer?td.Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};let nJ={"X-Client-Info":"storage-js/2.106.0"};var nX=class extends nF{constructor(e,t={},r,n){const s=new URL(e);(null==n?void 0:n.useNewHostname)&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase.")),super(s.href.replace(/\/$/,""),nR(nR({},nJ),t),r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=t.listBucketOptionsToQueryString(e);return await nL(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await nL(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await nU(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await nM(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await nU(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nB(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){let t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},nY=class extends nF{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nJ),t),r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await nU(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=new URLSearchParams;(null==e?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(null==e?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),(null==e?void 0:e.sortColumn)&&r.set("sortColumn",e.sortColumn),(null==e?void 0:e.sortOrder)&&r.set("sortOrder",e.sortOrder),(null==e?void 0:e.search)&&r.set("search",e.search);let n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await nL(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nB(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!(!(!e||"string"!=typeof e||0===e.length||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\"))&&/^[\w!.\*'() &$@=;:+,?-]+$/.test(e)))throw new nO("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new nk({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(e,t){let r=e[t];return"function"!=typeof r?r:async(...t)=>{try{return{data:await r.apply(e,t),error:null}}catch(e){if(n)throw e;return{data:null,error:e}}}}})}},nQ=class extends nF{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nJ),{},{"Content-Type":"application/json"},t),r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await nH.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await nH.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},nZ=class extends nF{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nJ),{},{"Content-Type":"application/json"},t),r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(void 0!==e.segmentCount){if(e.segmentCount<1||e.segmentCount>16)throw Error("segmentCount must be between 1 and 16");if(void 0!==e.segmentIndex&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},n0=class extends nF{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nJ),{},{"Content-Type":"application/json"},t),r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nH.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},n1=class extends n0{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new n2(this.url,this.headers,e,this.fetch)}async createBucket(e){return super.createBucket.call(this,e)}async getBucket(e){return super.getBucket.call(this,e)}async listBuckets(e={}){return super.listBuckets.call(this,e)}async deleteBucket(e){return super.deleteBucket.call(this,e)}},n2=class extends nQ{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){return super.createIndex.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName}))}async listIndexes(e={}){return super.listIndexes.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName}))}async getIndex(e){return super.getIndex.call(this,this.vectorBucketName,e)}async deleteIndex(e){return super.deleteIndex.call(this,this.vectorBucketName,e)}index(e){return new n4(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},n4=class extends nZ{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){return super.putVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async getVectors(e){return super.getVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async listVectors(e={}){return super.listVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async queryVectors(e){return super.queryVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async deleteVectors(e){return super.deleteVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}},n3=class extends nX{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new nK(this.url,this.headers,e,this.fetch)}get vectors(){return new n1(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new nY(this.url+"/iceberg",this.headers,this.fetch)}};let n6="2.106.0",n5={"X-Client-Info":`gotrue-js/${n6}`},n9="X-Supabase-Api-Version",n8={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},n7=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;class se extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function st(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class sr extends se{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}class sn extends se{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class ss extends se{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class si extends ss{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function sa(e){return st(e)&&"AuthSessionMissingError"===e.name}class so extends ss{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class sl extends ss{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class su extends ss{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class sc extends ss{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class sh extends ss{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function sd(e){return st(e)&&"AuthRetryableFetchError"===e.name}class sp extends ss{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class sf extends ss{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}let sg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),sm=" \n\r=".split(""),sb=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<sm.length;t+=1)e[sm[t].charCodeAt(0)]=-2;for(let t=0;t<sg.length;t+=1)e[sg[t].charCodeAt(0)]=t;return e})();function sy(e,t,r){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)r(sg[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)r(sg[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function sv(e,t,r){let n=sb[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(-2===n)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function sw(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=e=>{!function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}}(e,n,r)};for(let t=0;t<e.length;t+=1)sv(e.charCodeAt(t),s,i);return t.join("")}function s_(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)sv(e.charCodeAt(t),r,n);return new Uint8Array(t)}function sE(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};return e.forEach(e=>sy(e,r,n)),sy(null,r,n),t.join("")}let sk=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),sS=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},sT=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return null}},sR=async(e,t)=>{await e.removeItem(t)};class sO{constructor(){this.promise=new sO.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function sx(e){let t=e.split(".");if(3!==t.length)throw new sf("Invalid JWT structure");for(let e=0;e<t.length;e++)if(!n7.test(t[e]))throw new sf("JWT not in base64url format");return{header:JSON.parse(sw(t[0])),payload:JSON.parse(sw(t[1])),signature:s_(t[2]),raw:{header:t[0],payload:t[1]}}}async function sC(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function sP(e){return("0"+e.toString(16)).substr(-2)}async function sA(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>String.fromCharCode(e)).join("")}async function sI(e){return"u">typeof crypto&&void 0!==crypto.subtle&&"u">typeof TextEncoder?btoa(await sA(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):(console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e)}async function sj(e,t,r=!1){let n=function(){let e=new Uint32Array(56);if("u"<typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,r="";for(let n=0;n<56;n++)r+=e.charAt(Math.floor(Math.random()*t));return r}return crypto.getRandomValues(e),Array.from(e,sP).join("")}(),s=n;r&&(s+="/recovery"),await sS(e,`${t}-code-verifier`,s);let i=await sI(n),a=n===i?"plain":"s256";return[i,a]}sO.promiseConstructor=Promise;let sN=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i,s$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function sD(e){if(!s$.test(e))throw Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function sL(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function sU(){return new Proxy({},{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"==typeof t){let e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function sM(e){return JSON.parse(JSON.stringify(e))}let sq=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.msg)return e.msg;if("string"==typeof e.message)return e.message;if("string"==typeof e.error_description)return e.error_description;if("string"==typeof e.error)return e.error}return JSON.stringify(e)},sB=[502,503,504,520,521,522,523,524,530];async function sH(e){var t;let r,n;if(!("object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json))throw new sh(sq(e),0);if(sB.includes(e.status))throw new sh(sq(e),e.status);try{r=await e.json()}catch(e){throw new sn(sq(e),e)}let s=function(e){let t=e.headers.get(n9);if(!t||!t.match(sN))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch(e){return null}}(e);if(s&&s.getTime()>=n8["2024-01-01"].timestamp&&"object"==typeof r&&r&&"string"==typeof r.code?n=r.code:"object"==typeof r&&r&&"string"==typeof r.error_code&&(n=r.error_code),n){if("weak_password"===n)throw new sp(sq(r),e.status,(null==(t=r.weak_password)?void 0:t.reasons)||[]);else if("session_not_found"===n)throw new si}else if("object"==typeof r&&r&&"object"==typeof r.weak_password&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0))throw new sp(sq(r),e.status,r.weak_password.reasons);throw new sr(sq(r),e.status||500,n)}async function sF(e,t,r,n){var s;let i=Object.assign({},null==n?void 0:n.headers);i[n9]||(i[n9]=n8["2024-01-01"].name),(null==n?void 0:n.jwt)&&(i.Authorization=`Bearer ${n.jwt}`);let a=null!=(s=null==n?void 0:n.query)?s:{};(null==n?void 0:n.redirectTo)&&(a.redirect_to=n.redirectTo);let o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await sV(e,t,r+o,{headers:i,noResolveJson:null==n?void 0:n.noResolveJson},{},null==n?void 0:n.body);return(null==n?void 0:n.xform)?null==n?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function sV(e,t,r,n,s,i){let a,o,l=(o={method:t,headers:(null==n?void 0:n.headers)||{}},"GET"===t?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==n?void 0:n.headers),o.body=JSON.stringify(i),Object.assign(Object.assign({},o),s)));try{a=await e(r,Object.assign({},l))}catch(e){throw console.error(e),new sh(sq(e),0)}if(a.ok||await sH(a),null==n?void 0:n.noResolveJson)return a;try{return await a.json()}catch(e){await sH(e)}}function sW(e){var t,r,n;let s=null;(n=e).access_token&&n.refresh_token&&n.expires_in&&(s=Object.assign({},e),e.expires_at||(s.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r)));return{data:{session:s,user:null!=(t=e.user)?t:null},error:null}}function sG(e){let t=sW(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function sz(e){var t;return{data:{user:null!=(t=e.user)?t:e},error:null}}function sK(e){return{data:e,error:null}}function sJ(e){let{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=e;return{data:{properties:{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},user:Object.assign({},ry(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]))},error:null}}function sX(e){return e}let sY=["global","local","others"];class sQ{constructor({url:e="",headers:t={},fetch:r,experimental:n}){this.url=e,this.headers=t,this.fetch=sk(r),this.experimental=null!=n?n:{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=sY[0]){if(0>sY.indexOf(t))throw Error(`@supabase/auth-js: Parameter scope must be one of ${sY.join(", ")}`);try{return await sF(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await sF(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=ry(e,["options"]),n=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(n.new_email=null==r?void 0:r.newEmail,delete n.newEmail),await sF(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:sJ,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(st(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await sF(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,n,s,i,a,o;try{let l={nextPage:null,lastPage:0,total:0},u=await sF(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:sX});if(u.error)throw u.error;let c=await u.json(),h=null!=(i=u.headers.get("x-total-count"))?i:0,d=null!=(o=null==(a=u.headers.get("link"))?void 0:a.split(","))?o:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(st(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){sD(e);try{return await sF(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){sD(e);try{return await sF(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){sD(e);try{return await sF(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:sz})}catch(e){if(st(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){sD(e.userId);try{let{data:t,error:r}=await sF(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:r}}catch(e){if(st(e))return{data:null,error:e};throw e}}async _deleteFactor(e){sD(e.userId),sD(e.id);try{return{data:await sF(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){var t,r,n,s,i,a,o;try{let l={nextPage:null,lastPage:0,total:0},u=await sF(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:sX});if(u.error)throw u.error;let c=await u.json(),h=null!=(i=u.headers.get("x-total-count"))?i:0,d=null!=(o=null==(a=u.headers.get("link"))?void 0:a.split(","))?o:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(st(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await sF(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await sF(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await sF(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await sF(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await sF(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return(null==e?void 0:e.type)&&(t.type=e.type),await sF(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>{var t;return{data:{providers:null!=(t=null==e?void 0:e.providers)?t:[]},error:null}}})}catch(e){if(st(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await sF(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await sF(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await sF(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await sF(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){sL(this.experimental),sD(e.userId);try{return await sF(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(st(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){sL(this.experimental),sD(e.userId),sD(e.passkeyId);try{return await sF(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}}}function sZ(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}globalThis;class s0 extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}function s1(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}class s2 extends Error{constructor({message:e,code:t,cause:r,name:n}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=null!=(s=null!=n?n:r instanceof Error?r.name:void 0)?s:"Unknown Error",this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class s4 extends s2{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}let s3=new class{createNewAbortSignal(){if(this.controller){let e=Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};function s6(e){if(!e)throw Error("Credential creation options are required");if("u">typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:n}=e,s=ry(e,["challenge","user","excludeCredentials"]),i=s_(t).buffer,a=Object.assign(Object.assign({},r),{id:s_(r.id).buffer}),o=Object.assign(Object.assign({},s),{challenge:i,user:a});if(n&&n.length>0){o.excludeCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];o.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:s_(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return o}function s5(e){if(!e)throw Error("Credential request options are required");if("u">typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,n=ry(e,["challenge","allowCredentials"]),s=s_(t).buffer,i=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){i.allowCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];i.allowCredentials[e]=Object.assign(Object.assign({},t),{id:s_(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return i}function s9(e){var t;return"toJSON"in e&&"function"==typeof e.toJSON?e.toJSON():{id:e.id,rawId:e.id,response:{attestationObject:sE(new Uint8Array(e.response.attestationObject)),clientDataJSON:sE(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function s8(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();let r=e.getClientExtensionResults(),n=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:sE(new Uint8Array(n.authenticatorData)),clientDataJSON:sE(new Uint8Array(n.clientDataJSON)),signature:sE(new Uint8Array(n.signature)),userHandle:n.userHandle?sE(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function s7(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}async function ie(e){try{let t=await navigator.credentials.create(e);if(!t)return{data:null,error:new s4("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new s4("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){var r,n,s;let{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new s2({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if((null==(r=i.authenticatorSelection)?void 0:r.requireResidentKey)===!0)return new s2({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});else if("conditional"===t.mediation&&(null==(n=i.authenticatorSelection)?void 0:n.userVerification)==="required")return new s2({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});else if((null==(s=i.authenticatorSelection)?void 0:s.userVerification)==="required")return new s2({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if("InvalidStateError"===e.name)return new s2({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new s2({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new s2(0===i.pubKeyCredParams.filter(e=>"public-key"===e.type).length?{message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}:{message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!s7(t))return new s2({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(i.rp.id!==t)return new s2({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new s2({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new s2({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new s2({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}async function it(e){try{let t=await navigator.credentials.get(e);if(!t)return{data:null,error:new s4("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new s4("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new s2({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new s2({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!s7(t))return new s2({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new s2({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new s2({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new s2({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}let ir={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},is={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function ii(...e){let t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),n={};for(let s of e)if(s)for(let e in s){let i=s[e];if(void 0!==i)if(Array.isArray(i))n[e]=i;else if(r(i))n[e]=i;else if(t(i)){let r=n[e];t(r)?n[e]=ii(r,i):n[e]=ii(i)}else n[e]=i}return n}class ia{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:r,signal:n},s){var i,a,o,l,u;try{let{data:c,error:h}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!c)return{data:null,error:h};let d=null!=n?n:s3.createNewAbortSignal();if("create"===c.webauthn.type){let{user:e}=c.webauthn.credential_options.publicKey;if(!e.name)if(r)e.name=`${e.id}:${r}`;else{let t=(await this.client.getUser()).data.user,r=(null==(i=null==t?void 0:t.user_metadata)?void 0:i.name)||(null==t?void 0:t.email)||(null==t?void 0:t.id)||"User";e.name=`${e.id}:${r}`}e.displayName||(e.displayName=e.name)}switch(c.webauthn.type){case"create":{let t=(a=c.webauthn.credential_options.publicKey,o=null==s?void 0:s.create,ii(ir,a,o||{})),{data:r,error:n}=await ie({publicKey:t,signal:d});if(r)return{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}case"request":{let t=(l=c.webauthn.credential_options.publicKey,u=null==s?void 0:s.request,ii(is,l,u||{})),{data:r,error:n}=await it(Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:t,signal:d}));if(r)return{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}}}catch(e){if(st(e))return{data:null,error:e};return{data:null,error:new sn("Unexpected error in challenge",e)}}}async _verify({challengeId:e,factorId:t,webauthn:r}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:t,rpOrigins:r,signal:n}={}},s){if(!t)return{data:null,error:new se("rpId is required for WebAuthn authentication")};try{1;return{data:null,error:new sn("Browser does not support WebAuthn",null)}}catch(e){if(st(e))return{data:null,error:e};return{data:null,error:new sn("Unexpected error in authenticate",e)}}}async _register({friendlyName:e,webauthn:{rpId:t,rpOrigins:r,signal:n}={}},s){if(!t)return{data:null,error:new se("rpId is required for WebAuthn registration")};try{1;return{data:null,error:new sn("Browser does not support WebAuthn",null)}}catch(e){if(st(e))return{data:null,error:e};return{data:null,error:new sn("Unexpected error in register",e)}}}}if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"u">typeof self&&(self.globalThis=self)}let io={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:n5,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function il(e,t,r){return await r()}let iu={};class ic{get jwks(){var e,t;return null!=(t=null==(e=iu[this.storageKey])?void 0:e.jwks)?t:{keys:[]}}set jwks(e){iu[this.storageKey]=Object.assign(Object.assign({},iu[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!=(t=null==(e=iu[this.storageKey])?void 0:e.cachedAt)?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){iu[this.storageKey]=Object.assign(Object.assign({},iu[this.storageKey]),{cachedAt:e})}constructor(e){var t,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const n=Object.assign(Object.assign({},io),e);this.storageKey=n.storageKey,this.instanceID=null!=(t=ic.nextInstanceID[this.storageKey])?t:0,ic.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!n.debug,"function"==typeof n.debug&&(this.logger=n.debug),this.instanceID,this.persistSession=n.persistSession,this.autoRefreshToken=n.autoRefreshToken,this.experimental=null!=(r=n.experimental)?r:{},this.admin=new sQ({url:n.url,headers:n.headers,fetch:n.fetch,experimental:this.experimental}),this.url=n.url,this.headers=n.headers,this.fetch=sk(n.fetch),this.lock=n.lock||il,this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.hasCustomAuthorizationHeader=n.hasCustomAuthorizationHeader,this.throwOnError=n.throwOnError,this.lockAcquireTimeout=n.lockAcquireTimeout,n.lock?this.lock=n.lock:(this.persistSession,this.lock=il),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new ia(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(n.storage?this.storage=n.storage:(this.memoryStorage={},this.storage=sZ(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=sZ(this.memoryStorage)),n.skipAutoInitialize||this.initialize().catch(e=>{this._debug("#initialize()","error",e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${n6}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){try{return await this._recoverAndRefresh(),{error:null}}catch(e){if(st(e))return this._returnResult({error:e});return this._returnResult({error:new sn("Unexpected error during initialization",e)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,n;try{let{data:s,error:i}=await sF(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!=(r=null==(t=null==e?void 0:e.options)?void 0:t.data)?r:{},gotrue_meta_security:{captcha_token:null==(n=null==e?void 0:e.options)?void 0:n.captchaToken}},xform:sW});if(i||!s)return this._returnResult({data:{user:null,session:null},error:i});let a=s.session,o=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){var t,r,n;try{let s;if("email"in e){let{email:r,password:n,options:i}=e,a=null,o=null;"pkce"===this.flowType&&([a,o]=await sj(this.storage,this.storageKey)),s=await sF(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==i?void 0:i.emailRedirectTo,body:{email:r,password:n,data:null!=(t=null==i?void 0:i.data)?t:{},gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:a,code_challenge_method:o},xform:sW})}else if("phone"in e){let{phone:t,password:i,options:a}=e;s=await sF(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:i,data:null!=(r=null==a?void 0:a.data)?r:{},channel:null!=(n=null==a?void 0:a.channel)?n:"sms",gotrue_meta_security:{captcha_token:null==a?void 0:a.captchaToken}},xform:sW})}else throw new sl("You must provide either an email or phone number and a password");let{data:i,error:a}=s;if(a||!i)return await sR(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});let o=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",o)),this._returnResult({data:{user:l,session:o},error:null})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if("email"in e){let{email:r,password:n,options:s}=e;t=await sF(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:sG})}else if("phone"in e){let{phone:r,password:n,options:s}=e;t=await sF(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:sG})}else throw new sl("You must provide either an email or phone number and a password");let{data:r,error:n}=t;if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!r||!r.session||!r.user){let e=new so;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:n})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){var t,r,n,s;return await this._handleProviderSignIn(e.provider,{redirectTo:null==(t=e.options)?void 0:t.redirectTo,scopes:null==(r=e.options)?void 0:r.scopes,queryParams:null==(n=e.options)?void 0:n.queryParams,skipBrowserRedirect:null==(s=e.options)?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,r,n,s,i,a,o,l,u,c,h,d;let p,f;if("message"in e)p=e.message,f=e.signature;else{let{chain:c,wallet:h,statement:g,options:m}=e;if("object"!=typeof h||!(null==m?void 0:m.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");let b=new URL(null!=(t=null==m?void 0:m.url)?t:window.location.href),y=await h.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!y||0===y.length)throw Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let v=s1(y[0]),w=null==(r=null==m?void 0:m.signInWithEthereum)?void 0:r.chainId;w||(w=parseInt(await h.request({method:"eth_chainId"}),16)),p=function(e){var t;let{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:l,resources:u,scheme:c,uri:h,version:d}=e;if(!Number.isInteger(r))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!h)throw Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if("1"!==d)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(null==(t=e.statement)?void 0:t.includes("\n"))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let p=s1(e.address),f=c?`${c}://${n}`:n,g=e.statement?`${e.statement}
33
33
  `:"",m=`${f} wants you to sign in with your Ethereum account:
34
34
  ${p}
35
35
 
@@ -42,7 +42,7 @@ Expiration Time: ${s.toISOString()}`),o&&(b+=`
42
42
  Not Before: ${o.toISOString()}`),l&&(b+=`
43
43
  Request ID: ${l}`),u){let e="\nResources:";for(let t of u){if(!t||"string"!=typeof t)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`
44
44
  - ${t}`}b+=e}return`${m}
45
- ${b}`}({domain:b.host,address:v,statement:g,uri:b.href,version:"1",chainId:w,nonce:null==(n=null==m?void 0:m.signInWithEthereum)?void 0:n.nonce,issuedAt:null!=(i=null==(s=null==m?void 0:m.signInWithEthereum)?void 0:s.issuedAt)?i:new Date,expirationTime:null==(a=null==m?void 0:m.signInWithEthereum)?void 0:a.expirationTime,notBefore:null==(o=null==m?void 0:m.signInWithEthereum)?void 0:o.notBefore,requestId:null==(l=null==m?void 0:m.signInWithEthereum)?void 0:l.requestId,resources:null==(u=null==m?void 0:m.signInWithEthereum)?void 0:u.resources}),f=await h.request({method:"personal_sign",params:[(d=p,"0x"+Array.from(new TextEncoder().encode(d),e=>e.toString(16).padStart(2,"0")).join("")),v]})}try{let{data:t,error:r}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:f},(null==(c=e.options)?void 0:c.captchaToken)?{gotrue_meta_security:{captcha_token:null==(h=e.options)?void 0:h.captchaToken}}:null),xform:sG});if(r)throw r;if(!t||!t.session||!t.user){let e=new so;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){var t,r,n,s,i,a,o,l,u,c,h,d;let p,f;if("message"in e)p=e.message,f=e.signature;else{let{chain:h,wallet:d,statement:g,options:m}=e;if("object"!=typeof d||!(null==m?void 0:m.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");let b=new URL(null!=(t=null==m?void 0:m.url)?t:window.location.href);if("signIn"in d&&d.signIn){let e,t=await d.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},null==m?void 0:m.signInWithSolana),{version:"1",domain:b.host,uri:b.href}),g?{statement:g}:null));if(Array.isArray(t)&&t[0]&&"object"==typeof t[0])e=t[0];else if(t&&"object"==typeof t&&"signedMessage"in t&&"signature"in t)e=t;else throw Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in e&&"signature"in e&&("string"==typeof e.signedMessage||e.signedMessage instanceof Uint8Array)&&e.signature instanceof Uint8Array)p="string"==typeof e.signedMessage?e.signedMessage:new TextDecoder().decode(e.signedMessage),f=e.signature;else throw Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in d)||"function"!=typeof d.signMessage||!("publicKey"in d)||"object"!=typeof d||!d.publicKey||!("toBase58"in d.publicKey)||"function"!=typeof d.publicKey.toBase58)throw Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");p=[`${b.host} wants you to sign in with your Solana account:`,d.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${b.href}`,`Issued At: ${null!=(n=null==(r=null==m?void 0:m.signInWithSolana)?void 0:r.issuedAt)?n:new Date().toISOString()}`,...(null==(s=null==m?void 0:m.signInWithSolana)?void 0:s.notBefore)?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...(null==(i=null==m?void 0:m.signInWithSolana)?void 0:i.expirationTime)?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...(null==(a=null==m?void 0:m.signInWithSolana)?void 0:a.chainId)?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...(null==(o=null==m?void 0:m.signInWithSolana)?void 0:o.nonce)?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...(null==(l=null==m?void 0:m.signInWithSolana)?void 0:l.requestId)?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...(null==(c=null==(u=null==m?void 0:m.signInWithSolana)?void 0:u.resources)?void 0:c.length)?["Resources",...m.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");let e=await d.signMessage(new TextEncoder().encode(p),"utf8");if(!e||!(e instanceof Uint8Array))throw Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");f=e}}try{let{data:t,error:r}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:sE(f)},(null==(h=e.options)?void 0:h.captchaToken)?{gotrue_meta_security:{captcha_token:null==(d=e.options)?void 0:d.captchaToken}}:null),xform:sG});if(r)throw r;if(!t||!t.session||!t.user){let e=new so;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let t=await sT(this.storage,`${this.storageKey}-code-verifier`),[r,n]=(null!=t?t:"").split("/");try{if(!r&&"pkce"===this.flowType)throw new sc;let{data:t,error:s}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:sG});if(await sR(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!t||!t.session||!t.user){let e=new so;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("recovery"===n?"PASSWORD_RECOVERY":"SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=n?n:null}),error:s})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:r,token:n,access_token:s,nonce:i}=e,{data:a,error:o}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:sG});if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!a||!a.session||!a.user){let e=new so;return this._returnResult({data:{user:null,session:null},error:e})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:o})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){var t,r,n,s,i;try{if("email"in e){let{email:n,options:s}=e,i=null,a=null;"pkce"===this.flowType&&([i,a]=await sN(this.storage,this.storageKey));let{error:o}=await sF(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:n,data:null!=(t=null==s?void 0:s.data)?t:{},create_user:null==(r=null==s?void 0:s.shouldCreateUser)||r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}if("phone"in e){let{phone:t,options:r}=e,{data:a,error:o}=await sF(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!=(n=null==r?void 0:r.data)?n:{},create_user:null==(s=null==r?void 0:r.shouldCreateUser)||s,gotrue_meta_security:{captcha_token:null==r?void 0:r.captchaToken},channel:null!=(i=null==r?void 0:r.channel)?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==a?void 0:a.message_id},error:o})}throw new sl("You must provide either an email or phone number.")}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){var t,r;try{let n,s;"options"in e&&(n=null==(t=e.options)?void 0:t.redirectTo,s=null==(r=e.options)?void 0:r.captchaToken);let{data:i,error:a}=await sF(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:n,xform:sG});if(a)throw a;if(!i)throw Error("An error occurred on token verification.");let o=i.session,l=i.user;return(null==o?void 0:o.access_token)&&(await this._saveSession(o),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",o)),this._returnResult({data:{user:l,session:o},error:null})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){var t,r,n,s;try{let i=null,a=null;"pkce"===this.flowType&&([i,a]=await sN(this.storage,this.storageKey));let o=await sF(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!=(r=null==(t=e.options)?void 0:t.redirectTo)?r:void 0}),(null==(n=null==e?void 0:e.options)?void 0:n.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:a}),headers:this.headers,xform:sK});return null==(s=o.data)||s.url,this._returnResult(o)}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new si;let{error:n}=await sF(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:n})})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if("email"in e){let{email:r,type:n,options:s}=e,{error:i}=await sF(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:i})}if("phone"in e){let{phone:r,type:n,options:s}=e,{data:i,error:a}=await sF(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==i?void 0:i.message_id},error:a})}throw new sl("You must provide either an email or phone number and a type")}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch(e){}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let t=null,r=await sT(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),null!==r&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let n=!!t.expires_at&&1e3*t.expires_at-Date.now()<9e4;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){let e=await sT(this.userStorage,this.storageKey+"-user");(null==e?void 0:e.user)?t.user=e.user:t.user=sU()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){var e;let r={value:this.suppressGetSessionWarning};t.user=(e=t.user,new Proxy(e,{get:(e,t,n)=>{if("__isInsecureUserWarningProxy"===t)return!0;if("symbol"==typeof t){let r=t.toString();if("Symbol(Symbol.toPrimitive)"===r||"Symbol(Symbol.toStringTag)"===r||"Symbol(util.inspect.custom)"===r||"Symbol(nodejs.util.inspect.custom)"===r)return Reflect.get(e,t,n)}return r.value||"string"!=typeof t||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),r.value=!0),Reflect.get(e,t,n)}})),r.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}let{data:s,error:i}=await this._callRefreshToken(t.refresh_token);if(i)return this._returnResult({data:{session:null},error:i});return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{if(e)return await sF(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:sz});return await this._useSession(async e=>{var t,r,n;let{data:s,error:i}=e;if(i)throw i;return(null==(t=s.session)?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await sF(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!=(n=null==(r=s.session)?void 0:r.access_token)?n:void 0,xform:sz}):{data:{user:null},error:new si}})}catch(e){if(st(e))return sa(e)&&(await this._removeSession(),await sR(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{let{data:n,error:s}=r;if(s)throw s;if(!n.session)throw new si;let i=n.session,a=null,o=null;"pkce"===this.flowType&&null!=e.email&&([a,o]=await sN(this.storage,this.storageKey));let{data:l,error:u}=await sF(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:o}),jwt:i.access_token,xform:sz});if(u)throw u;return i.user=l.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new si;let t=Date.now()/1e3,r=t,n=!0,s=null,{payload:i}=sx(e.access_token);if(i.exp&&(n=(r=i.exp)<=t),n){let{data:t,error:r}=await this._callRefreshToken(e.refresh_token);if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!t)return{data:{user:null,session:null},error:null};s=t}else{let{data:n,error:i}=await this._getUser(e.access_token);if(i)return this._returnResult({data:{user:null,session:null},error:i});s={access_token:e.access_token,refresh_token:e.refresh_token,user:n.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(e){if(st(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:n,error:s}=t;if(s)throw s;e=null!=(r=n.session)?r:void 0}if(!(null==e?void 0:e.refresh_token))throw new si;let{data:n,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{throw new su("No browser detected.")}catch(e){if(st(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return"function"==typeof this.detectSessionInUrl?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await sT(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s&&!sa(s))return this._returnResult({error:s});let i=null==(r=n.session)?void 0:r.access_token;if(i){let{error:t}=await this.admin.signOut(i,e);if(t&&!(st(t)&&"AuthApiError"===t.name&&(404===t.status||401===t.status||403===t.status)||sa(t)))return this._returnResult({error:t})}return"others"!==e&&(await this._removeSession(),await sR(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=Symbol("auth-callback"),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{let{data:{session:n},error:s}=t;if(s)throw s;await (null==(r=this.stateChangeEmitters.get(e))?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(t){await (null==(n=this.stateChangeEmitters.get(e))?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),sa(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null;"pkce"===this.flowType&&([r,n]=await sN(this.storage,this.storageKey,!0));try{return await sF(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:n,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){var e;try{let{data:t,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:null!=(e=t.user.identities)?e:[]},error:null})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:r}=await this._useSession(async t=>{var r,n,s,i,a;let{data:o,error:l}=t;if(l)throw l;let u=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null==(r=e.options)?void 0:r.redirectTo,scopes:null==(n=e.options)?void 0:n.scopes,queryParams:null==(s=e.options)?void 0:s.queryParams,skipBrowserRedirect:!0});return await sF(this.fetch,"GET",u,{headers:this.headers,jwt:null!=(a=null==(i=o.session)?void 0:i.access_token)?a:void 0})});if(r)throw r;return this._returnResult({data:{provider:e.provider,url:null==t?void 0:t.url},error:null})}catch(t){if(st(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var r;try{let{error:n,data:{session:s}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:l,nonce:u}=e,{data:c,error:h}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:null!=(r=null==s?void 0:s.access_token)?r:void 0,body:{provider:a,id_token:o,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:sG});if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!c||!c.session||!c.user)return this._returnResult({data:{user:null,session:null},error:new so});return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("USER_UPDATED",c.session)),this._returnResult({data:c,error:h})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,n;let{data:s,error:i}=t;if(i)throw i;return await sF(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!=(n=null==(r=s.session)?void 0:r.access_token)?n:void 0})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{var r,n;let s=Date.now();return await (r=async r=>(r>0&&await sC(200*Math.pow(2,r-1)),this._debug(t,"refreshing attempt",r),await sF(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:sG})),n=(e,t)=>{let r=200*Math.pow(2,e);return t&&sd(t)&&Date.now()+r-s<3e4},new Promise((e,t)=>{(async()=>{for(let s=0;s<1/0;s++)try{let t=await r(s);if(!n(s,null,t))return void e(t)}catch(e){if(!n(s,e))return void t(e)}})()}))}catch(e){if(this._debug(t,"error",e),st(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,t;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await sT(this.storage,this.storageKey);if(n&&this.userStorage){let t=await sT(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!t&&(t={user:n.user},await sS(this.userStorage,this.storageKey+"-user",t)),n.user=null!=(e=null==t?void 0:t.user)?e:sU()}else if(n&&!n.user&&!n.user){let e=await sT(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(n.user=e.user,await sR(this.storage,this.storageKey+"-user"),await sS(this.storage,this.storageKey,n)):n.user=sU()}if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),null!==n&&await this._removeSession();return}let s=(null!=(t=n.expires_at)?t:1/0)*1e3-Date.now()<9e4;if(this._debug(r,`session has${s?"":" not"} expired with margin of 90000s`),s){if(this.autoRefreshToken&&n.refresh_token){let{error:e}=await this._callRefreshToken(n.refresh_token);e&&(console.error(e),sd(e)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else if(n.user&&!0===n.user.__isUserNotAvailableProxy)try{let{data:e,error:t}=await this._getUser(n.access_token);!t&&(null==e?void 0:e.user)?(n.user=e.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(e){console.error("Error getting user data:",e),this._debug(r,"error getting user data, skipping SIGNED_IN notification",e)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(e){this._debug(r,"error",e),console.error(e);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new si;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let n=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{this.refreshingDeferred=new sO;let{data:t,error:r}=await this._refreshAccessToken(e);if(r)throw r;if(!t.session)throw new si;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let n={data:t.session,error:null};return this.refreshingDeferred.resolve(n),n}catch(e){if(this._debug(n,"error",e),st(e)){let r={data:null,error:e};return sd(e)||await this._removeSession(),null==(t=this.refreshingDeferred)||t.resolve(r),r}throw null==(r=this.refreshingDeferred)||r.reject(e),e}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){let n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async r=>{try{await r.callback(e,t)}catch(e){n.push(e)}});if(await Promise.all(s),n.length>0){for(let e=0;e<n.length;e+=1)console.error(n[e]);throw n[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await sR(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),r=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!r&&t.user&&await sS(this.userStorage,this.storageKey+"-user",{user:t.user});let e=Object.assign({},t);delete e.user;let n=sM(e);await sS(this.storage,this.storageKey,n)}else{let e=sM(t);await sS(this.storage,this.storageKey,e)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await sR(this.storage,this.storageKey),await sR(this.storage,this.storageKey+"-code-verifier"),await sR(this.storage,this.storageKey+"-user"),this.userStorage&&await sR(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()"),this.visibilityChangedCallback,this.visibilityChangedCallback=null}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&"object"==typeof t&&"function"==typeof t.unref?t.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");let n=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),n<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof s0)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){return this._debug("#_handleVisibilityChange()"),this.autoRefreshToken&&this.startAutoRefresh(),!1}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{"visible"!==document.visibilityState?this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting"):await this._recoverAndRefresh()}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){let n=[`provider=${encodeURIComponent(t)}`];if((null==r?void 0:r.redirectTo)&&n.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),(null==r?void 0:r.scopes)&&n.push(`scopes=${encodeURIComponent(r.scopes)}`),"pkce"===this.flowType){let[e,t]=await sN(this.storage,this.storageKey),r=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});n.push(r.toString())}if(null==r?void 0:r.queryParams){let e=new URLSearchParams(r.queryParams);n.push(e.toString())}return(null==r?void 0:r.skipBrowserRedirect)&&n.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${n.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;return s?this._returnResult({data:null,error:s}):await sF(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;let{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:o,error:l}=await sF(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:null==(r=null==s?void 0:s.session)?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):("totp"===e.factorType&&"totp"===o.type&&(null==(n=null==o?void 0:o.totp)?void 0:n.qr_code)&&(o.totp.qr_code=`data:image/svg+xml;utf-8,${o.totp.qr_code}`),this._returnResult({data:o,error:null}))})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});let i=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?s9(e.webauthn.credential_response):s8(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await sF(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:o}))})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});let i=await sF(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});if(i.error)return i;let{data:a}=i;if("webauthn"!==a.type)return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:s6(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:s5(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;let{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};let n={all:[],phone:[],totp:[],webauthn:[]};for(let r of null!=(e=null==t?void 0:t.factors)?e:[])n.all.push(r),"verified"===r.status&&n[r.factor_type].push(r);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,r,n,s;if(e)try{let{payload:n}=sx(e),s=null;n.aal&&(s=n.aal);let i=s,{data:{user:a},error:o}=await this.getUser(e);if(o)return this._returnResult({data:null,error:o});(null!=(r=null==(t=null==a?void 0:a.factors)?void 0:t.filter(e=>"verified"===e.status))?r:[]).length>0&&(i="aal2");let l=n.amr||[];return{data:{currentLevel:s,nextLevel:i,currentAuthenticationMethods:l},error:null}}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:i},error:a}=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:o}=sx(i.access_token),l=null;o.aal&&(l=o.aal);let u=l;return(null!=(s=null==(n=i.user.factors)?void 0:n.filter(e=>"verified"===e.status))?s:[]).length>0&&(u="aal2"),{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:o.amr||[]},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await sF(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new si})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let s=await sF(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url,s})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let s=await sF(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url,s})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;return r?this._returnResult({data:null,error:r}):t?await sF(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new si})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?(await sF(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new si})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(t=>t.kid===e);if(r)return r;let n=Date.now();if((r=this.jwks.keys.find(t=>t.kid===e))&&this.jwks_cached_at+6e5>n)return r;let{data:s,error:i}=await sF(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return s.keys&&0!==s.keys.length&&(this.jwks=s,this.jwks_cached_at=n,r=s.keys.find(t=>t.kid===e))?r:null}async getClaims(e,t={}){try{var r;let n,s=e;if(!s){let{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});s=e.session.access_token}let{header:i,payload:a,signature:o,raw:{header:l,payload:u}}=sx(s);(null==t?void 0:t.allowExpired)||function(e){if(!e)throw Error("Missing exp claim");if(e<=Math.floor(Date.now()/1e3))throw Error("JWT has expired")}(a.exp);let c=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks);if(!c){let{error:e}=await this.getUser(s);if(e)throw e;return{data:{claims:a,header:i,signature:o},error:null}}let h=function(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw Error("Invalid alg claim")}}(i.alg),d=await crypto.subtle.importKey("jwk",c,h,!0,["verify"]);if(!await crypto.subtle.verify(h,d,o,(r=`${l}.${u}`,n=[],!function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(r,e=>n.push(e)),new Uint8Array(n))))throw new sf("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){var t,r,n;sL(this.experimental);try{1;return this._returnResult({data:null,error:new sn("Browser does not support WebAuthn",null)})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){var t,r;sL(this.experimental);try{1;return this._returnResult({data:null,error:new sn("Browser does not support WebAuthn",null)})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){sL(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new si});let{data:n,error:s}=await sF(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){sL(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let{data:s,error:i}=await sF(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){var t;sL(this.experimental);try{let{data:r,error:n}=await sF(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:null==(t=null==e?void 0:e.options)?void 0:t.captchaToken}}});if(n)return this._returnResult({data:null,error:n});return this._returnResult({data:r,error:null})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){sL(this.experimental);try{let{data:t,error:r}=await sF(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:sG});if(r)return this._returnResult({data:null,error:r});return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:t,error:null})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){sL(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new si});let{data:n,error:s}=await sF(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){sL(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let{data:s,error:i}=await sF(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:e.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){sL(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let{error:s}=await sF(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return s?this._returnResult({data:null,error:s}):this._returnResult({data:null,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}}ic.nextInstanceID={};let ih=ic,id="";id="u">typeof Deno?"deno":"u">typeof document?"web":"u">typeof navigator&&"ReactNative"===navigator.product?"react-native":"node";let ip={headers:{"X-Client-Info":`supabase-js-${id}/2.106.0`}},ig={schema:"public"},im={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ib={},iy={enabled:!1,respectSamplingDecision:!0},iv=null;function iw(e){return(iw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function iE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i_(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=iw(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=iw(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==iw(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i_(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}async function ik(e,t,r){if(!function(e,t){let r;if(!e||!t||0===t.length)return!1;if(e instanceof URL)r=e;else try{r=new URL(e)}catch(e){return!1}for(let e of t)try{if("string"==typeof e){if(function(e,t){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(2);if(e.endsWith(r)&&(e===r||e.endsWith("."+r)))return!0}return!1}(r.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(r.hostname))return!0}else if("function"==typeof e&&e(r))return!0}catch(e){continue}return!1}("string"==typeof e||e instanceof URL?e:e.url,t))return null;let n=await function(){var e,t,r,n;return e=this,t=void 0,r=void 0,n=function*(){try{let e=yield(null===iv&&(iv=import("@opentelemetry/api").catch(()=>null)),iv);if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let r=t.traceparent;if(!r)return null;return{traceparent:r,tracestate:t.tracestate,baggage:t.baggage}}catch(e){return null}},new(r||(r=Promise))(function(s,i){function a(e){try{l(n.next(e))}catch(e){i(e)}}function o(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((n=n.apply(e,t||[])).next())})}();if(!n||!n.traceparent)return null;if(r){let e=function(e){if(!e||"string"!=typeof e)return null;let t=e.split("-");if(4!==t.length)return null;let[r,n,s,i]=t;if(2!==r.length||32!==n.length||16!==s.length||2!==i.length)return null;let a=/^[0-9a-f]+$/i;return a.test(r)&&a.test(n)&&a.test(s)&&a.test(i)&&"00000000000000000000000000000000"!==n&&"0000000000000000"!==s?{version:r,traceId:n,parentId:s,traceFlags:i,isSampled:(1&parseInt(i,16))==1}:null}(n.traceparent);if(e&&!e.isSampled)return null}return n}function iS(e){return"boolean"==typeof e?{enabled:e}:e}var iT=class extends ih{constructor(e){super(e)}},iR=class{constructor(e,t,r){var n,s,i;this.supabaseUrl=e,this.supabaseKey=t;const a=function(e){let t=null==e?void 0:e.trim();if(!t)throw Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(t.endsWith("/")?t:t+"/")}catch(e){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}(e);if(!t)throw Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,l=function(e,t){var r,n,s,i,a,o;let{db:l,auth:u,realtime:c,global:h}=e,{db:d,auth:p,realtime:f,global:g}=t,m=iS(e.tracePropagation),b=iS(t.tracePropagation),y={db:iE(iE({},d),l),auth:iE(iE({},p),u),realtime:iE(iE({},f),c),storage:{},global:iE(iE(iE({},g),h),{},{headers:iE(iE({},null!=(r=null==g?void 0:g.headers)?r:{}),null!=(n=null==h?void 0:h.headers)?n:{})}),tracePropagation:{enabled:null!=(s=null!=(i=null==m?void 0:m.enabled)?i:null==b?void 0:b.enabled)&&s,respectSamplingDecision:null==(a=null!=(o=null==m?void 0:m.respectSamplingDecision)?o:null==b?void 0:b.respectSamplingDecision)||a},accessToken:async()=>""};return e.accessToken?y.accessToken=e.accessToken:delete y.accessToken,y}(null!=r?r:{},{db:ig,realtime:ib,auth:iE(iE({},im),{},{storageKey:o}),global:ip,tracePropagation:iy});this.settings=l,this.storageKey=null!=(n=l.auth.storageKey)?n:"",this.headers=null!=(s=l.global.headers)?s:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!=(i=l.auth)?i:{},this.headers,l.global.fetch),this.fetch=((e,t,r,n,s)=>{let i=n?(...e)=>n(...e):(...e)=>fetch(...e),a=Headers,o=(null==s?void 0:s.enabled)===!0,l=(null==s?void 0:s.respectSamplingDecision)!==!1,u=o?function(e){let t=[];try{let r=new URL(e);t.push(r.hostname)}catch(e){}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}(t):null;return async(t,n)=>{var s;let o=null!=(s=await r())?s:e,c=new a(null==n?void 0:n.headers);if(c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${o}`),u){let e=await ik(t,u,l);e&&(e.traceparent&&!c.has("traceparent")&&c.set("traceparent",e.traceparent),e.tracestate&&!c.has("tracestate")&&c.set("tracestate",e.tracestate),e.baggage&&!c.has("baggage")&&c.set("baggage",e.baggage))}return i(t,iE(iE({},n),{},{headers:c}))}})(t,e,this._getAccessToken.bind(this),l.global.fetch,l.tracePropagation),this.realtime=this._initRealtimeClient(iE({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn("Failed to set initial Realtime auth token:",e)),this.rest=new rN(new URL("rest/v1",a).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new n3(this.storageUrl.href,this.headers,this.fetch,null==r?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new rv(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,t;if(this.accessToken)return await this.accessToken();let{data:r}=await this.auth.getSession();return null!=(e=null==(t=r.session)?void 0:t.access_token)?e:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:a,lock:o,debug:l,throwOnError:u,experimental:c,lockAcquireTimeout:h,skipAutoInitialize:d},p,f){let g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new iT({url:this.authUrl.href,headers:iE(iE({},g),p),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:a,lock:o,debug:l,throwOnError:u,experimental:c,fetch:f,lockAcquireTimeout:h,skipAutoInitialize:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new nm(this.realtimeUrl.href,iE(iE({},e),{},{params:iE(iE({},{apikey:this.supabaseKey}),null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,r){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}};(function(){let e=globalThis.process;if(!e)return!1;let t=e.version;if(null==t)return!1;let r=t.match(/^v(\d+)\./);return!!r&&18>=parseInt(r[1],10)})()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");var iO=e.i(59692);let ix={path:"/",sameSite:"lax",httpOnly:!1,maxAge:3456e4},iC=/^(.*)[.](0|[1-9][0-9]*)$/;function iP(e,t){if(e===t)return!0;let r=e.match(iC);return!!r&&r[1]===t}function iA(e,t,r){let n=r??3180,s=encodeURIComponent(t);if(s.length<=n)return[{name:e,value:t}];let i=[];for(;s.length>0;){let e=s.slice(0,n),t=e.lastIndexOf("%");t>n-3&&(e=e.slice(0,t));let r="";for(;e.length>0;)try{r=decodeURIComponent(e);break}catch(t){if(t instanceof URIError&&"%"===e.at(-3)&&e.length>3)e=e.slice(0,e.length-3);else throw t}i.push(r),s=s.slice(e.length)}return i.map((t,r)=>({name:`${e}.${r}`,value:t}))}async function iI(e,t){let r=await t(e);if(r)return r;let n=[];for(let r=0;;r++){let s=`${e}.${r}`,i=await t(s);if(!i)break;n.push(i)}return n.length>0?n.join(""):null}iO.parse,iO.serialize;let iN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),ij=" \n\r=".split(""),i$=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<ij.length;t+=1)e[ij[t].charCodeAt(0)]=-2;for(let t=0;t<iN.length;t+=1)e[iN[t].charCodeAt(0)]=t;return e})();function iD(e){let t=[],r=0,n=0;if(function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(e,e=>{for(r=r<<8|e,n+=8;n>=6;){let e=r>>n-6&63;t.push(iN[e]),n-=6}}),n>0)for(r<<=6-n,n=6;n>=6;){let e=r>>n-6&63;t.push(iN[e]),n-=6}return t.join("")}let iL="base64-";function iU(e){let t;if(!e.startsWith(iL))return e;try{t=function(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},s=0,i=0;for(let t=0;t<e.length;t+=1){let a=i$[e.charCodeAt(t)];if(a>-1)for(s=s<<6|a,i+=6;i>=8;)(function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}})(s>>i-8&255,n,r),i-=8;else if(-2===a)continue;else throw Error(`Invalid Base64-URL character "${e.at(t)}" at position ${t}`)}return t.join("")}(e.substring(iL.length))}catch(e){return console.warn("@supabase/ssr: could not base64url-decode chunked cookie value, treating as absent. Cookie chunks may have been written partially across responses.",e),null}try{JSON.parse(t)}catch{return console.warn("@supabase/ssr: chunked cookie decoded to invalid JSON, treating as absent. This usually indicates that cookie chunks from different writes were combined (e.g. response committed before all Set-Cookie headers were sent)."),null}return t}async function iM({getAll:e,setAll:t,setItems:r,removedItems:n},s){let i=s.cookieEncoding,a=s.cookieOptions??null,o=await e([...r?Object.keys(r):[],...n?Object.keys(n):[]]),l=o?.map(({name:e})=>e)||[],u=Object.keys(n).flatMap(e=>l.filter(t=>iP(t,e))),c=Object.keys(r).flatMap(e=>{let t=new Set(l.filter(t=>iP(t,e))),n=r[e];"base64url"===i&&(n=iL+iD(n));let s=iA(e,n);return s.forEach(e=>{t.delete(e.name)}),u.push(...t),s}),h={...ix,...a,maxAge:0},d={...ix,...a,maxAge:ix.maxAge};delete h.name,delete d.name,await t([...u.map(e=>({name:e,value:"",options:h})),...c.map(({name:e,value:t})=>({name:e,value:t,options:d}))],{"Cache-Control":"private, no-cache, no-store, must-revalidate, max-age=0",Expires:"0",Pragma:"no-cache"})}let iB=!1,iq=["@supabase/auth-helpers-nextjs","@supabase/auth-helpers-react","@supabase/auth-helpers-remix","@supabase/auth-helpers-sveltekit"];function iH(){let e=process.env.NEXT_PUBLIC_SUPABASE_URL?.trim()??"",t=process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY?.trim()??"";return e.length>0&&t.length>0}async function iF(e){if(!iH())return e_.next();let{supabase:t,response:r}=function(e){let t=e_.next({request:e}),{anon_key:r,url:n}=function(){if(!iH())throw Error("Supabase is not configured");return{url:process.env.NEXT_PUBLIC_SUPABASE_URL.trim(),anon_key:process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY.trim()}}();return{supabase:function(e,t,r){if(!function(){if(iB||"u"<typeof process||!process.env?.npm_package_name)return;let e=process.env.npm_package_name;iq.includes(e)&&(iB=!0,console.warn(`
45
+ ${b}`}({domain:b.host,address:v,statement:g,uri:b.href,version:"1",chainId:w,nonce:null==(n=null==m?void 0:m.signInWithEthereum)?void 0:n.nonce,issuedAt:null!=(i=null==(s=null==m?void 0:m.signInWithEthereum)?void 0:s.issuedAt)?i:new Date,expirationTime:null==(a=null==m?void 0:m.signInWithEthereum)?void 0:a.expirationTime,notBefore:null==(o=null==m?void 0:m.signInWithEthereum)?void 0:o.notBefore,requestId:null==(l=null==m?void 0:m.signInWithEthereum)?void 0:l.requestId,resources:null==(u=null==m?void 0:m.signInWithEthereum)?void 0:u.resources}),f=await h.request({method:"personal_sign",params:[(d=p,"0x"+Array.from(new TextEncoder().encode(d),e=>e.toString(16).padStart(2,"0")).join("")),v]})}try{let{data:t,error:r}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:f},(null==(c=e.options)?void 0:c.captchaToken)?{gotrue_meta_security:{captcha_token:null==(h=e.options)?void 0:h.captchaToken}}:null),xform:sW});if(r)throw r;if(!t||!t.session||!t.user){let e=new so;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){var t,r,n,s,i,a,o,l,u,c,h,d;let p,f;if("message"in e)p=e.message,f=e.signature;else{let{chain:h,wallet:d,statement:g,options:m}=e;if("object"!=typeof d||!(null==m?void 0:m.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");let b=new URL(null!=(t=null==m?void 0:m.url)?t:window.location.href);if("signIn"in d&&d.signIn){let e,t=await d.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},null==m?void 0:m.signInWithSolana),{version:"1",domain:b.host,uri:b.href}),g?{statement:g}:null));if(Array.isArray(t)&&t[0]&&"object"==typeof t[0])e=t[0];else if(t&&"object"==typeof t&&"signedMessage"in t&&"signature"in t)e=t;else throw Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in e&&"signature"in e&&("string"==typeof e.signedMessage||e.signedMessage instanceof Uint8Array)&&e.signature instanceof Uint8Array)p="string"==typeof e.signedMessage?e.signedMessage:new TextDecoder().decode(e.signedMessage),f=e.signature;else throw Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in d)||"function"!=typeof d.signMessage||!("publicKey"in d)||"object"!=typeof d||!d.publicKey||!("toBase58"in d.publicKey)||"function"!=typeof d.publicKey.toBase58)throw Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");p=[`${b.host} wants you to sign in with your Solana account:`,d.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${b.href}`,`Issued At: ${null!=(n=null==(r=null==m?void 0:m.signInWithSolana)?void 0:r.issuedAt)?n:new Date().toISOString()}`,...(null==(s=null==m?void 0:m.signInWithSolana)?void 0:s.notBefore)?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...(null==(i=null==m?void 0:m.signInWithSolana)?void 0:i.expirationTime)?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...(null==(a=null==m?void 0:m.signInWithSolana)?void 0:a.chainId)?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...(null==(o=null==m?void 0:m.signInWithSolana)?void 0:o.nonce)?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...(null==(l=null==m?void 0:m.signInWithSolana)?void 0:l.requestId)?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...(null==(c=null==(u=null==m?void 0:m.signInWithSolana)?void 0:u.resources)?void 0:c.length)?["Resources",...m.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");let e=await d.signMessage(new TextEncoder().encode(p),"utf8");if(!e||!(e instanceof Uint8Array))throw Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");f=e}}try{let{data:t,error:r}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:sE(f)},(null==(h=e.options)?void 0:h.captchaToken)?{gotrue_meta_security:{captcha_token:null==(d=e.options)?void 0:d.captchaToken}}:null),xform:sW});if(r)throw r;if(!t||!t.session||!t.user){let e=new so;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let t=await sT(this.storage,`${this.storageKey}-code-verifier`),[r,n]=(null!=t?t:"").split("/");try{if(!r&&"pkce"===this.flowType)throw new sc;let{data:t,error:s}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:sW});if(await sR(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!t||!t.session||!t.user){let e=new so;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("recovery"===n?"PASSWORD_RECOVERY":"SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=n?n:null}),error:s})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:r,token:n,access_token:s,nonce:i}=e,{data:a,error:o}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:sW});if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!a||!a.session||!a.user){let e=new so;return this._returnResult({data:{user:null,session:null},error:e})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:o})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){var t,r,n,s,i;try{if("email"in e){let{email:n,options:s}=e,i=null,a=null;"pkce"===this.flowType&&([i,a]=await sj(this.storage,this.storageKey));let{error:o}=await sF(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:n,data:null!=(t=null==s?void 0:s.data)?t:{},create_user:null==(r=null==s?void 0:s.shouldCreateUser)||r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}if("phone"in e){let{phone:t,options:r}=e,{data:a,error:o}=await sF(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!=(n=null==r?void 0:r.data)?n:{},create_user:null==(s=null==r?void 0:r.shouldCreateUser)||s,gotrue_meta_security:{captcha_token:null==r?void 0:r.captchaToken},channel:null!=(i=null==r?void 0:r.channel)?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==a?void 0:a.message_id},error:o})}throw new sl("You must provide either an email or phone number.")}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){var t,r;try{let n,s;"options"in e&&(n=null==(t=e.options)?void 0:t.redirectTo,s=null==(r=e.options)?void 0:r.captchaToken);let{data:i,error:a}=await sF(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:n,xform:sW});if(a)throw a;if(!i)throw Error("An error occurred on token verification.");let o=i.session,l=i.user;return(null==o?void 0:o.access_token)&&(await this._saveSession(o),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",o)),this._returnResult({data:{user:l,session:o},error:null})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){var t,r,n,s;try{let i=null,a=null;"pkce"===this.flowType&&([i,a]=await sj(this.storage,this.storageKey));let o=await sF(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!=(r=null==(t=e.options)?void 0:t.redirectTo)?r:void 0}),(null==(n=null==e?void 0:e.options)?void 0:n.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:a}),headers:this.headers,xform:sK});return null==(s=o.data)||s.url,this._returnResult(o)}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new si;let{error:n}=await sF(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:n})})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if("email"in e){let{email:r,type:n,options:s}=e,{error:i}=await sF(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:i})}if("phone"in e){let{phone:r,type:n,options:s}=e,{data:i,error:a}=await sF(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==i?void 0:i.message_id},error:a})}throw new sl("You must provide either an email or phone number and a type")}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch(e){}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let t=null,r=await sT(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),null!==r&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let n=!!t.expires_at&&1e3*t.expires_at-Date.now()<9e4;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){let e=await sT(this.userStorage,this.storageKey+"-user");(null==e?void 0:e.user)?t.user=e.user:t.user=sU()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){var e;let r={value:this.suppressGetSessionWarning};t.user=(e=t.user,new Proxy(e,{get:(e,t,n)=>{if("__isInsecureUserWarningProxy"===t)return!0;if("symbol"==typeof t){let r=t.toString();if("Symbol(Symbol.toPrimitive)"===r||"Symbol(Symbol.toStringTag)"===r||"Symbol(util.inspect.custom)"===r||"Symbol(nodejs.util.inspect.custom)"===r)return Reflect.get(e,t,n)}return r.value||"string"!=typeof t||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),r.value=!0),Reflect.get(e,t,n)}})),r.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}let{data:s,error:i}=await this._callRefreshToken(t.refresh_token);if(i)return this._returnResult({data:{session:null},error:i});return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{if(e)return await sF(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:sz});return await this._useSession(async e=>{var t,r,n;let{data:s,error:i}=e;if(i)throw i;return(null==(t=s.session)?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await sF(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!=(n=null==(r=s.session)?void 0:r.access_token)?n:void 0,xform:sz}):{data:{user:null},error:new si}})}catch(e){if(st(e))return sa(e)&&(await this._removeSession(),await sR(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{let{data:n,error:s}=r;if(s)throw s;if(!n.session)throw new si;let i=n.session,a=null,o=null;"pkce"===this.flowType&&null!=e.email&&([a,o]=await sj(this.storage,this.storageKey));let{data:l,error:u}=await sF(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:o}),jwt:i.access_token,xform:sz});if(u)throw u;return i.user=l.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new si;let t=Date.now()/1e3,r=t,n=!0,s=null,{payload:i}=sx(e.access_token);if(i.exp&&(n=(r=i.exp)<=t),n){let{data:t,error:r}=await this._callRefreshToken(e.refresh_token);if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!t)return{data:{user:null,session:null},error:null};s=t}else{let{data:n,error:i}=await this._getUser(e.access_token);if(i)return this._returnResult({data:{user:null,session:null},error:i});s={access_token:e.access_token,refresh_token:e.refresh_token,user:n.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(e){if(st(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:n,error:s}=t;if(s)throw s;e=null!=(r=n.session)?r:void 0}if(!(null==e?void 0:e.refresh_token))throw new si;let{data:n,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{throw new su("No browser detected.")}catch(e){if(st(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return"function"==typeof this.detectSessionInUrl?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await sT(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s&&!sa(s))return this._returnResult({error:s});let i=null==(r=n.session)?void 0:r.access_token;if(i){let{error:t}=await this.admin.signOut(i,e);if(t&&!(st(t)&&"AuthApiError"===t.name&&(404===t.status||401===t.status||403===t.status)||sa(t)))return this._returnResult({error:t})}return"others"!==e&&(await this._removeSession(),await sR(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=Symbol("auth-callback"),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{let{data:{session:n},error:s}=t;if(s)throw s;await (null==(r=this.stateChangeEmitters.get(e))?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(t){await (null==(n=this.stateChangeEmitters.get(e))?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),sa(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null;"pkce"===this.flowType&&([r,n]=await sj(this.storage,this.storageKey,!0));try{return await sF(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:n,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){var e;try{let{data:t,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:null!=(e=t.user.identities)?e:[]},error:null})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:r}=await this._useSession(async t=>{var r,n,s,i,a;let{data:o,error:l}=t;if(l)throw l;let u=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null==(r=e.options)?void 0:r.redirectTo,scopes:null==(n=e.options)?void 0:n.scopes,queryParams:null==(s=e.options)?void 0:s.queryParams,skipBrowserRedirect:!0});return await sF(this.fetch,"GET",u,{headers:this.headers,jwt:null!=(a=null==(i=o.session)?void 0:i.access_token)?a:void 0})});if(r)throw r;return this._returnResult({data:{provider:e.provider,url:null==t?void 0:t.url},error:null})}catch(t){if(st(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var r;try{let{error:n,data:{session:s}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:l,nonce:u}=e,{data:c,error:h}=await sF(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:null!=(r=null==s?void 0:s.access_token)?r:void 0,body:{provider:a,id_token:o,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:sW});if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!c||!c.session||!c.user)return this._returnResult({data:{user:null,session:null},error:new so});return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("USER_UPDATED",c.session)),this._returnResult({data:c,error:h})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),st(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,n;let{data:s,error:i}=t;if(i)throw i;return await sF(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!=(n=null==(r=s.session)?void 0:r.access_token)?n:void 0})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{var r,n;let s=Date.now();return await (r=async r=>(r>0&&await sC(200*Math.pow(2,r-1)),this._debug(t,"refreshing attempt",r),await sF(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:sW})),n=(e,t)=>{let r=200*Math.pow(2,e);return t&&sd(t)&&Date.now()+r-s<3e4},new Promise((e,t)=>{(async()=>{for(let s=0;s<1/0;s++)try{let t=await r(s);if(!n(s,null,t))return void e(t)}catch(e){if(!n(s,e))return void t(e)}})()}))}catch(e){if(this._debug(t,"error",e),st(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,t;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await sT(this.storage,this.storageKey);if(n&&this.userStorage){let t=await sT(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!t&&(t={user:n.user},await sS(this.userStorage,this.storageKey+"-user",t)),n.user=null!=(e=null==t?void 0:t.user)?e:sU()}else if(n&&!n.user&&!n.user){let e=await sT(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(n.user=e.user,await sR(this.storage,this.storageKey+"-user"),await sS(this.storage,this.storageKey,n)):n.user=sU()}if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),null!==n&&await this._removeSession();return}let s=(null!=(t=n.expires_at)?t:1/0)*1e3-Date.now()<9e4;if(this._debug(r,`session has${s?"":" not"} expired with margin of 90000s`),s){if(this.autoRefreshToken&&n.refresh_token){let{error:e}=await this._callRefreshToken(n.refresh_token);e&&(console.error(e),sd(e)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else if(n.user&&!0===n.user.__isUserNotAvailableProxy)try{let{data:e,error:t}=await this._getUser(n.access_token);!t&&(null==e?void 0:e.user)?(n.user=e.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(e){console.error("Error getting user data:",e),this._debug(r,"error getting user data, skipping SIGNED_IN notification",e)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(e){this._debug(r,"error",e),console.error(e);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new si;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let n=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{this.refreshingDeferred=new sO;let{data:t,error:r}=await this._refreshAccessToken(e);if(r)throw r;if(!t.session)throw new si;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let n={data:t.session,error:null};return this.refreshingDeferred.resolve(n),n}catch(e){if(this._debug(n,"error",e),st(e)){let r={data:null,error:e};return sd(e)||await this._removeSession(),null==(t=this.refreshingDeferred)||t.resolve(r),r}throw null==(r=this.refreshingDeferred)||r.reject(e),e}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){let n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async r=>{try{await r.callback(e,t)}catch(e){n.push(e)}});if(await Promise.all(s),n.length>0){for(let e=0;e<n.length;e+=1)console.error(n[e]);throw n[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await sR(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),r=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!r&&t.user&&await sS(this.userStorage,this.storageKey+"-user",{user:t.user});let e=Object.assign({},t);delete e.user;let n=sM(e);await sS(this.storage,this.storageKey,n)}else{let e=sM(t);await sS(this.storage,this.storageKey,e)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await sR(this.storage,this.storageKey),await sR(this.storage,this.storageKey+"-code-verifier"),await sR(this.storage,this.storageKey+"-user"),this.userStorage&&await sR(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()"),this.visibilityChangedCallback,this.visibilityChangedCallback=null}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&"object"==typeof t&&"function"==typeof t.unref?t.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");let n=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),n<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof s0)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){return this._debug("#_handleVisibilityChange()"),this.autoRefreshToken&&this.startAutoRefresh(),!1}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{"visible"!==document.visibilityState?this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting"):await this._recoverAndRefresh()}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){let n=[`provider=${encodeURIComponent(t)}`];if((null==r?void 0:r.redirectTo)&&n.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),(null==r?void 0:r.scopes)&&n.push(`scopes=${encodeURIComponent(r.scopes)}`),"pkce"===this.flowType){let[e,t]=await sj(this.storage,this.storageKey),r=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});n.push(r.toString())}if(null==r?void 0:r.queryParams){let e=new URLSearchParams(r.queryParams);n.push(e.toString())}return(null==r?void 0:r.skipBrowserRedirect)&&n.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${n.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;return s?this._returnResult({data:null,error:s}):await sF(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;let{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:o,error:l}=await sF(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:null==(r=null==s?void 0:s.session)?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):("totp"===e.factorType&&"totp"===o.type&&(null==(n=null==o?void 0:o.totp)?void 0:n.qr_code)&&(o.totp.qr_code=`data:image/svg+xml;utf-8,${o.totp.qr_code}`),this._returnResult({data:o,error:null}))})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});let i=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?s9(e.webauthn.credential_response):s8(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await sF(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:o}))})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});let i=await sF(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});if(i.error)return i;let{data:a}=i;if("webauthn"!==a.type)return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:s6(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:s5(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;let{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};let n={all:[],phone:[],totp:[],webauthn:[]};for(let r of null!=(e=null==t?void 0:t.factors)?e:[])n.all.push(r),"verified"===r.status&&n[r.factor_type].push(r);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,r,n,s;if(e)try{let{payload:n}=sx(e),s=null;n.aal&&(s=n.aal);let i=s,{data:{user:a},error:o}=await this.getUser(e);if(o)return this._returnResult({data:null,error:o});(null!=(r=null==(t=null==a?void 0:a.factors)?void 0:t.filter(e=>"verified"===e.status))?r:[]).length>0&&(i="aal2");let l=n.amr||[];return{data:{currentLevel:s,nextLevel:i,currentAuthenticationMethods:l},error:null}}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:i},error:a}=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:o}=sx(i.access_token),l=null;o.aal&&(l=o.aal);let u=l;return(null!=(s=null==(n=i.user.factors)?void 0:n.filter(e=>"verified"===e.status))?s:[]).length>0&&(u="aal2"),{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:o.amr||[]},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await sF(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new si})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let s=await sF(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url,s})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let s=await sF(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url,s})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;return r?this._returnResult({data:null,error:r}):t?await sF(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new si})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?(await sF(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new si})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(t=>t.kid===e);if(r)return r;let n=Date.now();if((r=this.jwks.keys.find(t=>t.kid===e))&&this.jwks_cached_at+6e5>n)return r;let{data:s,error:i}=await sF(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return s.keys&&0!==s.keys.length&&(this.jwks=s,this.jwks_cached_at=n,r=s.keys.find(t=>t.kid===e))?r:null}async getClaims(e,t={}){try{var r;let n,s=e;if(!s){let{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});s=e.session.access_token}let{header:i,payload:a,signature:o,raw:{header:l,payload:u}}=sx(s);(null==t?void 0:t.allowExpired)||function(e){if(!e)throw Error("Missing exp claim");if(e<=Math.floor(Date.now()/1e3))throw Error("JWT has expired")}(a.exp);let c=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks);if(!c){let{error:e}=await this.getUser(s);if(e)throw e;return{data:{claims:a,header:i,signature:o},error:null}}let h=function(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw Error("Invalid alg claim")}}(i.alg),d=await crypto.subtle.importKey("jwk",c,h,!0,["verify"]);if(!await crypto.subtle.verify(h,d,o,(r=`${l}.${u}`,n=[],!function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(r,e=>n.push(e)),new Uint8Array(n))))throw new sf("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){var t,r,n;sL(this.experimental);try{1;return this._returnResult({data:null,error:new sn("Browser does not support WebAuthn",null)})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){var t,r;sL(this.experimental);try{1;return this._returnResult({data:null,error:new sn("Browser does not support WebAuthn",null)})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){sL(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new si});let{data:n,error:s}=await sF(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){sL(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let{data:s,error:i}=await sF(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){var t;sL(this.experimental);try{let{data:r,error:n}=await sF(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:null==(t=null==e?void 0:e.options)?void 0:t.captchaToken}}});if(n)return this._returnResult({data:null,error:n});return this._returnResult({data:r,error:null})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){sL(this.experimental);try{let{data:t,error:r}=await sF(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:sW});if(r)return this._returnResult({data:null,error:r});return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:t,error:null})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){sL(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new si});let{data:n,error:s}=await sF(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){sL(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let{data:s,error:i}=await sF(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:e.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){sL(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new si});let{error:s}=await sF(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return s?this._returnResult({data:null,error:s}):this._returnResult({data:null,error:null})})}catch(e){if(st(e))return this._returnResult({data:null,error:e});throw e}}}ic.nextInstanceID={};let ih=ic,id="";id="u">typeof Deno?"deno":"u">typeof document?"web":"u">typeof navigator&&"ReactNative"===navigator.product?"react-native":"node";let ip={headers:{"X-Client-Info":`supabase-js-${id}/2.106.0`}},ig={schema:"public"},im={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ib={},iy={enabled:!1,respectSamplingDecision:!0},iv=null;function iw(e){return(iw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function iE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i_(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=iw(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=iw(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==iw(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i_(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}async function ik(e,t,r){if(!function(e,t){let r;if(!e||!t||0===t.length)return!1;if(e instanceof URL)r=e;else try{r=new URL(e)}catch(e){return!1}for(let e of t)try{if("string"==typeof e){if(function(e,t){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(2);if(e.endsWith(r)&&(e===r||e.endsWith("."+r)))return!0}return!1}(r.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(r.hostname))return!0}else if("function"==typeof e&&e(r))return!0}catch(e){continue}return!1}("string"==typeof e||e instanceof URL?e:e.url,t))return null;let n=await function(){var e,t,r,n;return e=this,t=void 0,r=void 0,n=function*(){try{let e=yield(null===iv&&(iv=import("@opentelemetry/api").catch(()=>null)),iv);if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let r=t.traceparent;if(!r)return null;return{traceparent:r,tracestate:t.tracestate,baggage:t.baggage}}catch(e){return null}},new(r||(r=Promise))(function(s,i){function a(e){try{l(n.next(e))}catch(e){i(e)}}function o(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((n=n.apply(e,t||[])).next())})}();if(!n||!n.traceparent)return null;if(r){let e=function(e){if(!e||"string"!=typeof e)return null;let t=e.split("-");if(4!==t.length)return null;let[r,n,s,i]=t;if(2!==r.length||32!==n.length||16!==s.length||2!==i.length)return null;let a=/^[0-9a-f]+$/i;return a.test(r)&&a.test(n)&&a.test(s)&&a.test(i)&&"00000000000000000000000000000000"!==n&&"0000000000000000"!==s?{version:r,traceId:n,parentId:s,traceFlags:i,isSampled:(1&parseInt(i,16))==1}:null}(n.traceparent);if(e&&!e.isSampled)return null}return n}function iS(e){return"boolean"==typeof e?{enabled:e}:e}var iT=class extends ih{constructor(e){super(e)}},iR=class{constructor(e,t,r){var n,s,i;this.supabaseUrl=e,this.supabaseKey=t;const a=function(e){let t=null==e?void 0:e.trim();if(!t)throw Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(t.endsWith("/")?t:t+"/")}catch(e){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}(e);if(!t)throw Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,l=function(e,t){var r,n,s,i,a,o;let{db:l,auth:u,realtime:c,global:h}=e,{db:d,auth:p,realtime:f,global:g}=t,m=iS(e.tracePropagation),b=iS(t.tracePropagation),y={db:iE(iE({},d),l),auth:iE(iE({},p),u),realtime:iE(iE({},f),c),storage:{},global:iE(iE(iE({},g),h),{},{headers:iE(iE({},null!=(r=null==g?void 0:g.headers)?r:{}),null!=(n=null==h?void 0:h.headers)?n:{})}),tracePropagation:{enabled:null!=(s=null!=(i=null==m?void 0:m.enabled)?i:null==b?void 0:b.enabled)&&s,respectSamplingDecision:null==(a=null!=(o=null==m?void 0:m.respectSamplingDecision)?o:null==b?void 0:b.respectSamplingDecision)||a},accessToken:async()=>""};return e.accessToken?y.accessToken=e.accessToken:delete y.accessToken,y}(null!=r?r:{},{db:ig,realtime:ib,auth:iE(iE({},im),{},{storageKey:o}),global:ip,tracePropagation:iy});this.settings=l,this.storageKey=null!=(n=l.auth.storageKey)?n:"",this.headers=null!=(s=l.global.headers)?s:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!=(i=l.auth)?i:{},this.headers,l.global.fetch),this.fetch=((e,t,r,n,s)=>{let i=n?(...e)=>n(...e):(...e)=>fetch(...e),a=Headers,o=(null==s?void 0:s.enabled)===!0,l=(null==s?void 0:s.respectSamplingDecision)!==!1,u=o?function(e){let t=[];try{let r=new URL(e);t.push(r.hostname)}catch(e){}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}(t):null;return async(t,n)=>{var s;let o=null!=(s=await r())?s:e,c=new a(null==n?void 0:n.headers);if(c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${o}`),u){let e=await ik(t,u,l);e&&(e.traceparent&&!c.has("traceparent")&&c.set("traceparent",e.traceparent),e.tracestate&&!c.has("tracestate")&&c.set("tracestate",e.tracestate),e.baggage&&!c.has("baggage")&&c.set("baggage",e.baggage))}return i(t,iE(iE({},n),{},{headers:c}))}})(t,e,this._getAccessToken.bind(this),l.global.fetch,l.tracePropagation),this.realtime=this._initRealtimeClient(iE({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn("Failed to set initial Realtime auth token:",e)),this.rest=new rj(new URL("rest/v1",a).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new n3(this.storageUrl.href,this.headers,this.fetch,null==r?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new rv(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,t;if(this.accessToken)return await this.accessToken();let{data:r}=await this.auth.getSession();return null!=(e=null==(t=r.session)?void 0:t.access_token)?e:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:a,lock:o,debug:l,throwOnError:u,experimental:c,lockAcquireTimeout:h,skipAutoInitialize:d},p,f){let g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new iT({url:this.authUrl.href,headers:iE(iE({},g),p),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:a,lock:o,debug:l,throwOnError:u,experimental:c,fetch:f,lockAcquireTimeout:h,skipAutoInitialize:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new nm(this.realtimeUrl.href,iE(iE({},e),{},{params:iE(iE({},{apikey:this.supabaseKey}),null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,r){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}};(function(){let e=globalThis.process;if(!e)return!1;let t=e.version;if(null==t)return!1;let r=t.match(/^v(\d+)\./);return!!r&&18>=parseInt(r[1],10)})()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");var iO=e.i(59692);let ix={path:"/",sameSite:"lax",httpOnly:!1,maxAge:3456e4},iC=/^(.*)[.](0|[1-9][0-9]*)$/;function iP(e,t){if(e===t)return!0;let r=e.match(iC);return!!r&&r[1]===t}function iA(e,t,r){let n=r??3180,s=encodeURIComponent(t);if(s.length<=n)return[{name:e,value:t}];let i=[];for(;s.length>0;){let e=s.slice(0,n),t=e.lastIndexOf("%");t>n-3&&(e=e.slice(0,t));let r="";for(;e.length>0;)try{r=decodeURIComponent(e);break}catch(t){if(t instanceof URIError&&"%"===e.at(-3)&&e.length>3)e=e.slice(0,e.length-3);else throw t}i.push(r),s=s.slice(e.length)}return i.map((t,r)=>({name:`${e}.${r}`,value:t}))}async function iI(e,t){let r=await t(e);if(r)return r;let n=[];for(let r=0;;r++){let s=`${e}.${r}`,i=await t(s);if(!i)break;n.push(i)}return n.length>0?n.join(""):null}iO.parse,iO.serialize;let ij="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),iN=" \n\r=".split(""),i$=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<iN.length;t+=1)e[iN[t].charCodeAt(0)]=-2;for(let t=0;t<ij.length;t+=1)e[ij[t].charCodeAt(0)]=t;return e})();function iD(e){let t=[],r=0,n=0;if(function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(e,e=>{for(r=r<<8|e,n+=8;n>=6;){let e=r>>n-6&63;t.push(ij[e]),n-=6}}),n>0)for(r<<=6-n,n=6;n>=6;){let e=r>>n-6&63;t.push(ij[e]),n-=6}return t.join("")}let iL="base64-";function iU(e){let t;if(!e.startsWith(iL))return e;try{t=function(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},s=0,i=0;for(let t=0;t<e.length;t+=1){let a=i$[e.charCodeAt(t)];if(a>-1)for(s=s<<6|a,i+=6;i>=8;)(function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}})(s>>i-8&255,n,r),i-=8;else if(-2===a)continue;else throw Error(`Invalid Base64-URL character "${e.at(t)}" at position ${t}`)}return t.join("")}(e.substring(iL.length))}catch(e){return console.warn("@supabase/ssr: could not base64url-decode chunked cookie value, treating as absent. Cookie chunks may have been written partially across responses.",e),null}try{JSON.parse(t)}catch{return console.warn("@supabase/ssr: chunked cookie decoded to invalid JSON, treating as absent. This usually indicates that cookie chunks from different writes were combined (e.g. response committed before all Set-Cookie headers were sent)."),null}return t}async function iM({getAll:e,setAll:t,setItems:r,removedItems:n},s){let i=s.cookieEncoding,a=s.cookieOptions??null,o=await e([...r?Object.keys(r):[],...n?Object.keys(n):[]]),l=o?.map(({name:e})=>e)||[],u=Object.keys(n).flatMap(e=>l.filter(t=>iP(t,e))),c=Object.keys(r).flatMap(e=>{let t=new Set(l.filter(t=>iP(t,e))),n=r[e];"base64url"===i&&(n=iL+iD(n));let s=iA(e,n);return s.forEach(e=>{t.delete(e.name)}),u.push(...t),s}),h={...ix,...a,maxAge:0},d={...ix,...a,maxAge:ix.maxAge};delete h.name,delete d.name,await t([...u.map(e=>({name:e,value:"",options:h})),...c.map(({name:e,value:t})=>({name:e,value:t,options:d}))],{"Cache-Control":"private, no-cache, no-store, must-revalidate, max-age=0",Expires:"0",Pragma:"no-cache"})}let iq=!1,iB=["@supabase/auth-helpers-nextjs","@supabase/auth-helpers-react","@supabase/auth-helpers-remix","@supabase/auth-helpers-sveltekit"];function iH(){return("https://ctruizaqyeyidujmtxhc.supabase.co".trim()??"").length>0&&("sb_publishable_gTYHeWoWIPPW3SIC4cYaXw_ux7UL_Jb".trim()??"").length>0}async function iF(e){if(!iH())return e_.next();let{supabase:t,response:r}=function(e){let t=e_.next({request:e}),{anon_key:r,url:n}=function(){if(!iH())throw Error("Supabase is not configured");return{url:"https://ctruizaqyeyidujmtxhc.supabase.co".trim(),anon_key:"sb_publishable_gTYHeWoWIPPW3SIC4cYaXw_ux7UL_Jb".trim()}}();return{supabase:function(e,t,r){if(!function(){if(iq||"u"<typeof process||!process.env?.npm_package_name)return;let e=process.env.npm_package_name;iB.includes(e)&&(iq=!0,console.warn(`
46
46
  ╔════════════════════════════════════════════════════════════════════════════╗
47
47
  ║ ⚠️ IMPORTANT: Package Consolidation Notice ║
48
48
  ║ ║
@@ -64,6 +64,6 @@ ${b}`}({domain:b.host,address:v,statement:g,uri:b.href,version:"1",chainId:w,non
64
64
 
65
65
  Check your Supabase project's API settings to find these values
66
66
 
67
- https://supabase.com/dashboard/project/_/settings/api`);let{storage:n,getAll:s,setAll:i,setItems:a,removedItems:o}=function(e,t){let r,n,s=e.cookies??null,i=e.cookieEncoding,a={},o={},l=()=>{let e=(0,iO.parse)(document.cookie);return Object.keys(e).map(t=>({name:t,value:e[t]??""}))},u=e=>{e.forEach(({name:e,value:t,options:r})=>{document.cookie=(0,iO.serialize)(e,t,r)})};if(s)if("get"in s){let e=async e=>{let t=e.flatMap(e=>[e,...Array.from({length:5}).map((t,r)=>`${e}.${r}`)]),r=[];for(let e=0;e<t.length;e+=1){let n=await s.get(t[e]);(n||"string"==typeof n)&&r.push({name:t[e],value:n})}return r};if(r=async t=>await e(t),"set"in s&&"remove"in s)n=async e=>{for(let t=0;t<e.length;t+=1){let{name:r,value:n,options:i}=e[t];n?await s.set(r,n,i):await s.remove(r,i)}};else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without set and remove cookie methods, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness. Consider switching to the getAll and setAll cookie methods instead of get, set and remove which are deprecated and can be difficult to use correctly.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring a getAll and setAll cookie method (deprecated: alternatively both get, set and remove can be used)")}else if("getAll"in s)if(r=async()=>await s.getAll(),"setAll"in s)n=s.setAll;else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without the setAll cookie method, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring both getAll and setAll cookie methods (deprecated: alternatively both get, set and remove can be used)");else if(t||1)throw Error(`@supabase/ssr: ${t?"createServerClient":"createBrowserClient"} requires configuring getAll and setAll cookie methods (deprecated: alternatively use get, set and remove).`);else r=()=>l(),n=u;else if(t||1)if(t)throw Error("@supabase/ssr: createServerClient must be initialized with cookie options that specify getAll and setAll functions (deprecated, not recommended: alternatively use get, set and remove)");else r=()=>[],n=()=>{throw Error("@supabase/ssr: createBrowserClient in non-browser runtimes (including Next.js pre-rendering mode) was not initialized cookie options that specify getAll and setAll functions (deprecated: alternatively use get, set and remove), but they were needed")};else r=()=>l(),n=u;return t?{getAll:r,setAll:n,setItems:a,removedItems:o,storage:{isServer:!0,getItem:async e=>{if("string"==typeof a[e])return a[e];if(o[e])return null;let t=await r([e]),n=await iI(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});return n?"string"!=typeof n?n:iU(n):null},setItem:async(t,s)=>{t.endsWith("-code-verifier")&&await iM({getAll:r,setAll:n,setItems:{[t]:s},removedItems:{}},{cookieOptions:e?.cookieOptions??null,cookieEncoding:i}),a[t]=s,delete o[t]},removeItem:async e=>{delete a[e],o[e]=!0}}}:{getAll:r,setAll:n,setItems:a,removedItems:o,storage:{isServer:!1,getItem:async e=>{let t=await r([e]),n=await iI(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});return n?iU(n):null},setItem:async(t,s)=>{let a=await r([t]),o=new Set((a?.map(({name:e})=>e)||[]).filter(e=>iP(e,t))),l=s;"base64url"===i&&(l=iL+iD(s));let u=iA(t,l);u.forEach(({name:e})=>{o.delete(e)});let c={...ix,...e?.cookieOptions,maxAge:0},h={...ix,...e?.cookieOptions,maxAge:ix.maxAge};delete c.name,delete h.name;let d=[...[...o].map(e=>({name:e,value:"",options:c})),...u.map(({name:e,value:t})=>({name:e,value:t,options:h}))];d.length>0&&await n(d,{})},removeItem:async t=>{let s=await r([t]),i=(s?.map(({name:e})=>e)||[]).filter(e=>iP(e,t)),a={...ix,...e?.cookieOptions,maxAge:0};delete a.name,i.length>0&&await n(i.map(e=>({name:e,value:"",options:a})),{})}}}}({...r,cookieEncoding:r?.cookieEncoding??"base64url"},!0),l=new iR(e,t,{...r,global:{...r?.global,headers:{...r?.global?.headers,"X-Client-Info":"supabase-ssr/0.10.3 createServerClient"}},auth:{...r?.cookieOptions?.name?{storageKey:r.cookieOptions.name}:null,...r?.auth,flowType:"pkce",autoRefreshToken:!1,detectSessionInUrl:!1,persistSession:!0,skipAutoInitialize:!0,storage:n,...r?.cookies&&"encode"in r.cookies&&"tokens-only"===r.cookies.encode?{userStorage:r?.auth?.userStorage??function(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}()}:null}});return l.auth.onAuthStateChange(async e=>{(Object.keys(a).length>0||Object.keys(o).length>0)&&("SIGNED_IN"===e||"TOKEN_REFRESHED"===e||"USER_UPDATED"===e||"PASSWORD_RECOVERY"===e||"SIGNED_OUT"===e||"MFA_CHALLENGE_VERIFIED"===e)&&await iM({getAll:s,setAll:i,setItems:a,removedItems:o},{cookieOptions:r?.cookieOptions??null,cookieEncoding:r?.cookieEncoding??"base64url"})}),l}(n,r,{cookies:{getAll:()=>e.cookies.getAll(),setAll(r){r.forEach(({name:t,value:r})=>{e.cookies.set(t,r)}),t=e_.next({request:e}),r.forEach(({name:e,value:r,options:n})=>{t.cookies.set(e,r,n)})}}}),response:t}}(e);return await t.auth.getUser(),r}e.s(["config",0,{matcher:["/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)"]},"middleware",0,iF],99446);let iV={...e.i(99446)},iG="/middleware",iW=iV.middleware||iV.default;if("function"!=typeof iW)throw new class extends Error{constructor(e){super(e),this.stack=""}}(`The Middleware file "${iG}" must export a function named \`middleware\` or a default function.`);let iz=e=>tN({...e,IncrementalCache:rp,incrementalCacheHandler:null,page:iG,handler:async(...e)=>{try{return await iW(...e)}catch(s){let t=e[0],r=new URL(t.url),n=r.pathname+r.search;throw await u(s,{path:n,method:t.method,headers:Object.fromEntries(t.headers.entries())},{routerKind:"Pages Router",routePath:"/proxy",routeType:"proxy",revalidateReason:void 0}),s}}});async function iK(e,t){let r=await iz({request:{url:e.url,method:e.method,headers:k(e.headers),nextConfig:{basePath:"",i18n:"",trailingSlash:!1,experimental:{cacheLife:{default:{stale:300,revalidate:900,expire:0xfffffffe},seconds:{stale:30,revalidate:1,expire:60},minutes:{stale:300,revalidate:60,expire:3600},hours:{stale:300,revalidate:3600,expire:86400},days:{stale:300,revalidate:86400,expire:604800},weeks:{stale:300,revalidate:604800,expire:2592e3},max:{stale:300,revalidate:2592e3,expire:31536e3}},authInterrupts:!1,clientParamParsingOrigins:[]}},page:{name:iG},body:"GET"!==e.method&&"HEAD"!==e.method?e.body??void 0:void 0,waitUntil:t.waitUntil,requestMeta:t.requestMeta,signal:t.signal||new AbortController().signal}});return null==t.waitUntil||t.waitUntil.call(t,r.waitUntil),r.response}e.s(["default",0,iz,"handler",0,iK],94826)}]);
67
+ https://supabase.com/dashboard/project/_/settings/api`);let{storage:n,getAll:s,setAll:i,setItems:a,removedItems:o}=function(e,t){let r,n,s=e.cookies??null,i=e.cookieEncoding,a={},o={},l=()=>{let e=(0,iO.parse)(document.cookie);return Object.keys(e).map(t=>({name:t,value:e[t]??""}))},u=e=>{e.forEach(({name:e,value:t,options:r})=>{document.cookie=(0,iO.serialize)(e,t,r)})};if(s)if("get"in s){let e=async e=>{let t=e.flatMap(e=>[e,...Array.from({length:5}).map((t,r)=>`${e}.${r}`)]),r=[];for(let e=0;e<t.length;e+=1){let n=await s.get(t[e]);(n||"string"==typeof n)&&r.push({name:t[e],value:n})}return r};if(r=async t=>await e(t),"set"in s&&"remove"in s)n=async e=>{for(let t=0;t<e.length;t+=1){let{name:r,value:n,options:i}=e[t];n?await s.set(r,n,i):await s.remove(r,i)}};else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without set and remove cookie methods, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness. Consider switching to the getAll and setAll cookie methods instead of get, set and remove which are deprecated and can be difficult to use correctly.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring a getAll and setAll cookie method (deprecated: alternatively both get, set and remove can be used)")}else if("getAll"in s)if(r=async()=>await s.getAll(),"setAll"in s)n=s.setAll;else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without the setAll cookie method, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring both getAll and setAll cookie methods (deprecated: alternatively both get, set and remove can be used)");else if(t||1)throw Error(`@supabase/ssr: ${t?"createServerClient":"createBrowserClient"} requires configuring getAll and setAll cookie methods (deprecated: alternatively use get, set and remove).`);else r=()=>l(),n=u;else if(t||1)if(t)throw Error("@supabase/ssr: createServerClient must be initialized with cookie options that specify getAll and setAll functions (deprecated, not recommended: alternatively use get, set and remove)");else r=()=>[],n=()=>{throw Error("@supabase/ssr: createBrowserClient in non-browser runtimes (including Next.js pre-rendering mode) was not initialized cookie options that specify getAll and setAll functions (deprecated: alternatively use get, set and remove), but they were needed")};else r=()=>l(),n=u;return t?{getAll:r,setAll:n,setItems:a,removedItems:o,storage:{isServer:!0,getItem:async e=>{if("string"==typeof a[e])return a[e];if(o[e])return null;let t=await r([e]),n=await iI(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});return n?"string"!=typeof n?n:iU(n):null},setItem:async(t,s)=>{t.endsWith("-code-verifier")&&await iM({getAll:r,setAll:n,setItems:{[t]:s},removedItems:{}},{cookieOptions:e?.cookieOptions??null,cookieEncoding:i}),a[t]=s,delete o[t]},removeItem:async e=>{delete a[e],o[e]=!0}}}:{getAll:r,setAll:n,setItems:a,removedItems:o,storage:{isServer:!1,getItem:async e=>{let t=await r([e]),n=await iI(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});return n?iU(n):null},setItem:async(t,s)=>{let a=await r([t]),o=new Set((a?.map(({name:e})=>e)||[]).filter(e=>iP(e,t))),l=s;"base64url"===i&&(l=iL+iD(s));let u=iA(t,l);u.forEach(({name:e})=>{o.delete(e)});let c={...ix,...e?.cookieOptions,maxAge:0},h={...ix,...e?.cookieOptions,maxAge:ix.maxAge};delete c.name,delete h.name;let d=[...[...o].map(e=>({name:e,value:"",options:c})),...u.map(({name:e,value:t})=>({name:e,value:t,options:h}))];d.length>0&&await n(d,{})},removeItem:async t=>{let s=await r([t]),i=(s?.map(({name:e})=>e)||[]).filter(e=>iP(e,t)),a={...ix,...e?.cookieOptions,maxAge:0};delete a.name,i.length>0&&await n(i.map(e=>({name:e,value:"",options:a})),{})}}}}({...r,cookieEncoding:r?.cookieEncoding??"base64url"},!0),l=new iR(e,t,{...r,global:{...r?.global,headers:{...r?.global?.headers,"X-Client-Info":"supabase-ssr/0.10.3 createServerClient"}},auth:{...r?.cookieOptions?.name?{storageKey:r.cookieOptions.name}:null,...r?.auth,flowType:"pkce",autoRefreshToken:!1,detectSessionInUrl:!1,persistSession:!0,skipAutoInitialize:!0,storage:n,...r?.cookies&&"encode"in r.cookies&&"tokens-only"===r.cookies.encode?{userStorage:r?.auth?.userStorage??function(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}()}:null}});return l.auth.onAuthStateChange(async e=>{(Object.keys(a).length>0||Object.keys(o).length>0)&&("SIGNED_IN"===e||"TOKEN_REFRESHED"===e||"USER_UPDATED"===e||"PASSWORD_RECOVERY"===e||"SIGNED_OUT"===e||"MFA_CHALLENGE_VERIFIED"===e)&&await iM({getAll:s,setAll:i,setItems:a,removedItems:o},{cookieOptions:r?.cookieOptions??null,cookieEncoding:r?.cookieEncoding??"base64url"})}),l}(n,r,{cookies:{getAll:()=>e.cookies.getAll(),setAll(r){r.forEach(({name:t,value:r})=>{e.cookies.set(t,r)}),t=e_.next({request:e}),r.forEach(({name:e,value:r,options:n})=>{t.cookies.set(e,r,n)})}}}),response:t}}(e);return await t.auth.getUser(),r}e.s(["config",0,{matcher:["/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)"]},"middleware",0,iF],99446);let iV={...e.i(99446)},iW="/middleware",iG=iV.middleware||iV.default;if("function"!=typeof iG)throw new class extends Error{constructor(e){super(e),this.stack=""}}(`The Middleware file "${iW}" must export a function named \`middleware\` or a default function.`);let iz=e=>tj({...e,IncrementalCache:rp,incrementalCacheHandler:null,page:iW,handler:async(...e)=>{try{return await iG(...e)}catch(s){let t=e[0],r=new URL(t.url),n=r.pathname+r.search;throw await u(s,{path:n,method:t.method,headers:Object.fromEntries(t.headers.entries())},{routerKind:"Pages Router",routePath:"/proxy",routeType:"proxy",revalidateReason:void 0}),s}}});async function iK(e,t){let r=await iz({request:{url:e.url,method:e.method,headers:k(e.headers),nextConfig:{basePath:"",i18n:"",trailingSlash:!1,experimental:{cacheLife:{default:{stale:300,revalidate:900,expire:0xfffffffe},seconds:{stale:30,revalidate:1,expire:60},minutes:{stale:300,revalidate:60,expire:3600},hours:{stale:300,revalidate:3600,expire:86400},days:{stale:300,revalidate:86400,expire:604800},weeks:{stale:300,revalidate:604800,expire:2592e3},max:{stale:300,revalidate:2592e3,expire:31536e3}},authInterrupts:!1,clientParamParsingOrigins:[]}},page:{name:iW},body:"GET"!==e.method&&"HEAD"!==e.method?e.body??void 0:void 0,waitUntil:t.waitUntil,requestMeta:t.requestMeta,signal:t.signal||new AbortController().signal}});return null==t.waitUntil||t.waitUntil.call(t,r.waitUntil),r.response}e.s(["default",0,iz,"handler",0,iK],94826)}]);
68
68
 
69
69
  //# sourceMappingURL=%5Broot-of-the-server%5D__0t9u~vh._.js.map