@tempoxyz/id 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1096) hide show
  1. package/README.md +121 -2
  2. package/dist/App.d.ts +121 -0
  3. package/dist/App.d.ts.map +1 -0
  4. package/dist/App.js +132 -0
  5. package/dist/App.js.map +1 -0
  6. package/dist/app/client/.assetsignore +2 -0
  7. package/dist/app/client/_headers +4 -0
  8. package/dist/app/client/assets/Account-BYLpNFf3.css +1 -0
  9. package/dist/app/client/assets/Account-BllJah07.js +1 -0
  10. package/dist/app/client/assets/Amount-E_7snI0-.js +1 -0
  11. package/dist/app/client/assets/Amount-ZdtluGf-.css +1 -0
  12. package/dist/app/client/assets/Approval-CgV5JHlb.css +1 -0
  13. package/dist/app/client/assets/Approval-yKflypU2.js +1 -0
  14. package/dist/app/client/assets/ArrowUp-CRvqfMNU.js +1 -0
  15. package/dist/app/client/assets/Authentication-BAXhOh_4.js +2 -0
  16. package/dist/app/client/assets/BRLA-CZvVDNYr.png +0 -0
  17. package/dist/app/client/assets/BRZ-Cn3jEi9t.svg +1 -0
  18. package/dist/app/client/assets/CHFAU-DCedc4aH.png +0 -0
  19. package/dist/app/client/assets/Callout-B736759d.js +1 -0
  20. package/dist/app/client/assets/Callout-DBfEmP7q.css +1 -0
  21. package/dist/app/client/assets/Check-DVgD8tDG.js +1 -0
  22. package/dist/app/client/assets/ChevronRight-CsXtIZCB.js +1 -0
  23. package/dist/app/client/assets/ChooseAccount-BjxfQjPK.js +1 -0
  24. package/dist/app/client/assets/ChooseAccount-DL3wgJhE.css +1 -0
  25. package/dist/app/client/assets/Client-JrABNovb.js +1 -0
  26. package/dist/app/client/assets/Close-CRvWlhqc.js +1 -0
  27. package/dist/app/client/assets/Cloud-DgJsrqpQ.js +1 -0
  28. package/dist/app/client/assets/CodeInput-79Ctx8ZA.js +1 -0
  29. package/dist/app/client/assets/CodeInput-BqRteSwD.css +1 -0
  30. package/dist/app/client/assets/DLUSD-BnRXm3EI.png +0 -0
  31. package/dist/app/client/assets/Deposit-CclrAoXL.css +1 -0
  32. package/dist/app/client/assets/Deposit-c7uYn2Eb.js +1 -0
  33. package/dist/app/client/assets/DevTools-BYkmtuV5.css +1 -0
  34. package/dist/app/client/assets/DevTools-BgnzDGo2.js +1 -0
  35. package/dist/app/client/assets/DeviceApproval-BBUVv58e.js +1 -0
  36. package/dist/app/client/assets/DeviceApproval-BffFLD8F.css +1 -0
  37. package/dist/app/client/assets/EURAU-sjieTTB9.svg +1 -0
  38. package/dist/app/client/assets/EURC.e-CxYiiwkz.svg +1 -0
  39. package/dist/app/client/assets/Fingerprint-BNCA6qOJ.js +1 -0
  40. package/dist/app/client/assets/GBPA-DI_25xSG.svg +4 -0
  41. package/dist/app/client/assets/GUSD-BDEP2Qb-.svg +1 -0
  42. package/dist/app/client/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
  43. package/dist/app/client/assets/Globe-f0eWzcEI.js +1 -0
  44. package/dist/app/client/assets/Grant-5a-n1gJH.css +1 -0
  45. package/dist/app/client/assets/Grant-Dp7mpcEi.js +1 -0
  46. package/dist/app/client/assets/Hex-C9KeV7_9.css +1 -0
  47. package/dist/app/client/assets/Hex-CSp2U46W.js +10 -0
  48. package/dist/app/client/assets/IconChip-DpZHa1JW.js +1 -0
  49. package/dist/app/client/assets/IconChip-yqaQ2y_d.css +1 -0
  50. package/dist/app/client/assets/InputGroup-BlZvt9In.css +1 -0
  51. package/dist/app/client/assets/InputGroup-CsOeBnpB.js +1 -0
  52. package/dist/app/client/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
  53. package/dist/app/client/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
  54. package/dist/app/client/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
  55. package/dist/app/client/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
  56. package/dist/app/client/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
  57. package/dist/app/client/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
  58. package/dist/app/client/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
  59. package/dist/app/client/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
  60. package/dist/app/client/assets/Loader-Cm9YJNNJ.js +1 -0
  61. package/dist/app/client/assets/MACH-sK0r79kQ.svg +4 -0
  62. package/dist/app/client/assets/OUSD-BFXgVo-Z.svg +5 -0
  63. package/dist/app/client/assets/OUSD.dark-BbbjMvA1.svg +17 -0
  64. package/dist/app/client/assets/OUSD.light-B_zpSz_c.svg +17 -0
  65. package/dist/app/client/assets/PRIME-CiFp2-3e.svg +14 -0
  66. package/dist/app/client/assets/PopoverPopup-DprRXRQe.js +1 -0
  67. package/dist/app/client/assets/Rows-DPGTUdA8.css +1 -0
  68. package/dist/app/client/assets/Rows-Qqo3evtk.js +1 -0
  69. package/dist/app/client/assets/SBC-BTYkbkiD.svg +1 -0
  70. package/dist/app/client/assets/SEKAU-CB5Fc6o8.svg +5 -0
  71. package/dist/app/client/assets/Separator-CZUjVQOL.js +1 -0
  72. package/dist/app/client/assets/SignIn-HdaDzFmq.js +1 -0
  73. package/dist/app/client/assets/SignIn-mlBTwUq4.css +1 -0
  74. package/dist/app/client/assets/Stack-CkkvkOzj.js +1 -0
  75. package/dist/app/client/assets/Stack-D7Yt22Ed.css +1 -0
  76. package/dist/app/client/assets/Tag-BMh6ajrW.css +1 -0
  77. package/dist/app/client/assets/Tag-CLOVANTX.js +1 -0
  78. package/dist/app/client/assets/ToolbarRootContext-Zty_Dh3J.js +1 -0
  79. package/dist/app/client/assets/Tooltip-CLATV6YU.js +1 -0
  80. package/dist/app/client/assets/Tooltip-d3y9ESUJ.css +1 -0
  81. package/dist/app/client/assets/USD1-COVcO_PB.svg +30 -0
  82. package/dist/app/client/assets/USDB-Ckwb6UQw.svg +11 -0
  83. package/dist/app/client/assets/USDC.e-3nMsKAMC.svg +1 -0
  84. package/dist/app/client/assets/USDT0-ia60Dw0e.svg +1 -0
  85. package/dist/app/client/assets/USDY-CB4iet2q.svg +16 -0
  86. package/dist/app/client/assets/USDe-BXHQCd92.svg +1 -0
  87. package/dist/app/client/assets/Upgrade-D0_aO5AP.js +1 -0
  88. package/dist/app/client/assets/WalletUpgrade-BPsPNQsd.js +1 -0
  89. package/dist/app/client/assets/WalletUpgrade-C04kW0Jl.css +1 -0
  90. package/dist/app/client/assets/YLDS-CRh8Zw0g.svg +3 -0
  91. package/dist/app/client/assets/___-I98bns4o.css +1 -0
  92. package/dist/app/client/assets/___.flows-XOlLwMIy.js +5 -0
  93. package/dist/app/client/assets/alphaUSD-CpCFoVuh.svg +1 -0
  94. package/dist/app/client/assets/authorize-C-MlCyaM.js +1 -0
  95. package/dist/app/client/assets/betaUSD-9A8AjgYg.svg +1 -0
  96. package/dist/app/client/assets/cUSD-WsQfa-iC.svg +1 -0
  97. package/dist/app/client/assets/cbBTC-DvUDqrDi.svg +1 -0
  98. package/dist/app/client/assets/choose-account-nXR-SKa2.js +1 -0
  99. package/dist/app/client/assets/deposit-G8tiLPN4.js +1 -0
  100. package/dist/app/client/assets/device-BojBF7hZ.js +1 -0
  101. package/dist/app/client/assets/error-KiOpX7GD.js +1 -0
  102. package/dist/app/client/assets/frxUSD-n9pTpinR.svg +1 -0
  103. package/dist/app/client/assets/getPseudoElementBounds-BsLy4zf_.js +1 -0
  104. package/dist/app/client/assets/goUSD-D9kUvHsF.svg +5 -0
  105. package/dist/app/client/assets/iUSD-CWCJAq9X.svg +1 -0
  106. package/dist/app/client/assets/index-BZH0M7Nf.js +13 -0
  107. package/dist/app/client/assets/index-CIYxHmYA.css +1 -0
  108. package/dist/app/client/assets/login-DUjpk60p.js +1 -0
  109. package/dist/app/client/assets/pathUSD-BvaO6ooS.svg +25 -0
  110. package/dist/app/client/assets/preload-helper-Bs9KvdYl.js +1 -0
  111. package/dist/app/client/assets/rUSD-B-xuFS7T.svg +1 -0
  112. package/dist/app/client/assets/reUSD-CkIUs0Lx.svg +1 -0
  113. package/dist/app/client/assets/removable-DMiA3t_o.js +1 -0
  114. package/dist/app/client/assets/reset-co-CHrff.css +1 -0
  115. package/dist/app/client/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
  116. package/dist/app/client/assets/routes-CK8cthzA.js +1 -0
  117. package/dist/app/client/assets/sUSDe-j9GOnH7I.svg +1 -0
  118. package/dist/app/client/assets/siUSD-C10QUNYS.svg +1 -0
  119. package/dist/app/client/assets/stcUSD-DIntDJeh.svg +1 -0
  120. package/dist/app/client/assets/syrupUSDC-DhYwZqdM.svg +5 -0
  121. package/dist/app/client/assets/thetaUSD-Dgmksf6G.svg +1 -0
  122. package/dist/app/client/assets/useNavigate-CB6S2u4J.js +1 -0
  123. package/dist/app/client/assets/useQuery-BpHfPhTT.js +1 -0
  124. package/dist/app/client/assets/useRegisterFieldControl-DsslqY-V.js +1 -0
  125. package/dist/app/client/assets/wYLDS-CaCKDrO-.svg +10 -0
  126. package/dist/app/client/assets/wsrUSD-B2Ey0bDQ.svg +1 -0
  127. package/dist/app/client/assets/zyzz-DYC-X0_B.css +1 -0
  128. package/dist/app/client/assets/zyzz.config-DX_D_7j3.js +2 -0
  129. package/dist/app/db/auth.d.ts +3412 -0
  130. package/dist/app/db/auth.d.ts.map +1 -0
  131. package/dist/app/db/auth.js +349 -0
  132. package/dist/app/db/auth.js.map +1 -0
  133. package/dist/app/db/schema.d.ts +1091 -0
  134. package/dist/app/db/schema.d.ts.map +1 -0
  135. package/dist/app/db/schema.js +183 -0
  136. package/dist/app/db/schema.js.map +1 -0
  137. package/dist/app/db/table.d.ts +8 -0
  138. package/dist/app/db/table.d.ts.map +1 -0
  139. package/dist/app/db/table.js +28 -0
  140. package/dist/app/db/table.js.map +1 -0
  141. package/dist/app/server/.vite/manifest.json +2093 -0
  142. package/dist/app/server/assets/Account-BYLpNFf3.css +1 -0
  143. package/dist/app/server/assets/Account-G_SUeRU3.js +2 -0
  144. package/dist/app/server/assets/Account-G_SUeRU3.js.map +1 -0
  145. package/dist/app/server/assets/Amount-Cgwdr3Xt.js +2 -0
  146. package/dist/app/server/assets/Amount-Cgwdr3Xt.js.map +1 -0
  147. package/dist/app/server/assets/Amount-ZdtluGf-.css +1 -0
  148. package/dist/app/server/assets/Approval-CgV5JHlb.css +1 -0
  149. package/dist/app/server/assets/Approval-DvkB9tWA.js +2 -0
  150. package/dist/app/server/assets/Approval-DvkB9tWA.js.map +1 -0
  151. package/dist/app/server/assets/ArrowUp-DpK_zNgZ.js +2 -0
  152. package/dist/app/server/assets/ArrowUp-DpK_zNgZ.js.map +1 -0
  153. package/dist/app/server/assets/Authentication-BOkhlNQu.js +2 -0
  154. package/dist/app/server/assets/Authentication-BOkhlNQu.js.map +1 -0
  155. package/dist/app/server/assets/Authentication-C3oNZAVX.js +2 -0
  156. package/dist/app/server/assets/Authentication-C3oNZAVX.js.map +1 -0
  157. package/dist/app/server/assets/BRLA-CZvVDNYr.png +0 -0
  158. package/dist/app/server/assets/BRZ-Cn3jEi9t.svg +1 -0
  159. package/dist/app/server/assets/Bytes-C7CRVS3J.js +4 -0
  160. package/dist/app/server/assets/Bytes-C7CRVS3J.js.map +1 -0
  161. package/dist/app/server/assets/CHFAU-DCedc4aH.png +0 -0
  162. package/dist/app/server/assets/Callout-DBfEmP7q.css +1 -0
  163. package/dist/app/server/assets/Callout-tQoAitWq.js +2 -0
  164. package/dist/app/server/assets/Callout-tQoAitWq.js.map +1 -0
  165. package/dist/app/server/assets/ChainList-C4A_7e-9.js +6 -0
  166. package/dist/app/server/assets/ChainList-C4A_7e-9.js.map +1 -0
  167. package/dist/app/server/assets/ChainName-BMnJyJrd.js +2 -0
  168. package/dist/app/server/assets/ChainName-BMnJyJrd.js.map +1 -0
  169. package/dist/app/server/assets/Check-DU_oR3Ev.js +2 -0
  170. package/dist/app/server/assets/Check-DU_oR3Ev.js.map +1 -0
  171. package/dist/app/server/assets/ChevronRight-DTBnw-W6.js +2 -0
  172. package/dist/app/server/assets/ChevronRight-DTBnw-W6.js.map +1 -0
  173. package/dist/app/server/assets/ChooseAccount-BizJvMrY.js +2 -0
  174. package/dist/app/server/assets/ChooseAccount-BizJvMrY.js.map +1 -0
  175. package/dist/app/server/assets/ChooseAccount-DL3wgJhE.css +1 -0
  176. package/dist/app/server/assets/Client-Dx3KrpJZ.js +2 -0
  177. package/dist/app/server/assets/Client-Dx3KrpJZ.js.map +1 -0
  178. package/dist/app/server/assets/ClientOnly-CKLiu67O.js +2 -0
  179. package/dist/app/server/assets/ClientOnly-CKLiu67O.js.map +1 -0
  180. package/dist/app/server/assets/Close-DUeE37ev.js +2 -0
  181. package/dist/app/server/assets/Close-DUeE37ev.js.map +1 -0
  182. package/dist/app/server/assets/Cloud-CLB3rTTy.js +2 -0
  183. package/dist/app/server/assets/Cloud-CLB3rTTy.js.map +1 -0
  184. package/dist/app/server/assets/CodeInput-BqRteSwD.css +1 -0
  185. package/dist/app/server/assets/CodeInput-FsPzVuLU.js +2 -0
  186. package/dist/app/server/assets/CodeInput-FsPzVuLU.js.map +1 -0
  187. package/dist/app/server/assets/Credential-DFjcrdyI.js +2 -0
  188. package/dist/app/server/assets/Credential-DFjcrdyI.js.map +1 -0
  189. package/dist/app/server/assets/DLUSD-BnRXm3EI.png +0 -0
  190. package/dist/app/server/assets/Deposit-CclrAoXL.css +1 -0
  191. package/dist/app/server/assets/Deposit-ChYGRfW2.js +2 -0
  192. package/dist/app/server/assets/Deposit-ChYGRfW2.js.map +1 -0
  193. package/dist/app/server/assets/DevTools-BYkmtuV5.css +1 -0
  194. package/dist/app/server/assets/DevTools-ZJVXqrIK.js +2 -0
  195. package/dist/app/server/assets/DevTools-ZJVXqrIK.js.map +1 -0
  196. package/dist/app/server/assets/DeviceApproval-BffFLD8F.css +1 -0
  197. package/dist/app/server/assets/DeviceApproval-Bqe3Mi78.js +2 -0
  198. package/dist/app/server/assets/DeviceApproval-Bqe3Mi78.js.map +1 -0
  199. package/dist/app/server/assets/EURAU-sjieTTB9.svg +1 -0
  200. package/dist/app/server/assets/EURC.e-CxYiiwkz.svg +1 -0
  201. package/dist/app/server/assets/ExecutionError-CDszGSF1.js +9 -0
  202. package/dist/app/server/assets/ExecutionError-CDszGSF1.js.map +1 -0
  203. package/dist/app/server/assets/Fingerprint-DhOPOdRr.js +2 -0
  204. package/dist/app/server/assets/Fingerprint-DhOPOdRr.js.map +1 -0
  205. package/dist/app/server/assets/GBPA-DI_25xSG.svg +4 -0
  206. package/dist/app/server/assets/GUSD-BDEP2Qb-.svg +1 -0
  207. package/dist/app/server/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
  208. package/dist/app/server/assets/Globe-2CxqxU-7.js +2 -0
  209. package/dist/app/server/assets/Globe-2CxqxU-7.js.map +1 -0
  210. package/dist/app/server/assets/Grant-5a-n1gJH.css +1 -0
  211. package/dist/app/server/assets/Grant-D_tun0mF.js +2 -0
  212. package/dist/app/server/assets/Grant-D_tun0mF.js.map +1 -0
  213. package/dist/app/server/assets/Hex-C9KeV7_9.css +1 -0
  214. package/dist/app/server/assets/Hex-Z6m_0Y0m.js +11 -0
  215. package/dist/app/server/assets/Hex-Z6m_0Y0m.js.map +1 -0
  216. package/dist/app/server/assets/IconChip-C9ZrmGB5.js +2 -0
  217. package/dist/app/server/assets/IconChip-C9ZrmGB5.js.map +1 -0
  218. package/dist/app/server/assets/IconChip-yqaQ2y_d.css +1 -0
  219. package/dist/app/server/assets/InputGroup-BlZvt9In.css +1 -0
  220. package/dist/app/server/assets/InputGroup-hpjuLuR7.js +2 -0
  221. package/dist/app/server/assets/InputGroup-hpjuLuR7.js.map +1 -0
  222. package/dist/app/server/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
  223. package/dist/app/server/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
  224. package/dist/app/server/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
  225. package/dist/app/server/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
  226. package/dist/app/server/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
  227. package/dist/app/server/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
  228. package/dist/app/server/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
  229. package/dist/app/server/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
  230. package/dist/app/server/assets/Loader-DnKC9P5p.js +2 -0
  231. package/dist/app/server/assets/Loader-DnKC9P5p.js.map +1 -0
  232. package/dist/app/server/assets/MACH-sK0r79kQ.svg +4 -0
  233. package/dist/app/server/assets/Match-CyVdYcSf.js +2 -0
  234. package/dist/app/server/assets/Match-CyVdYcSf.js.map +1 -0
  235. package/dist/app/server/assets/OUSD-BFXgVo-Z.svg +5 -0
  236. package/dist/app/server/assets/OUSD.dark-BbbjMvA1.svg +17 -0
  237. package/dist/app/server/assets/OUSD.light-B_zpSz_c.svg +17 -0
  238. package/dist/app/server/assets/PRIME-CiFp2-3e.svg +14 -0
  239. package/dist/app/server/assets/PopoverPopup-CwqeQelI.js +2 -0
  240. package/dist/app/server/assets/PopoverPopup-CwqeQelI.js.map +1 -0
  241. package/dist/app/server/assets/Rows-CQKQwTI1.js +2 -0
  242. package/dist/app/server/assets/Rows-CQKQwTI1.js.map +1 -0
  243. package/dist/app/server/assets/Rows-DPGTUdA8.css +1 -0
  244. package/dist/app/server/assets/SBC-BTYkbkiD.svg +1 -0
  245. package/dist/app/server/assets/SEKAU-CB5Fc6o8.svg +5 -0
  246. package/dist/app/server/assets/Separator-DrI7KRAs.js +2 -0
  247. package/dist/app/server/assets/Separator-DrI7KRAs.js.map +1 -0
  248. package/dist/app/server/assets/SignIn-DfeeLEmN.js +2 -0
  249. package/dist/app/server/assets/SignIn-DfeeLEmN.js.map +1 -0
  250. package/dist/app/server/assets/SignIn-mlBTwUq4.css +1 -0
  251. package/dist/app/server/assets/Stack-D7Yt22Ed.css +1 -0
  252. package/dist/app/server/assets/Stack-DGktaLZc.js +2 -0
  253. package/dist/app/server/assets/Stack-DGktaLZc.js.map +1 -0
  254. package/dist/app/server/assets/Tag-9vSRBpph.js +2 -0
  255. package/dist/app/server/assets/Tag-9vSRBpph.js.map +1 -0
  256. package/dist/app/server/assets/Tag-BMh6ajrW.css +1 -0
  257. package/dist/app/server/assets/ToolbarRootContext-BH_CFSWd.js +2 -0
  258. package/dist/app/server/assets/ToolbarRootContext-BH_CFSWd.js.map +1 -0
  259. package/dist/app/server/assets/Tooltip-DLX41peb.js +2 -0
  260. package/dist/app/server/assets/Tooltip-DLX41peb.js.map +1 -0
  261. package/dist/app/server/assets/Tooltip-d3y9ESUJ.css +1 -0
  262. package/dist/app/server/assets/USD1-COVcO_PB.svg +30 -0
  263. package/dist/app/server/assets/USDB-Ckwb6UQw.svg +11 -0
  264. package/dist/app/server/assets/USDC.e-3nMsKAMC.svg +1 -0
  265. package/dist/app/server/assets/USDT0-ia60Dw0e.svg +1 -0
  266. package/dist/app/server/assets/USDY-CB4iet2q.svg +16 -0
  267. package/dist/app/server/assets/USDe-BXHQCd92.svg +1 -0
  268. package/dist/app/server/assets/Upgrade-Dbfm2nm0.js +2 -0
  269. package/dist/app/server/assets/Upgrade-Dbfm2nm0.js.map +1 -0
  270. package/dist/app/server/assets/WalletUpgrade-C04kW0Jl.css +1 -0
  271. package/dist/app/server/assets/WalletUpgrade-CWKc5fYt.js +2 -0
  272. package/dist/app/server/assets/WalletUpgrade-CWKc5fYt.js.map +1 -0
  273. package/dist/app/server/assets/YLDS-CRh8Zw0g.svg +3 -0
  274. package/dist/app/server/assets/___-I98bns4o.css +1 -0
  275. package/dist/app/server/assets/___.flows-Cc-awUoC.js +6 -0
  276. package/dist/app/server/assets/___.flows-Cc-awUoC.js.map +1 -0
  277. package/dist/app/server/assets/_tanstack-start-manifest_v-U7TrtUSA.js +1 -0
  278. package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows-B1pPOqsM.css +1 -0
  279. package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-CKALi9oD.js +2 -0
  280. package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-CKALi9oD.js.map +1 -0
  281. package/dist/app/server/assets/_zyzz_shared-BbDIEd_j.css +1 -0
  282. package/dist/app/server/assets/alphaUSD-CpCFoVuh.svg +1 -0
  283. package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +2 -0
  284. package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +1 -0
  285. package/dist/app/server/assets/async-local-storage-DlOvwxXd.js +2 -0
  286. package/dist/app/server/assets/async-local-storage-DlOvwxXd.js.map +1 -0
  287. package/dist/app/server/assets/authorize-BXzTo2Pb.js +2 -0
  288. package/dist/app/server/assets/authorize-BXzTo2Pb.js.map +1 -0
  289. package/dist/app/server/assets/authorize-BzoUqOdA.js +2 -0
  290. package/dist/app/server/assets/authorize-BzoUqOdA.js.map +1 -0
  291. package/dist/app/server/assets/authorize-DXYo-K2n-rmQQ42x1.js +56 -0
  292. package/dist/app/server/assets/authorize-DXYo-K2n-rmQQ42x1.js.map +1 -0
  293. package/dist/app/server/assets/authorize-DfjPYJqS.css +1 -0
  294. package/dist/app/server/assets/betaUSD-9A8AjgYg.svg +1 -0
  295. package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js +2 -0
  296. package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js.map +1 -0
  297. package/dist/app/server/assets/cUSD-WsQfa-iC.svg +1 -0
  298. package/dist/app/server/assets/call-dzi0xjZd.js +31 -0
  299. package/dist/app/server/assets/call-dzi0xjZd.js.map +1 -0
  300. package/dist/app/server/assets/cbBTC-DvUDqrDi.svg +1 -0
  301. package/dist/app/server/assets/ccip-DjD8z_3B.js +2 -0
  302. package/dist/app/server/assets/ccip-DjD8z_3B.js.map +1 -0
  303. package/dist/app/server/assets/choose-account-_X7xq5am.js +2 -0
  304. package/dist/app/server/assets/choose-account-_X7xq5am.js.map +1 -0
  305. package/dist/app/server/assets/choose-account-lqA5SLx9.css +1 -0
  306. package/dist/app/server/assets/choose-account-zm-5Qs3e.js +2 -0
  307. package/dist/app/server/assets/choose-account-zm-5Qs3e.js.map +1 -0
  308. package/dist/app/server/assets/compiled-query-Ds2NVcFT.js +2 -0
  309. package/dist/app/server/assets/compiled-query-Ds2NVcFT.js.map +1 -0
  310. package/dist/app/server/assets/convert-BIC8n32x.js +2 -0
  311. package/dist/app/server/assets/convert-BIC8n32x.js.map +1 -0
  312. package/dist/app/server/assets/cookie-DxViaO10.js +2 -0
  313. package/dist/app/server/assets/cookie-DxViaO10.js.map +1 -0
  314. package/dist/app/server/assets/core-BBrZXfrB.js +56 -0
  315. package/dist/app/server/assets/core-BBrZXfrB.js.map +1 -0
  316. package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js +2 -0
  317. package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js.map +1 -0
  318. package/dist/app/server/assets/decodeFunctionData-bP6V2ai4.js +2 -0
  319. package/dist/app/server/assets/decodeFunctionData-bP6V2ai4.js.map +1 -0
  320. package/dist/app/server/assets/default-u_dwuiYb-DOrMMcg9.js +2 -0
  321. package/dist/app/server/assets/default-u_dwuiYb-DOrMMcg9.js.map +1 -0
  322. package/dist/app/server/assets/deposit-BBaNI01u.js +2 -0
  323. package/dist/app/server/assets/deposit-BBaNI01u.js.map +1 -0
  324. package/dist/app/server/assets/deposit-LWS6ZTuf.js +2 -0
  325. package/dist/app/server/assets/deposit-LWS6ZTuf.js.map +1 -0
  326. package/dist/app/server/assets/deposit-oFx15XCA.css +1 -0
  327. package/dist/app/server/assets/device-CrXlusjr.js +2 -0
  328. package/dist/app/server/assets/device-CrXlusjr.js.map +1 -0
  329. package/dist/app/server/assets/device-DdFMgYe2.js +2 -0
  330. package/dist/app/server/assets/device-DdFMgYe2.js.map +1 -0
  331. package/dist/app/server/assets/device-tMCpu5zk.css +1 -0
  332. package/dist/app/server/assets/dist-CR6FW-yS.js +1 -0
  333. package/dist/app/server/assets/dist-CoH0hD1s.js +15 -0
  334. package/dist/app/server/assets/dist-CoH0hD1s.js.map +1 -0
  335. package/dist/app/server/assets/dist-DcICI3fd.js +2 -0
  336. package/dist/app/server/assets/dist-DcICI3fd.js.map +1 -0
  337. package/dist/app/server/assets/effect-QlVUlMFu-mXPkuQTb.js +2 -0
  338. package/dist/app/server/assets/effect-QlVUlMFu-mXPkuQTb.js.map +1 -0
  339. package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +2 -0
  340. package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +1 -0
  341. package/dist/app/server/assets/error-CXy8gqdE.css +1 -0
  342. package/dist/app/server/assets/error-DXDT2AHy.js +2 -0
  343. package/dist/app/server/assets/error-DXDT2AHy.js.map +1 -0
  344. package/dist/app/server/assets/error-bnVzy9tx.js +2 -0
  345. package/dist/app/server/assets/error-bnVzy9tx.js.map +1 -0
  346. package/dist/app/server/assets/esm-C6SW--yt.js +4 -0
  347. package/dist/app/server/assets/esm-C6SW--yt.js.map +1 -0
  348. package/dist/app/server/assets/factory-dvoOlKer.js +5 -0
  349. package/dist/app/server/assets/factory-dvoOlKer.js.map +1 -0
  350. package/dist/app/server/assets/frxUSD-n9pTpinR.svg +1 -0
  351. package/dist/app/server/assets/get-id-field-OwLpfjj2.js +6 -0
  352. package/dist/app/server/assets/get-id-field-OwLpfjj2.js.map +1 -0
  353. package/dist/app/server/assets/getPseudoElementBounds-PkWU72kn.js +2 -0
  354. package/dist/app/server/assets/getPseudoElementBounds-PkWU72kn.js.map +1 -0
  355. package/dist/app/server/assets/goUSD-D9kUvHsF.svg +5 -0
  356. package/dist/app/server/assets/iUSD-CWCJAq9X.svg +1 -0
  357. package/dist/app/server/assets/index-CLddUTqr-CC33CMvS.js +2 -0
  358. package/dist/app/server/assets/index-CLddUTqr-CC33CMvS.js.map +1 -0
  359. package/dist/app/server/assets/index-DZEfthgZ-Ec2MMQ_e.js +2 -0
  360. package/dist/app/server/assets/index-DZEfthgZ-Ec2MMQ_e.js.map +1 -0
  361. package/dist/app/server/assets/kysely-adapter-B8tQwTcu.js +1 -0
  362. package/dist/app/server/assets/lazyRouteComponent-DPOOPZw_.js +2 -0
  363. package/dist/app/server/assets/lazyRouteComponent-DPOOPZw_.js.map +1 -0
  364. package/dist/app/server/assets/load-server-Dr0IlySo.js +3 -0
  365. package/dist/app/server/assets/load-server-Dr0IlySo.js.map +1 -0
  366. package/dist/app/server/assets/login-BLq3tEEr.js +2 -0
  367. package/dist/app/server/assets/login-BLq3tEEr.js.map +1 -0
  368. package/dist/app/server/assets/login-DCIrAbED.js +2 -0
  369. package/dist/app/server/assets/login-DCIrAbED.js.map +1 -0
  370. package/dist/app/server/assets/login-msDnt3yT.css +1 -0
  371. package/dist/app/server/assets/matchContext-ByrIUj4L.js +2 -0
  372. package/dist/app/server/assets/matchContext-ByrIUj4L.js.map +1 -0
  373. package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js +2 -0
  374. package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js.map +1 -0
  375. package/dist/app/server/assets/pathUSD-BvaO6ooS.svg +25 -0
  376. package/dist/app/server/assets/rUSD-B-xuFS7T.svg +1 -0
  377. package/dist/app/server/assets/reUSD-CkIUs0Lx.svg +1 -0
  378. package/dist/app/server/assets/react-dom-DYzj0HXX.js +2 -0
  379. package/dist/app/server/assets/react-dom-DYzj0HXX.js.map +1 -0
  380. package/dist/app/server/assets/removable-BCLTvPOx.js +2 -0
  381. package/dist/app/server/assets/removable-BCLTvPOx.js.map +1 -0
  382. package/dist/app/server/assets/reset-DZWeTZeQ.js +2 -0
  383. package/dist/app/server/assets/reset-DZWeTZeQ.js.map +1 -0
  384. package/dist/app/server/assets/reset-co-CHrff.css +1 -0
  385. package/dist/app/server/assets/resolveError-CZXXvCJR.js +2 -0
  386. package/dist/app/server/assets/resolveError-CZXXvCJR.js.map +1 -0
  387. package/dist/app/server/assets/rolldown-runtime-BWaJ3C7D.js +1 -0
  388. package/dist/app/server/assets/router-Bqz5X4Qw.js +2 -0
  389. package/dist/app/server/assets/router-Bqz5X4Qw.js.map +1 -0
  390. package/dist/app/server/assets/router-CclzitkY.css +1 -0
  391. package/dist/app/server/assets/routes-BLQdKqcZ.js +2 -0
  392. package/dist/app/server/assets/routes-BLQdKqcZ.js.map +1 -0
  393. package/dist/app/server/assets/routes-BgiIzrOt.css +1 -0
  394. package/dist/app/server/assets/routes-Bv6WzsSR.js +2 -0
  395. package/dist/app/server/assets/routes-Bv6WzsSR.js.map +1 -0
  396. package/dist/app/server/assets/sUSDe-j9GOnH7I.svg +1 -0
  397. package/dist/app/server/assets/schema-check-oLqvHR8y.js +9 -0
  398. package/dist/app/server/assets/schema-check-oLqvHR8y.js.map +1 -0
  399. package/dist/app/server/assets/secp256k1-yg8eeIYU.js +2 -0
  400. package/dist/app/server/assets/secp256k1-yg8eeIYU.js.map +1 -0
  401. package/dist/app/server/assets/server-RRUiOef2.js +76 -0
  402. package/dist/app/server/assets/server-RRUiOef2.js.map +1 -0
  403. package/dist/app/server/assets/siUSD-C10QUNYS.svg +1 -0
  404. package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js +2 -0
  405. package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js.map +1 -0
  406. package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js +6 -0
  407. package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js.map +1 -0
  408. package/dist/app/server/assets/standard-json-DY77efq0.js +2 -0
  409. package/dist/app/server/assets/standard-json-DY77efq0.js.map +1 -0
  410. package/dist/app/server/assets/standard-json-ig2t0wRt.js +2 -0
  411. package/dist/app/server/assets/standard-json-ig2t0wRt.js.map +1 -0
  412. package/dist/app/server/assets/standard-json-t-LNckA6.js +2 -0
  413. package/dist/app/server/assets/standard-json-t-LNckA6.js.map +1 -0
  414. package/dist/app/server/assets/standard-openapi-CONmVRl8.js +2 -0
  415. package/dist/app/server/assets/standard-openapi-CONmVRl8.js.map +1 -0
  416. package/dist/app/server/assets/start-C63VetBp.js +2 -0
  417. package/dist/app/server/assets/start-C63VetBp.js.map +1 -0
  418. package/dist/app/server/assets/stcUSD-DIntDJeh.svg +1 -0
  419. package/dist/app/server/assets/sury-CWZTCd75-CDaOS2oM.js +2 -0
  420. package/dist/app/server/assets/sury-CWZTCd75-CDaOS2oM.js.map +1 -0
  421. package/dist/app/server/assets/syrupUSDC-DhYwZqdM.svg +5 -0
  422. package/dist/app/server/assets/thetaUSD-Dgmksf6G.svg +1 -0
  423. package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +2 -0
  424. package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +1 -0
  425. package/dist/app/server/assets/useNavigate-D6d1w7KE.js +2 -0
  426. package/dist/app/server/assets/useNavigate-D6d1w7KE.js.map +1 -0
  427. package/dist/app/server/assets/useQuery-BRpCr5vj.js +2 -0
  428. package/dist/app/server/assets/useQuery-BRpCr5vj.js.map +1 -0
  429. package/dist/app/server/assets/useRegisterFieldControl-cJesrOWK.js +2 -0
  430. package/dist/app/server/assets/useRegisterFieldControl-cJesrOWK.js.map +1 -0
  431. package/dist/app/server/assets/utils-C4ZXZIZW.js +2 -0
  432. package/dist/app/server/assets/utils-C4ZXZIZW.js.map +1 -0
  433. package/dist/app/server/assets/utils-D57zfcg-.js +2 -0
  434. package/dist/app/server/assets/utils-D57zfcg-.js.map +1 -0
  435. package/dist/app/server/assets/valibot--1zFm7rT-CIKoH3MS.js +2 -0
  436. package/dist/app/server/assets/valibot--1zFm7rT-CIKoH3MS.js.map +1 -0
  437. package/dist/app/server/assets/valibot-D_HTw1Gn-BdPyLkXt.js +2 -0
  438. package/dist/app/server/assets/valibot-D_HTw1Gn-BdPyLkXt.js.map +1 -0
  439. package/dist/app/server/assets/wYLDS-CaCKDrO-.svg +10 -0
  440. package/dist/app/server/assets/wsrUSD-B2Ey0bDQ.svg +1 -0
  441. package/dist/app/server/assets/zod-Bwrt9trS-BezI5Gi1.js +2 -0
  442. package/dist/app/server/assets/zod-Bwrt9trS-BezI5Gi1.js.map +1 -0
  443. package/dist/app/server/assets/zod-DSgpEGAE-DZ7M_Q33.js +2 -0
  444. package/dist/app/server/assets/zod-DSgpEGAE-DZ7M_Q33.js.map +1 -0
  445. package/dist/app/server/assets/zyzz-6R2K52xP.css +1 -0
  446. package/dist/app/server/assets/zyzz.config-CJRpjn0E.js +3 -0
  447. package/dist/app/server/assets/zyzz.config-CJRpjn0E.js.map +1 -0
  448. package/dist/app/server/index.js +532 -0
  449. package/dist/app/server/index.js.map +1 -0
  450. package/dist/app/server/wrangler.json +1 -0
  451. package/dist/cli/Admin.d.ts +34 -0
  452. package/dist/cli/Admin.d.ts.map +1 -0
  453. package/dist/cli/Admin.js +61 -0
  454. package/dist/cli/Admin.js.map +1 -0
  455. package/dist/cli/Apps.d.ts +9 -0
  456. package/dist/cli/Apps.d.ts.map +1 -0
  457. package/dist/cli/Apps.js +34 -0
  458. package/dist/cli/Apps.js.map +1 -0
  459. package/dist/cli/Cli.d.ts +13 -0
  460. package/dist/cli/Cli.d.ts.map +1 -0
  461. package/dist/cli/Cli.js +26 -0
  462. package/dist/cli/Cli.js.map +1 -0
  463. package/dist/cli/Project.d.ts +17 -0
  464. package/dist/cli/Project.d.ts.map +1 -0
  465. package/dist/cli/Project.js +90 -0
  466. package/dist/cli/Project.js.map +1 -0
  467. package/dist/cli/Realms.d.ts +24 -0
  468. package/dist/cli/Realms.d.ts.map +1 -0
  469. package/dist/cli/Realms.js +48 -0
  470. package/dist/cli/Realms.js.map +1 -0
  471. package/dist/cli/Session.d.ts +79 -0
  472. package/dist/cli/Session.d.ts.map +1 -0
  473. package/dist/cli/Session.js +229 -0
  474. package/dist/cli/Session.js.map +1 -0
  475. package/dist/cli/User.d.ts +24 -0
  476. package/dist/cli/User.d.ts.map +1 -0
  477. package/dist/cli/User.js +34 -0
  478. package/dist/cli/User.js.map +1 -0
  479. package/dist/cli/V1.d.ts +32 -0
  480. package/dist/cli/V1.d.ts.map +1 -0
  481. package/dist/cli/V1.js +38 -0
  482. package/dist/cli/V1.js.map +1 -0
  483. package/dist/cli/bin.d.ts +3 -0
  484. package/dist/cli/bin.d.ts.map +1 -0
  485. package/dist/cli/bin.js +46 -0
  486. package/dist/cli/bin.js.map +1 -0
  487. package/dist/cli/commands/admin/apps/create.d.ts +23 -0
  488. package/dist/cli/commands/admin/apps/create.d.ts.map +1 -0
  489. package/dist/cli/commands/admin/apps/create.js +84 -0
  490. package/dist/cli/commands/admin/apps/create.js.map +1 -0
  491. package/dist/cli/commands/admin/apps/delete.d.ts +15 -0
  492. package/dist/cli/commands/admin/apps/delete.d.ts.map +1 -0
  493. package/dist/cli/commands/admin/apps/delete.js +41 -0
  494. package/dist/cli/commands/admin/apps/delete.js.map +1 -0
  495. package/dist/cli/commands/admin/apps/index.d.ts +5 -0
  496. package/dist/cli/commands/admin/apps/index.d.ts.map +1 -0
  497. package/dist/cli/commands/admin/apps/index.js +14 -0
  498. package/dist/cli/commands/admin/apps/index.js.map +1 -0
  499. package/dist/cli/commands/admin/apps/list.d.ts +10 -0
  500. package/dist/cli/commands/admin/apps/list.d.ts.map +1 -0
  501. package/dist/cli/commands/admin/apps/list.js +26 -0
  502. package/dist/cli/commands/admin/apps/list.js.map +1 -0
  503. package/dist/cli/commands/admin/apps/rotate-secret.d.ts +17 -0
  504. package/dist/cli/commands/admin/apps/rotate-secret.d.ts.map +1 -0
  505. package/dist/cli/commands/admin/apps/rotate-secret.js +47 -0
  506. package/dist/cli/commands/admin/apps/rotate-secret.js.map +1 -0
  507. package/dist/cli/commands/admin/apps/update.d.ts +20 -0
  508. package/dist/cli/commands/admin/apps/update.d.ts.map +1 -0
  509. package/dist/cli/commands/admin/apps/update.js +71 -0
  510. package/dist/cli/commands/admin/apps/update.js.map +1 -0
  511. package/dist/cli/commands/admin/index.d.ts +5 -0
  512. package/dist/cli/commands/admin/index.d.ts.map +1 -0
  513. package/dist/cli/commands/admin/index.js +13 -0
  514. package/dist/cli/commands/admin/index.js.map +1 -0
  515. package/dist/cli/commands/admin/migrate.d.ts +10 -0
  516. package/dist/cli/commands/admin/migrate.d.ts.map +1 -0
  517. package/dist/cli/commands/admin/migrate.js +20 -0
  518. package/dist/cli/commands/admin/migrate.js.map +1 -0
  519. package/dist/cli/commands/admin/realms/add.d.ts +13 -0
  520. package/dist/cli/commands/admin/realms/add.d.ts.map +1 -0
  521. package/dist/cli/commands/admin/realms/add.js +42 -0
  522. package/dist/cli/commands/admin/realms/add.js.map +1 -0
  523. package/dist/cli/commands/admin/realms/index.d.ts +5 -0
  524. package/dist/cli/commands/admin/realms/index.d.ts.map +1 -0
  525. package/dist/cli/commands/admin/realms/index.js +13 -0
  526. package/dist/cli/commands/admin/realms/index.js.map +1 -0
  527. package/dist/cli/commands/admin/realms/list.d.ts +14 -0
  528. package/dist/cli/commands/admin/realms/list.d.ts.map +1 -0
  529. package/dist/cli/commands/admin/realms/list.js +36 -0
  530. package/dist/cli/commands/admin/realms/list.js.map +1 -0
  531. package/dist/cli/commands/admin/realms/passkeys/index.d.ts +5 -0
  532. package/dist/cli/commands/admin/realms/passkeys/index.d.ts.map +1 -0
  533. package/dist/cli/commands/admin/realms/passkeys/index.js +13 -0
  534. package/dist/cli/commands/admin/realms/passkeys/index.js.map +1 -0
  535. package/dist/cli/commands/admin/realms/passkeys/set.d.ts +17 -0
  536. package/dist/cli/commands/admin/realms/passkeys/set.d.ts.map +1 -0
  537. package/dist/cli/commands/admin/realms/passkeys/set.js +46 -0
  538. package/dist/cli/commands/admin/realms/passkeys/set.js.map +1 -0
  539. package/dist/cli/commands/admin/realms/privy/index.d.ts +5 -0
  540. package/dist/cli/commands/admin/realms/privy/index.d.ts.map +1 -0
  541. package/dist/cli/commands/admin/realms/privy/index.js +13 -0
  542. package/dist/cli/commands/admin/realms/privy/index.js.map +1 -0
  543. package/dist/cli/commands/admin/realms/privy/set.d.ts +19 -0
  544. package/dist/cli/commands/admin/realms/privy/set.d.ts.map +1 -0
  545. package/dist/cli/commands/admin/realms/privy/set.js +66 -0
  546. package/dist/cli/commands/admin/realms/privy/set.js.map +1 -0
  547. package/dist/cli/commands/admin/realms/remove.d.ts +12 -0
  548. package/dist/cli/commands/admin/realms/remove.d.ts.map +1 -0
  549. package/dist/cli/commands/admin/realms/remove.js +35 -0
  550. package/dist/cli/commands/admin/realms/remove.js.map +1 -0
  551. package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts +16 -0
  552. package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts.map +1 -0
  553. package/dist/cli/commands/admin/realms/secp256k1/disable.js +42 -0
  554. package/dist/cli/commands/admin/realms/secp256k1/disable.js.map +1 -0
  555. package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts +16 -0
  556. package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts.map +1 -0
  557. package/dist/cli/commands/admin/realms/secp256k1/enable.js +42 -0
  558. package/dist/cli/commands/admin/realms/secp256k1/enable.js.map +1 -0
  559. package/dist/cli/commands/admin/realms/secp256k1/index.d.ts +9 -0
  560. package/dist/cli/commands/admin/realms/secp256k1/index.d.ts.map +1 -0
  561. package/dist/cli/commands/admin/realms/secp256k1/index.js +17 -0
  562. package/dist/cli/commands/admin/realms/secp256k1/index.js.map +1 -0
  563. package/dist/cli/commands/admin/realms/set.d.ts +17 -0
  564. package/dist/cli/commands/admin/realms/set.d.ts.map +1 -0
  565. package/dist/cli/commands/admin/realms/set.js +46 -0
  566. package/dist/cli/commands/admin/realms/set.js.map +1 -0
  567. package/dist/cli/commands/admin/rotate-key.d.ts +16 -0
  568. package/dist/cli/commands/admin/rotate-key.d.ts.map +1 -0
  569. package/dist/cli/commands/admin/rotate-key.js +46 -0
  570. package/dist/cli/commands/admin/rotate-key.js.map +1 -0
  571. package/dist/cli/commands/init.d.ts +11 -0
  572. package/dist/cli/commands/init.d.ts.map +1 -0
  573. package/dist/cli/commands/init.js +34 -0
  574. package/dist/cli/commands/init.js.map +1 -0
  575. package/dist/cli/commands/login.d.ts +12 -0
  576. package/dist/cli/commands/login.d.ts.map +1 -0
  577. package/dist/cli/commands/login.js +29 -0
  578. package/dist/cli/commands/login.js.map +1 -0
  579. package/dist/cli/commands/logout.d.ts +8 -0
  580. package/dist/cli/commands/logout.d.ts.map +1 -0
  581. package/dist/cli/commands/logout.js +19 -0
  582. package/dist/cli/commands/logout.js.map +1 -0
  583. package/dist/cli/commands/whoami.d.ts +12 -0
  584. package/dist/cli/commands/whoami.d.ts.map +1 -0
  585. package/dist/cli/commands/whoami.js +24 -0
  586. package/dist/cli/commands/whoami.js.map +1 -0
  587. package/dist/client/Actions.d.ts +108 -0
  588. package/dist/client/Actions.d.ts.map +1 -0
  589. package/dist/client/Actions.js +94 -0
  590. package/dist/client/Actions.js.map +1 -0
  591. package/dist/client/Auth.d.ts +143 -0
  592. package/dist/client/Auth.d.ts.map +1 -0
  593. package/dist/client/Auth.js +106 -0
  594. package/dist/client/Auth.js.map +1 -0
  595. package/dist/client/Authorization.d.ts +29 -0
  596. package/dist/client/Authorization.d.ts.map +1 -0
  597. package/dist/client/Authorization.js +12 -0
  598. package/dist/client/Authorization.js.map +1 -0
  599. package/dist/client/Decorator.d.ts +172 -0
  600. package/dist/client/Decorator.d.ts.map +1 -0
  601. package/dist/client/Decorator.js +241 -0
  602. package/dist/client/Decorator.js.map +1 -0
  603. package/dist/client/Key.d.ts +82 -0
  604. package/dist/client/Key.d.ts.map +1 -0
  605. package/dist/client/Key.js +81 -0
  606. package/dist/client/Key.js.map +1 -0
  607. package/dist/client/Pending.d.ts +38 -0
  608. package/dist/client/Pending.d.ts.map +1 -0
  609. package/dist/client/Pending.js +12 -0
  610. package/dist/client/Pending.js.map +1 -0
  611. package/dist/client/Permissions.d.ts +36 -0
  612. package/dist/client/Permissions.d.ts.map +1 -0
  613. package/dist/client/Permissions.js +16 -0
  614. package/dist/client/Permissions.js.map +1 -0
  615. package/dist/client/Storage.d.ts +27 -0
  616. package/dist/client/Storage.d.ts.map +1 -0
  617. package/dist/client/Storage.js +16 -0
  618. package/dist/client/Storage.js.map +1 -0
  619. package/dist/client/TempoAccount.d.ts +52 -0
  620. package/dist/client/TempoAccount.d.ts.map +1 -0
  621. package/dist/client/TempoAccount.js +17 -0
  622. package/dist/client/TempoAccount.js.map +1 -0
  623. package/dist/client/Tokens.d.ts +25 -0
  624. package/dist/client/Tokens.d.ts.map +1 -0
  625. package/dist/client/Tokens.js +12 -0
  626. package/dist/client/Tokens.js.map +1 -0
  627. package/dist/client/User.d.ts +21 -0
  628. package/dist/client/User.d.ts.map +1 -0
  629. package/dist/client/User.js +12 -0
  630. package/dist/client/User.js.map +1 -0
  631. package/dist/client/actions/account.d.ts +75 -0
  632. package/dist/client/actions/account.d.ts.map +1 -0
  633. package/dist/client/actions/account.js +102 -0
  634. package/dist/client/actions/account.js.map +1 -0
  635. package/dist/client/actions/device.d.ts +52 -0
  636. package/dist/client/actions/device.d.ts.map +1 -0
  637. package/dist/client/actions/device.js +103 -0
  638. package/dist/client/actions/device.js.map +1 -0
  639. package/dist/client/actions/email.d.ts +89 -0
  640. package/dist/client/actions/email.d.ts.map +1 -0
  641. package/dist/client/actions/email.js +86 -0
  642. package/dist/client/actions/email.js.map +1 -0
  643. package/dist/client/actions/oauth.d.ts +112 -0
  644. package/dist/client/actions/oauth.d.ts.map +1 -0
  645. package/dist/client/actions/oauth.js +103 -0
  646. package/dist/client/actions/oauth.js.map +1 -0
  647. package/dist/client/actions/passkey.d.ts +140 -0
  648. package/dist/client/actions/passkey.d.ts.map +1 -0
  649. package/dist/client/actions/passkey.js +170 -0
  650. package/dist/client/actions/passkey.js.map +1 -0
  651. package/dist/client/actions/realm.d.ts +25 -0
  652. package/dist/client/actions/realm.d.ts.map +1 -0
  653. package/dist/client/actions/realm.js +16 -0
  654. package/dist/client/actions/realm.js.map +1 -0
  655. package/dist/client/actions/redirect.d.ts +152 -0
  656. package/dist/client/actions/redirect.d.ts.map +1 -0
  657. package/dist/client/actions/redirect.js +311 -0
  658. package/dist/client/actions/redirect.js.map +1 -0
  659. package/dist/client/internal/accessKey.d.ts +21 -0
  660. package/dist/client/internal/accessKey.d.ts.map +1 -0
  661. package/dist/client/internal/accessKey.js +38 -0
  662. package/dist/client/internal/accessKey.js.map +1 -0
  663. package/dist/client/internal/account.d.ts +17 -0
  664. package/dist/client/internal/account.d.ts.map +1 -0
  665. package/dist/client/internal/account.js +3 -0
  666. package/dist/client/internal/account.js.map +1 -0
  667. package/dist/client/internal/api.d.ts +110 -0
  668. package/dist/client/internal/api.d.ts.map +1 -0
  669. package/dist/client/internal/api.js +136 -0
  670. package/dist/client/internal/api.js.map +1 -0
  671. package/dist/client/internal/headless.d.ts +159 -0
  672. package/dist/client/internal/headless.d.ts.map +1 -0
  673. package/dist/client/internal/headless.js +196 -0
  674. package/dist/client/internal/headless.js.map +1 -0
  675. package/dist/client/internal/indexedDb.d.ts +8 -0
  676. package/dist/client/internal/indexedDb.d.ts.map +1 -0
  677. package/dist/client/internal/indexedDb.js +32 -0
  678. package/dist/client/internal/indexedDb.js.map +1 -0
  679. package/dist/client/internal/request.d.ts +56 -0
  680. package/dist/client/internal/request.d.ts.map +1 -0
  681. package/dist/client/internal/request.js +44 -0
  682. package/dist/client/internal/request.js.map +1 -0
  683. package/dist/client/internal/store.d.ts +12 -0
  684. package/dist/client/internal/store.d.ts.map +1 -0
  685. package/dist/client/internal/store.js +15 -0
  686. package/dist/client/internal/store.js.map +1 -0
  687. package/dist/client/internal/verifier.d.ts +25 -0
  688. package/dist/client/internal/verifier.d.ts.map +1 -0
  689. package/dist/client/internal/verifier.js +52 -0
  690. package/dist/client/internal/verifier.js.map +1 -0
  691. package/dist/client.d.ts +18 -0
  692. package/dist/client.d.ts.map +1 -0
  693. package/dist/client.js +18 -0
  694. package/dist/client.js.map +1 -0
  695. package/dist/index.d.ts +6 -0
  696. package/dist/index.d.ts.map +1 -0
  697. package/dist/index.js +6 -0
  698. package/dist/index.js.map +1 -0
  699. package/dist/internal/Apps.d.ts +3169 -0
  700. package/dist/internal/Apps.d.ts.map +1 -0
  701. package/dist/internal/Apps.js +948 -0
  702. package/dist/internal/Apps.js.map +1 -0
  703. package/dist/internal/Auth.d.ts +4287 -0
  704. package/dist/internal/Auth.d.ts.map +1 -0
  705. package/dist/internal/Auth.js +185 -0
  706. package/dist/internal/Auth.js.map +1 -0
  707. package/dist/internal/Authorize.d.ts +526 -0
  708. package/dist/internal/Authorize.d.ts.map +1 -0
  709. package/dist/internal/Authorize.js +330 -0
  710. package/dist/internal/Authorize.js.map +1 -0
  711. package/dist/internal/Cache.d.ts +56 -0
  712. package/dist/internal/Cache.d.ts.map +1 -0
  713. package/dist/internal/Cache.js +65 -0
  714. package/dist/internal/Cache.js.map +1 -0
  715. package/dist/internal/Chain.d.ts +738 -0
  716. package/dist/internal/Chain.d.ts.map +1 -0
  717. package/dist/internal/Chain.js +65 -0
  718. package/dist/internal/Chain.js.map +1 -0
  719. package/dist/internal/ChainList.d.ts +117 -0
  720. package/dist/internal/ChainList.d.ts.map +1 -0
  721. package/dist/internal/ChainList.js +148 -0
  722. package/dist/internal/ChainList.js.map +1 -0
  723. package/dist/internal/ChainName.d.ts +11 -0
  724. package/dist/internal/ChainName.d.ts.map +1 -0
  725. package/dist/internal/ChainName.js +13 -0
  726. package/dist/internal/ChainName.js.map +1 -0
  727. package/dist/internal/CodeEmail.d.ts +38 -0
  728. package/dist/internal/CodeEmail.d.ts.map +1 -0
  729. package/dist/internal/CodeEmail.js +85 -0
  730. package/dist/internal/CodeEmail.js.map +1 -0
  731. package/dist/internal/ConfigurableAccount.d.ts +600 -0
  732. package/dist/internal/ConfigurableAccount.d.ts.map +1 -0
  733. package/dist/internal/ConfigurableAccount.js +795 -0
  734. package/dist/internal/ConfigurableAccount.js.map +1 -0
  735. package/dist/internal/Device.d.ts +246 -0
  736. package/dist/internal/Device.d.ts.map +1 -0
  737. package/dist/internal/Device.js +257 -0
  738. package/dist/internal/Device.js.map +1 -0
  739. package/dist/internal/Env.d.ts +97 -0
  740. package/dist/internal/Env.d.ts.map +1 -0
  741. package/dist/internal/Env.js +2 -0
  742. package/dist/internal/Env.js.map +1 -0
  743. package/dist/internal/ErrorResponse.d.ts +608 -0
  744. package/dist/internal/ErrorResponse.d.ts.map +1 -0
  745. package/dist/internal/ErrorResponse.js +701 -0
  746. package/dist/internal/ErrorResponse.js.map +1 -0
  747. package/dist/internal/Id.d.ts +10 -0
  748. package/dist/internal/Id.d.ts.map +1 -0
  749. package/dist/internal/Id.js +34 -0
  750. package/dist/internal/Id.js.map +1 -0
  751. package/dist/internal/KeyAuthorization.d.ts +1650 -0
  752. package/dist/internal/KeyAuthorization.d.ts.map +1 -0
  753. package/dist/internal/KeyAuthorization.js +1187 -0
  754. package/dist/internal/KeyAuthorization.js.map +1 -0
  755. package/dist/internal/Limits.d.ts +70 -0
  756. package/dist/internal/Limits.d.ts.map +1 -0
  757. package/dist/internal/Limits.js +36 -0
  758. package/dist/internal/Limits.js.map +1 -0
  759. package/dist/internal/Log.d.ts +34 -0
  760. package/dist/internal/Log.d.ts.map +1 -0
  761. package/dist/internal/Log.js +99 -0
  762. package/dist/internal/Log.js.map +1 -0
  763. package/dist/internal/LogLine.d.ts +29 -0
  764. package/dist/internal/LogLine.d.ts.map +1 -0
  765. package/dist/internal/LogLine.js +50 -0
  766. package/dist/internal/LogLine.js.map +1 -0
  767. package/dist/internal/Migrations.d.ts +28 -0
  768. package/dist/internal/Migrations.d.ts.map +1 -0
  769. package/dist/internal/Migrations.js +82 -0
  770. package/dist/internal/Migrations.js.map +1 -0
  771. package/dist/internal/Owner.d.ts +230 -0
  772. package/dist/internal/Owner.d.ts.map +1 -0
  773. package/dist/internal/Owner.js +101 -0
  774. package/dist/internal/Owner.js.map +1 -0
  775. package/dist/internal/Passkey.d.ts +901 -0
  776. package/dist/internal/Passkey.d.ts.map +1 -0
  777. package/dist/internal/Passkey.js +1185 -0
  778. package/dist/internal/Passkey.js.map +1 -0
  779. package/dist/internal/PendingKey.d.ts +49 -0
  780. package/dist/internal/PendingKey.d.ts.map +1 -0
  781. package/dist/internal/PendingKey.js +58 -0
  782. package/dist/internal/PendingKey.js.map +1 -0
  783. package/dist/internal/Privy.d.ts +138 -0
  784. package/dist/internal/Privy.d.ts.map +1 -0
  785. package/dist/internal/Privy.js +285 -0
  786. package/dist/internal/Privy.js.map +1 -0
  787. package/dist/internal/RateLimit.d.ts +218 -0
  788. package/dist/internal/RateLimit.d.ts.map +1 -0
  789. package/dist/internal/RateLimit.js +209 -0
  790. package/dist/internal/RateLimit.js.map +1 -0
  791. package/dist/internal/Realm.d.ts +290 -0
  792. package/dist/internal/Realm.d.ts.map +1 -0
  793. package/dist/internal/Realm.js +502 -0
  794. package/dist/internal/Realm.js.map +1 -0
  795. package/dist/internal/RequestId.d.ts +16 -0
  796. package/dist/internal/RequestId.d.ts.map +1 -0
  797. package/dist/internal/RequestId.js +78 -0
  798. package/dist/internal/RequestId.js.map +1 -0
  799. package/dist/internal/SigningKey.d.ts +126 -0
  800. package/dist/internal/SigningKey.d.ts.map +1 -0
  801. package/dist/internal/SigningKey.js +221 -0
  802. package/dist/internal/SigningKey.js.map +1 -0
  803. package/dist/internal/TempoAccount.d.ts +181 -0
  804. package/dist/internal/TempoAccount.d.ts.map +1 -0
  805. package/dist/internal/TempoAccount.js +369 -0
  806. package/dist/internal/TempoAccount.js.map +1 -0
  807. package/dist/internal/TestInbox.d.ts +42 -0
  808. package/dist/internal/TestInbox.d.ts.map +1 -0
  809. package/dist/internal/TestInbox.js +20 -0
  810. package/dist/internal/TestInbox.js.map +1 -0
  811. package/dist/internal/Timing.d.ts +52 -0
  812. package/dist/internal/Timing.d.ts.map +1 -0
  813. package/dist/internal/Timing.js +116 -0
  814. package/dist/internal/Timing.js.map +1 -0
  815. package/dist/internal/Validation.d.ts +52 -0
  816. package/dist/internal/Validation.d.ts.map +1 -0
  817. package/dist/internal/Validation.js +22 -0
  818. package/dist/internal/Validation.js.map +1 -0
  819. package/dist/internal/Verification.d.ts +24 -0
  820. package/dist/internal/Verification.d.ts.map +1 -0
  821. package/dist/internal/Verification.js +37 -0
  822. package/dist/internal/Verification.js.map +1 -0
  823. package/dist/internal/Wallet.d.ts +66 -0
  824. package/dist/internal/Wallet.d.ts.map +1 -0
  825. package/dist/internal/Wallet.js +59 -0
  826. package/dist/internal/Wallet.js.map +1 -0
  827. package/dist/internal/owners/Passkey.d.ts +9 -0
  828. package/dist/internal/owners/Passkey.d.ts.map +1 -0
  829. package/dist/internal/owners/Passkey.js +58 -0
  830. package/dist/internal/owners/Passkey.js.map +1 -0
  831. package/dist/internal/owners/Privy.d.ts +13 -0
  832. package/dist/internal/owners/Privy.d.ts.map +1 -0
  833. package/dist/internal/owners/Privy.js +59 -0
  834. package/dist/internal/owners/Privy.js.map +1 -0
  835. package/dist/internal/owners/Secp256k1.d.ts +12 -0
  836. package/dist/internal/owners/Secp256k1.d.ts.map +1 -0
  837. package/dist/internal/owners/Secp256k1.js +99 -0
  838. package/dist/internal/owners/Secp256k1.js.map +1 -0
  839. package/dist/worker.d.ts +18 -0
  840. package/dist/worker.d.ts.map +1 -0
  841. package/dist/worker.js +18 -0
  842. package/dist/worker.js.map +1 -0
  843. package/package.json +83 -3
  844. package/src/Api.ts +157 -0
  845. package/src/App.ts +316 -0
  846. package/src/api/account.ts +2266 -0
  847. package/src/api/authenticate.ts +1662 -0
  848. package/src/api/authorize.ts +1086 -0
  849. package/src/api/device.ts +516 -0
  850. package/src/api/health.ts +72 -0
  851. package/src/api/lib/AccountStep.ts +485 -0
  852. package/src/api/lib/Auth.ts +164 -0
  853. package/src/api/lib/Configure.ts +921 -0
  854. package/src/api/lib/Consent.ts +388 -0
  855. package/src/api/lib/Cors.ts +160 -0
  856. package/src/api/lib/Database.ts +10 -0
  857. package/src/api/lib/DeviceRequest.ts +244 -0
  858. package/src/api/lib/FirstAccount.ts +136 -0
  859. package/src/api/lib/Headless.ts +616 -0
  860. package/src/api/lib/IsolateCache.ts +28 -0
  861. package/src/api/lib/KeySigner.ts +690 -0
  862. package/src/api/lib/PasskeyLink.ts +162 -0
  863. package/src/api/lib/Session.ts +64 -0
  864. package/src/api/lib/SignInConsent.ts +393 -0
  865. package/src/api/oauth.ts +1796 -0
  866. package/src/app/components/CodeInput.tsx +153 -0
  867. package/src/app/components/DevTools.tsx +1071 -0
  868. package/src/app/components/Grant.tsx +476 -0
  869. package/src/app/components/icons/BRLA.png +0 -0
  870. package/src/app/components/icons/BRZ.svg +1 -0
  871. package/src/app/components/icons/CHFAU.png +0 -0
  872. package/src/app/components/icons/DLUSD.png +0 -0
  873. package/src/app/components/icons/EURAU.svg +1 -0
  874. package/src/app/components/icons/EURC.e.svg +1 -0
  875. package/src/app/components/icons/GBPA.svg +4 -0
  876. package/src/app/components/icons/GUSD.svg +1 -0
  877. package/src/app/components/icons/MACH.svg +4 -0
  878. package/src/app/components/icons/OUSD.svg +5 -0
  879. package/src/app/components/icons/PRIME.svg +14 -0
  880. package/src/app/components/icons/SBC.svg +1 -0
  881. package/src/app/components/icons/SEKAU.svg +5 -0
  882. package/src/app/components/icons/USD1.svg +30 -0
  883. package/src/app/components/icons/USDB.svg +11 -0
  884. package/src/app/components/icons/USDC.e.svg +1 -0
  885. package/src/app/components/icons/USDT0.svg +1 -0
  886. package/src/app/components/icons/USDY.svg +16 -0
  887. package/src/app/components/icons/USDe.svg +1 -0
  888. package/src/app/components/icons/YLDS.svg +3 -0
  889. package/src/app/components/icons/alphaUSD.svg +1 -0
  890. package/src/app/components/icons/betaUSD.svg +1 -0
  891. package/src/app/components/icons/cUSD.svg +1 -0
  892. package/src/app/components/icons/cbBTC.svg +1 -0
  893. package/src/app/components/icons/frxUSD.svg +1 -0
  894. package/src/app/components/icons/goUSD.svg +5 -0
  895. package/src/app/components/icons/iUSD.svg +1 -0
  896. package/src/app/components/icons/pathUSD.svg +25 -0
  897. package/src/app/components/icons/rUSD.svg +1 -0
  898. package/src/app/components/icons/reUSD.svg +1 -0
  899. package/src/app/components/icons/sUSDe.svg +1 -0
  900. package/src/app/components/icons/siUSD.svg +1 -0
  901. package/src/app/components/icons/stcUSD.svg +1 -0
  902. package/src/app/components/icons/syrupUSDC.svg +5 -0
  903. package/src/app/components/icons/thetaUSD.svg +1 -0
  904. package/src/app/components/icons/wYLDS.svg +10 -0
  905. package/src/app/components/icons/wsrUSD.svg +1 -0
  906. package/src/app/components/logos/OUSD.dark.svg +17 -0
  907. package/src/app/components/logos/OUSD.light.svg +17 -0
  908. package/src/app/coverage.server.ts +73 -0
  909. package/src/app/coverage.ts +69 -0
  910. package/src/app/crons/cleanup.ts +104 -0
  911. package/src/app/db/auth.ts +440 -0
  912. package/src/app/db/migrations/0000_better_auth.sql +53 -0
  913. package/src/app/db/migrations/0001_oauth_provider.sql +162 -0
  914. package/src/app/db/migrations/0002_device_code.sql +17 -0
  915. package/src/app/db/migrations/0003_realms.sql +27 -0
  916. package/src/app/db/migrations/0004_default_realm.sql +2 -0
  917. package/src/app/db/migrations/0005_passkeys.sql +30 -0
  918. package/src/app/db/migrations/0006_first_accounts.sql +9 -0
  919. package/src/app/db/migrations/0007_pending_keys.sql +13 -0
  920. package/src/app/db/migrations/0008_secp256k1_owners.sql +18 -0
  921. package/src/app/db/migrations/0009_device_requests.sql +8 -0
  922. package/src/app/db/migrations/0010_device_keys.sql +4 -0
  923. package/src/app/db/migrations/0011_registered_passkeys.sql +2 -0
  924. package/src/app/db/migrations/0012_passkey_accounts.sql +7 -0
  925. package/src/app/db/migrations/0013_first_party_apps.sql +4 -0
  926. package/src/app/db/migrations/0014_logout_revokes_tokens.sql +17 -0
  927. package/src/app/db/migrations/0015_expiry_indexes.sql +9 -0
  928. package/src/app/db/migrations/0016_configurable_accounts.sql +15 -0
  929. package/src/app/db/migrations/0017_account_config_keys.sql +3 -0
  930. package/src/app/db/migrations/0018_better_auth_1_8.sql +9 -0
  931. package/src/app/db/migrations/0019_drop_provider_account_index.sql +1 -0
  932. package/src/app/db/migrations/meta/0000_snapshot.json +362 -0
  933. package/src/app/db/migrations/meta/0001_snapshot.json +1487 -0
  934. package/src/app/db/migrations/meta/0002_snapshot.json +1603 -0
  935. package/src/app/db/migrations/meta/0003_snapshot.json +1760 -0
  936. package/src/app/db/migrations/meta/0004_snapshot.json +1760 -0
  937. package/src/app/db/migrations/meta/0005_snapshot.json +1911 -0
  938. package/src/app/db/migrations/meta/0006_snapshot.json +1967 -0
  939. package/src/app/db/migrations/meta/0007_snapshot.json +2047 -0
  940. package/src/app/db/migrations/meta/0008_snapshot.json +2157 -0
  941. package/src/app/db/migrations/meta/0009_snapshot.json +2207 -0
  942. package/src/app/db/migrations/meta/0010_snapshot.json +2231 -0
  943. package/src/app/db/migrations/meta/0011_snapshot.json +2231 -0
  944. package/src/app/db/migrations/meta/0012_snapshot.json +2231 -0
  945. package/src/app/db/migrations/meta/0013_snapshot.json +2231 -0
  946. package/src/app/db/migrations/meta/0014_snapshot.json +2231 -0
  947. package/src/app/db/migrations/meta/0015_snapshot.json +2375 -0
  948. package/src/app/db/migrations/meta/0016_snapshot.json +2475 -0
  949. package/src/app/db/migrations/meta/0017_snapshot.json +2481 -0
  950. package/src/app/db/migrations/meta/0018_snapshot.json +2535 -0
  951. package/src/app/db/migrations/meta/0019_snapshot.json +2514 -0
  952. package/src/app/db/migrations/meta/_journal.json +146 -0
  953. package/src/app/db/schema.ts +241 -0
  954. package/src/app/db/table.ts +31 -0
  955. package/src/app/env.ts +57 -0
  956. package/src/app/inbox.ts +190 -0
  957. package/src/app/lib/Client.ts +82 -0
  958. package/src/app/lib/Inbox.ts +11 -0
  959. package/src/app/lib/Loader.ts +21 -0
  960. package/src/app/lib/Upgrade.ts +221 -0
  961. package/src/app/package.json +8 -0
  962. package/src/app/public/_headers +4 -0
  963. package/src/app/routeTree.gen.ts +219 -0
  964. package/src/app/router.tsx +47 -0
  965. package/src/app/routes/[_].flows.tsx +4254 -0
  966. package/src/app/routes/__root.tsx +172 -0
  967. package/src/app/routes/authorize.tsx +379 -0
  968. package/src/app/routes/choose-account.tsx +144 -0
  969. package/src/app/routes/deposit.tsx +107 -0
  970. package/src/app/routes/device.tsx +273 -0
  971. package/src/app/routes/error.tsx +62 -0
  972. package/src/app/routes/index.tsx +511 -0
  973. package/src/app/routes/login.tsx +577 -0
  974. package/src/app/screens/Account.tsx +559 -0
  975. package/src/app/screens/Approval.tsx +444 -0
  976. package/src/app/screens/ChooseAccount.tsx +206 -0
  977. package/src/app/screens/Deposit.tsx +523 -0
  978. package/src/app/screens/DeviceApproval.tsx +500 -0
  979. package/src/app/screens/NotFound.tsx +62 -0
  980. package/src/app/screens/SignIn.tsx +372 -0
  981. package/src/app/screens/WalletUpgrade.tsx +121 -0
  982. package/src/app/screens/chains/base.svg +3 -0
  983. package/src/app/screens/chains/ethereum.svg +11 -0
  984. package/src/app/screens/chains/solana.svg +4 -0
  985. package/src/app/screens/chains/tempo.svg +4 -0
  986. package/src/app/server.ts +342 -0
  987. package/src/app/vite.config.ts +128 -0
  988. package/src/app/void.config.ts +36 -0
  989. package/src/app/wallet.ts +69 -0
  990. package/src/app/zyzz.config.ts +52 -0
  991. package/src/cli/Admin.ts +74 -0
  992. package/src/cli/Apps.ts +27 -0
  993. package/src/cli/Cli.ts +41 -0
  994. package/src/cli/Project.ts +119 -0
  995. package/src/cli/Realms.ts +49 -0
  996. package/src/cli/Session.ts +290 -0
  997. package/src/cli/User.ts +40 -0
  998. package/src/cli/V1.ts +54 -0
  999. package/src/cli/bin.ts +44 -0
  1000. package/src/cli/commands/admin/apps/create.ts +96 -0
  1001. package/src/cli/commands/admin/apps/delete.ts +38 -0
  1002. package/src/cli/commands/admin/apps/index.ts +15 -0
  1003. package/src/cli/commands/admin/apps/list.ts +25 -0
  1004. package/src/cli/commands/admin/apps/rotate-secret.ts +47 -0
  1005. package/src/cli/commands/admin/apps/update.ts +79 -0
  1006. package/src/cli/commands/admin/index.ts +14 -0
  1007. package/src/cli/commands/admin/migrate.ts +19 -0
  1008. package/src/cli/commands/admin/realms/add.ts +40 -0
  1009. package/src/cli/commands/admin/realms/index.ts +14 -0
  1010. package/src/cli/commands/admin/realms/list.ts +38 -0
  1011. package/src/cli/commands/admin/realms/passkeys/index.ts +15 -0
  1012. package/src/cli/commands/admin/realms/passkeys/set.ts +44 -0
  1013. package/src/cli/commands/admin/realms/privy/index.ts +14 -0
  1014. package/src/cli/commands/admin/realms/privy/set.ts +69 -0
  1015. package/src/cli/commands/admin/realms/remove.ts +33 -0
  1016. package/src/cli/commands/admin/realms/secp256k1/disable.ts +40 -0
  1017. package/src/cli/commands/admin/realms/secp256k1/enable.ts +40 -0
  1018. package/src/cli/commands/admin/realms/secp256k1/index.ts +19 -0
  1019. package/src/cli/commands/admin/realms/set.ts +46 -0
  1020. package/src/cli/commands/admin/rotate-key.ts +47 -0
  1021. package/src/cli/commands/init.ts +42 -0
  1022. package/src/cli/commands/login.ts +32 -0
  1023. package/src/cli/commands/logout.ts +19 -0
  1024. package/src/cli/commands/whoami.ts +23 -0
  1025. package/src/client/Actions.ts +180 -0
  1026. package/src/client/Auth.ts +267 -0
  1027. package/src/client/Authorization.ts +34 -0
  1028. package/src/client/Decorator.ts +444 -0
  1029. package/src/client/Key.ts +137 -0
  1030. package/src/client/Pending.ts +45 -0
  1031. package/src/client/Permissions.ts +41 -0
  1032. package/src/client/Storage.ts +29 -0
  1033. package/src/client/TempoAccount.ts +55 -0
  1034. package/src/client/Tokens.ts +27 -0
  1035. package/src/client/User.ts +23 -0
  1036. package/src/client/actions/account.ts +171 -0
  1037. package/src/client/actions/device.ts +166 -0
  1038. package/src/client/actions/email.ts +164 -0
  1039. package/src/client/actions/oauth.ts +179 -0
  1040. package/src/client/actions/passkey.ts +333 -0
  1041. package/src/client/actions/realm.ts +37 -0
  1042. package/src/client/actions/redirect.ts +502 -0
  1043. package/src/client/internal/accessKey.ts +54 -0
  1044. package/src/client/internal/account.ts +18 -0
  1045. package/src/client/internal/api.ts +242 -0
  1046. package/src/client/internal/headless.ts +308 -0
  1047. package/src/client/internal/indexedDb.ts +44 -0
  1048. package/src/client/internal/request.ts +70 -0
  1049. package/src/client/internal/store.ts +20 -0
  1050. package/src/client/internal/verifier.ts +75 -0
  1051. package/src/client.ts +17 -0
  1052. package/src/index.ts +5 -0
  1053. package/src/internal/Apps.ts +1283 -0
  1054. package/src/internal/Auth.ts +273 -0
  1055. package/src/internal/Authorize.ts +433 -0
  1056. package/src/internal/Balance.ts +144 -0
  1057. package/src/internal/BodyLimit.ts +31 -0
  1058. package/src/internal/Cache.ts +119 -0
  1059. package/src/internal/Chain.ts +99 -0
  1060. package/src/internal/ChainList.ts +270 -0
  1061. package/src/internal/ChainName.ts +14 -0
  1062. package/src/internal/ChainStatus.ts +65 -0
  1063. package/src/internal/CodeEmail.ts +138 -0
  1064. package/src/internal/ConfigurableAccount.ts +1315 -0
  1065. package/src/internal/Device.ts +471 -0
  1066. package/src/internal/Env.ts +92 -0
  1067. package/src/internal/ErrorResponse.ts +896 -0
  1068. package/src/internal/Faucet.ts +43 -0
  1069. package/src/internal/Id.ts +41 -0
  1070. package/src/internal/KeyAuthorization.ts +1536 -0
  1071. package/src/internal/Limits.ts +40 -0
  1072. package/src/internal/Log.ts +166 -0
  1073. package/src/internal/LogLine.ts +81 -0
  1074. package/src/internal/Logout.ts +356 -0
  1075. package/src/internal/Migrations.ts +120 -0
  1076. package/src/internal/OpenApi.ts +300 -0
  1077. package/src/internal/Owner.ts +310 -0
  1078. package/src/internal/Passkey.ts +1904 -0
  1079. package/src/internal/PendingKey.ts +104 -0
  1080. package/src/internal/Privy.ts +536 -0
  1081. package/src/internal/RateLimit.ts +346 -0
  1082. package/src/internal/Realm.ts +814 -0
  1083. package/src/internal/RequestId.ts +118 -0
  1084. package/src/internal/SignInGrant.ts +175 -0
  1085. package/src/internal/SigningKey.ts +319 -0
  1086. package/src/internal/TempoAccount.ts +545 -0
  1087. package/src/internal/TestInbox.ts +51 -0
  1088. package/src/internal/Timing.ts +172 -0
  1089. package/src/internal/Validation.ts +52 -0
  1090. package/src/internal/Verification.ts +58 -0
  1091. package/src/internal/Wallet.ts +101 -0
  1092. package/src/internal/owners/Passkey.ts +76 -0
  1093. package/src/internal/owners/Privy.ts +82 -0
  1094. package/src/internal/owners/Secp256k1.ts +139 -0
  1095. package/src/types/app.d.ts +39 -0
  1096. package/src/worker.ts +17 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-server-Dr0IlySo.js","names":["SUCCESS","ERROR","NOT_FOUND","REDIRECTED","waitFor","getRoute","normalize","normalizeError","materializeRedirect","contextualize","getLoaderContext","createLoaderTask","getNotFoundBoundary","projectLane","nullReplaceEqualDeep","last","replaceEqualDeep","hasKeys","DEFAULT_PROTOCOL_ALLOWLIST","decodePath","deepEqual","getUrlScheme","functionalUpdate","encodePathLikeUrl","createNull","hasOwn","protocolRelativePrefixRegex","rootRouteId","redirect","isRedirect","interpolatePath","trimPath","compileDecodeCharMap","cleanPath","resolvePath","trimPathRight","invariant","isNotFound","obj","createSieveCache","cache","hand","newest","entry","key","existing","value","max","node","SEGMENT_TYPE_INDEX","SEGMENT_TYPE_PATHLESS","getParamNames","cached","data","keys","segment","parseSegment","part","path","start","end","open","close","optional","nameStart","parseSegments","cursor","route","options","length","literalEnd","caseSensitive","defaultCaseSensitive","parseParams","interpolation","literalStart","parentInterpolation","tail","next","nextNode","name","staticChildren","existingNode","createSegmentNode","kind","prefix","suffix","actuallyCaseSensitive","siblings","s","dynamicListsToSort","segmentData","pathlessNode","isLeaf","indexNode","sortDynamic","a","b","parent","processRouteMasks","segmentTree","visit","segments","parentNode","child","routeList","nodes","findFlatMatch","processedTree","result","findMatch","findSingleMatch","from","tree","fuzzy","findRouteMatch","err","buildRouteBranch","processRouteTree","routesById","routesByPath","index","trimmedFullPath","routeTree","parts","leaf","getNodeMatch","rawParams","extractParams","list","buildBranch","names","partIndex","nodeIndex","pathIndex","paramIndex","currentPathIndex","n","splat","trailingSlash","pathIsIndex","partsLength","stack","bestFuzzy","bestMatch","frame","isFrameMoreSpecific","validateParseParams","isBeyondPath","lowerPart","indexFrame","indexValid","dynamics","optionals","skipped","isPerfectStaticMatch","statics","i","suffixPart","nextSkipped","casePart","segmentScore","match","sliceIndex","state","prev","getSafeSessionStorage","encode","val","stringify","toValue","str","decode","searchParams","previousValue","jsonStart","defaultParseSearch","parseSearchWith","defaultStringifySearch","stringifySearchWith","isJsonParser","parser","searchStr","query","stringifyValue","search","rewriteBasepath","trimmedBasepath","basepath","normalizedBasepath","checkBasepath","checkBasepathWithSlash","basepathRewrite","pathname","url","rewrite","executeRewriteInput","executeRewriteOutput","res","createNonReactiveMutableStore","initialValue","nextOrUpdater","createNonReactiveReadonlyStore","read","createRouterStores","config","byRoute","status","createMutableStore","location","initialLocation","resolvedLocation","ids","matches","createReadonlyStore","id","__store","getMatchStore","matchStore","routeId","store","setMatches","previousIds","nextIds","nextMatches","batch","arraysEqual","nextMatch","stateIndexKey","protocolRelativePrefix","normalizeProtocolRelative","normalizeHref","href","character","noop","ServerHistory","createServerHistory","parseHref","sanitizedHref","hashIndex","searchIndex","createRandomKey","isExternalUrl","origin","getUrlPath","routeNeedsLoad","defaultSerializeError","getLocationChangeInfo","lifecycleEnd","runRouteLifecycle","previousEnd","previous","nextEnd","owner","router","candidate","RouterCore","fn","prevOptions","newOptions","nextBasepath","nextRewriteOption","rewriteChanged","processRouteTreeResult","listener","routerEvent","parse","parsedSearch","hash","previousLocation","locationToParse","__tempLocation","__tempKey","parsedTempLocation","pathnameOrNext","locationSearchOrOpts","opts","\"__root__\"","build","dest","parsed","currentLocation","lightweight","current","currentMatch","to","nextTo","destRoute","isTemplate","destRoutes","matchedRoutes","foundRoute","nextParams","fromParams","resolveNextParams","needsInheritedParams","EMPTY_RECORD","nextPathname","middlewares","getSearchMiddlewares","fromSearch","validatedSearch","validateSearch","nextSearch","applySearchMiddleware","hashStr","nextState","fullPath","publicHref","external","rewrittenUrl","params","_from","maskParams","maskProps","rest","loadServerRoute","committedMatches","filter","preloads","invalidIds","consider","abort","controller","invalidate","d","flight","scheme","discarded","discardedIds","loadRouteChunk","preloadClientRoute","matchLocation","isPending","baseLocation","getStoreConfig","caches","notFoundRoute","initialMatchedRoutes","isGlobalNotFound","_notFoundRouteId","findGlobalNotFoundRouteId","committed","previousAt","strictParams","parentMatch","preMatchSearch","strictMatchSearch","searchError","parentSearch","parentStrictSearch","strictSearch","searchParamError","SearchParamError","loaderDeps","loaderDepsHash","cause","usedParams","interpolatedPath","matchId","previousMatch","existingMatch","paramsError","extractStrictParams","PathParamError","_notFound","lastRouteId","lastStateMatch","lastStateMatchId","lastRoute","accumulatedSearch","canReuseParams","input","spec","base","routeOptions","routeValidateSearch","includeValidateSearch","validated","meta","applyNext","currentSearch","collectMeta","nextMeta","newSearch","notFoundMode","fallback","routes","accumulatedParams","preloadComponent","type","loadComponents","component","pending","onPendingReady","afterLazy","componentType","promise","_id","lazyRoute","error","_getRenderedMatches","_getAssetMatches","SUCCESS$1","ERROR$1","NOT_FOUND$1","REDIRECTED$1","CANCELED_OUTCOME","isControl","waitFor$1","signal","reject","resolve","getRoute$1","normalize$1","rejected","normalizeError$1","outcome","onErrorCause","normalizeLaneError","materializeRedirect$1","lane","contextualize$1","preload","parentContext","common","routeContext","releaseFlight","validationError","beforeLoad","previousStatus","retainedEnd","setFetching","planSuccessfulLane","releaseOwnedFlight","transferMatchResources","deferSameIdFlight","acquireMatchResources","presented","getLoaderContext$1","loadResource","loader","parentMatchPromise","settleInto","cacheLoaderMatch","planned","getParentSnapshot","createLoaderTask$1","plannedCacheMatch","configured","reload","reloadFailure","semanticParent","staleAge","routeLoader","isLoaderFn","preloadable","donor","background","loaded","blocking","onReady","onLazyReady","acceptedFlight","chunkFailure","chunk","candidateIndex","tasks","backgroundOutcome","getNotFoundBoundary$1","indexed","loading","discardBackground","task","settleTasks","loaderFailure","taskIndex","gate","redirectTasks","nextTask","nextOutcome","serialFailure","redirectOptions","publicLocation","resolved","failed","reduceLane","failure","settlement","redirectLimitExceeded","plannedBoundary","boundaryOf","found","readinessEnd","boundary","install","projectLane$1","context","head","scripts","executeClientLane","matched","reduced","visible","reduction","foreground","redirects","active","observeLate","callback","waitForReason","onLate","onLateError","SUCCESS","ERROR","NOT_FOUND","REDIRECTED","SKIPPED","MATCH_SETTLED_ABORT_REASON","REDIRECT_ABORT_REASON","getRoute","normalize","normalizeError","materializeRedirect","notify","maybe","navigateFrom","waitFor","resolveSsr","parentSsr","inherit","defaultSsr","inheritedDefault","option","stampNotFound","contextualize","globalBoundary","ssr","routeContextOptions","abortController","beforeLoadContext","getLoaderContext","createLoaderTask","snapshot","getNotFoundBoundary","abortMatches","reason","applyFailure","loadNormalChunks","chunks","projectLane","headers","executeServerLane","matchedMatches","abortLane","plannedGlobalBoundary","loaderEnd","control","loadedOutcome","outcomeEnd","requiredFailure","terminal","settled","canonical","changeInfo"],"sources":["../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/not-found.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/sieve-cache.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/scroll-restoration.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/qss.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/searchParams.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/rewrite.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/stores.js","../../../../../node_modules/.pnpm/@tanstack+history@1.162.4/node_modules/@tanstack/history/dist/esm/index.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/router.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/load-client.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/await-signal.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/load-server.js"],"sourcesContent":["//#region src/not-found.ts\n/**\n* Create a not-found error object recognized by TanStack Router.\n*\n* Throw this from loaders/actions to trigger the nearest `notFoundComponent`.\n* Use `routeId` to target a specific route's not-found boundary. If `throw`\n* is true, the error is thrown instead of returned.\n*\n* @param options Optional settings including `routeId`, `headers`, and `throw`.\n* @returns A not-found error object that can be thrown or returned.\n* @link https://tanstack.com/router/latest/docs/router/framework/react/api/router/notFoundFunction\n*/\nfunction notFound(options = {}) {\n\toptions.isNotFound = true;\n\tif (options.throw) throw options;\n\treturn options;\n}\n/** Determine if a value is a TanStack Router not-found error. */\nfunction isNotFound(obj) {\n\treturn obj?.isNotFound === true;\n}\n//#endregion\nexport { isNotFound, notFound };\n\n//# sourceMappingURL=not-found.js.map","//#region src/sieve-cache.ts\n/**\n* A fixed-capacity cache using the SIEVE eviction algorithm\n* (https://cachemon.github.io/SIEVE-website/).\n*\n* Entries live in the Map's FIFO insertion order; a hit only flips a `visited`\n* bit instead of relinking the entry, which makes `get` (by far the hottest\n* operation here) one `Map.get` plus a boolean store. Eviction sweeps a `hand`\n* from the oldest entry towards the newest, clearing `visited` bits until it\n* finds an unvisited entry to drop, so entries touched since the last sweep\n* survive one more round. This keeps LRU-like hit ratios while being\n* scan-resistant.\n*/\nfunction createSieveCache(max) {\n\tconst cache = /* @__PURE__ */ new Map();\n\tlet hand;\n\tlet newest;\n\treturn {\n\t\tget(key) {\n\t\t\tconst entry = cache.get(key);\n\t\t\tif (!entry) return;\n\t\t\tentry.visited = true;\n\t\t\treturn entry.value;\n\t\t},\n\t\tset(key, value) {\n\t\t\tconst existing = cache.get(key);\n\t\t\tif (existing) {\n\t\t\t\texisting.value = value;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cache.size >= max) {\n\t\t\t\tlet node = hand?.next().value;\n\t\t\t\twhile (!node || node.visited) {\n\t\t\t\t\tif (node) node.visited = false;\n\t\t\t\t\telse hand = cache.values();\n\t\t\t\t\tnode = hand.next().value;\n\t\t\t\t}\n\t\t\t\tif (node === newest) hand = void 0;\n\t\t\t\tcache.delete(node.key);\n\t\t\t}\n\t\t\tconst entry = {\n\t\t\t\tkey,\n\t\t\t\tvalue,\n\t\t\t\tvisited: false\n\t\t\t};\n\t\t\tnewest = entry;\n\t\t\tcache.set(key, entry);\n\t\t},\n\t\tclear() {\n\t\t\tcache.clear();\n\t\t\thand = void 0;\n\t\t\tnewest = void 0;\n\t\t}\n\t};\n}\n//#endregion\nexport { createSieveCache };\n\n//# sourceMappingURL=sieve-cache.js.map","import { last } from \"./utils.js\";\nimport { invariant } from \"./invariant.js\";\nimport { trimPathRight } from \"./path.js\";\nimport { createSieveCache } from \"./sieve-cache.js\";\nconst SEGMENT_TYPE_INDEX = 4;\nconst SEGMENT_TYPE_PATHLESS = 5;\nfunction getParamNames(data) {\n\tconst cached = data.names;\n\tif (cached) return cached;\n\tconst keys = [];\n\tfor (const segment of data) if (typeof segment !== \"string\") keys.push(segment[1]);\n\treturn data.names = keys;\n}\n/** Parse one segment for matching and retain the same record for interpolation. */\nfunction parseSegment(path, start, end) {\n\tconst part = path.substring(start, end);\n\tif (part.charCodeAt(0) === 36) return part.length === 1 ? [\n\t\t2,\n\t\t\"_splat\",\n\t\t\"\",\n\t\tvoid 0\n\t] : [\n\t\t1,\n\t\tpart.substring(1),\n\t\t\"\",\n\t\t\"\"\n\t];\n\tconst open = part.indexOf(\"{\");\n\tif (open >= 0) {\n\t\tconst close = part.indexOf(\"}\", open);\n\t\tconst optional = part.charCodeAt(open + 1) === 45;\n\t\tconst nameStart = open + (optional ? 3 : 2);\n\t\tif (close >= 0 && part.charCodeAt(nameStart - 1) === 36 && (!optional || nameStart < close)) {\n\t\t\tconst key = part.substring(nameStart, close);\n\t\t\treturn [\n\t\t\t\toptional ? 3 : key ? 1 : 2,\n\t\t\t\tkey || \"_splat\",\n\t\t\t\tpart.substring(0, open),\n\t\t\t\tpath.substring(start + close + 1, key ? end : path.length)\n\t\t\t];\n\t\t}\n\t}\n\treturn part;\n}\nfunction parseSegments(defaultCaseSensitive, route, start, node, dynamicListsToSort, parentInterpolation) {\n\tlet cursor = start;\n\tconst path = route.fullPath ?? route.from;\n\tconst options = route.options;\n\tconst length = path.length;\n\tconst literalEnd = path.endsWith(\"/\") ? length - 1 : length;\n\tconst caseSensitive = options?.caseSensitive ?? defaultCaseSensitive;\n\tconst parseParams = options?.params?.parse ?? options?.parseParams;\n\tlet interpolation;\n\tlet literalStart = parentInterpolation ? start - 1 : 0;\n\tif (!node || path.includes(\"$\")) {\n\t\tinterpolation = parentInterpolation?.slice() ?? [];\n\t\tconst tail = last(interpolation);\n\t\tif (tail && typeof tail !== \"string\" && tail[0] === 2) {\n\t\t\tinterpolation[interpolation.length - 1] = [\n\t\t\t\ttail[0],\n\t\t\t\ttail[1],\n\t\t\t\ttail[2],\n\t\t\t\ttail[3] === void 0 ? void 0 : tail[3] + path.substring(start - (path[start - 2] === \"/\" ? 2 : 1), literalEnd)\n\t\t\t];\n\t\t\tliteralStart = length;\n\t\t}\n\t}\n\twhile (cursor < length) {\n\t\tconst start = cursor;\n\t\tconst next = path.indexOf(\"/\", start);\n\t\tlet end = next === -1 ? length : next;\n\t\tconst segment = parseSegment(path, start, end);\n\t\tcursor = end + 1;\n\t\tlet nextNode;\n\t\tif (typeof segment === \"string\") {\n\t\t\tif (!node) continue;\n\t\t\tlet name = segment;\n\t\t\tlet staticChildren;\n\t\t\tif (caseSensitive) staticChildren = node.static ??= /* @__PURE__ */ new Map();\n\t\t\telse {\n\t\t\t\tname = segment.toLowerCase();\n\t\t\t\tstaticChildren = node.staticInsensitive ??= /* @__PURE__ */ new Map();\n\t\t\t}\n\t\t\tconst existingNode = staticChildren.get(name);\n\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\telse {\n\t\t\t\tconst next = createSegmentNode(node);\n\t\t\t\tnextNode = next;\n\t\t\t\tstaticChildren.set(name, next);\n\t\t\t}\n\t\t} else {\n\t\t\tconst kind = segment[0];\n\t\t\tlet prefix = segment[2];\n\t\t\tlet suffix = segment[3] ?? \"\";\n\t\t\tif (kind === 2) {\n\t\t\t\tend = length;\n\t\t\t\tcursor = end + 1;\n\t\t\t}\n\t\t\tif (interpolation && literalStart < end) {\n\t\t\t\tif (literalStart < start - 1) interpolation.push(path.substring(literalStart, start - 1));\n\t\t\t\tsegment[2] = \"/\" + prefix;\n\t\t\t\tif (kind === 2 && segment[3] !== void 0 && literalEnd < length) segment[3] = suffix.slice(0, -1);\n\t\t\t\tinterpolation.push(segment);\n\t\t\t\tliteralStart = end;\n\t\t\t}\n\t\t\tif (!node) continue;\n\t\t\tconst actuallyCaseSensitive = caseSensitive && !!(prefix || suffix);\n\t\t\tif (!caseSensitive) {\n\t\t\t\tprefix = prefix.toLowerCase();\n\t\t\t\tsuffix = suffix.toLowerCase();\n\t\t\t}\n\t\t\tconst siblings = kind === 1 ? node.dynamic ??= [] : kind === 3 ? node.optional ??= [] : node.wildcard ??= [];\n\t\t\tconst existingNode = kind !== 2 && !parseParams && siblings.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);\n\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\telse {\n\t\t\t\tconst next = createSegmentNode(node, kind, actuallyCaseSensitive, prefix, suffix);\n\t\t\t\tnextNode = next;\n\t\t\t\tsiblings.push(next);\n\t\t\t\tif (siblings.length === 2) dynamicListsToSort?.push(siblings);\n\t\t\t}\n\t\t}\n\t\tnode = nextNode;\n\t}\n\tif (interpolation && literalStart < literalEnd) interpolation.push(path.substring(literalStart, literalEnd));\n\tconst segmentData = interpolation?.slice();\n\tif (!node) return segmentData;\n\tif (parseParams && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf(\"/\") + 1) === 95) {\n\t\tconst pathlessNode = createSegmentNode(node, SEGMENT_TYPE_PATHLESS);\n\t\t(node.pathless ??= []).push(pathlessNode);\n\t\tnode = pathlessNode;\n\t}\n\tconst isLeaf = (route.path || !route.children) && !route.isRoot;\n\tif (isLeaf && literalEnd < length) {\n\t\tconst indexNode = createSegmentNode(node, SEGMENT_TYPE_INDEX);\n\t\tnode.index = indexNode;\n\t\tnode = indexNode;\n\t}\n\tnode.parse = parseParams ?? null;\n\tnode.priority = options?.params?.priority ?? 0;\n\tif (!node.route) {\n\t\tnode.data = segmentData;\n\t\tif (isLeaf) node.route = route;\n\t}\n\treturn [\n\t\tnode,\n\t\tcursor,\n\t\tsegmentData\n\t];\n}\nfunction sortDynamic(a, b) {\n\tif (a.parse && !b.parse) return -1;\n\tif (!a.parse && b.parse) return 1;\n\tif (a.parse && b.parse && (a.priority || b.priority)) return b.priority - a.priority;\n\tif (a.prefix && b.prefix && a.prefix !== b.prefix) {\n\t\tif (a.prefix.startsWith(b.prefix)) return -1;\n\t\tif (b.prefix.startsWith(a.prefix)) return 1;\n\t}\n\tif (a.suffix && b.suffix && a.suffix !== b.suffix) {\n\t\tif (a.suffix.endsWith(b.suffix)) return -1;\n\t\tif (b.suffix.endsWith(a.suffix)) return 1;\n\t}\n\tif (a.prefix && !b.prefix) return -1;\n\tif (!a.prefix && b.prefix) return 1;\n\tif (a.suffix && !b.suffix) return -1;\n\tif (!a.suffix && b.suffix) return 1;\n\tif (a.caseSensitive && !b.caseSensitive) return -1;\n\tif (!a.caseSensitive && b.caseSensitive) return 1;\n\treturn 0;\n}\nfunction createSegmentNode(parent, kind = 0, caseSensitive, prefix, suffix) {\n\treturn {\n\t\tkind,\n\t\tdepth: parent ? parent.depth + 1 : 0,\n\t\tpathless: null,\n\t\tindex: null,\n\t\tstatic: null,\n\t\tstaticInsensitive: null,\n\t\tdynamic: null,\n\t\toptional: null,\n\t\twildcard: null,\n\t\troute: null,\n\t\tdata: void 0,\n\t\tparent,\n\t\tparse: null,\n\t\tpriority: 0,\n\t\tcaseSensitive,\n\t\tprefix,\n\t\tsuffix\n\t};\n}\nfunction processRouteMasks(routeList, processedTree) {\n\tconst segmentTree = createSegmentNode();\n\tconst dynamicListsToSort = [];\n\tfunction visit(route, start, parentNode, parentInterpolation) {\n\t\tconst [node, cursor, segments] = parseSegments(false, route, start, parentNode, dynamicListsToSort, parentInterpolation);\n\t\tif (route.children) for (const child of route.children) visit(child, cursor, node, segments);\n\t}\n\tfor (const route of routeList) visit(route, 1, segmentTree);\n\tfor (const nodes of dynamicListsToSort) nodes.sort(sortDynamic);\n\tprocessedTree.masksTree = segmentTree;\n\tprocessedTree.flatCache = createSieveCache(1e3);\n}\n/**\n* Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it.\n*/\nfunction findFlatMatch(path, processedTree) {\n\tpath ||= \"/\";\n\tconst cached = processedTree.flatCache.get(path);\n\tif (cached !== void 0) return cached;\n\tconst result = findMatch(path, processedTree.masksTree);\n\tprocessedTree.flatCache.set(path, result);\n\treturn result;\n}\n/**\n* @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree\n*/\nfunction findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) {\n\tfrom ||= \"/\";\n\tpath ||= \"/\";\n\tconst key = caseSensitive ? `case\\0${from}` : from;\n\tlet tree = processedTree.singleCache.get(key);\n\tif (!tree) {\n\t\ttree = createSegmentNode();\n\t\tparseSegments(caseSensitive, { from }, 1, tree);\n\t\tprocessedTree.singleCache.set(key, tree);\n\t}\n\treturn findMatch(path, tree, fuzzy);\n}\nfunction findRouteMatch(path, processedTree, fuzzy = false) {\n\tconst key = fuzzy ? path : `nofuzz\\0${path}`;\n\tconst cached = processedTree.matchCache.get(key);\n\tif (cached !== void 0) return cached;\n\tpath ||= \"/\";\n\tlet result;\n\ttry {\n\t\tresult = findMatch(path, processedTree.segmentTree, fuzzy);\n\t} catch (err) {\n\t\tif (err instanceof URIError) result = null;\n\t\telse throw err;\n\t}\n\tif (result) result.branch = buildRouteBranch(result.route);\n\tprocessedTree.matchCache.set(key, result);\n\treturn result;\n}\n/**\n* Processes a route tree into a segment trie for efficient path matching.\n* Also builds lookup maps for routes by ID and by trimmed full path.\n*/\nfunction processRouteTree(routeTree, caseSensitive = false) {\n\tconst segmentTree = createSegmentNode();\n\tconst dynamicListsToSort = [];\n\tconst routesById = {};\n\tconst routesByPath = {};\n\tlet index = 0;\n\tfunction visit(route, start, parentNode, parentInterpolation) {\n\t\troute.init(index);\n\t\tif (route.id in routesById) {\n\t\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Duplicate routes found with id: ${String(route.id)}`);\n\t\t\tinvariant();\n\t\t}\n\t\troutesById[route.id] = route;\n\t\tif (index !== 0 && route.path) {\n\t\t\tconst trimmedFullPath = trimPathRight(route.fullPath);\n\t\t\tif (!routesByPath[trimmedFullPath] || route.fullPath.endsWith(\"/\")) routesByPath[trimmedFullPath] = route;\n\t\t}\n\t\tindex++;\n\t\tconst [node, cursor, segments] = parseSegments(caseSensitive, route, start, parentNode, dynamicListsToSort, parentInterpolation);\n\t\troute._interpolation = segments;\n\t\tif (route.children) for (const child of route.children) visit(child, cursor, node, segments);\n\t}\n\tvisit(routeTree, 1, segmentTree);\n\tfor (const nodes of dynamicListsToSort) nodes.sort(sortDynamic);\n\treturn {\n\t\tprocessedTree: {\n\t\t\tsegmentTree,\n\t\t\tsingleCache: createSieveCache(1e3),\n\t\t\tmatchCache: createSieveCache(1e3),\n\t\t\tflatCache: null,\n\t\t\tmasksTree: null\n\t\t},\n\t\troutesById,\n\t\troutesByPath\n\t};\n}\nfunction findMatch(path, segmentTree, fuzzy = false) {\n\tconst parts = path.split(\"/\");\n\tconst leaf = getNodeMatch(path, parts, segmentTree, fuzzy);\n\tif (!leaf) return null;\n\tconst [rawParams] = extractParams(path, parts, leaf);\n\treturn {\n\t\troute: leaf.node.route,\n\t\trawParams\n\t};\n}\n/**\n* This function is \"resumable\":\n* - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call\n* - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off\n*\n* Inputs are *not* mutated.\n*/\nfunction extractParams(path, parts, leaf) {\n\tconst list = buildBranch(leaf.node);\n\tconst names = leaf.node.data && getParamNames(leaf.node.data);\n\tconst rawParams = Object.create(null);\n\t/** which segment of the path we're currently processing */\n\tlet partIndex = leaf.extract?.part ?? 0;\n\t/** which node of the route tree branch we're currently processing */\n\tlet nodeIndex = leaf.extract?.node ?? 0;\n\t/** index of the 1st character of the segment we're processing in the path string */\n\tlet pathIndex = leaf.extract?.path ?? 0;\n\t/** Next original parameter name, independent of pathless/static nodes. */\n\tlet paramIndex = leaf.extract?.param ?? 0;\n\tfor (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++) {\n\t\tconst node = list[nodeIndex];\n\t\tif (node.kind === SEGMENT_TYPE_INDEX) break;\n\t\tif (node.kind === SEGMENT_TYPE_PATHLESS) {\n\t\t\tpartIndex--;\n\t\t\tpathIndex--;\n\t\t\tcontinue;\n\t\t}\n\t\tconst part = parts[partIndex];\n\t\tconst currentPathIndex = pathIndex;\n\t\tif (part) pathIndex += part.length;\n\t\tif (node.kind === 1 || node.kind === 3) {\n\t\t\tconst name = names[paramIndex++];\n\t\t\tif (node.kind === 3 && leaf.skipped & 1 << nodeIndex) {\n\t\t\t\tpartIndex--;\n\t\t\t\tpathIndex = currentPathIndex - 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = node.suffix || node.prefix ? part.substring(node.prefix.length, part.length - node.suffix.length) : part;\n\t\t\tif (value || node.kind === 1) rawParams[name] = decodeURIComponent(value);\n\t\t} else if (node.kind === 2) {\n\t\t\tconst n = node;\n\t\t\tconst value = path.substring(currentPathIndex + n.prefix.length, path.length - n.suffix.length);\n\t\t\tconst splat = decodeURIComponent(value);\n\t\t\trawParams[\"*\"] = splat;\n\t\t\trawParams._splat = splat;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (leaf.rawParams) Object.assign(rawParams, leaf.rawParams);\n\treturn [rawParams, {\n\t\tpart: partIndex,\n\t\tnode: nodeIndex,\n\t\tpath: pathIndex,\n\t\tparam: paramIndex\n\t}];\n}\nfunction buildRouteBranch(route) {\n\tconst list = [route];\n\twhile (route.parentRoute) {\n\t\troute = route.parentRoute;\n\t\tlist.push(route);\n\t}\n\tlist.reverse();\n\treturn list;\n}\nfunction buildBranch(node) {\n\tconst list = Array(node.depth + 1);\n\tdo {\n\t\tlist[node.depth] = node;\n\t\tnode = node.parent;\n\t} while (node);\n\treturn list;\n}\nfunction getNodeMatch(path, parts, segmentTree, fuzzy) {\n\tif (path === \"/\" && segmentTree.index) return {\n\t\tnode: segmentTree.index,\n\t\tskipped: 0\n\t};\n\tconst trailingSlash = !last(parts);\n\tconst pathIsIndex = trailingSlash && path !== \"/\";\n\tconst partsLength = parts.length - (trailingSlash ? 1 : 0);\n\tconst stack = [{\n\t\tnode: segmentTree,\n\t\tindex: 1,\n\t\tskipped: 0,\n\t\tstatics: 0,\n\t\tdynamics: 0,\n\t\toptionals: 0\n\t}];\n\tlet bestFuzzy = null;\n\tlet bestMatch = null;\n\twhile (stack.length) {\n\t\tconst frame = stack.pop();\n\t\tconst { node, index, skipped, statics, dynamics, optionals } = frame;\n\t\tlet { extract, rawParams } = frame;\n\t\tif (node.kind === 2 && node.route && !isFrameMoreSpecific(bestMatch, frame)) continue;\n\t\tif (node.parse) {\n\t\t\tif (!validateParseParams(path, parts, frame)) continue;\n\t\t\trawParams = frame.rawParams;\n\t\t\textract = frame.extract;\n\t\t}\n\t\tif (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame;\n\t\tconst isBeyondPath = index === partsLength;\n\t\tif (isBeyondPath) {\n\t\t\tif (node.route && (!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX || node.kind === 2) && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame;\n\t\t\tif (!node.optional && !node.wildcard && !node.index && !node.pathless) continue;\n\t\t}\n\t\tconst part = isBeyondPath ? void 0 : parts[index];\n\t\tlet lowerPart;\n\t\tif (isBeyondPath && node.index) {\n\t\t\tconst indexFrame = {\n\t\t\t\tnode: node.index,\n\t\t\t\tindex,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t};\n\t\t\tlet indexValid = true;\n\t\t\tif (node.index.parse) {\n\t\t\t\tif (!validateParseParams(path, parts, indexFrame)) indexValid = false;\n\t\t\t}\n\t\t\tif (indexValid) {\n\t\t\t\tif (!dynamics && !optionals && !skipped && isPerfectStaticMatch(statics, partsLength)) return indexFrame;\n\t\t\t\tif (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame;\n\t\t\t}\n\t\t}\n\t\tif (node.wildcard) for (let i = node.wildcard.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.wildcard[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tif (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue;\n\t\t\t}\n\t\t\tif (suffix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tconst end = parts.slice(index).join(\"/\");\n\t\t\t\tconst suffixPart = end.slice(-suffix.length);\n\t\t\t\tif ((segment.caseSensitive ? suffixPart : suffixPart.toLowerCase()) !== suffix || end.length - suffix.length < prefix.length) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: partsLength,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.optional) {\n\t\t\tconst nextSkipped = skipped | 1 << node.depth + 1;\n\t\t\tfor (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex,\n\t\t\t\t\tskipped: nextSkipped,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals,\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tconst { prefix, suffix } = segment;\n\t\t\t\tif (prefix || suffix) {\n\t\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\t\tif (suffix && casePart.indexOf(suffix, casePart.length - suffix.length) < prefix.length) continue;\n\t\t\t\t}\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex: index + 1,\n\t\t\t\t\tskipped,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals: optionals + segmentScore(partsLength, index),\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.dynamic[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix || suffix) {\n\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\tif (suffix && casePart.indexOf(suffix, casePart.length - suffix.length) < prefix.length) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics: dynamics + segmentScore(partsLength, index),\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.staticInsensitive) {\n\t\t\tconst match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase());\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.static) {\n\t\t\tconst match = node.static.get(part);\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.pathless) for (let i = node.pathless.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.pathless[i];\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t}\n\tif (bestMatch) return bestMatch;\n\tif (fuzzy && bestFuzzy) {\n\t\tlet sliceIndex = bestFuzzy.index;\n\t\tfor (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length;\n\t\tconst splat = sliceIndex === path.length ? \"/\" : path.slice(sliceIndex);\n\t\tbestFuzzy.rawParams ??= Object.create(null);\n\t\tbestFuzzy.rawParams[\"**\"] = decodeURIComponent(splat);\n\t\treturn bestFuzzy;\n\t}\n\treturn null;\n}\nfunction segmentScore(partsLength, index) {\n\treturn 2 ** (partsLength - index - 1);\n}\nfunction isPerfectStaticMatch(statics, partsLength) {\n\treturn statics === 2 ** (partsLength - 1) - 1;\n}\nfunction validateParseParams(path, parts, frame) {\n\tlet rawParams;\n\tlet state;\n\ttry {\n\t\t[rawParams, state] = extractParams(path, parts, frame);\n\t} catch {\n\t\treturn null;\n\t}\n\tframe.rawParams = rawParams;\n\tframe.extract = state;\n\tif (!frame.node.parse) return true;\n\ttry {\n\t\tif (frame.node.parse(rawParams) === false) return null;\n\t} catch {}\n\treturn true;\n}\nfunction isFrameMoreSpecific(prev, next) {\n\tif (!prev) return true;\n\treturn next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.node.depth > prev.node.depth)));\n}\n//#endregion\nexport { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, parseSegments, processRouteMasks, processRouteTree };\n\n//# sourceMappingURL=new-process-route-tree.js.map","import { isServer } from \"@tanstack/router-core/isServer\";\n//#region src/scroll-restoration.ts\nfunction getSafeSessionStorage() {\n\ttry {\n\t\treturn sessionStorage;\n\t} catch {\n\t\treturn;\n\t}\n}\nconst storageKey = \"tsr-scroll-restoration-v1_3\";\nconst safeSessionStorage = getSafeSessionStorage();\nfunction createScrollRestorationCache() {\n\ttry {\n\t\treturn JSON.parse(safeSessionStorage?.getItem(\"tsr-scroll-restoration-v1_3\") || \"{}\");\n\t} catch {\n\t\treturn {};\n\t}\n}\nconst scrollRestorationCache = /* @__PURE__ */ createScrollRestorationCache();\nconst scrollRestorationIdAttribute = \"data-scroll-restoration-id\";\n/**\n* The default `getKey` function for `useScrollRestoration`.\n* It returns the `key` from the location state or the `href` of the location.\n*\n* The `location.href` is used as a fallback to support the use case where the location state is not available like the initial render.\n*/\nconst defaultGetScrollRestorationKey = (location) => {\n\treturn location.state.__TSR_key || location.href;\n};\nfunction getScrollRestorationSelector(element) {\n\tconst attrId = element.getAttribute(scrollRestorationIdAttribute);\n\tif (attrId) return `[${scrollRestorationIdAttribute}=\"${attrId}\"]`;\n\tlet selector = \"\";\n\tlet el = element;\n\tlet parent;\n\twhile (parent = el.parentNode) {\n\t\tlet index = 1;\n\t\tlet sibling = el;\n\t\twhile (sibling = sibling.previousElementSibling) index++;\n\t\tconst part = `${el.localName}:nth-child(${index})`;\n\t\tselector = selector ? `${part} > ${selector}` : part;\n\t\tel = parent;\n\t}\n\treturn selector;\n}\nfunction getElementScrollRestorationEntry(router, options) {\n\tconst entries = scrollRestorationCache[(options.getKey || defaultGetScrollRestorationKey)(router.latestLocation)];\n\tif (!entries) return;\n\tif (options.id) return entries[`[${scrollRestorationIdAttribute}=\"${options.id}\"]`];\n\tconst element = options.getElement?.();\n\tif (!element) return;\n\treturn entries[element === window ? windowScrollTarget : getScrollRestorationSelector(element)];\n}\nlet ignoreScroll = false;\nconst windowScrollTarget = \"window\";\nfunction getElement(selector) {\n\ttry {\n\t\treturn typeof selector === \"function\" ? selector() : document.querySelector(selector);\n\t} catch {}\n}\nfunction getScrollToTopElements(scrollToTopSelectors) {\n\tconst elements = /* @__PURE__ */ new Set();\n\tfor (const selector of scrollToTopSelectors) {\n\t\tif (selector === windowScrollTarget) continue;\n\t\tconst element = getElement(selector);\n\t\tif (element) elements.add(element);\n\t}\n\treturn elements;\n}\nfunction setupScrollRestoration(router, force) {\n\tconst shouldSetupScrollRestoration = force ?? router.options.scrollRestoration;\n\tconst scroll = router._scroll;\n\tif (shouldSetupScrollRestoration) scroll.e = true;\n\tif (isServer ?? router.isServer) return;\n\tconst getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey;\n\tconst trackedScrollTargets = /* @__PURE__ */ new Set();\n\tconst snapshotCurrentScrollTargets = (restoreKey) => {\n\t\tconst keyEntry = scrollRestorationCache[restoreKey] ||= {};\n\t\tfor (const target of trackedScrollTargets) if (target === document) keyEntry[windowScrollTarget] = {\n\t\t\tscrollX,\n\t\t\tscrollY\n\t\t};\n\t\telse if (target.isConnected) keyEntry[getScrollRestorationSelector(target)] = {\n\t\t\tscrollX: target.scrollLeft,\n\t\t\tscrollY: target.scrollTop\n\t\t};\n\t};\n\tif (shouldSetupScrollRestoration && !scroll.s) {\n\t\tscroll.s = true;\n\t\tignoreScroll = false;\n\t\thistory.scrollRestoration = \"manual\";\n\t\tdocument.addEventListener(\"scroll\", (event) => {\n\t\t\tif (ignoreScroll) return;\n\t\t\ttrackedScrollTargets.add(event.target);\n\t\t}, true);\n\t\trouter.subscribe(\"onBeforeLoad\", (event) => {\n\t\t\tif (event.fromLocation) snapshotCurrentScrollTargets(getKey(event.fromLocation));\n\t\t\ttrackedScrollTargets.clear();\n\t\t});\n\t\taddEventListener(\"pagehide\", () => {\n\t\t\thistory.scrollRestoration = \"auto\";\n\t\t\tsnapshotCurrentScrollTargets(getKey(router.stores.resolvedLocation.get() ?? router.stores.location.get()));\n\t\t\ttry {\n\t\t\t\tsafeSessionStorage?.setItem(storageKey, JSON.stringify(scrollRestorationCache));\n\t\t\t} catch {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(\"[ts-router] Could not persist scroll restoration state to sessionStorage.\");\n\t\t\t}\n\t\t});\n\t\taddEventListener(\"pageshow\", (event) => {\n\t\t\tif (event.persisted) history.scrollRestoration = \"manual\";\n\t\t});\n\t}\n\tif (scroll.r) return;\n\tscroll.r = true;\n\trouter.subscribe(\"onRendered\", (event) => {\n\t\tconst behavior = router.options.scrollRestorationBehavior;\n\t\tconst scrollToTopSelectors = router.options.scrollToTopSelectors;\n\t\tconst shouldResetScroll = scroll.n;\n\t\tconst hashNavigation = scroll.h;\n\t\tlet scrollToTopElements;\n\t\ttrackedScrollTargets.clear();\n\t\tscroll.n = true;\n\t\tscroll.h = false;\n\t\tif (typeof router.options.scrollRestoration === \"function\" && !router.options.scrollRestoration({ location: router.latestLocation })) return;\n\t\tconst cacheKey = getKey(event.toLocation);\n\t\tconst fromCacheKey = event.fromLocation && getKey(event.fromLocation);\n\t\tif (scroll.e && fromCacheKey && fromCacheKey !== cacheKey) {\n\t\t\tconst fromElementEntries = scrollRestorationCache[fromCacheKey];\n\t\t\tif (fromElementEntries) {\n\t\t\t\tlet toElementEntries = scrollRestorationCache[cacheKey];\n\t\t\t\tfor (const elementSelector in fromElementEntries) {\n\t\t\t\t\tif (elementSelector === windowScrollTarget) {\n\t\t\t\t\t\tif (shouldResetScroll) continue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst element = getElement(elementSelector);\n\t\t\t\t\t\tif (!element) continue;\n\t\t\t\t\t\tif (shouldResetScroll && scrollToTopSelectors) {\n\t\t\t\t\t\t\tscrollToTopElements ??= getScrollToTopElements(scrollToTopSelectors);\n\t\t\t\t\t\t\tif (scrollToTopElements.has(element)) continue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!toElementEntries) toElementEntries = scrollRestorationCache[cacheKey] = {};\n\t\t\t\t\ttoElementEntries[elementSelector] ??= fromElementEntries[elementSelector];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tignoreScroll = true;\n\t\ttry {\n\t\t\tconst hash = event.toLocation.hash;\n\t\t\tconst hashScrollIntoViewOptions = event.toLocation.state.__hashScrollIntoViewOptions ?? true;\n\t\t\tlet windowRestored = false;\n\t\t\tif (shouldResetScroll) {\n\t\t\t\tif (!hash && scrollToTopSelectors) scrollToTopElements ??= getScrollToTopElements(scrollToTopSelectors);\n\t\t\t\tconst skipWindowRestore = hash && hashScrollIntoViewOptions && hashNavigation;\n\t\t\t\tconst elementEntries = scroll.e ? scrollRestorationCache[cacheKey] : void 0;\n\t\t\t\tif (elementEntries) for (const elementSelector in elementEntries) {\n\t\t\t\t\tconst { scrollX, scrollY } = elementEntries[elementSelector];\n\t\t\t\t\tif (elementSelector === windowScrollTarget) {\n\t\t\t\t\t\tif (skipWindowRestore) continue;\n\t\t\t\t\t\tscrollTo({\n\t\t\t\t\t\t\ttop: scrollY,\n\t\t\t\t\t\t\tleft: scrollX,\n\t\t\t\t\t\t\tbehavior\n\t\t\t\t\t\t});\n\t\t\t\t\t\twindowRestored = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst element = getElement(elementSelector);\n\t\t\t\t\t\tif (element) {\n\t\t\t\t\t\t\telement.scrollLeft = scrollX;\n\t\t\t\t\t\t\telement.scrollTop = scrollY;\n\t\t\t\t\t\t\tscrollToTopElements?.delete(element);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!hash) {\n\t\t\t\t\tconst scrollOptions = {\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\tbehavior\n\t\t\t\t\t};\n\t\t\t\t\tif (!windowRestored) scrollTo(scrollOptions);\n\t\t\t\t\tif (scrollToTopElements) for (const element of scrollToTopElements) element.scrollTo(scrollOptions);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!windowRestored && hash && hashScrollIntoViewOptions) document.getElementById(hash)?.scrollIntoView(hashScrollIntoViewOptions);\n\t\t} finally {\n\t\t\tignoreScroll = false;\n\t\t}\n\t});\n}\n//#endregion\nexport { defaultGetScrollRestorationKey, getElementScrollRestorationEntry, setupScrollRestoration, storageKey };\n\n//# sourceMappingURL=scroll-restoration.js.map","//#region src/qss.ts\n/**\n* Program is a reimplementation of the `qss` package:\n* Copyright (c) Luke Edwards luke.edwards05@gmail.com, MIT License\n* https://github.com/lukeed/qss/blob/master/license.md\n*\n* This reimplementation uses modern browser APIs\n* (namely URLSearchParams) and TypeScript while still\n* maintaining the original functionality and interface.\n*\n* Update: this implementation has also been mangled to\n* fit exactly our use-case (single value per key in encoding).\n*/\n/**\n* Encodes an object into a query string.\n* @param obj - The object to encode into a query string.\n* @param stringify - An optional custom stringify function.\n* @returns The encoded query string.\n* @example\n* ```\n* // Example input: encode({ token: 'foo', key: 'value' })\n* // Expected output: \"token=foo&key=value\"\n* ```\n*/\nfunction encode(obj, stringify = String) {\n\tlet result;\n\tfor (const key in obj) {\n\t\tconst val = obj[key];\n\t\tif (val !== void 0) (result ||= new URLSearchParams()).set(key, stringify(val));\n\t}\n\treturn result ? result.toString() : \"\";\n}\n/**\n* Converts a string value to its appropriate type (string, number, boolean).\n* @param mix - The string value to convert.\n* @returns The converted value.\n* @example\n* // Example input: toValue(\"123\")\n* // Expected output: 123\n*/\nfunction toValue(str) {\n\tif (!str) return \"\";\n\tif (str === \"false\") return false;\n\tif (str === \"true\") return true;\n\treturn +str * 0 === 0 && +str + \"\" === str ? +str : str;\n}\n/**\n* Decodes a query string into an object.\n* @param str - The query string to decode.\n* @returns The decoded key-value pairs in an object format.\n* @example\n* // Example input: decode(\"token=foo&key=value\")\n* // Expected output: { \"token\": \"foo\", \"key\": \"value\" }\n*/\nfunction decode(str) {\n\tconst searchParams = new URLSearchParams(str);\n\tconst result = Object.create(null);\n\tfor (const [key, value] of searchParams.entries()) {\n\t\tconst previousValue = result[key];\n\t\tif (previousValue == null) result[key] = toValue(value);\n\t\telse if (Array.isArray(previousValue)) previousValue.push(toValue(value));\n\t\telse result[key] = [previousValue, toValue(value)];\n\t}\n\treturn result;\n}\n//#endregion\nexport { decode, encode };\n\n//# sourceMappingURL=qss.js.map","import { decode, encode } from \"./qss.js\";\n//#region src/searchParams.ts\nconst jsonStart = /^(?:\\s|[\"[{\\d-]|fa|nu|tr)/;\n/** Default `parseSearch` that strips leading '?' and JSON-parses values. */\nconst defaultParseSearch = parseSearchWith(JSON.parse);\n/** Default `stringifySearch` using JSON.stringify for complex values. */\nconst defaultStringifySearch = stringifySearchWith(JSON.stringify, JSON.parse);\n/**\n* Build a `parseSearch` function using a provided JSON-like parser.\n*\n* The returned function strips a leading `?`, decodes values, and attempts to\n* JSON-parse string values using the given `parser`.\n*\n* @param parser Function to parse a string value (e.g. `JSON.parse`).\n* @returns A `parseSearch` function compatible with `Router` options.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n*/\nfunction parseSearchWith(parser) {\n\tconst isJsonParser = parser === JSON.parse;\n\treturn (searchStr) => {\n\t\tif (searchStr[0] === \"?\") searchStr = searchStr.substring(1);\n\t\tconst query = decode(searchStr);\n\t\tfor (const key in query) {\n\t\t\tconst value = query[key];\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tif (isJsonParser && !jsonStart.test(value)) continue;\n\t\t\t\ttry {\n\t\t\t\t\tquery[key] = parser(value);\n\t\t\t\t} catch (_err) {}\n\t\t\t}\n\t\t}\n\t\treturn query;\n\t};\n}\n/**\n* Build a `stringifySearch` function using a provided serializer.\n*\n* Non-primitive values are serialized with `stringify`. If a `parser` is\n* supplied, string values that are parseable are re-serialized to ensure\n* symmetry with `parseSearch`.\n*\n* @param stringify Function to serialize a value (e.g. `JSON.stringify`).\n* @param parser Optional parser to detect parseable strings.\n* @returns A `stringifySearch` function compatible with `Router` options.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n*/\nfunction stringifySearchWith(stringify, parser) {\n\tconst isJsonParser = parser === JSON.parse;\n\tfunction stringifyValue(val) {\n\t\tif (val && typeof val === \"object\") try {\n\t\t\treturn stringify(val);\n\t\t} catch (_err) {}\n\t\telse if (parser && typeof val === \"string\") {\n\t\t\tif (isJsonParser && !jsonStart.test(val)) return val;\n\t\t\ttry {\n\t\t\t\tparser(val);\n\t\t\t\treturn stringify(val);\n\t\t\t} catch (_err) {}\n\t\t}\n\t\treturn val;\n\t}\n\treturn (search) => {\n\t\tconst searchStr = encode(search, stringifyValue);\n\t\treturn searchStr ? `?${searchStr}` : \"\";\n\t};\n}\n//#endregion\nexport { defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith };\n\n//# sourceMappingURL=searchParams.js.map","import { cleanPath, trimPath } from \"./path.js\";\n//#region src/rewrite.ts\n/** Compose multiple rewrite pairs into a single in/out rewrite. */\nfunction composeRewrites(rewrites) {\n\treturn {\n\t\tinput: ({ url }) => {\n\t\t\tfor (const rewrite of rewrites) url = executeRewriteInput(rewrite, url);\n\t\t\treturn url;\n\t\t},\n\t\toutput: ({ url }) => {\n\t\t\tfor (let i = rewrites.length - 1; i >= 0; i--) url = executeRewriteOutput(rewrites[i], url);\n\t\t\treturn url;\n\t\t}\n\t};\n}\n/** Create a rewrite pair that strips/adds a basepath on input/output. */\nfunction rewriteBasepath(basepath, caseSensitive, rewrite) {\n\tconst trimmedBasepath = trimPath(basepath);\n\tconst normalizedBasepath = `/${trimmedBasepath}`;\n\tconst checkBasepath = caseSensitive ? normalizedBasepath : normalizedBasepath.toLowerCase();\n\tconst checkBasepathWithSlash = `${checkBasepath}/`;\n\tconst basepathRewrite = {\n\t\tinput: ({ url }) => {\n\t\t\tconst pathname = caseSensitive ? url.pathname : url.pathname.toLowerCase();\n\t\t\tif (pathname === checkBasepath) url.pathname = \"/\";\n\t\t\telse if (pathname.startsWith(checkBasepathWithSlash)) url.pathname = url.pathname.slice(normalizedBasepath.length);\n\t\t\treturn url;\n\t\t},\n\t\toutput: ({ url }) => {\n\t\t\turl.pathname = cleanPath(`/${trimmedBasepath}${url.pathname}`);\n\t\t\treturn url;\n\t\t}\n\t};\n\treturn rewrite ? {\n\t\tinput: ({ url }) => executeRewriteInput(rewrite, basepathRewrite.input({ url })),\n\t\toutput: ({ url }) => basepathRewrite.output({ url: executeRewriteOutput(rewrite, url) })\n\t} : basepathRewrite;\n}\n/** Execute a location input rewrite if provided. */\nfunction executeRewriteInput(rewrite, url) {\n\tconst res = rewrite?.input?.({ url });\n\tif (res) {\n\t\tif (typeof res === \"string\") return new URL(res);\n\t\telse if (res instanceof URL) return res;\n\t}\n\treturn url;\n}\n/** Execute a location output rewrite if provided. */\nfunction executeRewriteOutput(rewrite, url) {\n\tconst res = rewrite?.output?.({ url });\n\tif (res) {\n\t\tif (typeof res === \"string\") return new URL(res);\n\t\telse if (res instanceof URL) return res;\n\t}\n\treturn url;\n}\n//#endregion\nexport { composeRewrites, executeRewriteInput, executeRewriteOutput, rewriteBasepath };\n\n//# sourceMappingURL=rewrite.js.map","import { arraysEqual, functionalUpdate } from \"./utils.js\";\n//#region src/stores.ts\n/** SSR non-reactive createMutableStore */\nfunction createNonReactiveMutableStore(initialValue) {\n\tlet value = initialValue;\n\treturn {\n\t\tget() {\n\t\t\treturn value;\n\t\t},\n\t\tset(nextOrUpdater) {\n\t\t\tvalue = functionalUpdate(nextOrUpdater, value);\n\t\t}\n\t};\n}\n/** SSR non-reactive createReadonlyStore */\nfunction createNonReactiveReadonlyStore(read) {\n\treturn { get() {\n\t\treturn read();\n\t} };\n}\nfunction createRouterStores(initialLocation, config) {\n\tconst { createMutableStore, createReadonlyStore, batch } = config;\n\tconst byRoute = /* @__PURE__ */ new Map();\n\tconst status = createMutableStore(\"idle\");\n\tconst location = createMutableStore(initialLocation);\n\tconst resolvedLocation = createMutableStore(void 0);\n\tconst ids = createMutableStore([]);\n\tconst matches = createReadonlyStore(() => ids.get().map((id) => byRoute.get(id).get()));\n\tconst __store = createReadonlyStore(() => ({\n\t\tstatus: status.get(),\n\t\tisLoading: status.get() === \"pending\",\n\t\tmatches: matches.get(),\n\t\tlocation: location.get(),\n\t\tresolvedLocation: resolvedLocation.get()\n\t}));\n\tfunction getMatchStore(routeId) {\n\t\tlet matchStore = byRoute.get(routeId);\n\t\tif (!matchStore) {\n\t\t\tmatchStore = createMutableStore(void 0);\n\t\t\tbyRoute.set(routeId, matchStore);\n\t\t}\n\t\treturn matchStore;\n\t}\n\tconst store = {\n\t\tstatus,\n\t\tlocation,\n\t\tresolvedLocation,\n\t\tids,\n\t\tmatches,\n\t\tbyRoute,\n\t\t__store,\n\t\tgetMatchStore,\n\t\tsetMatches\n\t};\n\tfunction setMatches(nextMatches) {\n\t\tconst previousIds = ids.get();\n\t\tconst nextIds = nextMatches.map((match) => match.routeId);\n\t\tbatch(() => {\n\t\t\tif (!arraysEqual(previousIds, nextIds)) ids.set(nextIds);\n\t\t\tfor (const id of previousIds) if (!nextIds.includes(id)) byRoute.get(id).set(() => void 0);\n\t\t\tfor (const nextMatch of nextMatches) {\n\t\t\t\tconst matchStore = getMatchStore(nextMatch.routeId);\n\t\t\t\tif (matchStore.get() !== nextMatch) matchStore.set(nextMatch);\n\t\t\t}\n\t\t});\n\t}\n\treturn store;\n}\n//#endregion\nexport { createNonReactiveMutableStore, createNonReactiveReadonlyStore, createRouterStores };\n\n//# sourceMappingURL=stores.js.map","//#region src/index.ts\nvar stateIndexKey = \"__TSR_index\";\nvar popStateEvent = \"popstate\";\nvar beforeUnloadEvent = \"beforeunload\";\n/**\n* Turn protocol-relative inputs such as \"//evil.example\" into paths\n* such as \"/evil.example\", keeping navigation on the current origin.\n*\n* For HTTP(S) URLs, WHATWG parsing ignores leading C0 controls and spaces,\n* removes tabs/newlines, and treats backslashes as slashes, so inputs like\n* \"/\\evil.example\" also need normalization. This only allocates when those\n* rules would make the input protocol-relative.\n*/\nvar protocolRelativePrefix = /^[\\x00-\\x20]*(?:[\\\\/][\\t\\n\\r]*){2,}/;\nfunction normalizeProtocolRelative(url) {\n\tconst match = protocolRelativePrefix.exec(url);\n\treturn match ? \"/\" + url.slice(match[0].length) : url;\n}\nfunction normalizeHref(href) {\n\tif (/[\\x00-\\x1f\\x7f]/.test(href)) href = href.replace(/[\\x00-\\x1f\\x7f]/g, (character) => \"\t\\n\\r\".includes(character) ? \"\" : encodeURIComponent(character));\n\treturn normalizeProtocolRelative(href);\n}\nfunction createHistory(opts) {\n\tlet location = opts.getLocation();\n\tconst subscribers = /* @__PURE__ */ new Set();\n\tconst notify = (action) => {\n\t\tlocation = opts.getLocation();\n\t\tsubscribers.forEach((subscriber) => subscriber({\n\t\t\tlocation,\n\t\t\taction\n\t\t}));\n\t};\n\tconst handleIndexChange = (action) => {\n\t\tif (opts.notifyOnIndexChange ?? true) notify(action);\n\t\telse location = opts.getLocation();\n\t};\n\tconst tryNavigation = async ({ task, navigateOpts, ...actionInfo }) => {\n\t\tif (navigateOpts?.ignoreBlocker ?? false) {\n\t\t\ttask();\n\t\t\treturn;\n\t\t}\n\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\tconst isPushOrReplace = actionInfo.type === \"PUSH\" || actionInfo.type === \"REPLACE\";\n\t\tif (typeof document !== \"undefined\" && blockers.length && isPushOrReplace) for (const blocker of blockers) {\n\t\t\tconst nextLocation = parseHref(actionInfo.path, actionInfo.state);\n\t\t\tif (await blocker.blockerFn({\n\t\t\t\tcurrentLocation: location,\n\t\t\t\tnextLocation,\n\t\t\t\taction: actionInfo.type\n\t\t\t})) {\n\t\t\t\topts.onBlocked?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\ttask();\n\t};\n\treturn {\n\t\tget location() {\n\t\t\treturn location;\n\t\t},\n\t\tget length() {\n\t\t\treturn opts.getLength();\n\t\t},\n\t\tsubscribers,\n\t\tsubscribe: (cb) => {\n\t\t\tsubscribers.add(cb);\n\t\t\treturn () => {\n\t\t\t\tsubscribers.delete(cb);\n\t\t\t};\n\t\t},\n\t\tpush: (path, state, navigateOpts) => {\n\t\t\tconst currentIndex = location.state[stateIndexKey];\n\t\t\tstate = assignKeyAndIndex(currentIndex + 1, state);\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.pushState(path, state);\n\t\t\t\t\tnotify({ type: \"PUSH\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"PUSH\",\n\t\t\t\tpath,\n\t\t\t\tstate\n\t\t\t});\n\t\t},\n\t\treplace: (path, state, navigateOpts) => {\n\t\t\tconst currentIndex = location.state[stateIndexKey];\n\t\t\tstate = assignKeyAndIndex(currentIndex, state);\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.replaceState(path, state);\n\t\t\t\t\tnotify({ type: \"REPLACE\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"REPLACE\",\n\t\t\t\tpath,\n\t\t\t\tstate\n\t\t\t});\n\t\t},\n\t\tgo: (index, navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.go(index, navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({\n\t\t\t\t\t\ttype: \"GO\",\n\t\t\t\t\t\tindex\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"GO\"\n\t\t\t});\n\t\t},\n\t\tback: (navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.back(navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({ type: \"BACK\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"BACK\"\n\t\t\t});\n\t\t},\n\t\tforward: (navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.forward(navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({ type: \"FORWARD\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"FORWARD\"\n\t\t\t});\n\t\t},\n\t\tcanGoBack: () => location.state[stateIndexKey] !== 0,\n\t\tcreateHref: (str) => opts.createHref(str),\n\t\tblock: (blocker) => {\n\t\t\tif (!opts.setBlockers) return () => {};\n\t\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\t\topts.setBlockers([...blockers, blocker]);\n\t\t\treturn () => {\n\t\t\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\t\t\topts.setBlockers?.(blockers.filter((b) => b !== blocker));\n\t\t\t};\n\t\t},\n\t\tflush: () => opts.flush?.(),\n\t\tdestroy: () => opts.destroy?.(),\n\t\tnotify,\n\t\t_getBlockers: () => opts.getBlockers?.() ?? []\n\t};\n}\nfunction assignKeyAndIndex(index, state) {\n\tconst key = createRandomKey();\n\treturn {\n\t\t...state,\n\t\tkey,\n\t\t__TSR_key: key,\n\t\t[stateIndexKey]: index\n\t};\n}\n/**\n* Creates a history object that can be used to interact with the browser's\n* navigation. This is a lightweight API wrapping the browser's native methods.\n* It is designed to work with TanStack Router, but could be used as a standalone API as well.\n* IMPORTANT: This API implements history throttling via a microtask to prevent\n* excessive calls to the history API. In some browsers, calling history.pushState or\n* history.replaceState in quick succession can cause the browser to ignore subsequent\n* calls. This API smooths out those differences and ensures that your application\n* state will *eventually* match the browser state. In most cases, this is not a problem,\n* but if you need to ensure that the browser state is up to date, you can use the\n* `history.flush` method to immediately flush all pending state changes to the browser URL.\n* @param opts\n* @param opts.getHref A function that returns the current href (path + search + hash)\n* @param opts.createHref A function that takes a path and returns a href (path + search + hash)\n* @returns A history instance\n*/\nfunction createBrowserHistory(opts) {\n\tconst win = opts?.window ?? (typeof document !== \"undefined\" ? window : void 0);\n\tconst originalPushState = win.history.pushState;\n\tconst originalReplaceState = win.history.replaceState;\n\tlet blockers = [];\n\tconst _getBlockers = () => blockers;\n\tconst _setBlockers = (newBlockers) => blockers = newBlockers;\n\tconst createHref = (path) => normalizeHref(opts?.createHref ? opts.createHref(path) : path);\n\tconst parseLocation = opts?.parseLocation ?? (() => parseHref(`${win.location.pathname}${win.location.search}${win.location.hash}`, win.history.state));\n\tif (!win.history.state?.__TSR_key && !win.history.state?.key) {\n\t\tconst addedKey = createRandomKey();\n\t\twin.history.replaceState({\n\t\t\t[stateIndexKey]: 0,\n\t\t\tkey: addedKey,\n\t\t\t__TSR_key: addedKey\n\t\t}, \"\");\n\t}\n\tlet currentLocation = parseLocation();\n\tlet rollbackLocation;\n\tlet nextPopIsGo = false;\n\tlet ignoreNextPop = false;\n\tlet skipBlockerNextPop = false;\n\tlet ignoreNextBeforeUnload = false;\n\tconst getLocation = () => currentLocation;\n\tlet next;\n\tconst flush = () => {\n\t\tif (!next) return;\n\t\thistory._ignoreSubscribers = true;\n\t\t(next[2] ? win.history.pushState : win.history.replaceState)(next[1], \"\", next[0]);\n\t\thistory._ignoreSubscribers = false;\n\t\tnext = void 0;\n\t\trollbackLocation = void 0;\n\t};\n\tconst queueHistoryAction = (isPush, destHref, state) => {\n\t\tconst href = opts?.createHref ? createHref(destHref) : void 0;\n\t\tconst hasPendingAction = !!next;\n\t\tif (!hasPendingAction) rollbackLocation = currentLocation;\n\t\tcurrentLocation = parseHref(destHref, state);\n\t\tnext = [\n\t\t\thref ?? currentLocation.href,\n\t\t\tstate,\n\t\t\tnext?.[2] || isPush\n\t\t];\n\t\tif (!hasPendingAction) queueMicrotask(() => flush());\n\t};\n\tconst onPushPop = (type) => {\n\t\tcurrentLocation = parseLocation();\n\t\thistory.notify({ type });\n\t};\n\tconst onPushPopEvent = async () => {\n\t\tignoreNextBeforeUnload = false;\n\t\tif (ignoreNextPop) {\n\t\t\tignoreNextPop = false;\n\t\t\treturn;\n\t\t}\n\t\tconst nextLocation = parseLocation();\n\t\tconst delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey];\n\t\tconst isForward = delta === 1;\n\t\tconst isBack = delta === -1;\n\t\tconst isGo = !isForward && !isBack || nextPopIsGo;\n\t\tnextPopIsGo = false;\n\t\tconst action = isGo ? \"GO\" : isBack ? \"BACK\" : \"FORWARD\";\n\t\tconst notify = isGo ? {\n\t\t\ttype: \"GO\",\n\t\t\tindex: delta\n\t\t} : { type: isBack ? \"BACK\" : \"FORWARD\" };\n\t\tif (skipBlockerNextPop) skipBlockerNextPop = false;\n\t\telse {\n\t\t\tconst blockers = _getBlockers();\n\t\t\tif (typeof document !== \"undefined\" && blockers.length) {\n\t\t\t\tfor (const blocker of blockers) if (await blocker.blockerFn({\n\t\t\t\t\tcurrentLocation,\n\t\t\t\t\tnextLocation,\n\t\t\t\t\taction\n\t\t\t\t})) {\n\t\t\t\t\tignoreNextPop = true;\n\t\t\t\t\twin.history.go(-delta);\n\t\t\t\t\thistory.notify(notify);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcurrentLocation = parseLocation();\n\t\thistory.notify(notify);\n\t};\n\tconst onBeforeUnload = (e) => {\n\t\tif (ignoreNextBeforeUnload) {\n\t\t\tignoreNextBeforeUnload = false;\n\t\t\treturn;\n\t\t}\n\t\tlet shouldBlock = false;\n\t\tconst blockers = _getBlockers();\n\t\tif (typeof document !== \"undefined\" && blockers.length) for (const blocker of blockers) {\n\t\t\tconst shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true;\n\t\t\tif (shouldHaveBeforeUnload === true) {\n\t\t\t\tshouldBlock = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (typeof shouldHaveBeforeUnload === \"function\" && shouldHaveBeforeUnload() === true) {\n\t\t\t\tshouldBlock = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (shouldBlock) {\n\t\t\te.preventDefault();\n\t\t\treturn e.returnValue = \"\";\n\t\t}\n\t};\n\tconst history = createHistory({\n\t\tgetLocation,\n\t\tgetLength: () => win.history.length,\n\t\tpushState: (href, state) => queueHistoryAction(true, href, state),\n\t\treplaceState: (href, state) => queueHistoryAction(false, href, state),\n\t\tback: (ignoreBlocker) => {\n\t\t\tif (ignoreBlocker) {\n\t\t\t\tskipBlockerNextPop = true;\n\t\t\t\tignoreNextBeforeUnload = true;\n\t\t\t}\n\t\t\treturn win.history.back();\n\t\t},\n\t\tforward: (ignoreBlocker) => {\n\t\t\tif (ignoreBlocker) {\n\t\t\t\tskipBlockerNextPop = true;\n\t\t\t\tignoreNextBeforeUnload = true;\n\t\t\t}\n\t\t\twin.history.forward();\n\t\t},\n\t\tgo: (n, ignoreBlocker) => {\n\t\t\tnextPopIsGo = true;\n\t\t\tif (ignoreBlocker) {\n\t\t\t\tskipBlockerNextPop = true;\n\t\t\t\tignoreNextBeforeUnload = true;\n\t\t\t}\n\t\t\twin.history.go(n);\n\t\t},\n\t\tcreateHref: (href) => createHref(href),\n\t\tflush,\n\t\tdestroy: () => {\n\t\t\twin.history.pushState = originalPushState;\n\t\t\twin.history.replaceState = originalReplaceState;\n\t\t\twin.removeEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });\n\t\t\twin.removeEventListener(popStateEvent, onPushPopEvent);\n\t\t},\n\t\tonBlocked: () => {\n\t\t\tif (rollbackLocation && currentLocation !== rollbackLocation) currentLocation = rollbackLocation;\n\t\t},\n\t\tgetBlockers: _getBlockers,\n\t\tsetBlockers: _setBlockers,\n\t\tnotifyOnIndexChange: false\n\t});\n\thistory._ignoreNextBeforeUnload = (href) => {\n\t\tignoreNextBeforeUnload = false;\n\t\ttry {\n\t\t\thref = new URL(href, win.document.baseURI).href;\n\t\t\tignoreNextBeforeUnload = /^https?:/.test(href) && (!href.includes(\"#\") || href.split(\"#\")[0] !== win.location.href.split(\"#\")[0]);\n\t\t} catch {}\n\t};\n\twin.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });\n\twin.addEventListener(popStateEvent, onPushPopEvent);\n\twin.history.pushState = function(...args) {\n\t\tconst res = originalPushState.apply(win.history, args);\n\t\tif (!history._ignoreSubscribers) onPushPop(\"PUSH\");\n\t\treturn res;\n\t};\n\twin.history.replaceState = function(...args) {\n\t\tconst res = originalReplaceState.apply(win.history, args);\n\t\tif (!history._ignoreSubscribers) onPushPop(\"REPLACE\");\n\t\treturn res;\n\t};\n\treturn history;\n}\n/**\n* Create a hash-based history implementation.\n* Useful for static hosts or environments without server URL rewriting.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n*/\nfunction createHashHistory(opts) {\n\tconst win = opts?.window ?? (typeof document !== \"undefined\" ? window : void 0);\n\treturn createBrowserHistory({\n\t\twindow: win,\n\t\tparseLocation: () => {\n\t\t\tconst hashSplit = win.location.hash.split(\"#\").slice(1);\n\t\t\tconst pathPart = hashSplit[0] ?? \"/\";\n\t\t\tconst searchPart = win.location.search;\n\t\t\tconst hashEntries = hashSplit.slice(1);\n\t\t\treturn parseHref(`${pathPart}${searchPart}${hashEntries.length === 0 ? \"\" : `#${hashEntries.join(\"#\")}`}`, win.history.state);\n\t\t},\n\t\tcreateHref: (href) => `${win.location.pathname}${win.location.search}#${href}`\n\t});\n}\n/**\n* Create an in-memory history implementation.\n* Ideal for server rendering, tests, and non-DOM environments.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n*/\nfunction createMemoryHistory(opts = { initialEntries: [\"/\"] }) {\n\tconst entries = opts.initialEntries;\n\tlet index = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1;\n\tconst states = entries.map((_entry, index) => assignKeyAndIndex(index, void 0));\n\tconst getLocation = () => parseHref(entries[index], states[index]);\n\tlet blockers = [];\n\tconst _getBlockers = () => blockers;\n\tconst _setBlockers = (newBlockers) => blockers = newBlockers;\n\treturn createHistory({\n\t\tgetLocation,\n\t\tgetLength: () => entries.length,\n\t\tpushState: (path, state) => {\n\t\t\tindex = index < entries.length - 1 ? index + 1 : entries.length;\n\t\t\tstates[index] = state;\n\t\t\tentries[index] = path;\n\t\t\tif (index < entries.length - 1) {\n\t\t\t\tentries.length = index + 1;\n\t\t\t\tstates.length = index + 1;\n\t\t\t}\n\t\t},\n\t\treplaceState: (path, state) => {\n\t\t\tstates[index] = state;\n\t\t\tentries[index] = path;\n\t\t},\n\t\tback: () => {\n\t\t\tindex = Math.max(index - 1, 0);\n\t\t},\n\t\tforward: () => {\n\t\t\tindex = Math.min(index + 1, entries.length - 1);\n\t\t},\n\t\tgo: (n) => {\n\t\t\tindex = Math.min(Math.max(index + n, 0), entries.length - 1);\n\t\t},\n\t\tcreateHref: normalizeHref,\n\t\tgetBlockers: _getBlockers,\n\t\tsetBlockers: _setBlockers\n\t});\n}\nvar noop = () => {};\nvar ServerHistory = class {\n\tconstructor(location) {\n\t\tthis.location = location;\n\t}\n\tget length() {\n\t\treturn 1;\n\t}\n\tget subscribers() {\n\t\treturn this._subscribers ??= /* @__PURE__ */ new Set();\n\t}\n\tsubscribe() {\n\t\treturn noop;\n\t}\n\tpush() {}\n\treplace() {}\n\tgo() {}\n\tback() {}\n\tforward() {}\n\tcanGoBack() {\n\t\treturn false;\n\t}\n\tcreateHref(href) {\n\t\treturn normalizeHref(href);\n\t}\n\tblock() {\n\t\treturn noop;\n\t}\n\tflush() {}\n\tdestroy() {}\n\tnotify() {}\n\t_getBlockers() {\n\t\treturn [];\n\t}\n};\n/** A fixed request location; server navigation is a no-op. */\nfunction createServerHistory(href) {\n\treturn new ServerHistory(parseHref(href, void 0));\n}\nfunction parseHref(href, state) {\n\tconst sanitizedHref = normalizeHref(href);\n\tconst hashIndex = sanitizedHref.indexOf(\"#\");\n\tconst searchIndex = sanitizedHref.indexOf(\"?\");\n\tif (!state) {\n\t\tconst key = createRandomKey();\n\t\tstate = {\n\t\t\t[stateIndexKey]: 0,\n\t\t\tkey,\n\t\t\t__TSR_key: key\n\t\t};\n\t}\n\treturn {\n\t\thref: sanitizedHref,\n\t\tpathname: sanitizedHref.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : sanitizedHref.length),\n\t\thash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : \"\",\n\t\tsearch: searchIndex > -1 ? sanitizedHref.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : \"\",\n\t\tstate\n\t};\n}\nfunction createRandomKey() {\n\treturn (Math.random() + 1).toString(36).substring(7);\n}\n//#endregion\nexport { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory, createServerHistory, normalizeProtocolRelative, parseHref };\n\n//# sourceMappingURL=index.js.map","import { DEFAULT_PROTOCOL_ALLOWLIST, createNull, decodePath, deepEqual, encodePathLikeUrl, findLast, functionalUpdate, getUrlScheme, hasKeys, hasOwn, isDangerousProtocol, last, nullReplaceEqualDeep, protocolRelativePrefixRegex, replaceEqualDeep } from \"./utils.js\";\nimport { compileDecodeCharMap, interpolatePath, resolvePath, trimPath, trimPathRight } from \"./path.js\";\nimport { createSieveCache } from \"./sieve-cache.js\";\nimport { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, parseSegments, processRouteMasks, processRouteTree } from \"./new-process-route-tree.js\";\nimport { isNotFound } from \"./not-found.js\";\nimport { setupScrollRestoration } from \"./scroll-restoration.js\";\nimport { defaultParseSearch, defaultStringifySearch } from \"./searchParams.js\";\nimport { rootRouteId } from \"./root.js\";\nimport { isRedirect } from \"./redirect.js\";\nimport { loadClientRoute, loadRouteChunk, preloadClientRoute, refreshClientRoute, replaceRouteChunk } from \"./load-client.js\";\nimport { executeRewriteInput, executeRewriteOutput, rewriteBasepath } from \"./rewrite.js\";\nimport { createRouterStores } from \"./stores.js\";\nimport { createBrowserHistory, normalizeProtocolRelative, parseHref } from \"@tanstack/history\";\nimport { isServer, loadServerRoute } from \"@tanstack/router-core/isServer\";\n//#region src/router.ts\nfunction isExternalUrl(url, origin) {\n\treturn url.protocol !== \"http:\" && url.protocol !== \"https:\" || url.origin !== origin || !!url.username || !!url.password;\n}\nfunction getUrlPath(url) {\n\treturn url.pathname + url.search + url.hash;\n}\nfunction routeNeedsLoad(route) {\n\treturn route.options.loader || route.options.beforeLoad || route.lazyFn || route.options.component?.preload || route.options.pendingComponent?.preload;\n}\n/**\n* Convert an unknown error into a minimal, serializable object.\n* Includes name and message (and stack in development).\n*/\nfunction defaultSerializeError(err) {\n\tif (err instanceof Error) {\n\t\tconst obj = {\n\t\t\tname: err.name,\n\t\t\tmessage: err.message\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") obj.stack = err.stack;\n\t\treturn obj;\n\t}\n\treturn { data: err };\n}\n/** Options for configuring trailing-slash behavior. */\nconst trailingSlashOptions = {\n\talways: \"always\",\n\tnever: \"never\",\n\tpreserve: \"preserve\"\n};\n/**\n* Compute whether path, href or hash changed between previous and current\n* resolved locations.\n*/\nfunction getLocationChangeInfo(location, resolvedLocation) {\n\treturn {\n\t\tfromLocation: resolvedLocation,\n\t\ttoLocation: location,\n\t\tpathChanged: resolvedLocation?.pathname !== location.pathname,\n\t\threfChanged: resolvedLocation?.href !== location.href,\n\t\thashChanged: resolvedLocation?.hash !== location.hash\n\t};\n}\n/**\n* Return only state owned by the application, excluding volatile history\n* bookkeeping. Mask payloads (`__tempLocation`/`__tempKey`) are kept: they\n* distinguish otherwise-identical locations.\n*/\nfunction _getUserHistoryState({ key: _key, __TSR_key: _tsrKey, __TSR_index: _tsrIndex, __hashScrollIntoViewOptions: _hashScroll, ...state }) {\n\treturn state;\n}\nfunction lifecycleEnd(matches) {\n\treturn matches.findIndex((match) => match.status === \"error\" || match.status === \"notFound\" || match._notFound) + 1;\n}\n/** Run route lifecycle callbacks in leave/enter/stay phases. */\nfunction runRouteLifecycle(router, previous, matches, previousEnd, nextEnd, owner) {\n\tif (previousEnd) previous = previous.slice(0, previousEnd);\n\tif (nextEnd) matches = matches.slice(0, nextEnd);\n\tfor (const match of previous) {\n\t\tif (owner && router._tx !== owner) return;\n\t\tif (!matches.some((candidate) => candidate.routeId === match.routeId)) router.routesById[match.routeId].options.onLeave?.(match);\n\t}\n\tfor (const match of matches) {\n\t\tif (owner && router._tx !== owner) return;\n\t\trouter.routesById[match.routeId].options[previous.some((candidate) => candidate.routeId === match.routeId) ? \"onStay\" : \"onEnter\"]?.(match);\n\t}\n}\n/**\n* Core, framework-agnostic router engine that powers TanStack Router.\n*\n* Provides navigation, matching, loading, preloading, caching and event APIs\n* used by framework adapters (React/Solid). Prefer framework helpers like\n* `createRouter` in app code.\n*\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType\n*/\nvar RouterCore = class {\n\t/**\n\t* @deprecated Use the `createRouter` function instead\n\t*/\n\tconstructor(options, getStoreConfig) {\n\t\tthis.tempLocationKey = `${Math.round(Math.random() * 1e7)}`;\n\t\tthis._scroll = { n: true };\n\t\tthis.subscribers = /* @__PURE__ */ new Set();\n\t\tthis._cache = /* @__PURE__ */ new Map();\n\t\tthis._committed = [];\n\t\tthis.startTransition = async (fn) => {\n\t\t\tfn();\n\t\t\treturn false;\n\t\t};\n\t\tthis.update = (newOptions) => {\n\t\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\t\tif (newOptions.notFoundRoute) console.warn(\"The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.\");\n\t\t\t}\n\t\t\tconst prevOptions = this.options;\n\t\t\tthis.options = {\n\t\t\t\t...prevOptions,\n\t\t\t\t...newOptions\n\t\t\t};\n\t\t\tthis.isServer = this.options.isServer ?? isServer ?? typeof document === \"undefined\";\n\t\t\tif (!(isServer ?? this.isServer)) this.staticLocations = /* @__PURE__ */ new WeakMap();\n\t\t\tthis.protocolAllowlist = new Set(this.options.protocolAllowlist);\n\t\t\tif (!this.history || this.options.history && this.options.history !== this.history) if (!this.options.history) {\n\t\t\t\tif (!(isServer ?? this.isServer)) this.history = createBrowserHistory();\n\t\t\t} else this.history = this.options.history;\n\t\t\tthis.origin = this.options.origin;\n\t\t\tif (!this.origin) if (!(isServer ?? this.isServer) && window?.origin && window.origin !== \"null\") this.origin = window.origin;\n\t\t\telse this.origin = \"http://localhost\";\n\t\t\tconst nextBasepath = this.options.basepath ?? \"/\";\n\t\t\tconst nextRewriteOption = this.options.rewrite;\n\t\t\tconst rewriteChanged = this.basepath !== nextBasepath || prevOptions?.rewrite !== nextRewriteOption || prevOptions?.caseSensitive !== this.options.caseSensitive;\n\t\t\tif (rewriteChanged) {\n\t\t\t\tthis.basepath = nextBasepath;\n\t\t\t\tthis.rewrite = nextBasepath !== \"/\" && trimPath(nextBasepath) ? rewriteBasepath(nextBasepath, this.options.caseSensitive, nextRewriteOption) : nextRewriteOption;\n\t\t\t}\n\t\t\tif (this.history) this.updateLatestLocation();\n\t\t\tif (this.options.routeTree !== this.routeTree || (isServer ?? this.isServer) && prevOptions?.caseSensitive !== this.options.caseSensitive) {\n\t\t\t\tthis.routeTree = this.options.routeTree;\n\t\t\t\tlet processRouteTreeResult;\n\t\t\t\tif (process.env.NODE_ENV !== \"development\" && (isServer ?? this.isServer) && globalThis.__TSR_CACHE__ && globalThis.__TSR_CACHE__.routeTree === this.routeTree && globalThis.__TSR_CACHE__.caseSensitive === this.options.caseSensitive) processRouteTreeResult = globalThis.__TSR_CACHE__.processRouteTreeResult;\n\t\t\t\telse {\n\t\t\t\t\tprocessRouteTreeResult = this.buildRouteTree();\n\t\t\t\t\tif (process.env.NODE_ENV !== \"development\" && (isServer ?? this.isServer) && globalThis.__TSR_CACHE__ === void 0) globalThis.__TSR_CACHE__ = {\n\t\t\t\t\t\trouteTree: this.routeTree,\n\t\t\t\t\t\tcaseSensitive: this.options.caseSensitive,\n\t\t\t\t\t\tprocessRouteTreeResult\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tthis.setRoutes(processRouteTreeResult);\n\t\t\t}\n\t\t\tif (!this.stores) {\n\t\t\t\tif (this.latestLocation) {\n\t\t\t\t\tconst config = this.getStoreConfig(this);\n\t\t\t\t\tthis.batch = config.batch;\n\t\t\t\t\tthis.stores = createRouterStores(this.latestLocation, config);\n\t\t\t\t\tif (!(isServer ?? this.isServer)) setupScrollRestoration(this);\n\t\t\t\t}\n\t\t\t} else if (rewriteChanged) this.stores.location.set(this.latestLocation);\n\t\t};\n\t\tthis.updateLatestLocation = () => {\n\t\t\tthis.latestLocation = this.parseLocation(this.history.location, this.latestLocation);\n\t\t};\n\t\tthis.buildRouteTree = () => {\n\t\t\tconst result = processRouteTree(this.routeTree, this.options.caseSensitive);\n\t\t\tif (this.options.routeMasks) processRouteMasks(this.options.routeMasks, result.processedTree);\n\t\t\treturn {\n\t\t\t\t...result,\n\t\t\t\tresolvePathCache: createSieveCache(1e3)\n\t\t\t};\n\t\t};\n\t\tthis.subscribe = (eventType, fn) => {\n\t\t\tconst listener = {\n\t\t\t\teventType,\n\t\t\t\tfn\n\t\t\t};\n\t\t\tthis.subscribers.add(listener);\n\t\t\treturn () => {\n\t\t\t\tthis.subscribers.delete(listener);\n\t\t\t};\n\t\t};\n\t\tthis.emit = (routerEvent) => {\n\t\t\tfor (const listener of this.subscribers) if (listener.eventType === routerEvent.type) try {\n\t\t\t\tlistener.fn(routerEvent);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t};\n\t\tthis.parseLocation = (locationToParse, previousLocation) => {\n\t\t\tconst parse = ({ pathname, search, hash, href }, state) => {\n\t\t\t\tif (!this.rewrite && !/[ \\x00-\\x1f\\x7f\\u0080-\\uffff]/.test(pathname)) {\n\t\t\t\t\tconst parsedSearch = this.options.parseSearch(search);\n\t\t\t\t\tconst searchStr = this.options.stringifySearch(parsedSearch);\n\t\t\t\t\treturn {\n\t\t\t\t\t\thref: pathname + searchStr + hash,\n\t\t\t\t\t\tpublicHref: pathname + searchStr + hash,\n\t\t\t\t\t\tpathname: decodePath(pathname),\n\t\t\t\t\t\texternal: false,\n\t\t\t\t\t\tsearchStr,\n\t\t\t\t\t\tsearch: nullReplaceEqualDeep(previousLocation?.search, parsedSearch),\n\t\t\t\t\t\thash: decodePath(hash.slice(1)),\n\t\t\t\t\t\tstate: replaceEqualDeep(previousLocation?.state, state)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst url = executeRewriteInput(this.rewrite, new URL(href, this.origin));\n\t\t\t\tconst parsedSearch = this.options.parseSearch(url.search);\n\t\t\t\tconst searchStr = this.options.stringifySearch(parsedSearch);\n\t\t\t\turl.search = searchStr;\n\t\t\t\treturn {\n\t\t\t\t\thref: url.href.replace(url.origin, \"\"),\n\t\t\t\t\tpublicHref: href,\n\t\t\t\t\tpathname: decodePath(normalizeProtocolRelative(url.pathname)),\n\t\t\t\t\texternal: !!this.rewrite && isExternalUrl(url, this.origin),\n\t\t\t\t\tsearchStr,\n\t\t\t\t\tsearch: nullReplaceEqualDeep(previousLocation?.search, parsedSearch),\n\t\t\t\t\thash: decodePath(url.hash.slice(1)),\n\t\t\t\t\tstate: replaceEqualDeep(previousLocation?.state, state)\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst location = parse(locationToParse, locationToParse.state);\n\t\t\tconst { __tempLocation, __tempKey } = location.state;\n\t\t\tif (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {\n\t\t\t\tconst parsedTempLocation = parse(__tempLocation, {\n\t\t\t\t\t...__tempLocation.state,\n\t\t\t\t\t__tempLocation: void 0,\n\t\t\t\t\tkey: location.state.key,\n\t\t\t\t\t__TSR_key: location.state.__TSR_key\n\t\t\t\t});\n\t\t\t\tparsedTempLocation.maskedLocation = location;\n\t\t\t\treturn parsedTempLocation;\n\t\t\t}\n\t\t\treturn location;\n\t\t};\n\t\tthis.matchRoutes = (pathnameOrNext, locationSearchOrOpts, opts) => {\n\t\t\tif (typeof pathnameOrNext === \"string\") return this.matchRoutesInternal({\n\t\t\t\tpathname: pathnameOrNext,\n\t\t\t\tsearch: locationSearchOrOpts\n\t\t\t}, opts);\n\t\t\treturn this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts);\n\t\t};\n\t\tthis.getMatchedRoutes = (pathname) => {\n\t\t\tconst rawParams = Object.create(null);\n\t\t\tconst match = findRouteMatch(trimPathRight(pathname), this.processedTree, true);\n\t\t\tif (match) Object.assign(rawParams, match.rawParams);\n\t\t\treturn [\n\t\t\t\tmatch?.branch || [this.routesById[\"__root__\"]],\n\t\t\t\trawParams,\n\t\t\t\tmatch?.route\n\t\t\t];\n\t\t};\n\t\tthis.buildLocation = (opts) => {\n\t\t\tif (!(isServer ?? this.isServer)) {\n\t\t\t\tconst cached = this.staticLocations.get(opts);\n\t\t\t\tif (cached) return cached;\n\t\t\t}\n\t\t\tlet usedCurrent = false;\n\t\t\tconst build = (dest = {}) => {\n\t\t\t\tif (dest.href) {\n\t\t\t\t\tconst parsed = parseHref(dest.href, {});\n\t\t\t\t\tdest = {\n\t\t\t\t\t\t...dest,\n\t\t\t\t\t\tto: executeRewriteInput(this.rewrite, new URL(parsed.pathname, this.origin)).pathname,\n\t\t\t\t\t\tsearch: this.options.parseSearch(parsed.search),\n\t\t\t\t\t\thash: parsed.hash.slice(1)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst currentLocation = dest._fromLocation || this._pendingLocation || this.latestLocation;\n\t\t\t\tlet lightweight;\n\t\t\t\tconst current = () => {\n\t\t\t\t\tusedCurrent = true;\n\t\t\t\t\treturn currentLocation;\n\t\t\t\t};\n\t\t\t\tconst currentMatch = () => {\n\t\t\t\t\tusedCurrent = true;\n\t\t\t\t\treturn lightweight ??= this.matchRoutesLightweight(currentLocation);\n\t\t\t\t};\n\t\t\t\tif (process.env.NODE_ENV !== \"production\" && dest.from && dest._isNavigate) {\n\t\t\t\t\tconst [allFromMatches] = this.getMatchedRoutes(dest.from);\n\t\t\t\t\tconst [matchedRoutes, fullPath] = currentMatch();\n\t\t\t\t\tconst matchedFrom = findLast(matchedRoutes, (d) => {\n\t\t\t\t\t\treturn comparePaths(d.fullPath, dest.from);\n\t\t\t\t\t});\n\t\t\t\t\tconst matchedCurrent = findLast(allFromMatches, (d) => {\n\t\t\t\t\t\treturn comparePaths(d.fullPath, fullPath);\n\t\t\t\t\t});\n\t\t\t\t\tif (!matchedFrom && !matchedCurrent) console.warn(`Could not find match for from: ${dest.from}`);\n\t\t\t\t}\n\t\t\t\tconst to = dest.to ? `${dest.to}` : \".\";\n\t\t\t\tconst nextTo = resolvePath(to[0] === \"/\" ? \"\" : dest.unsafeRelative === \"path\" ? current().pathname : dest.from ?? currentMatch()[1], to, this.options.trailingSlash, this.resolvePathCache);\n\t\t\t\tconst destRoute = this.routesByPath[trimPathRight(nextTo)];\n\t\t\t\tconst isTemplate = nextTo.includes(\"$\");\n\t\t\t\tlet destRoutes;\n\t\t\t\tif (destRoute) destRoutes = destRoute._branch ??= buildRouteBranch(destRoute);\n\t\t\t\telse if (isTemplate) destRoutes = [];\n\t\t\t\telse {\n\t\t\t\t\tconst [matchedRoutes, rawParams, foundRoute] = this.getMatchedRoutes(nextTo);\n\t\t\t\t\tdestRoutes = matchedRoutes;\n\t\t\t\t\tif (this.options.notFoundRoute && (!foundRoute || foundRoute.path !== \"/\" && rawParams[\"**\"])) destRoutes = [...destRoutes, this.options.notFoundRoute];\n\t\t\t\t}\n\t\t\t\tconst interpolation = isTemplate ? destRoute?._interpolation ?? parseSegments(false, { fullPath: nextTo }, 0) : void 0;\n\t\t\t\tlet nextParams;\n\t\t\t\tfor (const route of destRoutes) {\n\t\t\t\t\tconst fn = route.options.params?.stringify ?? route.options.stringifyParams;\n\t\t\t\t\tif (fn) {\n\t\t\t\t\t\tconst fromParams = currentMatch()[3];\n\t\t\t\t\t\tnextParams ??= resolveNextParams(dest.params, fromParams);\n\t\t\t\t\t\tif (!hasKeys(nextParams)) break;\n\t\t\t\t\t\tif (nextParams === fromParams) nextParams = Object.assign(createNull(), nextParams);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tObject.assign(nextParams, fn(nextParams));\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextParams ??= resolveNextParams(dest.params, needsInheritedParams(dest.params, interpolation) ? currentMatch()[3] : EMPTY_RECORD);\n\t\t\t\tconst nextPathname = opts.leaveParams ? nextTo : normalizeProtocolRelative(decodePath(interpolation ? interpolatePath(nextTo, interpolation, nextParams, this.pathParamsDecoder) : nextTo));\n\t\t\t\tif (process.env.NODE_ENV !== \"production\" && destRoute && !opts.leaveParams) try {\n\t\t\t\t\tconst foundRoute = this.getMatchedRoutes(nextPathname)[2];\n\t\t\t\t\tif (foundRoute?.id !== destRoute.id) console.warn(`Generated path \"${nextPathname}\" for route \"${destRoute.id}\" matched route \"${foundRoute?.id}\" instead. This can happen when multiple route templates resolve to the same URL. Use the route template that matches the intended route, or adjust params.stringify if it changed the target path.`);\n\t\t\t\t} catch {}\n\t\t\t\tconst middlewares = getSearchMiddlewares(destRoutes, opts._includeValidateSearch);\n\t\t\t\tconst fromSearch = () => {\n\t\t\t\t\tlet search = currentMatch()[2];\n\t\t\t\t\tif (opts._includeValidateSearch && this.options.search?.strict) {\n\t\t\t\t\t\tconst validatedSearch = {};\n\t\t\t\t\t\tdestRoutes.forEach((route) => {\n\t\t\t\t\t\t\tif (route.options.validateSearch) try {\n\t\t\t\t\t\t\t\tObject.assign(validatedSearch, validateSearch(route.options.validateSearch, {\n\t\t\t\t\t\t\t\t\t...validatedSearch,\n\t\t\t\t\t\t\t\t\t...search\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsearch = validatedSearch;\n\t\t\t\t\t}\n\t\t\t\t\treturn search;\n\t\t\t\t};\n\t\t\t\tconst nextSearch = middlewares.length ? applySearchMiddleware(middlewares, fromSearch(), dest) : dest.search === true ? fromSearch() : typeof dest.search === \"function\" ? dest.search(fromSearch()) : dest.search || EMPTY_RECORD;\n\t\t\t\tconst searchStr = this.options.stringifySearch(nextSearch);\n\t\t\t\tconst hash = dest.hash === true ? current().hash : typeof dest.hash === \"function\" ? dest.hash(current().hash) : dest.hash || void 0;\n\t\t\t\tconst hashStr = hash ? `#${hash}` : \"\";\n\t\t\t\tconst nextState = !dest.state ? EMPTY_RECORD : dest.state === true ? current().state : typeof dest.state === \"function\" ? dest.state(current().state) : dest.state;\n\t\t\t\tconst fullPath = `${nextPathname}${searchStr}${hashStr}`;\n\t\t\t\tlet href;\n\t\t\t\tlet publicHref;\n\t\t\t\tlet external = false;\n\t\t\t\tif (this.rewrite) {\n\t\t\t\t\tconst url = new URL(fullPath, this.origin);\n\t\t\t\t\tconst origin = url.origin;\n\t\t\t\t\tconst rewrittenUrl = executeRewriteOutput(this.rewrite, url);\n\t\t\t\t\thref = getUrlPath(url);\n\t\t\t\t\tif (isExternalUrl(rewrittenUrl, origin)) {\n\t\t\t\t\t\tpublicHref = rewrittenUrl.href;\n\t\t\t\t\t\texternal = true;\n\t\t\t\t\t} else publicHref = normalizeProtocolRelative(getUrlPath(rewrittenUrl));\n\t\t\t\t} else {\n\t\t\t\t\thref = encodePathLikeUrl(fullPath);\n\t\t\t\t\tpublicHref = href;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tpublicHref,\n\t\t\t\t\thref,\n\t\t\t\t\tpathname: nextPathname,\n\t\t\t\t\tsearch: nextSearch,\n\t\t\t\t\tsearchStr,\n\t\t\t\t\tstate: nextState,\n\t\t\t\t\thash: hash ?? \"\",\n\t\t\t\t\texternal,\n\t\t\t\t\tunmaskOnReload: dest.unmaskOnReload\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst next = build(opts);\n\t\t\tif (opts.mask) next.maskedLocation = build({\n\t\t\t\tfrom: opts.from,\n\t\t\t\t...opts.mask\n\t\t\t});\n\t\t\telse if (this.options.routeMasks) {\n\t\t\t\tconst match = findFlatMatch(next.pathname, this.processedTree);\n\t\t\t\tif (match) {\n\t\t\t\t\tconst params = Object.assign(createNull(), match.rawParams);\n\t\t\t\t\tconst { from: _from, params: maskParams, ...maskProps } = match.route;\n\t\t\t\t\tconst nextParams = resolveNextParams(maskParams, params);\n\t\t\t\t\tnext.maskedLocation = build({\n\t\t\t\t\t\tfrom: opts.from,\n\t\t\t\t\t\t...maskProps,\n\t\t\t\t\t\tparams: nextParams\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!(isServer ?? this.isServer) && !usedCurrent && opts._fromLocation && !next.maskedLocation) this.staticLocations.set(opts, next);\n\t\t\treturn next;\n\t\t};\n\t\tthis.commitLocation = async ({ viewTransition, ignoreBlocker, ...next }) => {\n\t\t\tif (isServer ?? this.isServer) return;\n\t\t\tconst nextLocation = next.maskedLocation ?? next;\n\t\t\tif (nextLocation.external && !(isServer ?? this.isServer)) return documentNavigation(this, nextLocation.publicHref, {\n\t\t\t\treplace: next.replace,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t\tlet historyAction;\n\t\t\tconst isSameLocation = trimPathRight(this.latestLocation.href) === trimPathRight(next.href) && deepEqual(_getUserHistoryState(next.state), _getUserHistoryState(this.latestLocation.state));\n\t\t\tconst previousCommitPromise = this._commitPromise;\n\t\t\tlet resolve;\n\t\t\tconst commitPromise = new Promise((done) => {\n\t\t\t\tresolve = done;\n\t\t\t});\n\t\t\tcommitPromise.resolve = () => {\n\t\t\t\tresolve();\n\t\t\t\tpreviousCommitPromise?.resolve();\n\t\t\t};\n\t\t\tthis._commitPromise = commitPromise;\n\t\t\tif (isSameLocation) this.load();\n\t\t\telse {\n\t\t\t\tlet { maskedLocation, hashScrollIntoView, ...nextHistory } = next;\n\t\t\t\tif (maskedLocation) {\n\t\t\t\t\tnextHistory = {\n\t\t\t\t\t\t...maskedLocation,\n\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\t...maskedLocation.state,\n\t\t\t\t\t\t\t__tempKey: void 0,\n\t\t\t\t\t\t\t__tempLocation: {\n\t\t\t\t\t\t\t\t...nextHistory,\n\t\t\t\t\t\t\t\tsearch: nextHistory.searchStr,\n\t\t\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\t\t\t...nextHistory.state,\n\t\t\t\t\t\t\t\t\t__tempKey: void 0,\n\t\t\t\t\t\t\t\t\t__tempLocation: void 0,\n\t\t\t\t\t\t\t\t\t__TSR_key: void 0,\n\t\t\t\t\t\t\t\t\tkey: void 0\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tif (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) nextHistory.state.__tempKey = this.tempLocationKey;\n\t\t\t\t}\n\t\t\t\tnextHistory.state = {\n\t\t\t\t\t...nextHistory.state,\n\t\t\t\t\t__hashScrollIntoViewOptions: hashScrollIntoView ?? this.options.defaultHashScrollIntoView ?? true\n\t\t\t\t};\n\t\t\t\tthis.shouldViewTransition = viewTransition;\n\t\t\t\thistoryAction = next.replace ? \"REPLACE\" : \"PUSH\";\n\t\t\t\tthis.history[historyAction === \"REPLACE\" ? \"replace\" : \"push\"](nextHistory.publicHref, nextHistory.state, { ignoreBlocker });\n\t\t\t\tif (!this.history.subscribers.size) this.load({ action: { type: historyAction } });\n\t\t\t}\n\t\t\tthis._scroll.n = next.resetScroll ?? true;\n\t\t\treturn this._commitPromise;\n\t\t};\n\t\tthis.buildAndCommitLocation = ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, ...rest } = {}) => {\n\t\t\tif (isServer ?? this.isServer) return Promise.resolve();\n\t\t\tconst location = this.buildLocation({\n\t\t\t\t...rest,\n\t\t\t\t_includeValidateSearch: true\n\t\t\t});\n\t\t\tthis._pendingLocation = location;\n\t\t\tconst commitPromise = this.commitLocation({\n\t\t\t\t...location,\n\t\t\t\tviewTransition,\n\t\t\t\treplace,\n\t\t\t\tresetScroll,\n\t\t\t\thashScrollIntoView,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tif (this._pendingLocation === location) this._pendingLocation = void 0;\n\t\t\t});\n\t\t\treturn commitPromise;\n\t\t};\n\t\tthis.navigate = async ({ to, reloadDocument, href, publicHref, ...rest }) => {\n\t\t\tif (isServer ?? this.isServer) return;\n\t\t\tconst hrefScheme = href ? getUrlScheme(href) : void 0;\n\t\t\tif (hrefScheme || reloadDocument) {\n\t\t\t\tif (to !== void 0 || !href) {\n\t\t\t\t\tconst location = this.buildLocation({\n\t\t\t\t\t\tto,\n\t\t\t\t\t\t...rest\n\t\t\t\t\t});\n\t\t\t\t\tconst publicLocation = location.maskedLocation ?? location;\n\t\t\t\t\thref ??= publicLocation.publicHref;\n\t\t\t\t\tpublicHref ??= publicLocation.publicHref;\n\t\t\t\t}\n\t\t\t\tconst reloadHref = !hrefScheme && publicHref ? publicHref : href;\n\t\t\t\treturn documentNavigation(this, reloadHref, rest);\n\t\t\t}\n\t\t\treturn this.buildAndCommitLocation({\n\t\t\t\t...rest,\n\t\t\t\thref,\n\t\t\t\tto,\n\t\t\t\t_isNavigate: true\n\t\t\t});\n\t\t};\n\t\tthis.load = async (opts) => {\n\t\t\tif (isServer ?? this.isServer) return loadServerRoute(this, opts);\n\t\t\tthis.updateLatestLocation();\n\t\t\tif (opts?.action) this._scroll.h = opts.action.type === \"PUSH\" || opts.action.type === \"REPLACE\";\n\t\t\tawait loadClientRoute(this, opts);\n\t\t};\n\t\tthis.startViewTransition = (fn) => {\n\t\t\tconst shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition;\n\t\t\tthis.shouldViewTransition = void 0;\n\t\t\tif (shouldViewTransition && !(isServer ?? typeof document === \"undefined\") && typeof document.startViewTransition === \"function\") {\n\t\t\t\tlet startViewTransitionParams;\n\t\t\t\tif (typeof shouldViewTransition === \"object\" && window.CSS?.supports?.(\"selector(:active-view-transition-type(a))\")) {\n\t\t\t\t\tconst next = this.latestLocation;\n\t\t\t\t\tconst prevLocation = this.stores.resolvedLocation.get();\n\t\t\t\t\tconst resolvedViewTransitionTypes = typeof shouldViewTransition.types === \"function\" ? shouldViewTransition.types(getLocationChangeInfo(next, prevLocation)) : shouldViewTransition.types;\n\t\t\t\t\tif (resolvedViewTransitionTypes === false) return fn();\n\t\t\t\t\tstartViewTransitionParams = {\n\t\t\t\t\t\tupdate: fn,\n\t\t\t\t\t\ttypes: resolvedViewTransitionTypes\n\t\t\t\t\t};\n\t\t\t\t} else startViewTransitionParams = fn;\n\t\t\t\treturn document.startViewTransition(startViewTransitionParams).updateCallbackDone;\n\t\t\t}\n\t\t\treturn fn();\n\t\t};\n\t\tthis.invalidate = (opts) => {\n\t\t\tconst committedMatches = this._committed;\n\t\t\tconst filter = opts?.filter;\n\t\t\tconst preloads = this._preloads;\n\t\t\tconst invalidIds = /* @__PURE__ */ new Set();\n\t\t\tconst consider = (match) => {\n\t\t\t\tif (!filter || filter(match)) invalidIds.add(match.id);\n\t\t\t};\n\t\t\tcommittedMatches.forEach(consider);\n\t\t\tthis._cache.forEach(consider);\n\t\t\tpreloads?.forEach((matches) => matches.forEach(consider));\n\t\t\tthis._tx?.[3].forEach(consider);\n\t\t\tconst abort = [];\n\t\t\tfor (const [controller, matches] of preloads ?? []) if (matches.some((match) => invalidIds.has(match.id))) {\n\t\t\t\tpreloads.delete(controller);\n\t\t\t\tabort.push(controller);\n\t\t\t}\n\t\t\tconst invalidate = (d) => {\n\t\t\t\tif (invalidIds.has(d.id)) {\n\t\t\t\t\tconst route = this.routesById[d.routeId];\n\t\t\t\t\tconst next = {\n\t\t\t\t\t\t...d,\n\t\t\t\t\t\tinvalid: true,\n\t\t\t\t\t\t...(opts?.forcePending || d.status === \"error\" || d.status === \"notFound\") && routeNeedsLoad(route) ? {\n\t\t\t\t\t\t\tstatus: \"pending\",\n\t\t\t\t\t\t\terror: void 0\n\t\t\t\t\t\t} : void 0\n\t\t\t\t\t};\n\t\t\t\t\td._flight = void 0;\n\t\t\t\t\treturn next;\n\t\t\t\t}\n\t\t\t\treturn d;\n\t\t\t};\n\t\t\tthis._committed = committedMatches.map(invalidate);\n\t\t\tfor (const [id, match] of this._cache) if (invalidIds.has(id)) {\n\t\t\t\tmatch.invalid = true;\n\t\t\t\tif (opts?.forcePending) match.status = \"pending\";\n\t\t\t}\n\t\t\tfor (const id of invalidIds) {\n\t\t\t\tconst flight = this._flights?.get(id);\n\t\t\t\tthis._flights?.delete(id);\n\t\t\t\tif (flight && !flight[2]) abort.push(flight[1]);\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t\tthis.shouldViewTransition = false;\n\t\t\treturn this.load({ sync: opts?.sync });\n\t\t};\n\t\tthis.resolveRedirect = (redirect) => {\n\t\t\tconst options = redirect.options;\n\t\t\tlet href = redirect.headers.get(\"Location\") || options.href;\n\t\t\tif (!href) {\n\t\t\t\tconst location = this.buildLocation(options);\n\t\t\t\thref = (location.maskedLocation ?? location).publicHref || \"/\";\n\t\t\t}\n\t\t\tlet scheme;\n\t\t\tif (protocolRelativePrefixRegex.test(href) || (scheme = getUrlScheme(href)) && !this.protocolAllowlist.has(scheme)) throw new Error(process.env.NODE_ENV !== \"production\" ? `Redirect blocked: unsafe protocol in href \"${href}\". Allowed protocols: ${Array.from(this.protocolAllowlist).join(\", \")}.` : \"Redirect blocked: unsafe protocol\");\n\t\t\tif (scheme === \"http:\" || scheme === \"https:\") {\n\t\t\t\tconst url = new URL(href);\n\t\t\t\tif (url.pathname.startsWith(\"//\")) href = url.href;\n\t\t\t\telse if (!isExternalUrl(url, this.origin)) {\n\t\t\t\t\thref = getUrlPath(url);\n\t\t\t\t\tscheme = void 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (scheme) options.reloadDocument = true;\n\t\t\toptions.href = href;\n\t\t\tredirect.headers.set(\"Location\", href);\n\t\t\treturn redirect;\n\t\t};\n\t\tthis.clearCache = (opts) => {\n\t\t\tconst cached = this._cache;\n\t\t\tconst preloads = this._preloads;\n\t\t\tconst filter = opts?.filter;\n\t\t\tconst discarded = [];\n\t\t\tconst discardedIds = [];\n\t\t\tfor (const [id, match] of cached) if (!filter || filter(match)) {\n\t\t\t\tdiscardedIds.push(id);\n\t\t\t\tdiscarded.push(match);\n\t\t\t}\n\t\t\tconst abort = [];\n\t\t\tfor (const [controller, matches] of preloads ?? []) if (!filter || matches.some(filter)) {\n\t\t\t\tabort.push(controller);\n\t\t\t\tdiscarded.push(...matches);\n\t\t\t}\n\t\t\tfor (const id of discardedIds) cached.delete(id);\n\t\t\tfor (const controller of abort) preloads.delete(controller);\n\t\t\tfor (const match of discarded) {\n\t\t\t\tconst flight = match._flight;\n\t\t\t\tmatch._flight = void 0;\n\t\t\t\tif (flight && !--flight[2]) {\n\t\t\t\t\tif (this._flights?.get(match.id) === flight) this._flights.delete(match.id);\n\t\t\t\t\tabort.push(flight[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t};\n\t\tthis.loadRouteChunk = loadRouteChunk;\n\t\tthis.preloadRoute = (opts) => preloadClientRoute(this, opts);\n\t\tthis.matchRoute = (location, opts) => {\n\t\t\tconst matchLocation = {\n\t\t\t\t...location,\n\t\t\t\tto: location.to ? resolvePath(location.from || \"\", location.to, this.options.trailingSlash, this.resolvePathCache) : void 0,\n\t\t\t\tparams: location.params || {},\n\t\t\t\tleaveParams: true\n\t\t\t};\n\t\t\tconst next = this.buildLocation(matchLocation);\n\t\t\tconst isPending = this.stores.status.get() === \"pending\";\n\t\t\tif (opts?.pending && !isPending) return false;\n\t\t\tconst baseLocation = opts?.pending ?? !isPending ? this.latestLocation : this.stores.resolvedLocation.get() || this.stores.location.get();\n\t\t\tconst match = findSingleMatch(next.pathname, opts?.caseSensitive ?? false, opts?.fuzzy ?? false, baseLocation.pathname, this.processedTree);\n\t\t\tif (!match) return false;\n\t\t\tif (location.params) {\n\t\t\t\tif (!deepEqual(match.rawParams, location.params, true)) return false;\n\t\t\t}\n\t\t\tif (opts?.includeSearch ?? true) return deepEqual(baseLocation.search, next.search, true) ? match.rawParams : false;\n\t\t\treturn match.rawParams;\n\t\t};\n\t\tthis.getStoreConfig = getStoreConfig;\n\t\tif (options.pathParamsAllowedCharacters?.length) this.pathParamsDecoder = compileDecodeCharMap(options.pathParamsAllowedCharacters);\n\t\tthis.update({\n\t\t\tdefaultPreloadDelay: 50,\n\t\t\tdefaultPendingMs: 1e3,\n\t\t\tdefaultPendingMinMs: 500,\n\t\t\tcontext: void 0,\n\t\t\t...options,\n\t\t\tcaseSensitive: options.caseSensitive ?? false,\n\t\t\tnotFoundMode: options.notFoundMode ?? \"fuzzy\",\n\t\t\tstringifySearch: options.stringifySearch ?? defaultStringifySearch,\n\t\t\tparseSearch: options.parseSearch ?? defaultParseSearch,\n\t\t\tprotocolAllowlist: options.protocolAllowlist ?? DEFAULT_PROTOCOL_ALLOWLIST\n\t\t});\n\t\tif (!(isServer ?? typeof document === \"undefined\")) self.__TSR_ROUTER__ = this;\n\t}\n\tisShell() {\n\t\treturn !!this.options.isShell;\n\t}\n\tget state() {\n\t\treturn this.stores.__store.get();\n\t}\n\tsetRoutes(caches) {\n\t\tObject.assign(this, caches);\n\t\tthis.lightweightCache = /* @__PURE__ */ new WeakMap();\n\t\tif (!(isServer ?? this.isServer)) this.staticLocations = /* @__PURE__ */ new WeakMap();\n\t\tconst notFoundRoute = this.options.notFoundRoute;\n\t\tif (notFoundRoute) {\n\t\t\tnotFoundRoute.init(99999999999);\n\t\t\tif (this.routesById[notFoundRoute.id] !== notFoundRoute) notFoundRoute._interpolation = parseSegments(false, notFoundRoute, 0);\n\t\t\tthis.routesById[notFoundRoute.id] = notFoundRoute;\n\t\t}\n\t}\n\tmatchRoutesInternal(next, opts) {\n\t\tconst [initialMatchedRoutes, rawParams, foundRoute] = this.getMatchedRoutes(next.pathname);\n\t\tlet matchedRoutes = initialMatchedRoutes;\n\t\tlet isGlobalNotFound = false;\n\t\tif (foundRoute ? foundRoute.path !== \"/\" && rawParams[\"**\"] : trimPathRight(next.pathname)) if (this.options.notFoundRoute) matchedRoutes = [...matchedRoutes, this.options.notFoundRoute];\n\t\telse isGlobalNotFound = true;\n\t\tconst _notFoundRouteId = isGlobalNotFound ? findGlobalNotFoundRouteId(this.options.notFoundMode, matchedRoutes) : void 0;\n\t\tconst matches = new Array(matchedRoutes.length);\n\t\tconst committed = this._committed;\n\t\tconst previousAt = (route, index) => {\n\t\t\tconst match = committed[index];\n\t\t\treturn match?.routeId === route.id ? match : route === this.options.notFoundRoute ? committed.find((candidate) => candidate.routeId === route.id) : void 0;\n\t\t};\n\t\tlet strictParams;\n\t\tfor (let index = 0; index < matchedRoutes.length; index++) {\n\t\t\tconst route = matchedRoutes[index];\n\t\t\tconst parentMatch = matches[index - 1];\n\t\t\tlet preMatchSearch;\n\t\t\tlet strictMatchSearch;\n\t\t\tlet searchError;\n\t\t\t{\n\t\t\t\tconst parentSearch = parentMatch?.search ?? next.search;\n\t\t\t\tconst parentStrictSearch = parentMatch?._strictSearch ?? void 0;\n\t\t\t\ttry {\n\t\t\t\t\tconst strictSearch = validateSearch(route.options.validateSearch, { ...parentSearch }) ?? void 0;\n\t\t\t\t\tpreMatchSearch = {\n\t\t\t\t\t\t...parentSearch,\n\t\t\t\t\t\t...strictSearch\n\t\t\t\t\t};\n\t\t\t\t\tstrictMatchSearch = {\n\t\t\t\t\t\t...parentStrictSearch,\n\t\t\t\t\t\t...strictSearch\n\t\t\t\t\t};\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlet searchParamError = err;\n\t\t\t\t\tif (!(err instanceof SearchParamError)) searchParamError = new SearchParamError(err.message, { cause: err });\n\t\t\t\t\tif (opts?.throwOnError) throw searchParamError;\n\t\t\t\t\tpreMatchSearch = parentSearch;\n\t\t\t\t\tstrictMatchSearch = {};\n\t\t\t\t\tsearchError = searchParamError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet loaderDeps = \"\";\n\t\t\tlet loaderDepsHash = \"\";\n\t\t\ttry {\n\t\t\t\tloaderDeps = route.options.loaderDeps?.({ search: preMatchSearch }) ?? \"\";\n\t\t\t\tloaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) || \"\" : \"\";\n\t\t\t} catch (cause) {\n\t\t\t\tif (opts?.throwOnError) throw cause;\n\t\t\t\tsearchError ??= cause;\n\t\t\t}\n\t\t\tconst usedParams = createNull();\n\t\t\tconst interpolatedPath = route._interpolation ? interpolatePath(route.fullPath, route._interpolation, rawParams, this.pathParamsDecoder, usedParams) : route.fullPath;\n\t\t\tconst matchId = route.id + interpolatedPath + loaderDepsHash;\n\t\t\tconst previousMatch = previousAt(route, index);\n\t\t\tconst existingMatch = process.env.NODE_ENV !== \"production\" && opts?._rematerialize ? void 0 : this._cache.get(matchId) ?? (previousMatch?.id === matchId ? previousMatch : void 0);\n\t\t\tstrictParams = existingMatch?._strictParams ?? Object.assign(usedParams, strictParams);\n\t\t\tlet paramsError;\n\t\t\tif (!existingMatch) try {\n\t\t\t\textractStrictParams(route, strictParams);\n\t\t\t} catch (err) {\n\t\t\t\tif (isNotFound(err) || isRedirect(err)) paramsError = err;\n\t\t\t\telse paramsError = new PathParamError(err.message, { cause: err });\n\t\t\t\tif (opts?.throwOnError) throw paramsError;\n\t\t\t}\n\t\t\tconst cause = previousMatch ? \"stay\" : \"enter\";\n\t\t\tlet match;\n\t\t\tif (existingMatch) match = {\n\t\t\t\t...existingMatch,\n\t\t\t\tcause,\n\t\t\t\tsearch: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : nullReplaceEqualDeep(existingMatch.search, preMatchSearch),\n\t\t\t\t_strictSearch: strictMatchSearch,\n\t\t\t\tsearchError\n\t\t\t};\n\t\t\telse {\n\t\t\t\tconst status = routeNeedsLoad(route) ? \"pending\" : \"success\";\n\t\t\t\tmatch = {\n\t\t\t\t\tid: matchId,\n\t\t\t\t\tssr: isServer ?? this.isServer ? void 0 : route.options.ssr,\n\t\t\t\t\tindex,\n\t\t\t\t\trouteId: route.id,\n\t\t\t\t\tparams: previousMatch?.params ?? strictParams,\n\t\t\t\t\t_strictParams: strictParams,\n\t\t\t\t\tpathname: interpolatedPath,\n\t\t\t\t\tupdatedAt: Date.now(),\n\t\t\t\t\tsearch: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : preMatchSearch,\n\t\t\t\t\t_strictSearch: strictMatchSearch,\n\t\t\t\t\tsearchError,\n\t\t\t\t\tstatus,\n\t\t\t\t\tisFetching: false,\n\t\t\t\t\terror: void 0,\n\t\t\t\t\tparamsError,\n\t\t\t\t\tcontext: {},\n\t\t\t\t\tabortController: opts?._controller ?? new AbortController(),\n\t\t\t\t\tcause,\n\t\t\t\t\tloaderDeps: previousMatch ? replaceEqualDeep(previousMatch.loaderDeps, loaderDeps) : loaderDeps,\n\t\t\t\t\tinvalid: false,\n\t\t\t\t\tpreload: false,\n\t\t\t\t\tstaticData: route.options.staticData || {},\n\t\t\t\t\tfullPath: route.fullPath\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst _notFound = _notFoundRouteId === route.id;\n\t\t\tif (match._notFound && !_notFound) match.error = void 0;\n\t\t\tmatch._notFound = _notFound;\n\t\t\tmatches[index] = match;\n\t\t}\n\t\tfor (let index = 0; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tmatch.params = match.cause === \"stay\" ? nullReplaceEqualDeep(match.params, strictParams) : strictParams;\n\t\t\tif (opts?._controller) match.context = {};\n\t\t}\n\t\treturn matches;\n\t}\n\t/**\n\t* Lightweight route matching for buildLocation.\n\t* Only computes fullPath, accumulated search, and params - skipping expensive\n\t* operations like AbortController, loaderDeps, and full match objects.\n\t*/\n\tmatchRoutesLightweight(location) {\n\t\tconst lastRouteId = last(this.stores.ids.get());\n\t\tconst lastStateMatch = lastRouteId ? this.stores.byRoute.get(lastRouteId).get() : void 0;\n\t\tconst lastStateMatchId = lastStateMatch?.id;\n\t\tconst cached = this.lightweightCache.get(location);\n\t\tif (cached && cached[0] === lastStateMatchId) return cached[1];\n\t\tconst [matchedRoutes, rawParams] = this.getMatchedRoutes(location.pathname);\n\t\tconst lastRoute = last(matchedRoutes);\n\t\tconst accumulatedSearch = { ...location.search };\n\t\tfor (const route of matchedRoutes) try {\n\t\t\tObject.assign(accumulatedSearch, validateSearch(route.options.validateSearch, accumulatedSearch));\n\t\t} catch {}\n\t\tconst canReuseParams = lastStateMatch && lastStateMatch.routeId === lastRoute.id && lastStateMatch.pathname === location.pathname;\n\t\tlet params;\n\t\tif (canReuseParams) params = lastStateMatch.params;\n\t\telse {\n\t\t\tconst strictParams = rawParams;\n\t\t\tfor (const route of matchedRoutes) try {\n\t\t\t\textractStrictParams(route, strictParams);\n\t\t\t} catch {}\n\t\t\tparams = strictParams;\n\t\t}\n\t\tconst result = [\n\t\t\tmatchedRoutes,\n\t\t\tlastRoute.fullPath,\n\t\t\taccumulatedSearch,\n\t\t\tparams\n\t\t];\n\t\tthis.lightweightCache.set(location, [lastStateMatchId, result]);\n\t\treturn result;\n\t}\n};\nasync function documentNavigation(router, href, { replace, ignoreBlocker }) {\n\tif (isDangerousProtocol(href, router.protocolAllowlist)) {\n\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked navigation to dangerous protocol: ${href}`);\n\t\treturn;\n\t}\n\tif (!ignoreBlocker) {\n\t\tconst blockers = router.history._getBlockers();\n\t\tfor (const blocker of blockers) if (blocker?.blockerFn) {\n\t\t\tif (await blocker.blockerFn({\n\t\t\t\tcurrentLocation: router.history.location,\n\t\t\t\tnextLocation: router.history.location,\n\t\t\t\taction: replace ? \"REPLACE\" : \"PUSH\"\n\t\t\t})) return;\n\t\t}\n\t}\n\trouter.history._ignoreNextBeforeUnload?.(href);\n\tif (replace) window.location.replace(href);\n\telse window.location.href = href;\n}\n/**\n* In non-production environments,\n* augment the RouterCore class with a `_refreshRoute` method\n* dedicated to HMR.\n*/\nif (process.env.NODE_ENV !== \"production\") {\n\tRouterCore.prototype._replaceRouteChunk = replaceRouteChunk;\n\tRouterCore.prototype._refreshRoute = async function() {\n\t\tthis._serverResult = void 0;\n\t\tthis.updateLatestLocation();\n\t\tawait refreshClientRoute(this);\n\t};\n}\n/** Error thrown when search parameter validation fails. */\nvar SearchParamError = class extends Error {};\n/** Error thrown when path parameter parsing/validation fails. */\nvar PathParamError = class extends Error {};\nconst normalize = (str) => str.endsWith(\"/\") && str.length > 1 ? str.slice(0, -1) : str;\nfunction comparePaths(a, b) {\n\treturn normalize(a) === normalize(b);\n}\n/**\n* Lazily import a module function and forward arguments to it, retaining\n* parameter and return types for the selected export key.\n*/\nfunction lazyFn(fn, key) {\n\treturn async (...args) => {\n\t\treturn (await fn())[key || \"default\"](...args);\n\t};\n}\n/** Create an initial RouterState from a parsed location. */\nfunction getInitialRouterState(location) {\n\treturn {\n\t\tisLoading: false,\n\t\tstatus: \"idle\",\n\t\tresolvedLocation: void 0,\n\t\tlocation,\n\t\tmatches: []\n\t};\n}\nfunction validateSearch(validateSearch, input) {\n\tif (validateSearch == null) return {};\n\tif (\"~standard\" in validateSearch) {\n\t\tconst result = validateSearch[\"~standard\"].validate(input);\n\t\tif (result instanceof Promise) throw new SearchParamError(\"Async validation not supported\");\n\t\tif (result.issues) throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), { cause: result });\n\t\treturn result.value;\n\t}\n\tif (\"parse\" in validateSearch) return validateSearch.parse(input);\n\tif (typeof validateSearch === \"function\") return validateSearch(input);\n\treturn {};\n}\nfunction resolveNextParams(spec, base) {\n\tif (spec === void 0 || spec === true) return base;\n\tconst next = Object.create(null);\n\tif (spec === false || spec === null) return next;\n\tif (typeof spec === \"function\") {\n\t\tObject.assign(next, base);\n\t\treturn Object.assign(next, spec(next));\n\t}\n\treturn Object.assign(next, base, spec);\n}\nfunction needsInheritedParams(spec, interpolation) {\n\tif (typeof spec === \"function\") return true;\n\tif (!interpolation || spec === false || spec === null) return false;\n\treturn spec === void 0 || spec === true || interpolation.some((part) => typeof part !== \"string\" && !hasOwn.call(spec, part[1]));\n}\nconst EMPTY_RECORD = Object.freeze({});\nfunction getSearchMiddlewares(destRoutes, includeValidateSearch) {\n\tconst middlewares = [];\n\tfor (let i = 0; i < destRoutes.length; i++) {\n\t\tconst routeOptions = destRoutes[i].options;\n\t\tif (\"search\" in routeOptions) {\n\t\t\tif (routeOptions.search?.middlewares) middlewares.push(...routeOptions.search.middlewares);\n\t\t} else if (routeOptions.preSearchFilters || routeOptions.postSearchFilters) {\n\t\t\tconst legacyMiddleware = ({ search, next }) => {\n\t\t\t\tconst result = next(routeOptions.preSearchFilters ? routeOptions.preSearchFilters.reduce((prev, next) => next(prev), search) : search);\n\t\t\t\treturn routeOptions.postSearchFilters ? routeOptions.postSearchFilters.reduce((prev, next) => next(prev), result) : result;\n\t\t\t};\n\t\t\tmiddlewares.push(legacyMiddleware);\n\t\t}\n\t\tconst routeValidateSearch = routeOptions.validateSearch;\n\t\tif (includeValidateSearch && routeValidateSearch) {\n\t\t\tconst validate = ({ search, next, meta }) => {\n\t\t\t\tconst result = next(search);\n\t\t\t\ttry {\n\t\t\t\t\tconst validated = validateSearch(routeValidateSearch, result);\n\t\t\t\t\tif (meta && validated) {\n\t\t\t\t\t\tfor (const key in validated) if (!(key in result)) (meta.defaulted ||= /* @__PURE__ */ new Map()).set(key, validated[key]);\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...result,\n\t\t\t\t\t\t...validated\n\t\t\t\t\t};\n\t\t\t\t} catch {}\n\t\t\t\treturn result;\n\t\t\t};\n\t\t\tmiddlewares.push(validate);\n\t\t}\n\t}\n\treturn middlewares;\n}\nfunction applySearchMiddleware(middlewares, search, dest) {\n\tconst applyNext = (index, currentSearch, meta) => {\n\t\tif (index >= middlewares.length) {\n\t\t\tif (!dest.search) return {};\n\t\t\tif (dest.search === true) return currentSearch;\n\t\t\tconst result = functionalUpdate(dest.search, currentSearch);\n\t\t\tif (meta) meta.explicit = result;\n\t\t\treturn result;\n\t\t}\n\t\tconst next = (newSearch, collectMeta) => {\n\t\t\tif (collectMeta) {\n\t\t\t\tconst nextMeta = meta || {};\n\t\t\t\treturn {\n\t\t\t\t\tsearch: applyNext(index + 1, newSearch, nextMeta),\n\t\t\t\t\tmeta: nextMeta\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn applyNext(index + 1, newSearch, meta);\n\t\t};\n\t\treturn middlewares[index]({\n\t\t\tsearch: currentSearch,\n\t\t\tnext,\n\t\t\tmeta\n\t\t});\n\t};\n\treturn applyNext(0, search);\n}\nfunction findGlobalNotFoundRouteId(notFoundMode, routes) {\n\tif (notFoundMode !== \"root\") {\n\t\tlet fallback;\n\t\tfor (let i = routes.length - 1; i >= 0; i--) {\n\t\t\tconst route = routes[i];\n\t\t\tif (route.options.notFoundComponent) return route.id;\n\t\t\tfallback ||= route.children && route.id;\n\t\t}\n\t\tif (fallback) return fallback;\n\t}\n\treturn rootRouteId;\n}\nfunction extractStrictParams(route, accumulatedParams) {\n\tconst parseParams = route.options.params?.parse ?? route.options.parseParams;\n\tif (parseParams) Object.assign(accumulatedParams, parseParams(accumulatedParams));\n}\n//#endregion\nexport { PathParamError, RouterCore, SearchParamError, defaultSerializeError, getInitialRouterState, getLocationChangeInfo, lazyFn, lifecycleEnd, runRouteLifecycle, trailingSlashOptions };\n\n//# sourceMappingURL=router.js.map","import { isNotFound } from \"./not-found.js\";\nimport { isRedirect } from \"./redirect.js\";\nimport { hydrateSsrMatchId } from \"./ssr/ssr-match-id.js\";\nimport { getLocationChangeInfo, lifecycleEnd, runRouteLifecycle } from \"./router.js\";\n//#region src/load-client.ts\nfunction replaceRouteChunk(route, lazyFn) {\n\troute.lazyFn = lazyFn ?? route.lazyFn;\n\troute._lazy = void 0;\n}\nfunction preloadComponent(route, type) {\n\treturn route.options[type]?.preload?.();\n}\nfunction loadComponents(route, onPendingReady) {\n\tconst component = preloadComponent(route, \"component\");\n\tlet pending = preloadComponent(route, \"pendingComponent\");\n\tif (onPendingReady) if (pending) pending = pending.then(onPendingReady);\n\telse onPendingReady();\n\tif (component && pending) return Promise.all([component, pending]).then(() => {});\n\treturn component ?? pending;\n}\nfunction loadRouteChunk(route, componentType, onPendingReady) {\n\tconst afterLazy = () => componentType === false ? void 0 : componentType ? preloadComponent(route, componentType) : loadComponents(route, onPendingReady);\n\tconst current = route._lazy;\n\tif (current) return current === true ? afterLazy() : current.then(afterLazy);\n\tif (!route.lazyFn) return afterLazy();\n\tconst promise = route.lazyFn().then((lazyRoute) => {\n\t\tif (process.env.NODE_ENV === \"production\" || route._lazy === promise) {\n\t\t\tconst { id: _id, ...options } = lazyRoute.options;\n\t\t\tObject.assign(route.options, options);\n\t\t\troute._lazy = true;\n\t\t}\n\t}, (error) => {\n\t\tif (process.env.NODE_ENV === \"production\" || route._lazy === promise) route._lazy = void 0;\n\t\tthrow error;\n\t});\n\troute._lazy = promise;\n\treturn promise.then(afterLazy);\n}\n/** Return the structural lane through the first terminal render boundary. */\nfunction _getRenderedMatches(matches) {\n\tconst end = matches.findIndex((match) => match.status !== \"success\" || match._notFound) + 1;\n\treturn end && end < matches.length ? matches.slice(0, end) : matches;\n}\n/** Return the lane whose document assets belong to the current presentation. */\nfunction _getAssetMatches(matches) {\n\tlet end = matches.length;\n\tfor (let index = 0; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tif (match._assetEnd !== void 0) {\n\t\t\tend = Math.min(end, Math.max(index + 1, match._assetEnd));\n\t\t\tcontinue;\n\t\t}\n\t\tif (match.status !== \"success\" || match._notFound) {\n\t\t\tend = index + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn end < matches.length ? matches.slice(0, end) : matches;\n}\nconst SUCCESS = 0;\nconst ERROR = 1;\nconst NOT_FOUND = 2;\nconst REDIRECTED = 3;\nconst CANCELED_OUTCOME = [4];\nfunction isControl(result) {\n\treturn typeof result[0] === \"number\";\n}\nfunction waitFor(value, signal) {\n\tif (signal.aborted) return Promise.race([Promise.reject(signal), value]);\n\treturn new Promise((resolve, reject) => {\n\t\tconst abort = () => reject(signal);\n\t\tsignal.addEventListener(\"abort\", abort, { once: true });\n\t\tPromise.resolve(value).then(resolve, reject).then(() => signal.removeEventListener(\"abort\", abort));\n\t});\n}\nfunction getRoute(router, match) {\n\treturn router.routesById[match.routeId];\n}\nfunction normalize(value, rejected, routeId) {\n\tif (isRedirect(value)) return [REDIRECTED, value];\n\tif (isNotFound(value)) {\n\t\tvalue.routeId ||= routeId;\n\t\treturn [NOT_FOUND, value];\n\t}\n\tif (!rejected) return [SUCCESS, value];\n\tif (typeof value?.then === \"function\") value = new Error(\"A Promise was thrown\", { cause: value });\n\treturn [ERROR, value];\n}\nfunction normalizeError(route, cause) {\n\tlet outcome = normalize(cause, true, route.id);\n\tif (outcome[0] !== ERROR) return outcome;\n\ttry {\n\t\troute.options.onError?.(outcome[1]);\n\t} catch (onErrorCause) {\n\t\toutcome = normalize(onErrorCause, true, route.id);\n\t}\n\treturn outcome;\n}\nfunction normalizeLaneError(router, lane, route, cause, options) {\n\tif (options[0].signal.aborted) return CANCELED_OUTCOME;\n\treturn materializeRedirect(router, lane, route, normalizeError(route, cause), options);\n}\nasync function contextualize(router, lane, options, end, planSuccessfulLane, retainedEnd) {\n\tconst [location, matches] = lane;\n\tconst signal = options[0].signal;\n\tconst preload = !!options[3];\n\tfor (let index = options[6] ?? 0; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tconst route = getRoute(router, match);\n\t\tmatch.abortController = options[0];\n\t\tconst parentContext = matches[index - 1]?.context ?? router.options.context ?? {};\n\t\tconst common = {\n\t\t\tparams: match.params,\n\t\t\tlocation,\n\t\t\tnavigate: (opts) => router.navigate({\n\t\t\t\t...opts,\n\t\t\t\t_fromLocation: location\n\t\t\t}),\n\t\t\tbuildLocation: router.buildLocation,\n\t\t\tcause: preload ? \"preload\" : match.cause,\n\t\t\tabortController: options[0],\n\t\t\tpreload,\n\t\t\tmatches,\n\t\t\trouteId: route.id\n\t\t};\n\t\ttry {\n\t\t\tconst routeContext = match._ctx ||= route.options.context ? route.options.context({\n\t\t\t\t...common,\n\t\t\t\tdeps: match.loaderDeps,\n\t\t\t\tcontext: parentContext\n\t\t\t}) || {} : void 0;\n\t\t\tmatch.context = {\n\t\t\t\t...parentContext,\n\t\t\t\t...routeContext\n\t\t\t};\n\t\t} catch (cause) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t}\n\t\tif (signal.aborted) return [index, CANCELED_OUTCOME];\n\t\tconst validationError = match.paramsError ?? match.searchError;\n\t\tif (validationError !== void 0) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, validationError, options)];\n\t\t}\n\t\tconst beforeLoad = route.options.beforeLoad;\n\t\tif (!beforeLoad) continue;\n\t\tconst previousStatus = match.status;\n\t\tif (index >= retainedEnd) {\n\t\t\tmatch.status = \"pending\";\n\t\t\toptions[7]?.();\n\t\t}\n\t\ttry {\n\t\t\tsetFetching(router, match, \"beforeLoad\", options[0]);\n\t\t\tconst value = beforeLoad({\n\t\t\t\t...common,\n\t\t\t\tsearch: match.search,\n\t\t\t\tcontext: match.context,\n\t\t\t\t...router.options.additionalContext\n\t\t\t});\n\t\t\tconst result = await (typeof value?.then === \"function\" ? waitFor(value, signal) : value);\n\t\t\tif (signal.aborted) return [index, CANCELED_OUTCOME];\n\t\t\tconst outcome = materializeRedirect(router, lane, route, normalize(result, false, route.id), options);\n\t\t\tif (outcome[0] !== SUCCESS) {\n\t\t\t\treleaseFlight(router, match);\n\t\t\t\treturn [index, outcome];\n\t\t\t}\n\t\t\tmatch.context = {\n\t\t\t\t...match.context,\n\t\t\t\t...result\n\t\t\t};\n\t\t} catch (cause) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t} finally {\n\t\t\tmatch.status = previousStatus;\n\t\t\tsetFetching(router, match, false, options[0]);\n\t\t}\n\t}\n\tplanSuccessfulLane();\n}\nfunction releaseOwnedFlight(router, match, flight) {\n\tif (!flight || --flight[2]) return;\n\tif (router._flights?.get(match.id) === flight) {\n\t\tconst current = router._tx;\n\t\tif (current && !current[0].signal.aborted && !current[3].includes(match) && current[3].some((candidate) => candidate.id === match.id) && current[3].some((candidate) => candidate.isFetching === \"beforeLoad\")) return;\n\t\trouter._flights.delete(match.id);\n\t}\n\treturn flight[1];\n}\nfunction releaseFlight(router, match) {\n\tconst flight = match._flight;\n\tmatch._flight = void 0;\n\treleaseOwnedFlight(router, match, flight)?.abort();\n}\n/**\n* Not passing in a `next` ownership recipient\n* is equivalent to discarding the match resources\n*/\nfunction transferMatchResources(router, previous, next, deferSameIdFlight) {\n\tconst abort = [];\n\tfor (const match of previous) if (!next?.includes(match)) {\n\t\tconst flight = match._flight;\n\t\tmatch._flight = void 0;\n\t\tif (deferSameIdFlight && flight?.[2] === 1 && router._flights?.get(match.id) === flight && next?.some((candidate) => candidate.id === match.id)) flight[2] = 0;\n\t\telse {\n\t\t\tconst controller = releaseOwnedFlight(router, match, flight);\n\t\t\tif (controller) abort.push(controller);\n\t\t}\n\t}\n\tfor (const controller of abort) controller.abort();\n}\nfunction acquireMatchResources(matches) {\n\tfor (const match of matches) {\n\t\tconst flight = match._flight;\n\t\tif (flight) flight[2]++;\n\t}\n}\nfunction setFetching(router, match, value, owner) {\n\tmatch.isFetching = value;\n\tif (owner && router._tx?.[0] !== owner) return;\n\tconst store = router.stores.byRoute.get(match.routeId);\n\tconst presented = store?.get();\n\tif (presented?.id === match.id) store.set({\n\t\t...presented,\n\t\tisFetching: value\n\t});\n}\nfunction getLoaderContext(router, lane, match, route, controller, parentMatchPromise, preload) {\n\tconst location = lane[0];\n\treturn {\n\t\tparams: match.params,\n\t\tlocation,\n\t\tnavigate: (opts) => router.navigate({\n\t\t\t...opts,\n\t\t\t_fromLocation: location\n\t\t}),\n\t\tcause: preload ? \"preload\" : match.cause,\n\t\tabortController: controller,\n\t\tpreload,\n\t\tdeps: match.loaderDeps,\n\t\tparentMatchPromise,\n\t\tcontext: match.context,\n\t\troute,\n\t\t...router.options.additionalContext\n\t};\n}\nasync function loadResource(router, lane, match, route, loader, parentMatchPromise, options) {\n\tconst owner = options[0];\n\tconst signal = owner.signal;\n\tif (signal.aborted) return CANCELED_OUTCOME;\n\tif (!loader) return [SUCCESS, void 0];\n\tlet flight = match._flight;\n\tsetFetching(router, match, \"loader\", owner);\n\ttry {\n\t\tif (!flight) {\n\t\t\tconst controller = new AbortController();\n\t\t\tflight = [\n\t\t\t\tPromise.resolve().then(() => loader(getLoaderContext(router, lane, match, route, controller, parentMatchPromise, !!options[3]))).then((value) => normalize(value, false, route.id), (cause) => normalize(cause, true, route.id)).then((result) => {\n\t\t\t\t\tif (result[0] !== SUCCESS && router._flights?.get(match.id) === flight) {\n\t\t\t\t\t\trouter._flights.delete(match.id);\n\t\t\t\t\t\tif (!flight[2]) controller.abort();\n\t\t\t\t\t}\n\t\t\t\t\treturn result[0] === ERROR && flight[2] ? normalizeError(route, result[1]) : result;\n\t\t\t\t}),\n\t\t\t\tcontroller,\n\t\t\t\t1\n\t\t\t];\n\t\t\t(router._flights ??= /* @__PURE__ */ new Map()).set(match.id, flight);\n\t\t}\n\t\tmatch._flight = flight;\n\t\tmatch.abortController = flight[1];\n\t\treturn materializeRedirect(router, lane, route, await waitFor(flight[0], signal), options);\n\t} catch (cause) {\n\t\tif (cause !== signal || !signal.aborted) throw cause;\n\t\treleaseFlight(router, match);\n\t\treturn CANCELED_OUTCOME;\n\t} finally {\n\t\tsetFetching(router, match, false, owner);\n\t}\n}\nfunction settleInto(match, result, preload) {\n\tif (result[0] === REDIRECTED) return;\n\tmatch.status = \"success\";\n\tmatch.error = void 0;\n\tif (result[0] === SUCCESS) {\n\t\tmatch.loaderData = result[1];\n\t\tmatch.invalid = false;\n\t\tmatch.updatedAt = Date.now();\n\t\tmatch.preload = preload;\n\t} else match.invalid = true;\n}\nfunction cacheLoaderMatch(router, match, planned) {\n\tconst current = router._cache.get(match.id);\n\tif (current !== planned || router._committed.some((candidate) => candidate.id === match.id && candidate._flight === match._flight)) return;\n\tconst cached = {\n\t\t...match,\n\t\t_notFound: void 0,\n\t\tcontext: {}\n\t};\n\tif (cached._flight) cached._flight[2]++;\n\trouter._cache.set(match.id, cached);\n\tif (current) releaseFlight(router, current);\n}\nfunction getParentSnapshot(match, outcome) {\n\tif (outcome[0] === ERROR || outcome[0] === NOT_FOUND) return {\n\t\t...match,\n\t\tstatus: outcome[0] === ERROR ? \"error\" : \"notFound\",\n\t\terror: outcome[1],\n\t\t_flight: void 0\n\t};\n\treturn match;\n}\nfunction createLoaderTask(router, lane, index, tasks, semanticParent, options, retainedEnd) {\n\tconst match = lane[1][index];\n\tconst route = getRoute(router, match);\n\tconst preload = !!options[3];\n\tconst plannedCacheMatch = router._cache.get(match.id);\n\tlet configured;\n\tlet reload = false;\n\tlet reloadFailure;\n\ttry {\n\t\tif (match.status === \"success\") {\n\t\t\tconfigured = route.options.shouldReload;\n\t\t\tif (typeof configured === \"function\") configured = configured(getLoaderContext(router, lane, match, route, options[0], semanticParent, preload));\n\t\t\tif (options[0].signal.aborted) reloadFailure = CANCELED_OUTCOME;\n\t\t}\n\t\tif (!reloadFailure) if (match.status !== \"success\") reload = true;\n\t\telse {\n\t\t\tconst staleAge = preload || match.preload ? route.options.preloadStaleTime ?? router.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? router.options.defaultStaleTime ?? 0;\n\t\t\treload = !!(match.invalid || configured || configured === void 0 && Date.now() - match.updatedAt >= staleAge && (options[5] || match.cause === \"enter\" || options[2].some((candidate) => candidate.routeId === match.routeId && candidate.id !== match.id)));\n\t\t}\n\t} catch (cause) {\n\t\tmatch.invalid = true;\n\t\treleaseFlight(router, match);\n\t\treloadFailure = normalizeLaneError(router, lane, route, cause, options);\n\t}\n\tconst routeLoader = route.options.loader;\n\tconst isLoaderFn = typeof routeLoader === \"function\";\n\tconst loader = isLoaderFn ? routeLoader : routeLoader?.handler;\n\tconst preloadable = !preload || route.options.preload !== false;\n\tlet donor = preloadable && routeLoader && !(process.env.NODE_ENV !== \"production\" && router._tx?.[6]) ? router._flights?.get(match.id) : void 0;\n\tif (donor === match._flight || reloadFailure) donor = void 0;\n\telse if (donor && !reload && !preload && configured === void 0) reload = true;\n\telse if (!reload) donor = void 0;\n\tconst background = !!(routeLoader && reload && match.status === \"success\" && !preload && !options[4] && ((isLoaderFn ? void 0 : routeLoader.staleReloadMode) ?? router.options.defaultStaleReloadMode) !== \"blocking\");\n\tconst loaded = reload && preloadable;\n\tconst blocking = loaded && !background && (match.status !== \"success\" || !!routeLoader);\n\tconst onReady = index >= retainedEnd ? options[7] : void 0;\n\tconst onLazyReady = route.lazyFn && route._lazy !== true ? onReady : void 0;\n\tif (loaded && !routeLoader) {\n\t\tmatch.invalid = false;\n\t\tmatch.updatedAt = Date.now();\n\t}\n\tif (donor) donor[2]++;\n\tif (blocking) {\n\t\tconst acceptedFlight = match._flight;\n\t\tmatch._flight = donor;\n\t\treleaseOwnedFlight(router, match, acceptedFlight)?.abort();\n\t\tif (index >= retainedEnd) match.status = \"pending\";\n\t\tonReady?.();\n\t}\n\tif (!loaded) match.isFetching = false;\n\tconst outcome = !reloadFailure && blocking ? loadResource(router, lane, match, route, loader, semanticParent, options).then((result) => {\n\t\tsettleInto(match, result, preload);\n\t\tif (result[0] === SUCCESS) {\n\t\t\tif (routeLoader && !options[0].signal.aborted) cacheLoaderMatch(router, match, plannedCacheMatch);\n\t\t\tif (index >= retainedEnd) match.status = \"pending\";\n\t\t}\n\t\treturn result;\n\t}) : Promise.resolve(reloadFailure ?? [SUCCESS, match.loaderData]);\n\tconst chunkFailure = (async () => {\n\t\ttry {\n\t\t\tconst chunk = loadRouteChunk(route, void 0, onLazyReady);\n\t\t\tif (chunk) await waitFor(chunk, options[0].signal);\n\t\t} catch (cause) {\n\t\t\tif (!lane[1].some((candidate, candidateIndex) => candidateIndex <= index && (candidate.status === \"error\" || candidate.status === \"notFound\" || candidate._notFound))) return [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t}\n\t\tconst result = await outcome;\n\t\tif (blocking && result[0] === SUCCESS && match.status === \"pending\" && !options[0].signal.aborted) {\n\t\t\tmatch.status = \"success\";\n\t\t\tonReady?.();\n\t\t}\n\t})();\n\ttasks.push([\n\t\tindex,\n\t\toutcome,\n\t\tchunkFailure\n\t]);\n\tif (!background) return outcome.then((result) => getParentSnapshot(match, result));\n\tconst candidate = {\n\t\t...match,\n\t\tstatus: \"pending\",\n\t\tpreload: false,\n\t\t_flight: donor\n\t};\n\tmatch.invalid = false;\n\tmatch.isFetching = \"loader\";\n\tconst backgroundOutcome = loadResource(router, lane, candidate, route, loader, semanticParent, options).then((result) => {\n\t\tmatch.isFetching = false;\n\t\tsettleInto(candidate, result, false);\n\t\treturn result;\n\t});\n\t(lane[2] ??= []).push([\n\t\tindex,\n\t\tbackgroundOutcome,\n\t\tchunkFailure,\n\t\tcandidate\n\t]);\n\treturn backgroundOutcome.then((result) => getParentSnapshot(candidate, result));\n}\nasync function getNotFoundBoundary(router, matches, indexed, signal, fallback = 0) {\n\tconst cause = indexed?.[1][1];\n\tlet index = cause?.routeId ? matches.findIndex((match) => match.routeId === cause.routeId) : indexed?.[0] ?? matches.length - 1;\n\tif (index < 0) index = 0;\n\tfor (let i = index; i >= 0; i--) {\n\t\tconst route = getRoute(router, matches[i]);\n\t\ttry {\n\t\t\tconst loading = loadRouteChunk(route, false);\n\t\t\tif (loading) await waitFor(loading, signal);\n\t\t} catch (cause) {\n\t\t\tif (cause === signal && signal.aborted) throw cause;\n\t\t}\n\t\tif (route.options.notFoundComponent) return i;\n\t}\n\treturn cause?.routeId ? index : fallback;\n}\nfunction discardBackground(router, lane) {\n\tif (lane[2]) {\n\t\ttransferMatchResources(router, lane[2].map((task) => task[3]));\n\t\tlane[2] = void 0;\n\t}\n}\nasync function settleTasks(tasks, serialFailure, redirectTasks, gate) {\n\tlet loaderFailure;\n\ttry {\n\t\tawait Promise.all(tasks.map((task) => task[1].then(async (outcome) => {\n\t\t\tconst taskIndex = task[0];\n\t\t\tif (gate && taskIndex >= await gate) return;\n\t\t\tif (outcome[0] >= REDIRECTED) throw [taskIndex, outcome];\n\t\t\tif (!loaderFailure && outcome[0] !== SUCCESS) {\n\t\t\t\tloaderFailure = [taskIndex, outcome];\n\t\t\t\tawait Promise.all((redirectTasks ?? []).map((nextTask) => {\n\t\t\t\t\tif (nextTask[0] <= taskIndex) return;\n\t\t\t\t\treturn nextTask[1].then((nextOutcome) => {\n\t\t\t\t\t\tif (nextOutcome[0] === REDIRECTED) throw [nextTask[0], nextOutcome];\n\t\t\t\t\t});\n\t\t\t\t}));\n\t\t\t}\n\t\t})));\n\t} catch (cause) {\n\t\treturn cause;\n\t}\n\treturn serialFailure ?? loaderFailure;\n}\nfunction materializeRedirect(router, lane, route, outcome, options, failed) {\n\twhile (outcome[0] === REDIRECTED) {\n\t\tconst redirect = outcome[1];\n\t\tconst redirectOptions = redirect.options;\n\t\ttry {\n\t\t\tif (redirectOptions.href || redirect.headers.has(\"Location\")) {\n\t\t\t\trouter.resolveRedirect(redirect);\n\t\t\t\tif (redirectOptions.reloadDocument) return outcome;\n\t\t\t}\n\t\t\tif (redirectOptions.reloadDocument ? options[3] : options[1] >= 20) return outcome;\n\t\t\tconst location = router.buildLocation({\n\t\t\t\t...redirectOptions,\n\t\t\t\t_fromLocation: lane[0],\n\t\t\t\t_includeValidateSearch: true\n\t\t\t});\n\t\t\tconst publicLocation = location.maskedLocation ?? location;\n\t\t\tif (publicLocation.external) {\n\t\t\t\tconst resolved = redirect.clone();\n\t\t\t\tresolved.options = { ...redirectOptions };\n\t\t\t\tresolved.headers.set(\"Location\", publicLocation.publicHref);\n\t\t\t\trouter.resolveRedirect(resolved);\n\t\t\t\treturn options[3] ? [REDIRECTED, resolved] : [\n\t\t\t\t\tREDIRECTED,\n\t\t\t\t\tresolved,\n\t\t\t\t\tpublicLocation\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn [\n\t\t\t\tREDIRECTED,\n\t\t\t\tredirect,\n\t\t\t\tlocation\n\t\t\t];\n\t\t} catch (cause) {\n\t\t\toutcome = failed ? [ERROR, cause] : normalizeError(route, cause);\n\t\t\tfailed = true;\n\t\t}\n\t}\n\treturn outcome;\n}\nasync function reduceLane(router, lane, tasks, controller, settlement, onReady) {\n\tconst matches = lane[1];\n\tlet failure = await settlement;\n\tlet redirectLimitExceeded = false;\n\tconst plannedBoundary = matches.findIndex((match) => match._notFound);\n\tconst boundaryOf = (found) => found[1][0] === NOT_FOUND ? getNotFoundBoundary(router, matches, found, controller.signal) : found[0];\n\tlet readinessEnd = plannedBoundary < 0 ? matches.length : plannedBoundary;\n\tif ((failure?.[1][0] ?? 0) >= REDIRECTED) readinessEnd = 0;\n\telse if (failure) {\n\t\treadinessEnd = failure[2] ??= await boundaryOf(failure);\n\t\tfor (const task of tasks) {\n\t\t\tif (task[0] >= readinessEnd) break;\n\t\t\tconst outcome = await task[1];\n\t\t\tif (outcome[0] !== SUCCESS && outcome[0] < REDIRECTED && !(\"loaderData\" in matches[task[0]])) {\n\t\t\t\tfailure = [task[0], outcome];\n\t\t\t\treadinessEnd = failure[2] = await boundaryOf(failure);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfor (const task of tasks) {\n\t\tif (task[0] >= readinessEnd) break;\n\t\tconst chunkFailure = await task[2];\n\t\tif (!chunkFailure) continue;\n\t\tfailure = chunkFailure;\n\t\tbreak;\n\t}\n\tif ((failure?.[1][0] ?? 0) >= REDIRECTED) {\n\t\tconst outcome = failure[1];\n\t\tif (outcome[0] !== REDIRECTED || outcome[1].options.reloadDocument || outcome[2]) {\n\t\t\tdiscardBackground(router, lane);\n\t\t\treturn outcome;\n\t\t}\n\t\tredirectLimitExceeded = true;\n\t\tfailure = [0, [ERROR, /* @__PURE__ */ new Error(\"Too many redirects\")]];\n\t}\n\tconst boundary = failure ? failure[2] ?? await boundaryOf(failure) : plannedBoundary;\n\tif (boundary >= 0) {\n\t\tconst outcome = failure?.[1];\n\t\tconst kind = outcome?.[0];\n\t\tconst match = matches[boundary];\n\t\tconst cause = outcome?.[1];\n\t\tconst install = () => {\n\t\t\tif (outcome) {\n\t\t\t\tmatch._notFound = void 0;\n\t\t\t\tif (kind === ERROR) match.status = \"error\";\n\t\t\t\telse {\n\t\t\t\t\tcause.routeId = match.routeId;\n\t\t\t\t\tif (match.routeId === router.routeTree.id) {\n\t\t\t\t\t\tmatch.status = \"success\";\n\t\t\t\t\t\tmatch._notFound = true;\n\t\t\t\t\t} else match.status = \"notFound\";\n\t\t\t\t}\n\t\t\t\tmatch.error = cause;\n\t\t\t\tmatch.isFetching = false;\n\t\t\t}\n\t\t};\n\t\tinstall();\n\t\tif (!outcome) onReady?.();\n\t\tconst route = getRoute(router, match);\n\t\ttry {\n\t\t\tawait waitFor(outcome ? Promise.resolve().then(() => loadRouteChunk(route, kind === ERROR ? \"errorComponent\" : \"notFoundComponent\")) : Promise.all([loadRouteChunk(route), loadRouteChunk(route, \"notFoundComponent\")]), controller.signal);\n\t\t} catch (cause) {\n\t\t\tif (cause === controller.signal && controller.signal.aborted) {\n\t\t\t\tdiscardBackground(router, lane);\n\t\t\t\treturn CANCELED_OUTCOME;\n\t\t\t}\n\t\t}\n\t\tif (!outcome) match.status = \"success\";\n\t\telse if (redirectLimitExceeded) {\n\t\t\tcontroller.abort();\n\t\t\tawait Promise.all([\n\t\t\t\t...tasks.map((task) => task[1]),\n\t\t\t\t...tasks.map((task) => task[2]),\n\t\t\t\t...(lane[2] ?? []).map((task) => task[1])\n\t\t\t]);\n\t\t\tdiscardBackground(router, lane);\n\t\t\ttransferMatchResources(router, matches);\n\t\t\tinstall();\n\t\t}\n\t}\n\treturn lane;\n}\nasync function projectLane(router, lane, signal, start = 0, end = lane[1].length) {\n\tconst matches = lane[1];\n\tfor (let index = start; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tconst routeOptions = getRoute(router, match).options;\n\t\tif (routeOptions.head || routeOptions.scripts) try {\n\t\t\tconst context = {\n\t\t\t\tssr: router.options.ssr,\n\t\t\t\tmatches,\n\t\t\t\tmatch,\n\t\t\t\tparams: match.params,\n\t\t\t\tloaderData: match.loaderData\n\t\t\t};\n\t\t\tconst [head, scripts] = await waitFor(Promise.all([routeOptions.head?.(context), routeOptions.scripts?.(context)]), signal);\n\t\t\tmatch.meta = head?.meta;\n\t\t\tmatch.links = head?.links;\n\t\t\tmatch.headScripts = head?.scripts;\n\t\t\tmatch.styles = head?.styles;\n\t\t\tmatch.scripts = scripts;\n\t\t} catch (cause) {\n\t\t\tif (cause === signal && signal.aborted) break;\n\t\t\tconsole.error(cause);\n\t\t}\n\t\tif (match.status !== \"success\" || match._notFound) break;\n\t}\n\treturn lane;\n}\nasync function executeClientLane(router, location, matches, options) {\n\tconst matched = [location, matches];\n\tconst signal = options[0].signal;\n\tlet reduced;\n\ttry {\n\t\tconst presented = router.stores.matches.get();\n\t\tlet plannedBoundary = matches.findIndex((match) => match._notFound);\n\t\tif (router.options.notFoundMode !== \"root\" && plannedBoundary >= 0) {\n\t\t\tconst boundary = await getNotFoundBoundary(router, matches, void 0, signal, plannedBoundary);\n\t\t\tmatches[plannedBoundary]._notFound = void 0;\n\t\t\tmatches[boundary]._notFound = true;\n\t\t\tplannedBoundary = boundary;\n\t\t}\n\t\tlet end = plannedBoundary < 0 ? matches.length : plannedBoundary + 1;\n\t\tlet retainedEnd = 0;\n\t\twhile (retainedEnd < end && retainedEnd !== plannedBoundary) {\n\t\t\tconst match = matches[retainedEnd];\n\t\t\tconst committed = options[2][retainedEnd];\n\t\t\tconst visible = presented[retainedEnd];\n\t\t\tif (committed?.id !== match.id || committed.status !== \"success\" || match.preload || visible?.id !== match.id || visible.status !== \"success\") break;\n\t\t\tretainedEnd++;\n\t\t\tif (committed._notFound || visible._notFound) break;\n\t\t}\n\t\tconst tasks = [];\n\t\tconst start = options[6] ?? 0;\n\t\tlet semanticParent = start ? Promise.resolve(matches[start - 1]) : void 0;\n\t\tconst planSuccessfulLane = () => {\n\t\t\tfor (let index = start; index < end; index++) {\n\t\t\t\tif (signal.aborted) break;\n\t\t\t\tsemanticParent = createLoaderTask(router, matched, index, tasks, semanticParent, options, retainedEnd);\n\t\t\t}\n\t\t};\n\t\tconst failure = await contextualize(router, matched, options, end, planSuccessfulLane, retainedEnd);\n\t\tif (failure) {\n\t\t\toptions[4] = true;\n\t\t\tend = failure[0];\n\t\t\tif (failure[1][0] === NOT_FOUND) {\n\t\t\t\tconst boundary = await getNotFoundBoundary(router, matches, failure, signal);\n\t\t\t\tfailure[2] = boundary;\n\t\t\t\tend = Math.min(end, boundary + 1);\n\t\t\t} else if (failure[1][0] >= REDIRECTED) end = 0;\n\t\t\tplanSuccessfulLane();\n\t\t}\n\t\tif (!signal.aborted && !options[3]) {\n\t\t\tconst abort = [];\n\t\t\tfor (const [id, flight] of router._flights ?? []) if (!flight[2]) {\n\t\t\t\trouter._flights.delete(id);\n\t\t\t\tabort.push(flight[1]);\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t}\n\t\tconst reduction = reduceLane(router, matched, tasks, options[0], settleTasks(tasks, failure, matched[2]), options[7]);\n\t\tif (matched[2]?.length) matched[3] = settleTasks(matched[2], void 0, void 0, reduction.then((foreground) => isControl(foreground) ? 0 : _getRenderedMatches(matches).length, () => 0));\n\t\treduced = await reduction;\n\t} catch (cause) {\n\t\tdiscardBackground(router, matched);\n\t\tif (cause === signal && signal.aborted) return CANCELED_OUTCOME;\n\t\tthrow cause;\n\t}\n\tif (isControl(reduced)) return reduced;\n\treturn projectLane(router, reduced, signal, options[6] === matches.length ? options[6] : 0);\n}\n/**\n* Waits for `pendingMs`, then presents the complete lane. Rendering applies the\n* selected boundary cutoff while retaining every match's structural state.\n* A replacement load for the same match keeps the timer; choosing a different\n* match resets it. `pendingMinMs` starts after the fallback renders.\n*/\nfunction offerPending(router, tx) {\n\tif (router._tx !== tx) return;\n\tconst matches = tx[3];\n\tconst presented = router.stores.matches.get();\n\tlet session = router._pending;\n\tfor (let index = 0; index < matches.length; index++) {\n\t\tconst match = matches[index];\n\t\tconst success = match.status === \"success\" && !match._notFound;\n\t\tconst presentedPending = presented[index]?.id === match.id && presented[index]?.status === \"pending\";\n\t\tif (success && !presentedPending) continue;\n\t\tconst route = getRoute(router, match);\n\t\tconst delay = success || match.invalid ? 0 : route.options.pendingMs ?? router.options.defaultPendingMs;\n\t\tconst component = route.options.pendingComponent ?? router.options.defaultPendingComponent;\n\t\tif (!component || typeof delay !== \"number\" || delay === Infinity) {\n\t\t\tif (session) {\n\t\t\t\tsession[0] = tx;\n\t\t\t\tsession[2] = 0;\n\t\t\t\tsession[4] = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst min = route.options.pendingMinMs ?? router.options.defaultPendingMinMs ?? 0;\n\t\tlet tookOver = false;\n\t\tif (session?.[1] === match.id) {\n\t\t\ttookOver = session[0] !== tx;\n\t\t\tsession[0] = tx;\n\t\t} else {\n\t\t\tclearTimeout(session?.[3]);\n\t\t\trouter._pending = session = void 0;\n\t\t}\n\t\tif (!session) router._pending = session = [\n\t\t\ttx,\n\t\t\tmatch.id,\n\t\t\tpresentedPending ? Date.now() + min : tx[4] + delay,\n\t\t\tvoid 0,\n\t\t\tpresentedPending || void 0,\n\t\t\tcomponent\n\t\t];\n\t\tif (session[4] && !tookOver && session[5] === component) return;\n\t\tsession[5] = component;\n\t\tif (!session[4]) {\n\t\t\tclearTimeout(session[3]);\n\t\t\tconst remaining = session[2] - Date.now();\n\t\t\tif (remaining > 0) {\n\t\t\t\tsession[3] = setTimeout(() => offerPending(router, tx), remaining);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsession[2] = 0;\n\t\t}\n\t\tconst offered = matches.map((match) => ({\n\t\t\t...match,\n\t\t\t_flight: void 0\n\t\t}));\n\t\toffered[index].status = \"pending\";\n\t\tconst ack = session[4] = router.startTransition(() => router.stores.setMatches(offered), offered).then((rendered) => {\n\t\t\tif (rendered && router._pending === session && session[4] === ack && !session[2]) session[2] = Date.now() + min;\n\t\t\treturn rendered;\n\t\t});\n\t\treturn;\n\t}\n}\n/**\n* Cancels pending UI timing unless the current successor can take over the\n* same boundary that remains painted.\n*/\nfunction finishPending(router, tx) {\n\tconst session = router._pending;\n\tif (router._tx === tx || !router._tx?.[3].some((match) => match.id === session?.[1])) {\n\t\tclearTimeout(session?.[3]);\n\t\trouter._pending = void 0;\n\t}\n}\nasync function awaitPendingMinimum(router, tx) {\n\tconst session = router._pending;\n\tif (!session) return;\n\tclearTimeout(session[3]);\n\tconst remaining = session[2] - Date.now();\n\tif (!session[4] || remaining <= 0 || !_getRenderedMatches(tx[3]).some((match) => match.id === session[1])) return;\n\tlet timer;\n\ttry {\n\t\tawait waitFor(new Promise((resolve) => {\n\t\t\ttimer = setTimeout(resolve, remaining);\n\t\t}), tx[0].signal);\n\t} catch {}\n\tclearTimeout(timer);\n}\nfunction publishMatches(router, matches) {\n\trouter._committed = matches;\n\trouter.stores.setMatches(matches);\n}\nfunction commitMatches(router, tx, matches, resolvedPrefix) {\n\tconst previous = router._committed;\n\tconst previousEnd = router._lifecycleEnd;\n\tconst previousCached = router._cache;\n\tfor (const match of matches) {\n\t\tmatch.preload = false;\n\t\tif (resolvedPrefix) match._assetEnd = void 0;\n\t}\n\tconst cut = _getRenderedMatches(matches).length;\n\tconst cached = /* @__PURE__ */ new Map();\n\tif (process.env.NODE_ENV === \"production\" || !tx[6]) {\n\t\tconst now = Date.now();\n\t\tconst superseded = /* @__PURE__ */ new Set();\n\t\tfor (let index = 0; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tif (index < cut || match.status === \"success\") superseded.add(match.id);\n\t\t}\n\t\tfor (const match of [...previous, ...previousCached.values()]) {\n\t\t\tif (match.status !== \"success\" || superseded.has(match.id)) continue;\n\t\t\tconst route = getRoute(router, match);\n\t\t\tif (!route.options.loader || now - match.updatedAt >= (match.preload ? route.options.preloadGcTime ?? router.options.defaultPreloadGcTime ?? 3e5 : route.options.gcTime ?? router.options.defaultGcTime ?? 3e5)) continue;\n\t\t\tcached.set(match.id, previousCached.get(match.id) === match ? match : {\n\t\t\t\t...match,\n\t\t\t\t_flight: void 0,\n\t\t\t\tisFetching: false,\n\t\t\t\tcontext: {}\n\t\t\t});\n\t\t}\n\t}\n\ttx[3] = [];\n\trouter._cache = cached;\n\tconst nextEnd = router._lifecycleEnd = lifecycleEnd(matches);\n\tpublishMatches(router, matches);\n\ttransferMatchResources(router, [...previousCached.values(), ...previous].filter((match) => match._flight && cached.get(match.id) !== match), matches);\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst handoff = tx[6]?.[0];\n\t\tif (handoff && router._handoff === handoff) handoff[1]();\n\t}\n\trunRouteLifecycle(router, previous, matches, previousEnd, nextEnd, tx);\n}\n/**\n* Resolve once the router has settled on a transaction other than `owner`.\n* Each transaction's completion follows its current successor, so all waiters\n* share the same chain instead of polling every successor independently.\n*/\nasync function awaitCurrent(router, owner) {\n\tlet current = router._tx;\n\twhile (current && current !== owner) {\n\t\towner = current;\n\t\tawait current[5];\n\t\tcurrent = router._tx;\n\t}\n}\nfunction followRedirect(router, tx, outcome) {\n\tconst options = outcome[1].options;\n\tconst location = outcome[2];\n\tif (!location) return router.navigate({\n\t\t...options,\n\t\treplace: true,\n\t\tignoreBlocker: true\n\t});\n\tif (options.reloadDocument) return router.navigate({\n\t\thref: (location.maskedLocation ?? location).publicHref,\n\t\treloadDocument: true,\n\t\treplace: true,\n\t\tignoreBlocker: true\n\t});\n\tlocation._redirects = tx[1] + 1;\n\trouter._pendingLocation = location;\n\tconst committed = router.commitLocation({\n\t\t...location,\n\t\tviewTransition: options.viewTransition,\n\t\treplace: true,\n\t\tresetScroll: options.resetScroll,\n\t\thashScrollIntoView: options.hashScrollIntoView,\n\t\tignoreBlocker: true\n\t});\n\tqueueMicrotask(() => {\n\t\tif (router._pendingLocation === location) router._pendingLocation = void 0;\n\t});\n\treturn committed;\n}\nasync function runBackground(router, tx, base, tasks, settlement) {\n\tconst next = base.map((match) => ({ ...match }));\n\tacquireMatchResources(next);\n\tfor (const task of tasks) {\n\t\treleaseFlight(router, next[task[0]]);\n\t\tnext[task[0]] = task[3];\n\t}\n\tconst lane = [tx[2], next];\n\tlet reduced;\n\ttry {\n\t\treduced = await reduceLane(router, lane, tasks, tx[0], settlement);\n\t} catch (cause) {\n\t\ttransferMatchResources(router, next);\n\t\tthrow cause;\n\t}\n\tif (isControl(reduced)) {\n\t\ttransferMatchResources(router, next);\n\t\tif (reduced[0] === REDIRECTED && router._tx === tx && router._committed === base) await followRedirect(router, tx, reduced);\n\t\treturn;\n\t}\n\tawait projectLane(router, reduced, tx[0].signal);\n\tif (router._tx !== tx || router._committed !== base) {\n\t\ttransferMatchResources(router, next);\n\t\treturn;\n\t}\n\tfor (const match of next) {\n\t\tconst cached = router._cache.get(match.id);\n\t\tif (cached?._flight && cached._flight === match._flight) {\n\t\t\trouter._cache.delete(match.id);\n\t\t\treleaseFlight(router, cached);\n\t\t}\n\t}\n\tpublishMatches(router, next);\n\ttransferMatchResources(router, base, next);\n}\nasync function runClientTransaction(router, tx, forceStaleReload, onReady, sync, resolvedPrefix) {\n\tconst result = await executeClientLane(router, tx[2], tx[3], [\n\t\ttx[0],\n\t\ttx[1],\n\t\trouter._committed,\n\t\tvoid 0,\n\t\tsync,\n\t\tforceStaleReload,\n\t\tresolvedPrefix,\n\t\tonReady\n\t]);\n\tif (isControl(result)) {\n\t\tconst follow = result[0] === REDIRECTED && router._tx === tx;\n\t\tif (!follow || result[1].options.reloadDocument) finishPending(router, tx);\n\t\ttransferMatchResources(router, tx[3]);\n\t\ttx[3] = [];\n\t\tif (!follow) return;\n\t\tif (router._tx !== tx) {\n\t\t\tfinishPending(router, tx);\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.NODE_ENV !== \"production\" && tx[6]) router._refreshNextLoad = true;\n\t\tawait followRedirect(router, tx, result);\n\t\treturn;\n\t}\n\tconst matches = result[1];\n\tif (router._tx === tx) await awaitPendingMinimum(router, tx);\n\tif (router._tx !== tx) {\n\t\tfinishPending(router, tx);\n\t\ttransferMatchResources(router, matches);\n\t\tdiscardBackground(router, result);\n\t\treturn;\n\t}\n\tconst toLocation = tx[2];\n\tconst changeInfo = getLocationChangeInfo(toLocation, router.stores.resolvedLocation.get());\n\tconst background = result[2];\n\tawait router.startViewTransition(async () => {\n\t\tif (router._tx === tx) await awaitPendingMinimum(router, tx);\n\t\tif (router._tx !== tx) {\n\t\t\tfinishPending(router, tx);\n\t\t\ttransferMatchResources(router, matches);\n\t\t\tdiscardBackground(router, result);\n\t\t\treturn;\n\t\t}\n\t\tconst commit = () => {\n\t\t\tfinishPending(router, tx);\n\t\t\tcommitMatches(router, tx, matches, resolvedPrefix);\n\t\t\tif (router._tx !== tx) return;\n\t\t\trouter.emit({\n\t\t\t\ttype: \"onLoad\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t\tif (router._tx === tx) router.emit({\n\t\t\t\ttype: \"onBeforeRouteMount\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t};\n\t\tconst rendered = await router.startTransition(commit, matches);\n\t\tif (process.env.NODE_ENV !== \"production\" && tx[6]) tx[6] = void 0;\n\t\tif (router._tx !== tx) {\n\t\t\tdiscardBackground(router, result);\n\t\t\treturn;\n\t\t}\n\t\tif (background?.length) runBackground(router, tx, matches, background, result[3]).catch(console.error);\n\t\trouter.batch(() => {\n\t\t\trouter.stores.resolvedLocation.set(toLocation);\n\t\t\trouter.stores.status.set(\"idle\");\n\t\t\tif (router._tx === tx) router.emit({\n\t\t\t\ttype: \"onResolved\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t\tif (rendered && router._tx === tx) router.emit({\n\t\t\t\ttype: \"onRendered\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t});\n\t\tif (router._tx !== tx) return;\n\t\trouter._commitPromise?.resolve();\n\t\trouter._commitPromise = void 0;\n\t});\n}\nasync function loadClientRoute(router, opts) {\n\tlet rematerialize = false;\n\tif (process.env.NODE_ENV !== \"production\") rematerialize = !!router._refreshNextLoad || !!router._tx?.[6];\n\tconst previousOwner = router._tx;\n\tconst resolvedLocation = router.stores.resolvedLocation.get();\n\tconst previousLocation = resolvedLocation ?? router.stores.location.get();\n\tconst location = router.latestLocation;\n\tconst pendingLocation = router._pendingLocation;\n\tconst redirects = pendingLocation?.href === location.href ? pendingLocation._redirects ?? 0 : 0;\n\tconst handoff = router._handoff;\n\tconst hydrationController = rematerialize ? void 0 : handoff?.[0]();\n\tconst preflight = new AbortController();\n\tconst previousPreflight = router._preflight;\n\trouter._preflight = preflight;\n\tif (!rematerialize && !hydrationController) handoff?.[1]();\n\tpreviousPreflight?.abort();\n\tif (!preflight.signal.aborted) {\n\t\tconst changeInfo = getLocationChangeInfo(location, resolvedLocation);\n\t\trouter.emit({\n\t\t\ttype: \"onBeforeNavigate\",\n\t\t\t...changeInfo\n\t\t});\n\t\tif (!preflight.signal.aborted) router.emit({\n\t\t\ttype: \"onBeforeLoad\",\n\t\t\t...changeInfo\n\t\t});\n\t}\n\tif (preflight.signal.aborted) {\n\t\tawait awaitCurrent(router, previousOwner);\n\t\treturn;\n\t}\n\tconst sameHref = previousLocation.href === location.href;\n\tlet controller = preflight;\n\tconst matches = process.env.NODE_ENV !== \"production\" && rematerialize ? router.matchRoutes(location, {\n\t\t_controller: preflight,\n\t\t_rematerialize: true\n\t}) : router.matchRoutes(location, { _controller: preflight });\n\tacquireMatchResources(matches);\n\tconst resolvedPrefix = hydrationController ? handoff[1](matches) : void 0;\n\tif (resolvedPrefix) controller = hydrationController;\n\telse hydrationController?.abort();\n\tif (preflight.signal.aborted) {\n\t\ttransferMatchResources(router, matches);\n\t\tawait awaitCurrent(router, previousOwner);\n\t\treturn;\n\t}\n\trouter._preflight = void 0;\n\tlet settle;\n\tconst run = () => runClientTransaction(router, tx, sameHref, () => offerPending(router, tx), opts?.sync, resolvedPrefix);\n\tconst done = opts?.sync ? new Promise((resolve) => settle = resolve) : Promise.resolve().then(run);\n\tconst tx = [\n\t\tcontroller,\n\t\tredirects,\n\t\tlocation,\n\t\tmatches,\n\t\tDate.now(),\n\t\tdone.then(() => awaitCurrent(router, tx))\n\t];\n\tif (process.env.NODE_ENV !== \"production\" && rematerialize) {\n\t\ttx[6] = [handoff];\n\t\trouter._refreshNextLoad = void 0;\n\t}\n\trouter._tx = tx;\n\tif (previousOwner) {\n\t\tfor (const match of router.stores.matches.get()) {\n\t\t\tif (router._tx !== tx) break;\n\t\t\tif (match.isFetching) setFetching(router, match, false);\n\t\t}\n\t\tpreviousOwner[0].abort();\n\t\ttransferMatchResources(router, previousOwner[3], tx[3], true);\n\t}\n\tif (router._tx !== tx) {\n\t\ttransferMatchResources(router, tx[3]);\n\t\ttx[3] = [];\n\t\tsettle?.();\n\t\tawait awaitCurrent(router, tx);\n\t\treturn;\n\t}\n\trouter.batch(() => {\n\t\trouter.stores.status.set(\"pending\");\n\t\trouter.stores.location.set(location);\n\t});\n\tif (resolvedPrefix || !router._committed.length && matches[0]?.status !== \"success\" && !matches.some((match) => match._notFound)) offerPending(router, tx);\n\tsettle?.(run());\n\tawait tx[5];\n}\nasync function refreshClientRoute(router) {\n\tconst pending = router._tx;\n\tif (pending && !pending[6] && router.stores.status.get() === \"pending\") {\n\t\tawait pending[5];\n\t\tif (router._tx !== pending) await awaitCurrent(router, pending);\n\t}\n\trouter._flights?.clear();\n\trouter.clearCache();\n\trouter._refreshNextLoad = true;\n\tawait loadClientRoute(router, { sync: true });\n}\nasync function preloadClientRoute(router, opts) {\n\tif (process.env.NODE_ENV !== \"production\" && (router._refreshNextLoad || router._tx?.[6])) return;\n\tlet location = router.buildLocation(opts);\n\tfor (let redirects = 0;; redirects++) {\n\t\tconst base = router._committed;\n\t\tconst controller = new AbortController();\n\t\tlet matches;\n\t\tlet active;\n\t\tlet result;\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tmatches = router.matchRoutes(location, { _controller: controller });\n\t\t\t\tacquireMatchResources(matches);\n\t\t\t\tactive = (router._preloads ??= /* @__PURE__ */ new Map()).set(controller, matches);\n\t\t\t\tresult = await executeClientLane(router, location, matches, [\n\t\t\t\t\tcontroller,\n\t\t\t\t\tredirects,\n\t\t\t\t\tbase,\n\t\t\t\t\ttrue\n\t\t\t\t]);\n\t\t\t} finally {\n\t\t\t\tif (active) {\n\t\t\t\t\tactive = active.delete(controller);\n\t\t\t\t\ttransferMatchResources(router, matches);\n\t\t\t\t}\n\t\t\t\tcontroller.abort();\n\t\t\t}\n\t\t\tif (!isControl(result)) return result[1];\n\t\t\tif (!active || result.length < 3 || process.env.NODE_ENV !== \"production\" && (router._refreshNextLoad || router._tx?.[6])) return;\n\t\t\tlocation = result[2];\n\t\t} catch (cause) {\n\t\t\tif (!isNotFound(cause)) console.error(cause);\n\t\t\treturn;\n\t\t}\n\t}\n}\nasync function hydrate(router) {\n\tif (process.env.NODE_ENV !== \"production\" && !window.$_TSR) throw new Error(\"Invariant failed: Expected to find bootstrap data on window.$_TSR, but we did not. Please file an issue!\");\n\tconst tsr = window.$_TSR;\n\tconst adapters = router.options.serializationAdapters;\n\tif (adapters?.length) {\n\t\ttsr.t = new Map(adapters.map((adapter) => [adapter.key, adapter.fromSerializable]));\n\t\ttsr.buffer.forEach((script) => script());\n\t}\n\ttsr.initialized = true;\n\tconst dehydratedRouter = tsr.router;\n\tif (process.env.NODE_ENV !== \"production\" && !dehydratedRouter) throw new Error(\"Invariant failed: Expected to find a dehydrated data on window.$_TSR.router, but we did not. Please file an issue!\");\n\trouter.ssr = { manifest: dehydratedRouter.manifest };\n\trouter.options.ssr = { nonce: document.querySelector(\"meta[property=\\\"csp-nonce\\\"]\")?.content };\n\tconst dehydratedMatches = dehydratedRouter.matches;\n\tconst controller = new AbortController();\n\tconst previousPreflight = router._preflight;\n\trouter._preflight = controller;\n\tpreviousPreflight?.abort();\n\tconst isCurrent = () => router._preflight === controller;\n\tlet location;\n\tlet candidates;\n\tlet handoffHistoryHref;\n\tlet handoffHistoryState;\n\ttry {\n\t\tawait waitFor(router.options.hydrate?.(dehydratedRouter.dehydratedData), controller.signal);\n\t\tif (!isCurrent()) return;\n\t\tconst historyLocation = router.history.location;\n\t\thandoffHistoryHref = historyLocation.href;\n\t\thandoffHistoryState = historyLocation.state;\n\t\trouter.updateLatestLocation();\n\t\tlocation = router.latestLocation;\n\t\trouter.stores.location.set(location);\n\t\tcandidates = router.matchRoutes(location, { _controller: controller });\n\t} catch (cause) {\n\t\tif (isCurrent()) router._preflight = void 0;\n\t\tcontroller.abort(cause);\n\t\tif (cause !== controller.signal) throw cause;\n\t}\n\tif (!isCurrent()) return;\n\tconst committed = [];\n\tlet pendingBoundary;\n\tlet verifiedAssetEnd = 0;\n\tconst retryFrom = (index) => {\n\t\tverifiedAssetEnd = Math.min(verifiedAssetEnd, index + 1);\n\t\tconst removed = committed.splice(index);\n\t\tfor (const match of removed) if (getRoute(router, match).options.loader && (match.status === \"success\" || !match.invalid && \"loaderData\" in match)) cacheLoaderMatch(router, {\n\t\t\t...match,\n\t\t\tstatus: \"success\",\n\t\t\terror: void 0,\n\t\t\tpreload: true\n\t\t}, router._cache.get(match.id));\n\t\ttransferMatchResources(router, removed);\n\t};\n\tconst shared = dehydratedMatches.length > candidates.length ? candidates.findIndex((match) => match._notFound) + 1 : dehydratedMatches.length;\n\tlet isTerminal = false;\n\tfor (let index = 0; index < shared; index++) {\n\t\tconst candidate = candidates[index];\n\t\tconst dehydrated = dehydratedMatches[index];\n\t\tif (typeof dehydrated.i !== \"string\" || hydrateSsrMatchId(dehydrated.i) !== candidate.id) {\n\t\t\tpendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tverifiedAssetEnd = index + 1;\n\t\tconst route = getRoute(router, candidate);\n\t\tif (\"l\" in dehydrated || dehydrated.s === \"success\" && dehydrated.e === void 0 && route.options.loader) candidate.loaderData = dehydrated.l;\n\t\tcandidate.status = dehydrated.s;\n\t\tcandidate.ssr = dehydrated.ssr;\n\t\troute.options.ssr = candidate.ssr;\n\t\tcandidate.updatedAt = dehydrated.u;\n\t\tcandidate.error = dehydrated.e;\n\t\tcandidate._notFound ||= dehydrated.g;\n\t\tif (candidate.status === \"error\" || candidate.status === \"notFound\" || candidate._notFound) {\n\t\t\tisTerminal = true;\n\t\t\tcommitted.push(candidate);\n\t\t\tif (candidate.ssr === false || candidate.ssr === \"data-only\") pendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tif (candidate.status === \"pending\") {\n\t\t\tpendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tcommitted.push(candidate);\n\t\tif (candidate.ssr === \"data-only\") pendingBoundary ??= index;\n\t}\n\tif (!isTerminal && committed.length === shared && shared < candidates.length) pendingBoundary = shared;\n\tconst chunks = committed.map(async (match) => {\n\t\ttry {\n\t\t\tconst route = getRoute(router, match);\n\t\t\tawait (match._notFound ? Promise.all([loadRouteChunk(route), loadRouteChunk(route, \"notFoundComponent\")]) : loadRouteChunk(route, match.status === \"error\" ? \"errorComponent\" : match.status === \"notFound\" ? \"notFoundComponent\" : void 0));\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t});\n\tlet chunkFailure = 0;\n\ttry {\n\t\twhile (chunkFailure < chunks.length && await waitFor(chunks[chunkFailure], controller.signal)) chunkFailure++;\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isCurrent()) return;\n\tif (chunkFailure < committed.length) retryFrom(chunkFailure);\n\tconst contextEnd = Math.max(pendingBoundary === committed.length ? committed.length + 1 : committed.length, chunkFailure < chunks.length ? chunkFailure : verifiedAssetEnd);\n\tfor (let index = 0; index < contextEnd; index++) {\n\t\tconst match = candidates[index];\n\t\tconst route = getRoute(router, match);\n\t\tconst parentContext = candidates[index - 1]?.context ?? router.options.context ?? {};\n\t\tlet routeContext;\n\t\tif (route.options.context) {\n\t\t\ttry {\n\t\t\t\trouteContext = match._ctx = route.options.context({\n\t\t\t\t\tdeps: match.loaderDeps,\n\t\t\t\t\tparams: match.params,\n\t\t\t\t\tcontext: parentContext,\n\t\t\t\t\tlocation,\n\t\t\t\t\tnavigate: (opts) => router.navigate({\n\t\t\t\t\t\t...opts,\n\t\t\t\t\t\t_fromLocation: location\n\t\t\t\t\t}),\n\t\t\t\t\tbuildLocation: router.buildLocation,\n\t\t\t\t\tcause: match.cause,\n\t\t\t\t\tabortController: controller,\n\t\t\t\t\tpreload: false,\n\t\t\t\t\tmatches: candidates,\n\t\t\t\t\trouteId: route.id\n\t\t\t\t}) || {};\n\t\t\t} catch {\n\t\t\t\tif (!isCurrent()) return;\n\t\t\t\tif (match.status !== \"error\" && match.status !== \"notFound\" && !match._notFound) {\n\t\t\t\t\tpendingBoundary = Math.min(pendingBoundary ?? index, index);\n\t\t\t\t\tretryFrom(index);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isCurrent()) return;\n\t\t}\n\t\tmatch.context = {\n\t\t\t...parentContext,\n\t\t\t...routeContext,\n\t\t\t...committed[index] && dehydratedMatches[index].b\n\t\t};\n\t}\n\tawait projectLane(router, [location, candidates], controller.signal, 0, verifiedAssetEnd);\n\tif (!isCurrent()) return;\n\tconst needsClientLoad = pendingBoundary !== void 0 || committed.length < shared;\n\tconst committedMatches = isTerminal && committed.length === shared ? candidates : committed;\n\tlet presented = needsClientLoad ? candidates : committedMatches;\n\tlet dataOnlyAssetEnd;\n\tif (needsClientLoad && pendingBoundary !== void 0) {\n\t\tconst boundary = presented[pendingBoundary];\n\t\tdataOnlyAssetEnd = boundary.ssr === \"data-only\" && verifiedAssetEnd > pendingBoundary + 1 ? verifiedAssetEnd : void 0;\n\t\tpresented = presented.slice();\n\t\tpresented[pendingBoundary] = {\n\t\t\t...boundary,\n\t\t\tstatus: \"pending\",\n\t\t\tssr: boundary.ssr === \"data-only\" ? \"data-only\" : false,\n\t\t\t_assetEnd: dataOnlyAssetEnd\n\t\t};\n\t}\n\tconst claim = () => {\n\t\tconst historyLocation = router.history.location;\n\t\treturn needsClientLoad && !router._tx && historyLocation.href === handoffHistoryHref && historyLocation.state === handoffHistoryState && router._committed === committedMatches && committedMatches.length && !controller.signal.aborted ? controller : void 0;\n\t};\n\tconst handoff = [claim, (matches) => {\n\t\tif (router._handoff !== handoff) return;\n\t\trouter._handoff = void 0;\n\t\tconst prefix = committedMatches.length;\n\t\tif (!matches || !claim() || committedMatches.some((match, index) => match.id !== matches[index]?.id)) {\n\t\t\tcontroller.abort();\n\t\t\treturn;\n\t\t}\n\t\tlet handoffAssetEnd = dataOnlyAssetEnd;\n\t\tif (handoffAssetEnd !== void 0) {\n\t\t\tfor (let index = prefix; index < handoffAssetEnd; index++) if (candidates[index]?.id !== matches[index]?.id) {\n\t\t\t\thandoffAssetEnd = index > pendingBoundary + 1 ? index : void 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst clones = committedMatches.map((match) => ({ ...match }));\n\t\tif (handoffAssetEnd !== void 0) clones[pendingBoundary]._assetEnd = handoffAssetEnd;\n\t\ttransferMatchResources(router, matches.splice(0, prefix, ...clones));\n\t\tfor (let index = prefix; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tconst hydrated = candidates[index];\n\t\t\tif (hydrated?.id === match.id && hydrated._ctx) match._ctx = hydrated._ctx;\n\t\t\tmatch.abortController = controller;\n\t\t}\n\t\treturn prefix;\n\t}];\n\trouter._committed = committedMatches;\n\trouter._lifecycleEnd = lifecycleEnd(committedMatches);\n\trouter._handoff = handoff;\n\trouter._preflight = void 0;\n\trouter.batch(() => {\n\t\trouter.stores.setMatches(presented);\n\t\trouter.stores.status.set(\"idle\");\n\t\tif (!needsClientLoad) router.stores.resolvedLocation.set(router.stores.location.get());\n\t});\n}\n//#endregion\nexport { _getAssetMatches, _getRenderedMatches, hydrate, loadClientRoute, loadRouteChunk, preloadClientRoute, refreshClientRoute, replaceRouteChunk };\n\n//# sourceMappingURL=load-client.js.map","//#region src/await-signal.ts\nfunction observeLate(callback, value) {\n\tif (!callback) return;\n\ttry {\n\t\tconst result = callback(value);\n\t\tif (result !== void 0) Promise.resolve(result).catch(() => {});\n\t} catch {}\n}\n/**\n* Await `value` unless `signal` aborts first. A result that settles after the\n* abort is passed to `onLate` / `onLateError` instead.\n*\n* One abort listener per wait: SSR requests nest at most a few waits on one\n* signal, so pooling them was measurably slower than this.\n*/\nfunction waitForReason(value, signal, onLate, onLateError) {\n\tconst promise = Promise.resolve(value);\n\tif (signal.aborted) {\n\t\tpromise.then((result) => observeLate(onLate, result), (error) => observeLate(onLateError, error));\n\t\treturn Promise.reject(signal.reason);\n\t}\n\treturn new Promise((resolve, reject) => {\n\t\tconst abort = () => reject(signal.reason);\n\t\tsignal.addEventListener(\"abort\", abort, { once: true });\n\t\tpromise.then((result) => {\n\t\t\tsignal.removeEventListener(\"abort\", abort);\n\t\t\tif (signal.aborted) observeLate(onLate, result);\n\t\t\telse resolve(result);\n\t\t}, (error) => {\n\t\t\tsignal.removeEventListener(\"abort\", abort);\n\t\t\tif (signal.aborted) observeLate(onLateError, error);\n\t\t\telse reject(error);\n\t\t});\n\t});\n}\n//#endregion\nexport { waitForReason };\n\n//# sourceMappingURL=await-signal.js.map","import { isNotFound } from \"./not-found.js\";\nimport { rootRouteId } from \"./root.js\";\nimport { isRedirect, redirect } from \"./redirect.js\";\nimport { loadRouteChunk } from \"./load-client.js\";\nimport { getLocationChangeInfo, lifecycleEnd, runRouteLifecycle } from \"./router.js\";\nimport { waitForReason } from \"./await-signal.js\";\n//#region src/load-server.ts\nconst SUCCESS = 0;\nconst ERROR = 1;\nconst NOT_FOUND = 2;\nconst REDIRECTED = 3;\nconst SKIPPED = 4;\nconst MATCH_SETTLED_ABORT_REASON = Object.freeze({\n\tname: \"AbortError\",\n\tmessage: \"TanStack Router aborted this server match because it settled.\"\n});\nconst REDIRECT_ABORT_REASON = Object.freeze({\n\tname: \"AbortError\",\n\tmessage: \"TanStack Router aborted this server match because of a redirect.\"\n});\nfunction getRoute(router, match) {\n\treturn router.routesById[match.routeId];\n}\nfunction normalize(value, rejected) {\n\tif (isRedirect(value)) return [REDIRECTED, value];\n\tif (isNotFound(value)) return [NOT_FOUND, value];\n\tif (rejected && typeof value?.then === \"function\") value = new Error(\"A Promise was thrown\", { cause: value });\n\treturn rejected ? [ERROR, value] : [SUCCESS, value];\n}\nfunction normalizeError(router, lane, route, cause, signal, notify = true) {\n\tsignal?.throwIfAborted();\n\tlet outcome = normalize(cause, true);\n\tif (outcome[0] !== ERROR) return materializeRedirect(router, lane, route, outcome, signal, notify);\n\ttry {\n\t\troute.options.onError?.(outcome[1]);\n\t} catch (onErrorCause) {\n\t\toutcome = normalize(onErrorCause, true);\n\t}\n\tsignal?.throwIfAborted();\n\treturn materializeRedirect(router, lane, route, outcome, signal, notify);\n}\nfunction materializeRedirect(router, lane, route, outcome, signal, notify = true) {\n\tif (outcome[0] !== REDIRECTED) return outcome;\n\tsignal?.throwIfAborted();\n\ttry {\n\t\toutcome[1].options._fromLocation = lane.location;\n\t\trouter.resolveRedirect(outcome[1]);\n\t\tsignal?.throwIfAborted();\n\t\treturn outcome;\n\t} catch (cause) {\n\t\tsignal?.throwIfAborted();\n\t\treturn notify ? normalizeError(router, lane, route, cause, signal, false) : [ERROR, cause];\n\t}\n}\nfunction maybe(value, cause) {\n\tif (cause !== void 0) return {\n\t\tstatus: \"error\",\n\t\terror: cause\n\t};\n\treturn {\n\t\tstatus: \"success\",\n\t\tvalue\n\t};\n}\nfunction navigateFrom(router, location) {\n\treturn (options) => router.navigate({\n\t\t...options,\n\t\t_fromLocation: location\n\t});\n}\nfunction waitFor(value, signal) {\n\treturn signal ? waitForReason(value, signal) : value;\n}\nfunction resolveSsr(router, lane, index) {\n\tconst match = lane.matches[index];\n\tconst route = getRoute(router, match);\n\tconst parentSsr = lane.matches[index - 1]?.ssr;\n\tif (router.isShell()) return route.id === rootRouteId;\n\tif (parentSsr === false) return false;\n\tconst inherit = (value) => {\n\t\treturn value === true && parentSsr === \"data-only\" ? \"data-only\" : value;\n\t};\n\tconst defaultSsr = router.options.defaultSsr ?? true;\n\tconst inheritedDefault = inherit(defaultSsr);\n\tmatch.ssr = inheritedDefault;\n\tconst option = route.options.ssr;\n\tif (option === void 0) return inheritedDefault;\n\tif (typeof option !== \"function\") return inherit(option);\n\tconst context = {\n\t\tsearch: maybe(match.search, match.searchError),\n\t\tparams: maybe(match.params, match.paramsError),\n\t\tlocation: lane.location,\n\t\tmatches: lane.matches.map((candidate) => ({\n\t\t\tindex: candidate.index,\n\t\t\tpathname: candidate.pathname,\n\t\t\tfullPath: candidate.fullPath,\n\t\t\tstaticData: candidate.staticData,\n\t\t\tid: candidate.id,\n\t\t\trouteId: candidate.routeId,\n\t\t\tsearch: maybe(candidate.search, candidate.searchError),\n\t\t\tparams: maybe(candidate.params, candidate.paramsError),\n\t\t\tssr: candidate.ssr\n\t\t}))\n\t};\n\ttry {\n\t\treturn Promise.resolve(option(context)).then((value) => inherit(value ?? defaultSsr));\n\t} catch (cause) {\n\t\treturn Promise.reject(cause);\n\t}\n}\nfunction stampNotFound(match, outcome) {\n\tif (outcome[0] === NOT_FOUND && !outcome[1].routeId) outcome[1].routeId = match.routeId;\n\treturn outcome;\n}\nasync function contextualize(router, lane, signal) {\n\tconst globalBoundary = lane.matches.findIndex((match) => match._notFound);\n\tlet end = globalBoundary < 0 ? lane.matches.length : globalBoundary + 1;\n\tlet failure;\n\tlet parentContext = { ...router.options.context ?? {} };\n\tfor (let index = 0; index < end; index++) {\n\t\tconst match = lane.matches[index];\n\t\tconst route = getRoute(router, match);\n\t\ttry {\n\t\t\tconst ssr = resolveSsr(router, lane, index);\n\t\t\tmatch.ssr = ssr instanceof Promise ? await ssr : ssr;\n\t\t} catch (cause) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tfailure = [index, stampNotFound(match, normalizeError(router, lane, route, cause, signal))];\n\t\t\tend = index;\n\t\t}\n\t\tsignal?.throwIfAborted();\n\t\tif (failure?.[1][0] === REDIRECTED) break;\n\t\tmatch.__beforeLoadContext = void 0;\n\t\tlet context = parentContext;\n\t\ttry {\n\t\t\tlet routeContext;\n\t\t\tif (route.options.context) {\n\t\t\t\tconst routeContextOptions = {\n\t\t\t\t\tdeps: match.loaderDeps,\n\t\t\t\t\tparams: match.params,\n\t\t\t\t\tcontext: parentContext,\n\t\t\t\t\tlocation: lane.location,\n\t\t\t\t\tnavigate: navigateFrom(router, lane.location),\n\t\t\t\t\tbuildLocation: router.buildLocation,\n\t\t\t\t\tcause: match.cause,\n\t\t\t\t\tabortController: match.abortController,\n\t\t\t\t\tpreload: false,\n\t\t\t\t\tmatches: lane.matches,\n\t\t\t\t\trouteId: route.id\n\t\t\t\t};\n\t\t\t\trouteContext = route.options.context(routeContextOptions) ?? void 0;\n\t\t\t}\n\t\t\tcontext = {\n\t\t\t\t...parentContext,\n\t\t\t\t...routeContext\n\t\t\t};\n\t\t\tmatch.context = context;\n\t\t} catch (cause) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tif (!failure) failure = [index, stampNotFound(match, normalizeError(router, lane, route, cause, signal))];\n\t\t\tend = index;\n\t\t\tbreak;\n\t\t}\n\t\tsignal?.throwIfAborted();\n\t\tif (failure) break;\n\t\tconst validationError = match.paramsError ?? match.searchError;\n\t\tif (validationError !== void 0) {\n\t\t\tfailure = [index, stampNotFound(match, normalizeError(router, lane, route, validationError, signal))];\n\t\t\tend = index;\n\t\t\tbreak;\n\t\t}\n\t\tsignal?.throwIfAborted();\n\t\tif (match.ssr === false || !route.options.beforeLoad) {\n\t\t\tparentContext = context;\n\t\t\tcontinue;\n\t\t}\n\t\tconst abortController = match.abortController;\n\t\tconst options = {\n\t\t\tsearch: match.search,\n\t\t\tabortController,\n\t\t\tparams: match.params,\n\t\t\tpreload: false,\n\t\t\tcontext,\n\t\t\tlocation: lane.location,\n\t\t\tnavigate: navigateFrom(router, lane.location),\n\t\t\tbuildLocation: router.buildLocation,\n\t\t\tcause: match.cause,\n\t\t\tmatches: lane.matches,\n\t\t\trouteId: route.id,\n\t\t\t...router.options.additionalContext\n\t\t};\n\t\ttry {\n\t\t\tconst beforeLoadContext = await route.options.beforeLoad(options);\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst outcome = stampNotFound(match, materializeRedirect(router, lane, route, normalize(beforeLoadContext, false), signal));\n\t\t\tif (outcome[0] !== SUCCESS) {\n\t\t\t\tfailure = [index, outcome];\n\t\t\t\tend = index;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatch.__beforeLoadContext = beforeLoadContext;\n\t\t\tmatch.context = {\n\t\t\t\t...context,\n\t\t\t\t...beforeLoadContext\n\t\t\t};\n\t\t\tparentContext = match.context;\n\t\t} catch (cause) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tfailure = [index, stampNotFound(match, normalizeError(router, lane, route, cause, signal))];\n\t\t\tend = index;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn {\n\t\tlocation: lane.location,\n\t\tmatches: lane.matches,\n\t\tend,\n\t\tfailure\n\t};\n}\nfunction getLoaderContext(router, lane, match, route, index, tasks) {\n\treturn {\n\t\tparams: match.params,\n\t\tdeps: match.loaderDeps,\n\t\tpreload: false,\n\t\tparentMatchPromise: tasks[index - 1]?.match,\n\t\tabortController: match.abortController,\n\t\tcontext: match.context,\n\t\tlocation: lane.location,\n\t\tnavigate: navigateFrom(router, lane.location),\n\t\tcause: match.cause,\n\t\troute,\n\t\t...router.options.additionalContext\n\t};\n}\nfunction createLoaderTask(router, lane, index, tasks, signal) {\n\tconst match = lane.matches[index];\n\tconst route = getRoute(router, match);\n\tlet outcome;\n\tif (match.ssr === false) outcome = Promise.resolve([SKIPPED]);\n\telse {\n\t\tconst routeLoader = route.options.loader;\n\t\tconst loader = typeof routeLoader === \"function\" ? routeLoader : routeLoader?.handler;\n\t\tif (!loader) outcome = Promise.resolve([SUCCESS, void 0]);\n\t\telse outcome = Promise.resolve().then(() => loader(getLoaderContext(router, lane, match, route, index, tasks))).then((result) => normalize(result, false), (cause) => normalize(cause, true)).then((result) => {\n\t\t\tif (signal?.aborted || match.abortController.signal.reason === REDIRECT_ABORT_REASON) return [SKIPPED];\n\t\t\tif (result[0] === ERROR) result = normalizeError(router, lane, route, result[1], signal);\n\t\t\telse result = materializeRedirect(router, lane, route, result, signal);\n\t\t\treturn stampNotFound(match, result);\n\t\t});\n\t}\n\tconst parentMatch = outcome.then((result) => {\n\t\tconst snapshot = { ...match };\n\t\tif (result[0] === SUCCESS) {\n\t\t\tsnapshot.loaderData = result[1];\n\t\t\tsnapshot.status = \"success\";\n\t\t\tsnapshot.error = void 0;\n\t\t\tsnapshot.invalid = false;\n\t\t\tsnapshot.isFetching = false;\n\t\t} else if (result[0] === ERROR) {\n\t\t\tsnapshot.status = \"error\";\n\t\t\tsnapshot.error = result[1];\n\t\t} else if (result[0] === NOT_FOUND) {\n\t\t\tsnapshot.status = \"notFound\";\n\t\t\tsnapshot.error = result[1];\n\t\t}\n\t\treturn snapshot;\n\t});\n\treturn {\n\t\tindex,\n\t\toutcome,\n\t\tmatch: parentMatch\n\t};\n}\nasync function getNotFoundBoundary(router, matches, indexed, signal, fallback = 0) {\n\tconst cause = indexed?.[1][1];\n\tlet index = cause?.routeId ? matches.findIndex((match) => match.routeId === cause.routeId) : indexed?.[0] ?? matches.length - 1;\n\tif (index < 0) index = 0;\n\tfor (let candidate = index; candidate >= 0; candidate--) {\n\t\tconst route = getRoute(router, matches[candidate]);\n\t\ttry {\n\t\t\tconst loading = loadRouteChunk(route, false);\n\t\t\tif (loading) await loading;\n\t\t} catch {\n\t\t\tsignal?.throwIfAborted();\n\t\t}\n\t\tsignal?.throwIfAborted();\n\t\tif (route.options.notFoundComponent) return candidate;\n\t}\n\treturn cause?.routeId ? index : fallback;\n}\nfunction abortMatches(matches, start = 0, reason = MATCH_SETTLED_ABORT_REASON) {\n\tfor (let index = start; index < matches.length; index++) matches[index].abortController.abort(reason);\n}\nasync function applyFailure(router, lane, indexed, signal) {\n\tif (!indexed) {\n\t\tconst boundary = lane.matches.findIndex((match) => match._notFound);\n\t\tif (boundary >= 0) {\n\t\t\tabortMatches(lane.matches, boundary + 1);\n\t\t\treturn {\n\t\t\t\tstatus: 404,\n\t\t\t\tboundary,\n\t\t\t\tkind: NOT_FOUND\n\t\t\t};\n\t\t}\n\t\treturn { status: 200 };\n\t}\n\tconst [index, outcome] = indexed;\n\tif (outcome[0] === ERROR) {\n\t\tconst match = lane.matches[index];\n\t\tmatch._notFound = void 0;\n\t\tmatch.status = \"error\";\n\t\tmatch.error = outcome[1];\n\t\tmatch.isFetching = false;\n\t\tabortMatches(lane.matches, index + 1);\n\t\treturn {\n\t\t\tstatus: 500,\n\t\t\tboundary: index,\n\t\t\tkind: ERROR\n\t\t};\n\t}\n\tconst boundary = indexed[2] ?? await getNotFoundBoundary(router, lane.matches, indexed, signal);\n\tconst match = lane.matches[boundary];\n\tconst cause = outcome[1];\n\tcause.routeId = match.routeId;\n\tmatch._notFound = void 0;\n\tif (match.routeId === router.routeTree.id) {\n\t\tmatch.status = \"success\";\n\t\tmatch._notFound = true;\n\t\tmatch.error = cause;\n\t} else {\n\t\tmatch.status = \"notFound\";\n\t\tmatch.error = cause;\n\t}\n\tmatch.isFetching = false;\n\tabortMatches(lane.matches, boundary + 1);\n\treturn {\n\t\tstatus: 404,\n\t\tboundary,\n\t\tkind: NOT_FOUND\n\t};\n}\nasync function loadNormalChunks(router, lane, end, signal) {\n\tconst chunks = [];\n\tfor (let index = 0; index < lane.matches.length; index++) {\n\t\tconst match = lane.matches[index];\n\t\tif (index >= end || match.ssr !== true || match.status !== \"success\") continue;\n\t\tconst route = getRoute(router, match);\n\t\ttry {\n\t\t\tconst loading = loadRouteChunk(route);\n\t\t\tif (loading) {\n\t\t\t\tconst chunk = loading.then(() => {\n\t\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\t}, (cause) => {\n\t\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\t\treturn [index, stampNotFound(match, normalizeError(router, lane, route, cause, signal))];\n\t\t\t\t});\n\t\t\t\tchunk.catch(() => {});\n\t\t\t\tchunks.push(chunk);\n\t\t\t}\n\t\t} catch (cause) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tchunks.push([index, stampNotFound(match, normalizeError(router, lane, route, cause, signal))]);\n\t\t}\n\t}\n\tfor (const chunk of chunks) {\n\t\tconst indexed = Array.isArray(chunk) ? chunk : await chunk;\n\t\tif (indexed) return indexed;\n\t}\n}\nasync function projectLane(router, lane, signal) {\n\tfor (const match of lane.matches) {\n\t\tconst routeOptions = getRoute(router, match).options;\n\t\tif (routeOptions.head || routeOptions.scripts || routeOptions.headers) {\n\t\t\tconst context = {\n\t\t\t\tssr: router.options.ssr,\n\t\t\t\tmatches: lane.matches,\n\t\t\t\tmatch,\n\t\t\t\tparams: match.params,\n\t\t\t\tloaderData: match.loaderData\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tconst [head, scripts, headers] = await Promise.all([\n\t\t\t\t\trouteOptions.head?.(context),\n\t\t\t\t\trouteOptions.scripts?.(context),\n\t\t\t\t\trouteOptions.headers?.(context)\n\t\t\t\t]);\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\tmatch.meta = head?.meta;\n\t\t\t\tmatch.links = head?.links;\n\t\t\t\tmatch.headScripts = head?.scripts;\n\t\t\t\tmatch.styles = head?.styles;\n\t\t\t\tmatch.scripts = scripts;\n\t\t\t\tmatch.headers = headers;\n\t\t\t} catch (cause) {\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\tconsole.error(cause);\n\t\t\t}\n\t\t}\n\t\tif (match.ssr === false || match.status !== \"success\" || match._notFound) break;\n\t}\n}\nasync function executeServerLane(router, location, matchedMatches, signal) {\n\tconst matched = {\n\t\tlocation,\n\t\tmatches: matchedMatches.map((match) => ({\n\t\t\t...match,\n\t\t\t__beforeLoadContext: void 0,\n\t\t\tcontext: {},\n\t\t\tisFetching: false,\n\t\t\tabortController: new AbortController()\n\t\t}))\n\t};\n\tconst abortLane = () => abortMatches(matched.matches, 0, signal?.reason ?? MATCH_SETTLED_ABORT_REASON);\n\tif (signal?.aborted) {\n\t\tabortLane();\n\t\tsignal.throwIfAborted();\n\t}\n\tsignal?.addEventListener(\"abort\", abortLane, { once: true });\n\ttry {\n\t\tconst plannedGlobalBoundary = matched.matches.findIndex((match) => match._notFound);\n\t\tif (router.options.notFoundMode !== \"root\" && plannedGlobalBoundary >= 0) {\n\t\t\tconst boundary = await getNotFoundBoundary(router, matched.matches, void 0, signal, plannedGlobalBoundary);\n\t\t\tif (boundary !== plannedGlobalBoundary) {\n\t\t\t\tmatched.matches[plannedGlobalBoundary]._notFound = void 0;\n\t\t\t\tmatched.matches[boundary]._notFound = true;\n\t\t\t}\n\t\t}\n\t\tconst lane = await contextualize(router, matched, signal);\n\t\tsignal?.throwIfAborted();\n\t\tlet loaderEnd = lane.end;\n\t\tif (lane.failure?.[1][0] === REDIRECTED) loaderEnd = 0;\n\t\telse if (lane.failure?.[1][0] === NOT_FOUND) {\n\t\t\tlane.failure[2] = await getNotFoundBoundary(router, lane.matches, lane.failure, signal);\n\t\t\tloaderEnd = Math.min(loaderEnd, lane.failure[2] + 1);\n\t\t}\n\t\tconst tasks = [];\n\t\tfor (let index = 0; index < loaderEnd; index++) {\n\t\t\tconst task = createLoaderTask(router, lane, index, tasks, signal);\n\t\t\ttasks.push(task);\n\t\t}\n\t\tlet loaderFailure;\n\t\tlet control = lane.failure?.[1][0] === REDIRECTED ? lane.failure : void 0;\n\t\ttry {\n\t\t\tawait Promise.all(tasks.map((task) => task.outcome.then((loadedOutcome) => {\n\t\t\t\tconst match = lane.matches[task.index];\n\t\t\t\tconst outcome = loadedOutcome;\n\t\t\t\tif (outcome[0] === SUCCESS) {\n\t\t\t\t\tmatch.loaderData = outcome[1];\n\t\t\t\t\tmatch.status = \"success\";\n\t\t\t\t\tmatch.error = void 0;\n\t\t\t\t\tmatch.invalid = false;\n\t\t\t\t\tmatch.isFetching = false;\n\t\t\t\t\tmatch.updatedAt = Date.now();\n\t\t\t\t} else if (outcome[0] === REDIRECTED) {\n\t\t\t\t\tcontrol = [task.index, outcome];\n\t\t\t\t\tthrow control;\n\t\t\t\t} else {\n\t\t\t\t\tif (match.ssr !== false) {\n\t\t\t\t\t\tmatch.status = \"success\";\n\t\t\t\t\t\tmatch.error = void 0;\n\t\t\t\t\t\tmatch.invalid = true;\n\t\t\t\t\t\tmatch.isFetching = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (!loaderFailure && outcome[0] !== SKIPPED) loaderFailure = [task.index, outcome];\n\t\t\t\t}\n\t\t\t})));\n\t\t} catch (cause) {\n\t\t\tif (!Array.isArray(cause)) throw cause;\n\t\t\tcontrol = cause;\n\t\t}\n\t\tsignal?.throwIfAborted();\n\t\tif (control?.[1][0] === REDIRECTED) {\n\t\t\tabortMatches(lane.matches, 0, REDIRECT_ABORT_REASON);\n\t\t\treturn {\n\t\t\t\ttype: \"redirect\",\n\t\t\t\tredirect: control[1][1]\n\t\t\t};\n\t\t}\n\t\tlet failure = lane.failure ?? loaderFailure;\n\t\tconst plannedBoundary = lane.matches.findIndex((match) => match._notFound);\n\t\tlet readinessEnd;\n\t\tif (failure) {\n\t\t\tconst outcomeEnd = failure[2] ??= failure[1][0] === NOT_FOUND ? await getNotFoundBoundary(router, lane.matches, failure, signal) : failure[0];\n\t\t\tfor (const task of tasks) {\n\t\t\t\tif (task.index >= outcomeEnd) break;\n\t\t\t\tconst outcome = await task.outcome;\n\t\t\t\tif (outcome[0] !== SUCCESS && outcome[0] < REDIRECTED && !(\"loaderData\" in lane.matches[task.index])) {\n\t\t\t\t\tfailure = [task.index, outcome];\n\t\t\t\t\tfailure[2] = outcome[0] === NOT_FOUND ? await getNotFoundBoundary(router, lane.matches, failure, signal) : task.index;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treadinessEnd = failure[2];\n\t\t} else readinessEnd = plannedBoundary < 0 ? lane.matches.length : plannedBoundary;\n\t\tconst requiredFailure = await loadNormalChunks(router, lane, readinessEnd, signal);\n\t\tsignal?.throwIfAborted();\n\t\tif (requiredFailure) {\n\t\t\tif (requiredFailure[1][0] === REDIRECTED) {\n\t\t\t\tabortMatches(lane.matches, 0, REDIRECT_ABORT_REASON);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"redirect\",\n\t\t\t\t\tredirect: requiredFailure[1][1]\n\t\t\t\t};\n\t\t\t}\n\t\t\tfailure = requiredFailure;\n\t\t}\n\t\tconst terminal = await applyFailure(router, lane, failure, signal);\n\t\tif (terminal.boundary !== void 0) {\n\t\t\tconst match = lane.matches[terminal.boundary];\n\t\t\tif (match.ssr === true) {\n\t\t\t\tconst route = getRoute(router, match);\n\t\t\t\ttry {\n\t\t\t\t\tif (terminal.kind === ERROR) await loadRouteChunk(route, \"errorComponent\");\n\t\t\t\t\telse if (match._notFound) await Promise.all([loadRouteChunk(route), loadRouteChunk(route, \"notFoundComponent\")]);\n\t\t\t\t\telse await loadRouteChunk(route, \"notFoundComponent\");\n\t\t\t\t} catch {}\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t}\n\t\t}\n\t\tsignal?.throwIfAborted();\n\t\tawait projectLane(router, {\n\t\t\tlocation: lane.location,\n\t\t\tmatches: lane.matches\n\t\t}, signal);\n\t\tsignal?.throwIfAborted();\n\t\trouter.serverSsr?.onCleanup((settled) => {\n\t\t\tif (!settled) abortLane();\n\t\t});\n\t\treturn {\n\t\t\ttype: \"render\",\n\t\t\tstatus: terminal.status,\n\t\t\tmatches: lane.matches\n\t\t};\n\t} finally {\n\t\tsignal?.removeEventListener(\"abort\", abortLane);\n\t}\n}\nasync function loadServerRoute(router, opts) {\n\trouter.updateLatestLocation();\n\tconst next = router.latestLocation;\n\tconst previous = router._committed;\n\tconst previousEnd = router._lifecycleEnd;\n\tlet result;\n\ttry {\n\t\tconst canonical = router.buildLocation({\n\t\t\tto: next.pathname,\n\t\t\tsearch: true,\n\t\t\tparams: true,\n\t\t\thash: true,\n\t\t\tstate: true,\n\t\t\t_includeValidateSearch: true\n\t\t});\n\t\tif (next.publicHref !== canonical.publicHref) throw redirect({ href: canonical.publicHref || \"/\" });\n\t\tconst changeInfo = getLocationChangeInfo(next, router.stores.resolvedLocation.get());\n\t\trouter.emit({\n\t\t\ttype: \"onBeforeNavigate\",\n\t\t\t...changeInfo\n\t\t});\n\t\trouter.emit({\n\t\t\ttype: \"onBeforeLoad\",\n\t\t\t...changeInfo\n\t\t});\n\t\topts?._signal?.throwIfAborted();\n\t\tresult = await waitFor(executeServerLane(router, next, router.matchRoutes(next), opts?._signal), opts?._signal);\n\t\topts?._signal?.throwIfAborted();\n\t} catch (cause) {\n\t\topts?._signal?.throwIfAborted();\n\t\tif (!isRedirect(cause)) throw cause;\n\t\tcause.options._fromLocation = next;\n\t\tresult = {\n\t\t\ttype: \"redirect\",\n\t\t\tredirect: router.resolveRedirect(cause)\n\t\t};\n\t}\n\trouter._serverResult = result;\n\tlet nextEnd = 0;\n\trouter.batch(() => {\n\t\trouter.stores.location.set(next);\n\t\trouter.stores.status.set(\"idle\");\n\t\tif (result.type === \"render\") {\n\t\t\trouter._committed = result.matches;\n\t\t\tnextEnd = router._lifecycleEnd = lifecycleEnd(result.matches);\n\t\t\trouter.stores.setMatches(result.matches);\n\t\t\trouter.stores.resolvedLocation.set(next);\n\t\t}\n\t});\n\tif (result.type === \"render\") runRouteLifecycle(router, previous, result.matches, previousEnd, nextEnd);\n\trouter._commitPromise?.resolve();\n\trouter._commitPromise = void 0;\n}\n//#endregion\nexport { loadServerRoute };\n\n//# sourceMappingURL=load-server.js.map"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12],"mappings":"A,uTAkBA,SAASqC,EAAW,EAAK,CACxB,OAAOC,GAAK,aAAe,EAC5B,CCPA,SAASC,EAAiB,EAAK,CAC9B,IAAMC,EAAwB,IAAI,IAC9BC,EACAC,EACJ,MAAO,CACN,IAAI,EAAK,CACR,IAAMC,EAAQH,EAAM,IAAII,CAAG,EAC3B,GAAKD,EAEL,MADA,GAAM,QAAU,GACTA,EAAM,KACd,EACA,IAAI,EAAK,EAAO,CACf,IAAME,EAAWL,EAAM,IAAII,CAAG,EAC9B,GAAIC,EAAU,CACb,EAAS,MAAQC,EACjB,MACD,CACA,GAAIN,EAAM,MAAQO,EAAK,CACtB,IAAIC,EAAOP,GAAM,KAAK,CAAC,CAAC,MACxB,KAAO,CAACO,GAAQA,EAAK,SAChBA,EAAM,EAAK,QAAU,GACpB,EAAOR,EAAM,OAAO,EACzB,EAAOC,EAAK,KAAK,CAAC,CAAC,MAEhBO,IAASN,IAAQ,EAAO,IAAK,IACjCF,EAAM,OAAOQ,EAAK,GAAG,CACtB,CACA,IAAML,EAAQ,CACb,MACA,QAC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