@elgap/edukaai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/.output/nitro.json +15 -0
  2. package/.output/public/_nuxt/BHDzAs85.js +1 -0
  3. package/.output/public/_nuxt/BJzbfdL_.js +1 -0
  4. package/.output/public/_nuxt/BKGLlKXk.js +6 -0
  5. package/.output/public/_nuxt/BLuXzJk3.js +1 -0
  6. package/.output/public/_nuxt/BNOzzLI3.js +1 -0
  7. package/.output/public/_nuxt/BO5GMwXh.js +1 -0
  8. package/.output/public/_nuxt/BQRbsFGy.js +1 -0
  9. package/.output/public/_nuxt/Be4MVdOg.js +1 -0
  10. package/.output/public/_nuxt/Bu4d3Z1T.js +1 -0
  11. package/.output/public/_nuxt/BwpBBNv4.js +1 -0
  12. package/.output/public/_nuxt/C1Og9-6n.js +97 -0
  13. package/.output/public/_nuxt/C3CjAhtj.js +1 -0
  14. package/.output/public/_nuxt/C6E3Ty3z.js +1 -0
  15. package/.output/public/_nuxt/COct4B42.js +1 -0
  16. package/.output/public/_nuxt/CQ6g2dtj.js +1 -0
  17. package/.output/public/_nuxt/CURSW5TV.js +246 -0
  18. package/.output/public/_nuxt/CW57JW4s.js +1 -0
  19. package/.output/public/_nuxt/Cg2fM61o.js +18 -0
  20. package/.output/public/_nuxt/CgGOeWta.js +1 -0
  21. package/.output/public/_nuxt/CoyYbT7u.js +1 -0
  22. package/.output/public/_nuxt/D11MHbGc.js +133 -0
  23. package/.output/public/_nuxt/D24dz0S8.js +1 -0
  24. package/.output/public/_nuxt/D3EFPr8x.js +1 -0
  25. package/.output/public/_nuxt/Dvt4ZHil.js +1 -0
  26. package/.output/public/_nuxt/builds/latest.json +1 -0
  27. package/.output/public/_nuxt/builds/meta/ab87ba0e-6d0d-4466-8b12-00d44f8fb9d3.json +1 -0
  28. package/.output/public/_nuxt/default.C1K1-g4D.css +1 -0
  29. package/.output/public/_nuxt/entry.CH8k-Mga.css +1 -0
  30. package/.output/public/_nuxt/error-404.C-Ezrlz-.css +1 -0
  31. package/.output/public/_nuxt/error-500.DBWf9FGj.css +1 -0
  32. package/.output/public/_nuxt/first-training.wFDD65zm.css +1 -0
  33. package/.output/public/_nuxt/import.cUKYdCrq.css +1 -0
  34. package/.output/public/_nuxt/index.D-2VHyHA.css +1 -0
  35. package/.output/public/_nuxt/index.D4J_vHmL.css +1 -0
  36. package/.output/public/_nuxt/mPJeLIz7.js +1 -0
  37. package/.output/server/chunks/_/error-500.mjs +19 -0
  38. package/.output/server/chunks/_/error-500.mjs.map +1 -0
  39. package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs +8 -0
  40. package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs.map +1 -0
  41. package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs +238 -0
  42. package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs.map +1 -0
  43. package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs +8 -0
  44. package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs.map +1 -0
  45. package/.output/server/chunks/build/_id_-BUSGcL-H.mjs +113 -0
  46. package/.output/server/chunks/build/_id_-BUSGcL-H.mjs.map +1 -0
  47. package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs +112 -0
  48. package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs.map +1 -0
  49. package/.output/server/chunks/build/best-practices-DsadorHb.mjs +38 -0
  50. package/.output/server/chunks/build/best-practices-DsadorHb.mjs.map +1 -0
  51. package/.output/server/chunks/build/client.precomputed.mjs +4 -0
  52. package/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
  53. package/.output/server/chunks/build/default-DPkqqHOE.mjs +354 -0
  54. package/.output/server/chunks/build/default-DPkqqHOE.mjs.map +1 -0
  55. package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs +8 -0
  56. package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs.map +1 -0
  57. package/.output/server/chunks/build/error-404-K4UfZNck.mjs +97 -0
  58. package/.output/server/chunks/build/error-404-K4UfZNck.mjs.map +1 -0
  59. package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs +8 -0
  60. package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs.map +1 -0
  61. package/.output/server/chunks/build/error-500-CA7TEPNg.mjs +79 -0
  62. package/.output/server/chunks/build/error-500-CA7TEPNg.mjs.map +1 -0
  63. package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs +8 -0
  64. package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs.map +1 -0
  65. package/.output/server/chunks/build/examples-BHK8MDrs.mjs +134 -0
  66. package/.output/server/chunks/build/examples-BHK8MDrs.mjs.map +1 -0
  67. package/.output/server/chunks/build/export-BzxFqqfP.mjs +233 -0
  68. package/.output/server/chunks/build/export-BzxFqqfP.mjs.map +1 -0
  69. package/.output/server/chunks/build/faq-DKch73dS.mjs +112 -0
  70. package/.output/server/chunks/build/faq-DKch73dS.mjs.map +1 -0
  71. package/.output/server/chunks/build/field-guide-qbukT8F0.mjs +38 -0
  72. package/.output/server/chunks/build/field-guide-qbukT8F0.mjs.map +1 -0
  73. package/.output/server/chunks/build/first-training-BbEOBcEW.mjs +343 -0
  74. package/.output/server/chunks/build/first-training-BbEOBcEW.mjs.map +1 -0
  75. package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs +8 -0
  76. package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs.map +1 -0
  77. package/.output/server/chunks/build/glossary-CxSGCJoH.mjs +397 -0
  78. package/.output/server/chunks/build/glossary-CxSGCJoH.mjs.map +1 -0
  79. package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs +128 -0
  80. package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs.map +1 -0
  81. package/.output/server/chunks/build/import-C0kYhRv9.mjs +247 -0
  82. package/.output/server/chunks/build/import-C0kYhRv9.mjs.map +1 -0
  83. package/.output/server/chunks/build/index-C1ntBEWd.mjs +235 -0
  84. package/.output/server/chunks/build/index-C1ntBEWd.mjs.map +1 -0
  85. package/.output/server/chunks/build/index-D3CxihcX.mjs +320 -0
  86. package/.output/server/chunks/build/index-D3CxihcX.mjs.map +1 -0
  87. package/.output/server/chunks/build/index-DgKa1cy0.mjs +360 -0
  88. package/.output/server/chunks/build/index-DgKa1cy0.mjs.map +1 -0
  89. package/.output/server/chunks/build/index-cG54gaKX.mjs +513 -0
  90. package/.output/server/chunks/build/index-cG54gaKX.mjs.map +1 -0
  91. package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs +8 -0
  92. package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs.map +1 -0
  93. package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs +91 -0
  94. package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs.map +1 -0
  95. package/.output/server/chunks/build/new-b3338aLF.mjs +92 -0
  96. package/.output/server/chunks/build/new-b3338aLF.mjs.map +1 -0
  97. package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs +290 -0
  98. package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs.map +1 -0
  99. package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs +45 -0
  100. package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs.map +1 -0
  101. package/.output/server/chunks/build/server.mjs +1979 -0
  102. package/.output/server/chunks/build/server.mjs.map +1 -0
  103. package/.output/server/chunks/build/styles.mjs +20 -0
  104. package/.output/server/chunks/build/styles.mjs.map +1 -0
  105. package/.output/server/chunks/build/test-router-BYM6Cpst.mjs +105 -0
  106. package/.output/server/chunks/build/test-router-BYM6Cpst.mjs.map +1 -0
  107. package/.output/server/chunks/nitro/nitro.mjs +5800 -0
  108. package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
  109. package/.output/server/chunks/routes/renderer.mjs +481 -0
  110. package/.output/server/chunks/routes/renderer.mjs.map +1 -0
  111. package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
  112. package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
  113. package/.output/server/index.mjs +12 -0
  114. package/.output/server/index.mjs.map +1 -0
  115. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/api.js +2 -0
  116. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/app.js +2 -0
  117. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/component.js +2 -0
  118. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/context.js +2 -0
  119. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/hooks.js +2 -0
  120. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/index.js +22 -0
  121. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/util.js +2 -0
  122. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/const.js +5 -0
  123. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/env.js +17 -0
  124. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/index.js +45 -0
  125. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/plugin.js +2 -0
  126. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/proxy.js +111 -0
  127. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/time.js +28 -0
  128. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/package.json +37 -0
  129. package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/dist/index.cjs +42 -0
  130. package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/package.json +32 -0
  131. package/.output/server/node_modules/.nitro/hookable@5.5.3/dist/index.cjs +299 -0
  132. package/.output/server/node_modules/.nitro/hookable@5.5.3/package.json +49 -0
  133. package/.output/server/node_modules/.nitro/hookable@6.0.1/dist/index.mjs +266 -0
  134. package/.output/server/node_modules/.nitro/hookable@6.0.1/package.json +52 -0
  135. package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/dist/index.cjs +59 -0
  136. package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/package.json +44 -0
  137. package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/dist/index.mjs +89 -0
  138. package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/package.json +41 -0
  139. package/.output/server/node_modules/@babel/parser/lib/index.js +14582 -0
  140. package/.output/server/node_modules/@babel/parser/package.json +50 -0
  141. package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +292 -0
  142. package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +702 -0
  143. package/.output/server/node_modules/@iconify/utils/lib/css/common.js +76 -0
  144. package/.output/server/node_modules/@iconify/utils/lib/css/format.js +40 -0
  145. package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +52 -0
  146. package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +133 -0
  147. package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +20 -0
  148. package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +15 -0
  149. package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +18 -0
  150. package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +18 -0
  151. package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +31 -0
  152. package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +80 -0
  153. package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +102 -0
  154. package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +29 -0
  155. package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +60 -0
  156. package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +50 -0
  157. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +204 -0
  158. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +35 -0
  159. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +134 -0
  160. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +167 -0
  161. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +81 -0
  162. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +94 -0
  163. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +28 -0
  164. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +78 -0
  165. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +68 -0
  166. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +47 -0
  167. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +105 -0
  168. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +38 -0
  169. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +94 -0
  170. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +64 -0
  171. package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +26 -0
  172. package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +18 -0
  173. package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +58 -0
  174. package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +34 -0
  175. package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +13 -0
  176. package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +126 -0
  177. package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +21 -0
  178. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +27 -0
  179. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +38 -0
  180. package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +93 -0
  181. package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +48 -0
  182. package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +24 -0
  183. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +44 -0
  184. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +125 -0
  185. package/.output/server/node_modules/@iconify/utils/lib/index.js +53 -0
  186. package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +32 -0
  187. package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +28 -0
  188. package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +42 -0
  189. package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +63 -0
  190. package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +27 -0
  191. package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +27 -0
  192. package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +10 -0
  193. package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +115 -0
  194. package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +32 -0
  195. package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +15 -0
  196. package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +10 -0
  197. package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +42 -0
  198. package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +23 -0
  199. package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +69 -0
  200. package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +55 -0
  201. package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +28 -0
  202. package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +8 -0
  203. package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +23 -0
  204. package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +9 -0
  205. package/.output/server/node_modules/@iconify/utils/package.json +118 -0
  206. package/.output/server/node_modules/@iconify/vue/dist/iconify.mjs +1893 -0
  207. package/.output/server/node_modules/@iconify/vue/package.json +64 -0
  208. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
  209. package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
  210. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
  211. package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
  212. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
  213. package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
  214. package/.output/server/node_modules/@vue/devtools-kit/dist/index.cjs +6850 -0
  215. package/.output/server/node_modules/@vue/devtools-kit/package.json +44 -0
  216. package/.output/server/node_modules/@vue/devtools-shared/dist/index.cjs +378 -0
  217. package/.output/server/node_modules/@vue/devtools-shared/package.json +34 -0
  218. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1870 -0
  219. package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
  220. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6810 -0
  221. package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
  222. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1750 -0
  223. package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
  224. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +883 -0
  225. package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
  226. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
  227. package/.output/server/node_modules/@vue/shared/package.json +47 -0
  228. package/.output/server/node_modules/birpc/dist/index.cjs +296 -0
  229. package/.output/server/node_modules/birpc/package.json +57 -0
  230. package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
  231. package/.output/server/node_modules/consola/dist/core.mjs +512 -0
  232. package/.output/server/node_modules/consola/dist/index.mjs +651 -0
  233. package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
  234. package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
  235. package/.output/server/node_modules/consola/package.json +136 -0
  236. package/.output/server/node_modules/devalue/index.js +4 -0
  237. package/.output/server/node_modules/devalue/package.json +37 -0
  238. package/.output/server/node_modules/devalue/src/base64.js +110 -0
  239. package/.output/server/node_modules/devalue/src/constants.js +7 -0
  240. package/.output/server/node_modules/devalue/src/parse.js +246 -0
  241. package/.output/server/node_modules/devalue/src/stringify.js +350 -0
  242. package/.output/server/node_modules/devalue/src/uneval.js +490 -0
  243. package/.output/server/node_modules/devalue/src/utils.js +148 -0
  244. package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  245. package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
  246. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
  247. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
  248. package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
  249. package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
  250. package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
  251. package/.output/server/node_modules/entities/package.json +120 -0
  252. package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
  253. package/.output/server/node_modules/estree-walker/package.json +37 -0
  254. package/.output/server/node_modules/pinia/dist/pinia.prod.cjs +719 -0
  255. package/.output/server/node_modules/pinia/package.json +94 -0
  256. package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
  257. package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  258. package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
  259. package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
  260. package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
  261. package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
  262. package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  263. package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  264. package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
  265. package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
  266. package/.output/server/node_modules/source-map-js/package.json +71 -0
  267. package/.output/server/node_modules/source-map-js/source-map.js +8 -0
  268. package/.output/server/node_modules/tailwindcss/dist/chunk-X4GG3EDV.mjs +1 -0
  269. package/.output/server/node_modules/tailwindcss/dist/colors.mjs +1 -0
  270. package/.output/server/node_modules/tailwindcss/package.json +89 -0
  271. package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
  272. package/.output/server/node_modules/ufo/package.json +48 -0
  273. package/.output/server/node_modules/unhead/dist/index.mjs +9 -0
  274. package/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
  275. package/.output/server/node_modules/unhead/dist/plugins.mjs +101 -0
  276. package/.output/server/node_modules/unhead/dist/scripts.mjs +30 -0
  277. package/.output/server/node_modules/unhead/dist/server.mjs +180 -0
  278. package/.output/server/node_modules/unhead/dist/shared/unhead.BPM0-cfG.mjs +44 -0
  279. package/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
  280. package/.output/server/node_modules/unhead/dist/shared/unhead.BnoAbrHA.mjs +269 -0
  281. package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
  282. package/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
  283. package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
  284. package/.output/server/node_modules/unhead/dist/shared/unhead.D_nrZZPH.mjs +182 -0
  285. package/.output/server/node_modules/unhead/dist/shared/unhead.ckV6dpEQ.mjs +166 -0
  286. package/.output/server/node_modules/unhead/dist/shared/unhead.fVVqDC1O.mjs +203 -0
  287. package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
  288. package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
  289. package/.output/server/node_modules/unhead/package.json +105 -0
  290. package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
  291. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
  292. package/.output/server/node_modules/vue/index.js +7 -0
  293. package/.output/server/node_modules/vue/index.mjs +1 -0
  294. package/.output/server/node_modules/vue/package.json +112 -0
  295. package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
  296. package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
  297. package/.output/server/node_modules/vue-bundle-renderer/package.json +55 -0
  298. package/.output/server/node_modules/vue-router/dist/devtools-EWN81iOl.mjs +1220 -0
  299. package/.output/server/node_modules/vue-router/dist/vue-router.mjs +1557 -0
  300. package/.output/server/node_modules/vue-router/package.json +153 -0
  301. package/.output/server/node_modules/vue-router/vue-router.node.mjs +2 -0
  302. package/.output/server/package.json +37 -0
  303. package/LICENSE +21 -0
  304. package/README.md +132 -0
  305. package/bin/cli.js +75 -0
  306. package/package.json +71 -0
@@ -0,0 +1,1557 @@
1
+ /*!
2
+ * vue-router v4.6.4
3
+ * (c) 2025 Eduardo San Martin Morote
4
+ * @license MIT
5
+ */
6
+ import { $ as isBrowser, A as START, B as stringifyURL, C as computeScrollPosition, D as scrollToPosition, E as saveScrollPosition, F as isSameRouteLocation, H as decode, I as isSameRouteLocationParams, J as assign, K as warn$1, L as isSameRouteRecord, M as normalizeBase, O as NavigationDirection, P as START_LOCATION_NORMALIZED, Q as noop, R as parseURL, S as isRouteName, T as getScrollKey, U as encodeHash, V as stripBase, W as encodeParam, X as isArray, Z as mergeOptions, _ as ErrorTypes, a as loadRouteLocation, b as isNavigationFailure, c as useCallbacks, d as routerKey, f as routerViewLocationKey, g as stringifyQuery, h as parseQuery, i as guardToPromiseFn, j as createHref, k as NavigationType, l as matchedRouteKey, m as normalizeQuery, n as extractChangingRecords, o as onBeforeRouteLeave, p as viewDepthKey, q as applyToParams, r as extractComponentsGuards, s as onBeforeRouteUpdate, t as addDevtools, u as routeLocationKey, v as NavigationFailureType, w as getSavedScrollPosition, x as isRouteLocation, y as createRouterError } from "./devtools-EWN81iOl.mjs";
7
+ import { computed, defineComponent, getCurrentInstance, h, inject, nextTick, provide, reactive, ref, shallowReactive, shallowRef, unref, watch, watchEffect } from "vue";
8
+
9
+ //#region src/history/html5.ts
10
+ let createBaseLocation = () => location.protocol + "//" + location.host;
11
+ /**
12
+ * Creates a normalized history location from a window.location object
13
+ * @param base - The base path
14
+ * @param location - The window.location object
15
+ */
16
+ function createCurrentLocation(base, location$1) {
17
+ const { pathname, search, hash } = location$1;
18
+ const hashPos = base.indexOf("#");
19
+ if (hashPos > -1) {
20
+ let slicePos = hash.includes(base.slice(hashPos)) ? base.slice(hashPos).length : 1;
21
+ let pathFromHash = hash.slice(slicePos);
22
+ if (pathFromHash[0] !== "/") pathFromHash = "/" + pathFromHash;
23
+ return stripBase(pathFromHash, "");
24
+ }
25
+ return stripBase(pathname, base) + search + hash;
26
+ }
27
+ function useHistoryListeners(base, historyState, currentLocation, replace) {
28
+ let listeners = [];
29
+ let teardowns = [];
30
+ let pauseState = null;
31
+ const popStateHandler = ({ state }) => {
32
+ const to = createCurrentLocation(base, location);
33
+ const from = currentLocation.value;
34
+ const fromState = historyState.value;
35
+ let delta = 0;
36
+ if (state) {
37
+ currentLocation.value = to;
38
+ historyState.value = state;
39
+ if (pauseState && pauseState === from) {
40
+ pauseState = null;
41
+ return;
42
+ }
43
+ delta = fromState ? state.position - fromState.position : 0;
44
+ } else replace(to);
45
+ listeners.forEach((listener) => {
46
+ listener(currentLocation.value, from, {
47
+ delta,
48
+ type: NavigationType.pop,
49
+ direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
50
+ });
51
+ });
52
+ };
53
+ function pauseListeners() {
54
+ pauseState = currentLocation.value;
55
+ }
56
+ function listen(callback) {
57
+ listeners.push(callback);
58
+ const teardown = () => {
59
+ const index = listeners.indexOf(callback);
60
+ if (index > -1) listeners.splice(index, 1);
61
+ };
62
+ teardowns.push(teardown);
63
+ return teardown;
64
+ }
65
+ function beforeUnloadListener() {
66
+ if (document.visibilityState === "hidden") {
67
+ const { history: history$1 } = window;
68
+ if (!history$1.state) return;
69
+ history$1.replaceState(assign({}, history$1.state, { scroll: computeScrollPosition() }), "");
70
+ }
71
+ }
72
+ function destroy() {
73
+ for (const teardown of teardowns) teardown();
74
+ teardowns = [];
75
+ window.removeEventListener("popstate", popStateHandler);
76
+ window.removeEventListener("pagehide", beforeUnloadListener);
77
+ document.removeEventListener("visibilitychange", beforeUnloadListener);
78
+ }
79
+ window.addEventListener("popstate", popStateHandler);
80
+ window.addEventListener("pagehide", beforeUnloadListener);
81
+ document.addEventListener("visibilitychange", beforeUnloadListener);
82
+ return {
83
+ pauseListeners,
84
+ listen,
85
+ destroy
86
+ };
87
+ }
88
+ /**
89
+ * Creates a state object
90
+ */
91
+ function buildState(back, current, forward, replaced = false, computeScroll = false) {
92
+ return {
93
+ back,
94
+ current,
95
+ forward,
96
+ replaced,
97
+ position: window.history.length,
98
+ scroll: computeScroll ? computeScrollPosition() : null
99
+ };
100
+ }
101
+ function useHistoryStateNavigation(base) {
102
+ const { history: history$1, location: location$1 } = window;
103
+ const currentLocation = { value: createCurrentLocation(base, location$1) };
104
+ const historyState = { value: history$1.state };
105
+ if (!historyState.value) changeLocation(currentLocation.value, {
106
+ back: null,
107
+ current: currentLocation.value,
108
+ forward: null,
109
+ position: history$1.length - 1,
110
+ replaced: true,
111
+ scroll: null
112
+ }, true);
113
+ function changeLocation(to, state, replace$1) {
114
+ /**
115
+ * if a base tag is provided, and we are on a normal domain, we have to
116
+ * respect the provided `base` attribute because pushState() will use it and
117
+ * potentially erase anything before the `#` like at
118
+ * https://github.com/vuejs/router/issues/685 where a base of
119
+ * `/folder/#` but a base of `/` would erase the `/folder/` section. If
120
+ * there is no host, the `<base>` tag makes no sense and if there isn't a
121
+ * base tag we can just use everything after the `#`.
122
+ */
123
+ const hashIndex = base.indexOf("#");
124
+ const url = hashIndex > -1 ? (location$1.host && document.querySelector("base") ? base : base.slice(hashIndex)) + to : createBaseLocation() + base + to;
125
+ try {
126
+ history$1[replace$1 ? "replaceState" : "pushState"](state, "", url);
127
+ historyState.value = state;
128
+ } catch (err) {
129
+ if (process.env.NODE_ENV !== "production") warn$1("Error with push/replace State", err);
130
+ else console.error(err);
131
+ location$1[replace$1 ? "replace" : "assign"](url);
132
+ }
133
+ }
134
+ function replace(to, data) {
135
+ changeLocation(to, assign({}, history$1.state, buildState(historyState.value.back, to, historyState.value.forward, true), data, { position: historyState.value.position }), true);
136
+ currentLocation.value = to;
137
+ }
138
+ function push(to, data) {
139
+ const currentState = assign({}, historyState.value, history$1.state, {
140
+ forward: to,
141
+ scroll: computeScrollPosition()
142
+ });
143
+ if (process.env.NODE_ENV !== "production" && !history$1.state) warn$1("history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:\n\nhistory.replaceState(history.state, '', url)\n\nYou can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state");
144
+ changeLocation(currentState.current, currentState, true);
145
+ changeLocation(to, assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data), false);
146
+ currentLocation.value = to;
147
+ }
148
+ return {
149
+ location: currentLocation,
150
+ state: historyState,
151
+ push,
152
+ replace
153
+ };
154
+ }
155
+ /**
156
+ * Creates an HTML5 history. Most common history for single page applications.
157
+ *
158
+ * @param base -
159
+ */
160
+ function createWebHistory(base) {
161
+ base = normalizeBase(base);
162
+ const historyNavigation = useHistoryStateNavigation(base);
163
+ const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
164
+ function go(delta, triggerListeners = true) {
165
+ if (!triggerListeners) historyListeners.pauseListeners();
166
+ history.go(delta);
167
+ }
168
+ const routerHistory = assign({
169
+ location: "",
170
+ base,
171
+ go,
172
+ createHref: createHref.bind(null, base)
173
+ }, historyNavigation, historyListeners);
174
+ Object.defineProperty(routerHistory, "location", {
175
+ enumerable: true,
176
+ get: () => historyNavigation.location.value
177
+ });
178
+ Object.defineProperty(routerHistory, "state", {
179
+ enumerable: true,
180
+ get: () => historyNavigation.state.value
181
+ });
182
+ return routerHistory;
183
+ }
184
+
185
+ //#endregion
186
+ //#region src/history/memory.ts
187
+ /**
188
+ * Creates an in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere.
189
+ * It's up to the user to replace that location with the starter location by either calling `router.push` or `router.replace`.
190
+ *
191
+ * @param base - Base applied to all urls, defaults to '/'
192
+ * @returns a history object that can be passed to the router constructor
193
+ */
194
+ function createMemoryHistory(base = "") {
195
+ let listeners = [];
196
+ let queue = [[START, {}]];
197
+ let position = 0;
198
+ base = normalizeBase(base);
199
+ function setLocation(location$1, state = {}) {
200
+ position++;
201
+ if (position !== queue.length) queue.splice(position);
202
+ queue.push([location$1, state]);
203
+ }
204
+ function triggerListeners(to, from, { direction, delta }) {
205
+ const info = {
206
+ direction,
207
+ delta,
208
+ type: NavigationType.pop
209
+ };
210
+ for (const callback of listeners) callback(to, from, info);
211
+ }
212
+ const routerHistory = {
213
+ location: START,
214
+ state: {},
215
+ base,
216
+ createHref: createHref.bind(null, base),
217
+ replace(to, state) {
218
+ queue.splice(position--, 1);
219
+ setLocation(to, state);
220
+ },
221
+ push(to, state) {
222
+ setLocation(to, state);
223
+ },
224
+ listen(callback) {
225
+ listeners.push(callback);
226
+ return () => {
227
+ const index = listeners.indexOf(callback);
228
+ if (index > -1) listeners.splice(index, 1);
229
+ };
230
+ },
231
+ destroy() {
232
+ listeners = [];
233
+ queue = [[START, {}]];
234
+ position = 0;
235
+ },
236
+ go(delta, shouldTrigger = true) {
237
+ const from = this.location;
238
+ const direction = delta < 0 ? NavigationDirection.back : NavigationDirection.forward;
239
+ position = Math.max(0, Math.min(position + delta, queue.length - 1));
240
+ if (shouldTrigger) triggerListeners(this.location, from, {
241
+ direction,
242
+ delta
243
+ });
244
+ }
245
+ };
246
+ Object.defineProperty(routerHistory, "location", {
247
+ enumerable: true,
248
+ get: () => queue[position][0]
249
+ });
250
+ Object.defineProperty(routerHistory, "state", {
251
+ enumerable: true,
252
+ get: () => queue[position][1]
253
+ });
254
+ return routerHistory;
255
+ }
256
+
257
+ //#endregion
258
+ //#region src/history/hash.ts
259
+ /**
260
+ * Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
261
+ * handle any URL is not possible.
262
+ *
263
+ * @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `<base>` tag
264
+ * in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
265
+ * calls**, meaning that if you use a `<base>` tag, it's `href` value **has to match this parameter** (ignoring anything
266
+ * after the `#`).
267
+ *
268
+ * @example
269
+ * ```js
270
+ * // at https://example.com/folder
271
+ * createWebHashHistory() // gives a url of `https://example.com/folder#`
272
+ * createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
273
+ * // if the `#` is provided in the base, it won't be added by `createWebHashHistory`
274
+ * createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
275
+ * // you should avoid doing this because it changes the original url and breaks copying urls
276
+ * createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
277
+ *
278
+ * // at file:///usr/etc/folder/index.html
279
+ * // for locations with no `host`, the base is ignored
280
+ * createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
281
+ * ```
282
+ */
283
+ function createWebHashHistory(base) {
284
+ base = location.host ? base || location.pathname + location.search : "";
285
+ if (!base.includes("#")) base += "#";
286
+ if (process.env.NODE_ENV !== "production" && !base.endsWith("#/") && !base.endsWith("#")) warn$1(`A hash base must end with a "#":\n"${base}" should be "${base.replace(/#.*$/, "#")}".`);
287
+ return createWebHistory(base);
288
+ }
289
+
290
+ //#endregion
291
+ //#region src/matcher/pathTokenizer.ts
292
+ let TokenType = /* @__PURE__ */ function(TokenType$1) {
293
+ TokenType$1[TokenType$1["Static"] = 0] = "Static";
294
+ TokenType$1[TokenType$1["Param"] = 1] = "Param";
295
+ TokenType$1[TokenType$1["Group"] = 2] = "Group";
296
+ return TokenType$1;
297
+ }({});
298
+ var TokenizerState = /* @__PURE__ */ function(TokenizerState$1) {
299
+ TokenizerState$1[TokenizerState$1["Static"] = 0] = "Static";
300
+ TokenizerState$1[TokenizerState$1["Param"] = 1] = "Param";
301
+ TokenizerState$1[TokenizerState$1["ParamRegExp"] = 2] = "ParamRegExp";
302
+ TokenizerState$1[TokenizerState$1["ParamRegExpEnd"] = 3] = "ParamRegExpEnd";
303
+ TokenizerState$1[TokenizerState$1["EscapeNext"] = 4] = "EscapeNext";
304
+ return TokenizerState$1;
305
+ }(TokenizerState || {});
306
+ const ROOT_TOKEN = {
307
+ type: TokenType.Static,
308
+ value: ""
309
+ };
310
+ const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
311
+ function tokenizePath(path) {
312
+ if (!path) return [[]];
313
+ if (path === "/") return [[ROOT_TOKEN]];
314
+ if (!path.startsWith("/")) throw new Error(process.env.NODE_ENV !== "production" ? `Route paths should start with a "/": "${path}" should be "/${path}".` : `Invalid path "${path}"`);
315
+ function crash(message) {
316
+ throw new Error(`ERR (${state})/"${buffer}": ${message}`);
317
+ }
318
+ let state = TokenizerState.Static;
319
+ let previousState = state;
320
+ const tokens = [];
321
+ let segment;
322
+ function finalizeSegment() {
323
+ if (segment) tokens.push(segment);
324
+ segment = [];
325
+ }
326
+ let i = 0;
327
+ let char;
328
+ let buffer = "";
329
+ let customRe = "";
330
+ function consumeBuffer() {
331
+ if (!buffer) return;
332
+ if (state === TokenizerState.Static) segment.push({
333
+ type: TokenType.Static,
334
+ value: buffer
335
+ });
336
+ else if (state === TokenizerState.Param || state === TokenizerState.ParamRegExp || state === TokenizerState.ParamRegExpEnd) {
337
+ if (segment.length > 1 && (char === "*" || char === "+")) crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
338
+ segment.push({
339
+ type: TokenType.Param,
340
+ value: buffer,
341
+ regexp: customRe,
342
+ repeatable: char === "*" || char === "+",
343
+ optional: char === "*" || char === "?"
344
+ });
345
+ } else crash("Invalid state to consume buffer");
346
+ buffer = "";
347
+ }
348
+ function addCharToBuffer() {
349
+ buffer += char;
350
+ }
351
+ while (i < path.length) {
352
+ char = path[i++];
353
+ if (char === "\\" && state !== TokenizerState.ParamRegExp) {
354
+ previousState = state;
355
+ state = TokenizerState.EscapeNext;
356
+ continue;
357
+ }
358
+ switch (state) {
359
+ case TokenizerState.Static:
360
+ if (char === "/") {
361
+ if (buffer) consumeBuffer();
362
+ finalizeSegment();
363
+ } else if (char === ":") {
364
+ consumeBuffer();
365
+ state = TokenizerState.Param;
366
+ } else addCharToBuffer();
367
+ break;
368
+ case TokenizerState.EscapeNext:
369
+ addCharToBuffer();
370
+ state = previousState;
371
+ break;
372
+ case TokenizerState.Param:
373
+ if (char === "(") state = TokenizerState.ParamRegExp;
374
+ else if (VALID_PARAM_RE.test(char)) addCharToBuffer();
375
+ else {
376
+ consumeBuffer();
377
+ state = TokenizerState.Static;
378
+ if (char !== "*" && char !== "?" && char !== "+") i--;
379
+ }
380
+ break;
381
+ case TokenizerState.ParamRegExp:
382
+ if (char === ")") if (customRe[customRe.length - 1] == "\\") customRe = customRe.slice(0, -1) + char;
383
+ else state = TokenizerState.ParamRegExpEnd;
384
+ else customRe += char;
385
+ break;
386
+ case TokenizerState.ParamRegExpEnd:
387
+ consumeBuffer();
388
+ state = TokenizerState.Static;
389
+ if (char !== "*" && char !== "?" && char !== "+") i--;
390
+ customRe = "";
391
+ break;
392
+ default:
393
+ crash("Unknown state");
394
+ break;
395
+ }
396
+ }
397
+ if (state === TokenizerState.ParamRegExp) crash(`Unfinished custom RegExp for param "${buffer}"`);
398
+ consumeBuffer();
399
+ finalizeSegment();
400
+ return tokens;
401
+ }
402
+
403
+ //#endregion
404
+ //#region src/matcher/pathParserRanker.ts
405
+ const BASE_PARAM_PATTERN = "[^/]+?";
406
+ const BASE_PATH_PARSER_OPTIONS = {
407
+ sensitive: false,
408
+ strict: false,
409
+ start: true,
410
+ end: true
411
+ };
412
+ var PathScore = /* @__PURE__ */ function(PathScore$1) {
413
+ PathScore$1[PathScore$1["_multiplier"] = 10] = "_multiplier";
414
+ PathScore$1[PathScore$1["Root"] = 90] = "Root";
415
+ PathScore$1[PathScore$1["Segment"] = 40] = "Segment";
416
+ PathScore$1[PathScore$1["SubSegment"] = 30] = "SubSegment";
417
+ PathScore$1[PathScore$1["Static"] = 40] = "Static";
418
+ PathScore$1[PathScore$1["Dynamic"] = 20] = "Dynamic";
419
+ PathScore$1[PathScore$1["BonusCustomRegExp"] = 10] = "BonusCustomRegExp";
420
+ PathScore$1[PathScore$1["BonusWildcard"] = -50] = "BonusWildcard";
421
+ PathScore$1[PathScore$1["BonusRepeatable"] = -20] = "BonusRepeatable";
422
+ PathScore$1[PathScore$1["BonusOptional"] = -8] = "BonusOptional";
423
+ PathScore$1[PathScore$1["BonusStrict"] = .7000000000000001] = "BonusStrict";
424
+ PathScore$1[PathScore$1["BonusCaseSensitive"] = .25] = "BonusCaseSensitive";
425
+ return PathScore$1;
426
+ }(PathScore || {});
427
+ const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
428
+ /**
429
+ * Creates a path parser from an array of Segments (a segment is an array of Tokens)
430
+ *
431
+ * @param segments - array of segments returned by tokenizePath
432
+ * @param extraOptions - optional options for the regexp
433
+ * @returns a PathParser
434
+ */
435
+ function tokensToParser(segments, extraOptions) {
436
+ const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
437
+ const score = [];
438
+ let pattern = options.start ? "^" : "";
439
+ const keys = [];
440
+ for (const segment of segments) {
441
+ const segmentScores = segment.length ? [] : [PathScore.Root];
442
+ if (options.strict && !segment.length) pattern += "/";
443
+ for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
444
+ const token = segment[tokenIndex];
445
+ let subSegmentScore = PathScore.Segment + (options.sensitive ? PathScore.BonusCaseSensitive : 0);
446
+ if (token.type === TokenType.Static) {
447
+ if (!tokenIndex) pattern += "/";
448
+ pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
449
+ subSegmentScore += PathScore.Static;
450
+ } else if (token.type === TokenType.Param) {
451
+ const { value, repeatable, optional, regexp } = token;
452
+ keys.push({
453
+ name: value,
454
+ repeatable,
455
+ optional
456
+ });
457
+ const re$1 = regexp ? regexp : BASE_PARAM_PATTERN;
458
+ if (re$1 !== BASE_PARAM_PATTERN) {
459
+ subSegmentScore += PathScore.BonusCustomRegExp;
460
+ try {
461
+ `${re$1}`;
462
+ } catch (err) {
463
+ throw new Error(`Invalid custom RegExp for param "${value}" (${re$1}): ` + err.message);
464
+ }
465
+ }
466
+ let subPattern = repeatable ? `((?:${re$1})(?:/(?:${re$1}))*)` : `(${re$1})`;
467
+ if (!tokenIndex) subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
468
+ if (optional) subPattern += "?";
469
+ pattern += subPattern;
470
+ subSegmentScore += PathScore.Dynamic;
471
+ if (optional) subSegmentScore += PathScore.BonusOptional;
472
+ if (repeatable) subSegmentScore += PathScore.BonusRepeatable;
473
+ if (re$1 === ".*") subSegmentScore += PathScore.BonusWildcard;
474
+ }
475
+ segmentScores.push(subSegmentScore);
476
+ }
477
+ score.push(segmentScores);
478
+ }
479
+ if (options.strict && options.end) {
480
+ const i = score.length - 1;
481
+ score[i][score[i].length - 1] += PathScore.BonusStrict;
482
+ }
483
+ if (!options.strict) pattern += "/?";
484
+ if (options.end) pattern += "$";
485
+ else if (options.strict && !pattern.endsWith("/")) pattern += "(?:/|$)";
486
+ const re = new RegExp(pattern, options.sensitive ? "" : "i");
487
+ function parse(path) {
488
+ const match = path.match(re);
489
+ const params = {};
490
+ if (!match) return null;
491
+ for (let i = 1; i < match.length; i++) {
492
+ const value = match[i] || "";
493
+ const key = keys[i - 1];
494
+ params[key.name] = value && key.repeatable ? value.split("/") : value;
495
+ }
496
+ return params;
497
+ }
498
+ function stringify(params) {
499
+ let path = "";
500
+ let avoidDuplicatedSlash = false;
501
+ for (const segment of segments) {
502
+ if (!avoidDuplicatedSlash || !path.endsWith("/")) path += "/";
503
+ avoidDuplicatedSlash = false;
504
+ for (const token of segment) if (token.type === TokenType.Static) path += token.value;
505
+ else if (token.type === TokenType.Param) {
506
+ const { value, repeatable, optional } = token;
507
+ const param = value in params ? params[value] : "";
508
+ if (isArray(param) && !repeatable) throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
509
+ const text = isArray(param) ? param.join("/") : param;
510
+ if (!text) if (optional) {
511
+ if (segment.length < 2) if (path.endsWith("/")) path = path.slice(0, -1);
512
+ else avoidDuplicatedSlash = true;
513
+ } else throw new Error(`Missing required param "${value}"`);
514
+ path += text;
515
+ }
516
+ }
517
+ return path || "/";
518
+ }
519
+ return {
520
+ re,
521
+ score,
522
+ keys,
523
+ parse,
524
+ stringify
525
+ };
526
+ }
527
+ /**
528
+ * Compares an array of numbers as used in PathParser.score and returns a
529
+ * number. This function can be used to `sort` an array
530
+ *
531
+ * @param a - first array of numbers
532
+ * @param b - second array of numbers
533
+ * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
534
+ * should be sorted first
535
+ */
536
+ function compareScoreArray(a, b) {
537
+ let i = 0;
538
+ while (i < a.length && i < b.length) {
539
+ const diff = b[i] - a[i];
540
+ if (diff) return diff;
541
+ i++;
542
+ }
543
+ if (a.length < b.length) return a.length === 1 && a[0] === PathScore.Static + PathScore.Segment ? -1 : 1;
544
+ else if (a.length > b.length) return b.length === 1 && b[0] === PathScore.Static + PathScore.Segment ? 1 : -1;
545
+ return 0;
546
+ }
547
+ /**
548
+ * Compare function that can be used with `sort` to sort an array of PathParser
549
+ *
550
+ * @param a - first PathParser
551
+ * @param b - second PathParser
552
+ * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
553
+ */
554
+ function comparePathParserScore(a, b) {
555
+ let i = 0;
556
+ const aScore = a.score;
557
+ const bScore = b.score;
558
+ while (i < aScore.length && i < bScore.length) {
559
+ const comp = compareScoreArray(aScore[i], bScore[i]);
560
+ if (comp) return comp;
561
+ i++;
562
+ }
563
+ if (Math.abs(bScore.length - aScore.length) === 1) {
564
+ if (isLastScoreNegative(aScore)) return 1;
565
+ if (isLastScoreNegative(bScore)) return -1;
566
+ }
567
+ return bScore.length - aScore.length;
568
+ }
569
+ /**
570
+ * This allows detecting splats at the end of a path: /home/:id(.*)*
571
+ *
572
+ * @param score - score to check
573
+ * @returns true if the last entry is negative
574
+ */
575
+ function isLastScoreNegative(score) {
576
+ const last = score[score.length - 1];
577
+ return score.length > 0 && last[last.length - 1] < 0;
578
+ }
579
+ const PATH_PARSER_OPTIONS_DEFAULTS = {
580
+ strict: false,
581
+ end: true,
582
+ sensitive: false
583
+ };
584
+
585
+ //#endregion
586
+ //#region src/matcher/pathMatcher.ts
587
+ function createRouteRecordMatcher(record, parent, options) {
588
+ const parser = tokensToParser(tokenizePath(record.path), options);
589
+ if (process.env.NODE_ENV !== "production") {
590
+ const existingKeys = /* @__PURE__ */ new Set();
591
+ for (const key of parser.keys) {
592
+ if (existingKeys.has(key.name)) warn$1(`Found duplicated params with name "${key.name}" for path "${record.path}". Only the last one will be available on "$route.params".`);
593
+ existingKeys.add(key.name);
594
+ }
595
+ }
596
+ const matcher = assign(parser, {
597
+ record,
598
+ parent,
599
+ children: [],
600
+ alias: []
601
+ });
602
+ if (parent) {
603
+ if (!matcher.record.aliasOf === !parent.record.aliasOf) parent.children.push(matcher);
604
+ }
605
+ return matcher;
606
+ }
607
+
608
+ //#endregion
609
+ //#region src/matcher/index.ts
610
+ /**
611
+ * Creates a Router Matcher.
612
+ *
613
+ * @internal
614
+ * @param routes - array of initial routes
615
+ * @param globalOptions - global route options
616
+ */
617
+ function createRouterMatcher(routes, globalOptions) {
618
+ const matchers = [];
619
+ const matcherMap = /* @__PURE__ */ new Map();
620
+ globalOptions = mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS, globalOptions);
621
+ function getRecordMatcher(name) {
622
+ return matcherMap.get(name);
623
+ }
624
+ function addRoute(record, parent, originalRecord) {
625
+ const isRootAdd = !originalRecord;
626
+ const mainNormalizedRecord = normalizeRouteRecord(record);
627
+ if (process.env.NODE_ENV !== "production") checkChildMissingNameWithEmptyPath(mainNormalizedRecord, parent);
628
+ mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
629
+ const options = mergeOptions(globalOptions, record);
630
+ const normalizedRecords = [mainNormalizedRecord];
631
+ if ("alias" in record) {
632
+ const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
633
+ for (const alias of aliases) normalizedRecords.push(normalizeRouteRecord(assign({}, mainNormalizedRecord, {
634
+ components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
635
+ path: alias,
636
+ aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
637
+ })));
638
+ }
639
+ let matcher;
640
+ let originalMatcher;
641
+ for (const normalizedRecord of normalizedRecords) {
642
+ const { path } = normalizedRecord;
643
+ if (parent && path[0] !== "/") {
644
+ const parentPath = parent.record.path;
645
+ const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
646
+ normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
647
+ }
648
+ if (process.env.NODE_ENV !== "production" && normalizedRecord.path === "*") throw new Error("Catch all routes (\"*\") must now be defined using a param with a custom regexp.\nSee more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.");
649
+ matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
650
+ if (process.env.NODE_ENV !== "production" && parent && path[0] === "/") checkMissingParamsInAbsolutePath(matcher, parent);
651
+ if (originalRecord) {
652
+ originalRecord.alias.push(matcher);
653
+ if (process.env.NODE_ENV !== "production") checkSameParams(originalRecord, matcher);
654
+ } else {
655
+ originalMatcher = originalMatcher || matcher;
656
+ if (originalMatcher !== matcher) originalMatcher.alias.push(matcher);
657
+ if (isRootAdd && record.name && !isAliasRecord(matcher)) {
658
+ if (process.env.NODE_ENV !== "production") checkSameNameAsAncestor(record, parent);
659
+ removeRoute(record.name);
660
+ }
661
+ }
662
+ if (isMatchable(matcher)) insertMatcher(matcher);
663
+ if (mainNormalizedRecord.children) {
664
+ const children = mainNormalizedRecord.children;
665
+ for (let i = 0; i < children.length; i++) addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
666
+ }
667
+ originalRecord = originalRecord || matcher;
668
+ }
669
+ return originalMatcher ? () => {
670
+ removeRoute(originalMatcher);
671
+ } : noop;
672
+ }
673
+ function removeRoute(matcherRef) {
674
+ if (isRouteName(matcherRef)) {
675
+ const matcher = matcherMap.get(matcherRef);
676
+ if (matcher) {
677
+ matcherMap.delete(matcherRef);
678
+ matchers.splice(matchers.indexOf(matcher), 1);
679
+ matcher.children.forEach(removeRoute);
680
+ matcher.alias.forEach(removeRoute);
681
+ }
682
+ } else {
683
+ const index = matchers.indexOf(matcherRef);
684
+ if (index > -1) {
685
+ matchers.splice(index, 1);
686
+ if (matcherRef.record.name) matcherMap.delete(matcherRef.record.name);
687
+ matcherRef.children.forEach(removeRoute);
688
+ matcherRef.alias.forEach(removeRoute);
689
+ }
690
+ }
691
+ }
692
+ function getRoutes() {
693
+ return matchers;
694
+ }
695
+ function insertMatcher(matcher) {
696
+ const index = findInsertionIndex(matcher, matchers);
697
+ matchers.splice(index, 0, matcher);
698
+ if (matcher.record.name && !isAliasRecord(matcher)) matcherMap.set(matcher.record.name, matcher);
699
+ }
700
+ function resolve(location$1, currentLocation) {
701
+ let matcher;
702
+ let params = {};
703
+ let path;
704
+ let name;
705
+ if ("name" in location$1 && location$1.name) {
706
+ matcher = matcherMap.get(location$1.name);
707
+ if (!matcher) throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND, { location: location$1 });
708
+ if (process.env.NODE_ENV !== "production") {
709
+ const invalidParams = Object.keys(location$1.params || {}).filter((paramName) => !matcher.keys.find((k) => k.name === paramName));
710
+ if (invalidParams.length) warn$1(`Discarded invalid param(s) "${invalidParams.join("\", \"")}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
711
+ }
712
+ name = matcher.record.name;
713
+ params = assign(pickParams(currentLocation.params, matcher.keys.filter((k) => !k.optional).concat(matcher.parent ? matcher.parent.keys.filter((k) => k.optional) : []).map((k) => k.name)), location$1.params && pickParams(location$1.params, matcher.keys.map((k) => k.name)));
714
+ path = matcher.stringify(params);
715
+ } else if (location$1.path != null) {
716
+ path = location$1.path;
717
+ if (process.env.NODE_ENV !== "production" && !path.startsWith("/")) warn$1(`The Matcher cannot resolve relative paths but received "${path}". Unless you directly called \`matcher.resolve("${path}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`);
718
+ matcher = matchers.find((m) => m.re.test(path));
719
+ if (matcher) {
720
+ params = matcher.parse(path);
721
+ name = matcher.record.name;
722
+ }
723
+ } else {
724
+ matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path));
725
+ if (!matcher) throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND, {
726
+ location: location$1,
727
+ currentLocation
728
+ });
729
+ name = matcher.record.name;
730
+ params = assign({}, currentLocation.params, location$1.params);
731
+ path = matcher.stringify(params);
732
+ }
733
+ const matched = [];
734
+ let parentMatcher = matcher;
735
+ while (parentMatcher) {
736
+ matched.unshift(parentMatcher.record);
737
+ parentMatcher = parentMatcher.parent;
738
+ }
739
+ return {
740
+ name,
741
+ path,
742
+ params,
743
+ matched,
744
+ meta: mergeMetaFields(matched)
745
+ };
746
+ }
747
+ routes.forEach((route) => addRoute(route));
748
+ function clearRoutes() {
749
+ matchers.length = 0;
750
+ matcherMap.clear();
751
+ }
752
+ return {
753
+ addRoute,
754
+ resolve,
755
+ removeRoute,
756
+ clearRoutes,
757
+ getRoutes,
758
+ getRecordMatcher
759
+ };
760
+ }
761
+ /**
762
+ * Picks an object param to contain only specified keys.
763
+ *
764
+ * @param params - params object to pick from
765
+ * @param keys - keys to pick
766
+ */
767
+ function pickParams(params, keys) {
768
+ const newParams = {};
769
+ for (const key of keys) if (key in params) newParams[key] = params[key];
770
+ return newParams;
771
+ }
772
+ /**
773
+ * Normalizes a RouteRecordRaw. Creates a copy
774
+ *
775
+ * @param record
776
+ * @returns the normalized version
777
+ */
778
+ function normalizeRouteRecord(record) {
779
+ const normalized = {
780
+ path: record.path,
781
+ redirect: record.redirect,
782
+ name: record.name,
783
+ meta: record.meta || {},
784
+ aliasOf: record.aliasOf,
785
+ beforeEnter: record.beforeEnter,
786
+ props: normalizeRecordProps(record),
787
+ children: record.children || [],
788
+ instances: {},
789
+ leaveGuards: /* @__PURE__ */ new Set(),
790
+ updateGuards: /* @__PURE__ */ new Set(),
791
+ enterCallbacks: {},
792
+ components: "components" in record ? record.components || null : record.component && { default: record.component }
793
+ };
794
+ Object.defineProperty(normalized, "mods", { value: {} });
795
+ return normalized;
796
+ }
797
+ /**
798
+ * Normalize the optional `props` in a record to always be an object similar to
799
+ * components. Also accept a boolean for components.
800
+ * @param record
801
+ */
802
+ function normalizeRecordProps(record) {
803
+ const propsObject = {};
804
+ const props = record.props || false;
805
+ if ("component" in record) propsObject.default = props;
806
+ else for (const name in record.components) propsObject[name] = typeof props === "object" ? props[name] : props;
807
+ return propsObject;
808
+ }
809
+ /**
810
+ * Checks if a record or any of its parent is an alias
811
+ * @param record
812
+ */
813
+ function isAliasRecord(record) {
814
+ while (record) {
815
+ if (record.record.aliasOf) return true;
816
+ record = record.parent;
817
+ }
818
+ return false;
819
+ }
820
+ /**
821
+ * Merge meta fields of an array of records
822
+ *
823
+ * @param matched - array of matched records
824
+ */
825
+ function mergeMetaFields(matched) {
826
+ return matched.reduce((meta, record) => assign(meta, record.meta), {});
827
+ }
828
+ function isSameParam(a, b) {
829
+ return a.name === b.name && a.optional === b.optional && a.repeatable === b.repeatable;
830
+ }
831
+ /**
832
+ * Check if a path and its alias have the same required params
833
+ *
834
+ * @param a - original record
835
+ * @param b - alias record
836
+ */
837
+ function checkSameParams(a, b) {
838
+ for (const key of a.keys) if (!key.optional && !b.keys.find(isSameParam.bind(null, key))) return warn$1(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
839
+ for (const key of b.keys) if (!key.optional && !a.keys.find(isSameParam.bind(null, key))) return warn$1(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
840
+ }
841
+ /**
842
+ * A route with a name and a child with an empty path without a name should warn when adding the route
843
+ *
844
+ * @param mainNormalizedRecord - RouteRecordNormalized
845
+ * @param parent - RouteRecordMatcher
846
+ */
847
+ function checkChildMissingNameWithEmptyPath(mainNormalizedRecord, parent) {
848
+ if (parent && parent.record.name && !mainNormalizedRecord.name && !mainNormalizedRecord.path) warn$1(`The route named "${String(parent.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`);
849
+ }
850
+ function checkSameNameAsAncestor(record, parent) {
851
+ for (let ancestor = parent; ancestor; ancestor = ancestor.parent) if (ancestor.record.name === record.name) throw new Error(`A route named "${String(record.name)}" has been added as a ${parent === ancestor ? "child" : "descendant"} of a route with the same name. Route names must be unique and a nested route cannot use the same name as an ancestor.`);
852
+ }
853
+ function checkMissingParamsInAbsolutePath(record, parent) {
854
+ for (const key of parent.keys) if (!record.keys.find(isSameParam.bind(null, key))) return warn$1(`Absolute path "${record.record.path}" must have the exact same param named "${key.name}" as its parent "${parent.record.path}".`);
855
+ }
856
+ /**
857
+ * Performs a binary search to find the correct insertion index for a new matcher.
858
+ *
859
+ * Matchers are primarily sorted by their score. If scores are tied then we also consider parent/child relationships,
860
+ * with descendants coming before ancestors. If there's still a tie, new routes are inserted after existing routes.
861
+ *
862
+ * @param matcher - new matcher to be inserted
863
+ * @param matchers - existing matchers
864
+ */
865
+ function findInsertionIndex(matcher, matchers) {
866
+ let lower = 0;
867
+ let upper = matchers.length;
868
+ while (lower !== upper) {
869
+ const mid = lower + upper >> 1;
870
+ if (comparePathParserScore(matcher, matchers[mid]) < 0) upper = mid;
871
+ else lower = mid + 1;
872
+ }
873
+ const insertionAncestor = getInsertionAncestor(matcher);
874
+ if (insertionAncestor) {
875
+ upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
876
+ if (process.env.NODE_ENV !== "production" && upper < 0) warn$1(`Finding ancestor route "${insertionAncestor.record.path}" failed for "${matcher.record.path}"`);
877
+ }
878
+ return upper;
879
+ }
880
+ function getInsertionAncestor(matcher) {
881
+ let ancestor = matcher;
882
+ while (ancestor = ancestor.parent) if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) return ancestor;
883
+ }
884
+ /**
885
+ * Checks if a matcher can be reachable. This means if it's possible to reach it as a route. For example, routes without
886
+ * a component, or name, or redirect, are just used to group other routes.
887
+ * @param matcher
888
+ * @param matcher.record record of the matcher
889
+ * @returns
890
+ */
891
+ function isMatchable({ record }) {
892
+ return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
893
+ }
894
+
895
+ //#endregion
896
+ //#region src/RouterLink.ts
897
+ /**
898
+ * Returns the internal behavior of a {@link RouterLink} without the rendering part.
899
+ *
900
+ * @param props - a `to` location and an optional `replace` flag
901
+ */
902
+ function useLink(props) {
903
+ const router = inject(routerKey);
904
+ const currentRoute = inject(routeLocationKey);
905
+ let hasPrevious = false;
906
+ let previousTo = null;
907
+ const route = computed(() => {
908
+ const to = unref(props.to);
909
+ if (process.env.NODE_ENV !== "production" && (!hasPrevious || to !== previousTo)) {
910
+ if (!isRouteLocation(to)) if (hasPrevious) warn$1(`Invalid value for prop "to" in useLink()\n- to:`, to, `\n- previous to:`, previousTo, `\n- props:`, props);
911
+ else warn$1(`Invalid value for prop "to" in useLink()\n- to:`, to, `\n- props:`, props);
912
+ previousTo = to;
913
+ hasPrevious = true;
914
+ }
915
+ return router.resolve(to);
916
+ });
917
+ const activeRecordIndex = computed(() => {
918
+ const { matched } = route.value;
919
+ const { length } = matched;
920
+ const routeMatched = matched[length - 1];
921
+ const currentMatched = currentRoute.matched;
922
+ if (!routeMatched || !currentMatched.length) return -1;
923
+ const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
924
+ if (index > -1) return index;
925
+ const parentRecordPath = getOriginalPath(matched[length - 2]);
926
+ return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
927
+ });
928
+ const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
929
+ const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
930
+ function navigate(e = {}) {
931
+ if (guardEvent(e)) {
932
+ const p = router[unref(props.replace) ? "replace" : "push"](unref(props.to)).catch(noop);
933
+ if (props.viewTransition && typeof document !== "undefined" && "startViewTransition" in document) document.startViewTransition(() => p);
934
+ return p;
935
+ }
936
+ return Promise.resolve();
937
+ }
938
+ if ((process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) && isBrowser) {
939
+ const instance = getCurrentInstance();
940
+ if (instance) {
941
+ const linkContextDevtools = {
942
+ route: route.value,
943
+ isActive: isActive.value,
944
+ isExactActive: isExactActive.value,
945
+ error: null
946
+ };
947
+ instance.__vrl_devtools = instance.__vrl_devtools || [];
948
+ instance.__vrl_devtools.push(linkContextDevtools);
949
+ watchEffect(() => {
950
+ linkContextDevtools.route = route.value;
951
+ linkContextDevtools.isActive = isActive.value;
952
+ linkContextDevtools.isExactActive = isExactActive.value;
953
+ linkContextDevtools.error = isRouteLocation(unref(props.to)) ? null : "Invalid \"to\" value";
954
+ }, { flush: "post" });
955
+ }
956
+ }
957
+ /**
958
+ * NOTE: update {@link _RouterLinkI}'s `$slots` type when updating this
959
+ */
960
+ return {
961
+ route,
962
+ href: computed(() => route.value.href),
963
+ isActive,
964
+ isExactActive,
965
+ navigate
966
+ };
967
+ }
968
+ function preferSingleVNode(vnodes) {
969
+ return vnodes.length === 1 ? vnodes[0] : vnodes;
970
+ }
971
+ const RouterLinkImpl = /* @__PURE__ */ defineComponent({
972
+ name: "RouterLink",
973
+ compatConfig: { MODE: 3 },
974
+ props: {
975
+ to: {
976
+ type: [String, Object],
977
+ required: true
978
+ },
979
+ replace: Boolean,
980
+ activeClass: String,
981
+ exactActiveClass: String,
982
+ custom: Boolean,
983
+ ariaCurrentValue: {
984
+ type: String,
985
+ default: "page"
986
+ },
987
+ viewTransition: Boolean
988
+ },
989
+ useLink,
990
+ setup(props, { slots }) {
991
+ const link = reactive(useLink(props));
992
+ const { options } = inject(routerKey);
993
+ const elClass = computed(() => ({
994
+ [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
995
+ [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
996
+ }));
997
+ return () => {
998
+ const children = slots.default && preferSingleVNode(slots.default(link));
999
+ return props.custom ? children : h("a", {
1000
+ "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
1001
+ href: link.href,
1002
+ onClick: link.navigate,
1003
+ class: elClass.value
1004
+ }, children);
1005
+ };
1006
+ }
1007
+ });
1008
+ /**
1009
+ * Component to render a link that triggers a navigation on click.
1010
+ */
1011
+ const RouterLink = RouterLinkImpl;
1012
+ function guardEvent(e) {
1013
+ if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
1014
+ if (e.defaultPrevented) return;
1015
+ if (e.button !== void 0 && e.button !== 0) return;
1016
+ if (e.currentTarget && e.currentTarget.getAttribute) {
1017
+ const target = e.currentTarget.getAttribute("target");
1018
+ if (/\b_blank\b/i.test(target)) return;
1019
+ }
1020
+ if (e.preventDefault) e.preventDefault();
1021
+ return true;
1022
+ }
1023
+ function includesParams(outer, inner) {
1024
+ for (const key in inner) {
1025
+ const innerValue = inner[key];
1026
+ const outerValue = outer[key];
1027
+ if (typeof innerValue === "string") {
1028
+ if (innerValue !== outerValue) return false;
1029
+ } else if (!isArray(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value.valueOf() !== outerValue[i].valueOf())) return false;
1030
+ }
1031
+ return true;
1032
+ }
1033
+ /**
1034
+ * Get the original path value of a record by following its aliasOf
1035
+ * @param record
1036
+ */
1037
+ function getOriginalPath(record) {
1038
+ return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
1039
+ }
1040
+ /**
1041
+ * Utility class to get the active class based on defaults.
1042
+ * @param propClass
1043
+ * @param globalClass
1044
+ * @param defaultClass
1045
+ */
1046
+ const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
1047
+
1048
+ //#endregion
1049
+ //#region src/RouterView.ts
1050
+ const RouterViewImpl = /* @__PURE__ */ defineComponent({
1051
+ name: "RouterView",
1052
+ inheritAttrs: false,
1053
+ props: {
1054
+ name: {
1055
+ type: String,
1056
+ default: "default"
1057
+ },
1058
+ route: Object
1059
+ },
1060
+ compatConfig: { MODE: 3 },
1061
+ setup(props, { attrs, slots }) {
1062
+ process.env.NODE_ENV !== "production" && warnDeprecatedUsage();
1063
+ const injectedRoute = inject(routerViewLocationKey);
1064
+ const routeToDisplay = computed(() => props.route || injectedRoute.value);
1065
+ const injectedDepth = inject(viewDepthKey, 0);
1066
+ const depth = computed(() => {
1067
+ let initialDepth = unref(injectedDepth);
1068
+ const { matched } = routeToDisplay.value;
1069
+ let matchedRoute;
1070
+ while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) initialDepth++;
1071
+ return initialDepth;
1072
+ });
1073
+ const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
1074
+ provide(viewDepthKey, computed(() => depth.value + 1));
1075
+ provide(matchedRouteKey, matchedRouteRef);
1076
+ provide(routerViewLocationKey, routeToDisplay);
1077
+ const viewRef = ref();
1078
+ watch(() => [
1079
+ viewRef.value,
1080
+ matchedRouteRef.value,
1081
+ props.name
1082
+ ], ([instance, to, name], [oldInstance, from, oldName]) => {
1083
+ if (to) {
1084
+ to.instances[name] = instance;
1085
+ if (from && from !== to && instance && instance === oldInstance) {
1086
+ if (!to.leaveGuards.size) to.leaveGuards = from.leaveGuards;
1087
+ if (!to.updateGuards.size) to.updateGuards = from.updateGuards;
1088
+ }
1089
+ }
1090
+ if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
1091
+ }, { flush: "post" });
1092
+ return () => {
1093
+ const route = routeToDisplay.value;
1094
+ const currentName = props.name;
1095
+ const matchedRoute = matchedRouteRef.value;
1096
+ const ViewComponent = matchedRoute && matchedRoute.components[currentName];
1097
+ if (!ViewComponent) return normalizeSlot(slots.default, {
1098
+ Component: ViewComponent,
1099
+ route
1100
+ });
1101
+ const routePropsOption = matchedRoute.props[currentName];
1102
+ const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
1103
+ const onVnodeUnmounted = (vnode) => {
1104
+ if (vnode.component.isUnmounted) matchedRoute.instances[currentName] = null;
1105
+ };
1106
+ const component = h(ViewComponent, assign({}, routeProps, attrs, {
1107
+ onVnodeUnmounted,
1108
+ ref: viewRef
1109
+ }));
1110
+ if ((process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) && isBrowser && component.ref) {
1111
+ const info = {
1112
+ depth: depth.value,
1113
+ name: matchedRoute.name,
1114
+ path: matchedRoute.path,
1115
+ meta: matchedRoute.meta
1116
+ };
1117
+ (isArray(component.ref) ? component.ref.map((r) => r.i) : [component.ref.i]).forEach((instance) => {
1118
+ instance.__vrv_devtools = info;
1119
+ });
1120
+ }
1121
+ return normalizeSlot(slots.default, {
1122
+ Component: component,
1123
+ route
1124
+ }) || component;
1125
+ };
1126
+ }
1127
+ });
1128
+ function normalizeSlot(slot, data) {
1129
+ if (!slot) return null;
1130
+ const slotContent = slot(data);
1131
+ return slotContent.length === 1 ? slotContent[0] : slotContent;
1132
+ }
1133
+ /**
1134
+ * Component to display the current route the user is at.
1135
+ */
1136
+ const RouterView = RouterViewImpl;
1137
+ function warnDeprecatedUsage() {
1138
+ const instance = getCurrentInstance();
1139
+ const parentName = instance.parent && instance.parent.type.name;
1140
+ const parentSubTreeType = instance.parent && instance.parent.subTree && instance.parent.subTree.type;
1141
+ if (parentName && (parentName === "KeepAlive" || parentName.includes("Transition")) && typeof parentSubTreeType === "object" && parentSubTreeType.name === "RouterView") {
1142
+ const comp = parentName === "KeepAlive" ? "keep-alive" : "transition";
1143
+ warn$1(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
1144
+ Use slot props instead:
1145
+
1146
+ <router-view v-slot="{ Component }">
1147
+ <${comp}>\n <component :is="Component" />\n </${comp}>\n</router-view>`);
1148
+ }
1149
+ }
1150
+
1151
+ //#endregion
1152
+ //#region src/router.ts
1153
+ /**
1154
+ * Creates a Router instance that can be used by a Vue app.
1155
+ *
1156
+ * @param options - {@link RouterOptions}
1157
+ */
1158
+ function createRouter(options) {
1159
+ const matcher = createRouterMatcher(options.routes, options);
1160
+ const parseQuery$1 = options.parseQuery || parseQuery;
1161
+ const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
1162
+ const routerHistory = options.history;
1163
+ if (process.env.NODE_ENV !== "production" && !routerHistory) throw new Error("Provide the \"history\" option when calling \"createRouter()\": https://router.vuejs.org/api/interfaces/RouterOptions.html#history");
1164
+ const beforeGuards = useCallbacks();
1165
+ const beforeResolveGuards = useCallbacks();
1166
+ const afterGuards = useCallbacks();
1167
+ const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
1168
+ let pendingLocation = START_LOCATION_NORMALIZED;
1169
+ if (isBrowser && options.scrollBehavior && "scrollRestoration" in history) history.scrollRestoration = "manual";
1170
+ const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
1171
+ const encodeParams = applyToParams.bind(null, encodeParam);
1172
+ const decodeParams = applyToParams.bind(null, decode);
1173
+ function addRoute(parentOrRoute, route) {
1174
+ let parent;
1175
+ let record;
1176
+ if (isRouteName(parentOrRoute)) {
1177
+ parent = matcher.getRecordMatcher(parentOrRoute);
1178
+ if (process.env.NODE_ENV !== "production" && !parent) warn$1(`Parent route "${String(parentOrRoute)}" not found when adding child route`, route);
1179
+ record = route;
1180
+ } else record = parentOrRoute;
1181
+ return matcher.addRoute(record, parent);
1182
+ }
1183
+ function removeRoute(name) {
1184
+ const recordMatcher = matcher.getRecordMatcher(name);
1185
+ if (recordMatcher) matcher.removeRoute(recordMatcher);
1186
+ else if (process.env.NODE_ENV !== "production") warn$1(`Cannot remove non-existent route "${String(name)}"`);
1187
+ }
1188
+ function getRoutes() {
1189
+ return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
1190
+ }
1191
+ function hasRoute(name) {
1192
+ return !!matcher.getRecordMatcher(name);
1193
+ }
1194
+ function resolve(rawLocation, currentLocation) {
1195
+ currentLocation = assign({}, currentLocation || currentRoute.value);
1196
+ if (typeof rawLocation === "string") {
1197
+ const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
1198
+ const matchedRoute$1 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
1199
+ const href$1 = routerHistory.createHref(locationNormalized.fullPath);
1200
+ if (process.env.NODE_ENV !== "production") {
1201
+ if (href$1.startsWith("//")) warn$1(`Location "${rawLocation}" resolved to "${href$1}". A resolved location cannot start with multiple slashes.`);
1202
+ else if (!matchedRoute$1.matched.length) warn$1(`No match found for location with path "${rawLocation}"`);
1203
+ }
1204
+ return assign(locationNormalized, matchedRoute$1, {
1205
+ params: decodeParams(matchedRoute$1.params),
1206
+ hash: decode(locationNormalized.hash),
1207
+ redirectedFrom: void 0,
1208
+ href: href$1
1209
+ });
1210
+ }
1211
+ if (process.env.NODE_ENV !== "production" && !isRouteLocation(rawLocation)) {
1212
+ warn$1(`router.resolve() was passed an invalid location. This will fail in production.\n- Location:`, rawLocation);
1213
+ return resolve({});
1214
+ }
1215
+ let matcherLocation;
1216
+ if (rawLocation.path != null) {
1217
+ if (process.env.NODE_ENV !== "production" && "params" in rawLocation && !("name" in rawLocation) && Object.keys(rawLocation.params).length) warn$1(`Path "${rawLocation.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`);
1218
+ matcherLocation = assign({}, rawLocation, { path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path });
1219
+ } else {
1220
+ const targetParams = assign({}, rawLocation.params);
1221
+ for (const key in targetParams) if (targetParams[key] == null) delete targetParams[key];
1222
+ matcherLocation = assign({}, rawLocation, { params: encodeParams(targetParams) });
1223
+ currentLocation.params = encodeParams(currentLocation.params);
1224
+ }
1225
+ const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
1226
+ const hash = rawLocation.hash || "";
1227
+ if (process.env.NODE_ENV !== "production" && hash && !hash.startsWith("#")) warn$1(`A \`hash\` should always start with the character "#". Replace "${hash}" with "#${hash}".`);
1228
+ matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
1229
+ const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
1230
+ hash: encodeHash(hash),
1231
+ path: matchedRoute.path
1232
+ }));
1233
+ const href = routerHistory.createHref(fullPath);
1234
+ if (process.env.NODE_ENV !== "production") {
1235
+ if (href.startsWith("//")) warn$1(`Location "${rawLocation}" resolved to "${href}". A resolved location cannot start with multiple slashes.`);
1236
+ else if (!matchedRoute.matched.length) warn$1(`No match found for location with path "${rawLocation.path != null ? rawLocation.path : rawLocation}"`);
1237
+ }
1238
+ return assign({
1239
+ fullPath,
1240
+ hash,
1241
+ query: stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
1242
+ }, matchedRoute, {
1243
+ redirectedFrom: void 0,
1244
+ href
1245
+ });
1246
+ }
1247
+ function locationAsObject(to) {
1248
+ return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign({}, to);
1249
+ }
1250
+ function checkCanceledNavigation(to, from) {
1251
+ if (pendingLocation !== to) return createRouterError(ErrorTypes.NAVIGATION_CANCELLED, {
1252
+ from,
1253
+ to
1254
+ });
1255
+ }
1256
+ function push(to) {
1257
+ return pushWithRedirect(to);
1258
+ }
1259
+ function replace(to) {
1260
+ return push(assign(locationAsObject(to), { replace: true }));
1261
+ }
1262
+ function handleRedirectRecord(to, from) {
1263
+ const lastMatched = to.matched[to.matched.length - 1];
1264
+ if (lastMatched && lastMatched.redirect) {
1265
+ const { redirect } = lastMatched;
1266
+ let newTargetLocation = typeof redirect === "function" ? redirect(to, from) : redirect;
1267
+ if (typeof newTargetLocation === "string") {
1268
+ newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
1269
+ newTargetLocation.params = {};
1270
+ }
1271
+ if (process.env.NODE_ENV !== "production" && newTargetLocation.path == null && !("name" in newTargetLocation)) {
1272
+ warn$1(`Invalid redirect found:\n${JSON.stringify(newTargetLocation, null, 2)}\n when navigating to "${to.fullPath}". A redirect must contain a name or path. This will break in production.`);
1273
+ throw new Error("Invalid redirect");
1274
+ }
1275
+ return assign({
1276
+ query: to.query,
1277
+ hash: to.hash,
1278
+ params: newTargetLocation.path != null ? {} : to.params
1279
+ }, newTargetLocation);
1280
+ }
1281
+ }
1282
+ function pushWithRedirect(to, redirectedFrom) {
1283
+ const targetLocation = pendingLocation = resolve(to);
1284
+ const from = currentRoute.value;
1285
+ const data = to.state;
1286
+ const force = to.force;
1287
+ const replace$1 = to.replace === true;
1288
+ const shouldRedirect = handleRedirectRecord(targetLocation, from);
1289
+ if (shouldRedirect) return pushWithRedirect(assign(locationAsObject(shouldRedirect), {
1290
+ state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
1291
+ force,
1292
+ replace: replace$1
1293
+ }), redirectedFrom || targetLocation);
1294
+ const toLocation = targetLocation;
1295
+ toLocation.redirectedFrom = redirectedFrom;
1296
+ let failure;
1297
+ if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
1298
+ failure = createRouterError(ErrorTypes.NAVIGATION_DUPLICATED, {
1299
+ to: toLocation,
1300
+ from
1301
+ });
1302
+ handleScroll(from, from, true, false);
1303
+ }
1304
+ return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure$1) => {
1305
+ if (failure$1) {
1306
+ if (isNavigationFailure(failure$1, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
1307
+ if (process.env.NODE_ENV !== "production" && isSameRouteLocation(stringifyQuery$1, resolve(failure$1.to), toLocation) && redirectedFrom && (redirectedFrom._count = redirectedFrom._count ? redirectedFrom._count + 1 : 1) > 30) {
1308
+ warn$1(`Detected a possibly infinite redirection in a navigation guard when going from "${from.fullPath}" to "${toLocation.fullPath}". Aborting to avoid a Stack Overflow.\n Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`);
1309
+ return Promise.reject(/* @__PURE__ */ new Error("Infinite redirect in navigation guard"));
1310
+ }
1311
+ return pushWithRedirect(assign({ replace: replace$1 }, locationAsObject(failure$1.to), {
1312
+ state: typeof failure$1.to === "object" ? assign({}, data, failure$1.to.state) : data,
1313
+ force
1314
+ }), redirectedFrom || toLocation);
1315
+ }
1316
+ } else failure$1 = finalizeNavigation(toLocation, from, true, replace$1, data);
1317
+ triggerAfterEach(toLocation, from, failure$1);
1318
+ return failure$1;
1319
+ });
1320
+ }
1321
+ /**
1322
+ * Helper to reject and skip all navigation guards if a new navigation happened
1323
+ * @param to
1324
+ * @param from
1325
+ */
1326
+ function checkCanceledNavigationAndReject(to, from) {
1327
+ const error = checkCanceledNavigation(to, from);
1328
+ return error ? Promise.reject(error) : Promise.resolve();
1329
+ }
1330
+ function runWithContext(fn) {
1331
+ const app = installedApps.values().next().value;
1332
+ return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
1333
+ }
1334
+ function navigate(to, from) {
1335
+ let guards;
1336
+ const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
1337
+ guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
1338
+ for (const record of leavingRecords) record.leaveGuards.forEach((guard) => {
1339
+ guards.push(guardToPromiseFn(guard, to, from));
1340
+ });
1341
+ const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
1342
+ guards.push(canceledNavigationCheck);
1343
+ return runGuardQueue(guards).then(() => {
1344
+ guards = [];
1345
+ for (const guard of beforeGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
1346
+ guards.push(canceledNavigationCheck);
1347
+ return runGuardQueue(guards);
1348
+ }).then(() => {
1349
+ guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
1350
+ for (const record of updatingRecords) record.updateGuards.forEach((guard) => {
1351
+ guards.push(guardToPromiseFn(guard, to, from));
1352
+ });
1353
+ guards.push(canceledNavigationCheck);
1354
+ return runGuardQueue(guards);
1355
+ }).then(() => {
1356
+ guards = [];
1357
+ for (const record of enteringRecords) if (record.beforeEnter) if (isArray(record.beforeEnter)) for (const beforeEnter of record.beforeEnter) guards.push(guardToPromiseFn(beforeEnter, to, from));
1358
+ else guards.push(guardToPromiseFn(record.beforeEnter, to, from));
1359
+ guards.push(canceledNavigationCheck);
1360
+ return runGuardQueue(guards);
1361
+ }).then(() => {
1362
+ to.matched.forEach((record) => record.enterCallbacks = {});
1363
+ guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
1364
+ guards.push(canceledNavigationCheck);
1365
+ return runGuardQueue(guards);
1366
+ }).then(() => {
1367
+ guards = [];
1368
+ for (const guard of beforeResolveGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
1369
+ guards.push(canceledNavigationCheck);
1370
+ return runGuardQueue(guards);
1371
+ }).catch((err) => isNavigationFailure(err, ErrorTypes.NAVIGATION_CANCELLED) ? err : Promise.reject(err));
1372
+ }
1373
+ function triggerAfterEach(to, from, failure) {
1374
+ afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
1375
+ }
1376
+ /**
1377
+ * - Cleans up any navigation guards
1378
+ * - Changes the url if necessary
1379
+ * - Calls the scrollBehavior
1380
+ */
1381
+ function finalizeNavigation(toLocation, from, isPush, replace$1, data) {
1382
+ const error = checkCanceledNavigation(toLocation, from);
1383
+ if (error) return error;
1384
+ const isFirstNavigation = from === START_LOCATION_NORMALIZED;
1385
+ const state = !isBrowser ? {} : history.state;
1386
+ if (isPush) if (replace$1 || isFirstNavigation) routerHistory.replace(toLocation.fullPath, assign({ scroll: isFirstNavigation && state && state.scroll }, data));
1387
+ else routerHistory.push(toLocation.fullPath, data);
1388
+ currentRoute.value = toLocation;
1389
+ handleScroll(toLocation, from, isPush, isFirstNavigation);
1390
+ markAsReady();
1391
+ }
1392
+ let removeHistoryListener;
1393
+ function setupListeners() {
1394
+ if (removeHistoryListener) return;
1395
+ removeHistoryListener = routerHistory.listen((to, _from, info) => {
1396
+ if (!router.listening) return;
1397
+ const toLocation = resolve(to);
1398
+ const shouldRedirect = handleRedirectRecord(toLocation, router.currentRoute.value);
1399
+ if (shouldRedirect) {
1400
+ pushWithRedirect(assign(shouldRedirect, {
1401
+ replace: true,
1402
+ force: true
1403
+ }), toLocation).catch(noop);
1404
+ return;
1405
+ }
1406
+ pendingLocation = toLocation;
1407
+ const from = currentRoute.value;
1408
+ if (isBrowser) saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
1409
+ navigate(toLocation, from).catch((error) => {
1410
+ if (isNavigationFailure(error, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_CANCELLED)) return error;
1411
+ if (isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
1412
+ pushWithRedirect(assign(locationAsObject(error.to), { force: true }), toLocation).then((failure) => {
1413
+ if (isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED) && !info.delta && info.type === NavigationType.pop) routerHistory.go(-1, false);
1414
+ }).catch(noop);
1415
+ return Promise.reject();
1416
+ }
1417
+ if (info.delta) routerHistory.go(-info.delta, false);
1418
+ return triggerError(error, toLocation, from);
1419
+ }).then((failure) => {
1420
+ failure = failure || finalizeNavigation(toLocation, from, false);
1421
+ if (failure) {
1422
+ if (info.delta && !isNavigationFailure(failure, ErrorTypes.NAVIGATION_CANCELLED)) routerHistory.go(-info.delta, false);
1423
+ else if (info.type === NavigationType.pop && isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED)) routerHistory.go(-1, false);
1424
+ }
1425
+ triggerAfterEach(toLocation, from, failure);
1426
+ }).catch(noop);
1427
+ });
1428
+ }
1429
+ let readyHandlers = useCallbacks();
1430
+ let errorListeners = useCallbacks();
1431
+ let ready;
1432
+ /**
1433
+ * Trigger errorListeners added via onError and throws the error as well
1434
+ *
1435
+ * @param error - error to throw
1436
+ * @param to - location we were navigating to when the error happened
1437
+ * @param from - location we were navigating from when the error happened
1438
+ * @returns the error as a rejected promise
1439
+ */
1440
+ function triggerError(error, to, from) {
1441
+ markAsReady(error);
1442
+ const list = errorListeners.list();
1443
+ if (list.length) list.forEach((handler) => handler(error, to, from));
1444
+ else {
1445
+ if (process.env.NODE_ENV !== "production") warn$1("uncaught error during route navigation:");
1446
+ console.error(error);
1447
+ }
1448
+ return Promise.reject(error);
1449
+ }
1450
+ function isReady() {
1451
+ if (ready && currentRoute.value !== START_LOCATION_NORMALIZED) return Promise.resolve();
1452
+ return new Promise((resolve$1, reject) => {
1453
+ readyHandlers.add([resolve$1, reject]);
1454
+ });
1455
+ }
1456
+ function markAsReady(err) {
1457
+ if (!ready) {
1458
+ ready = !err;
1459
+ setupListeners();
1460
+ readyHandlers.list().forEach(([resolve$1, reject]) => err ? reject(err) : resolve$1());
1461
+ readyHandlers.reset();
1462
+ }
1463
+ return err;
1464
+ }
1465
+ function handleScroll(to, from, isPush, isFirstNavigation) {
1466
+ const { scrollBehavior } = options;
1467
+ if (!isBrowser || !scrollBehavior) return Promise.resolve();
1468
+ const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
1469
+ return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
1470
+ }
1471
+ const go = (delta) => routerHistory.go(delta);
1472
+ let started;
1473
+ const installedApps = /* @__PURE__ */ new Set();
1474
+ const router = {
1475
+ currentRoute,
1476
+ listening: true,
1477
+ addRoute,
1478
+ removeRoute,
1479
+ clearRoutes: matcher.clearRoutes,
1480
+ hasRoute,
1481
+ getRoutes,
1482
+ resolve,
1483
+ options,
1484
+ push,
1485
+ replace,
1486
+ go,
1487
+ back: () => go(-1),
1488
+ forward: () => go(1),
1489
+ beforeEach: beforeGuards.add,
1490
+ beforeResolve: beforeResolveGuards.add,
1491
+ afterEach: afterGuards.add,
1492
+ onError: errorListeners.add,
1493
+ isReady,
1494
+ install(app) {
1495
+ app.component("RouterLink", RouterLink);
1496
+ app.component("RouterView", RouterView);
1497
+ app.config.globalProperties.$router = router;
1498
+ Object.defineProperty(app.config.globalProperties, "$route", {
1499
+ enumerable: true,
1500
+ get: () => unref(currentRoute)
1501
+ });
1502
+ if (isBrowser && !started && currentRoute.value === START_LOCATION_NORMALIZED) {
1503
+ started = true;
1504
+ push(routerHistory.location).catch((err) => {
1505
+ if (process.env.NODE_ENV !== "production") warn$1("Unexpected error when starting the router:", err);
1506
+ });
1507
+ }
1508
+ const reactiveRoute = {};
1509
+ for (const key in START_LOCATION_NORMALIZED) Object.defineProperty(reactiveRoute, key, {
1510
+ get: () => currentRoute.value[key],
1511
+ enumerable: true
1512
+ });
1513
+ app.provide(routerKey, router);
1514
+ app.provide(routeLocationKey, shallowReactive(reactiveRoute));
1515
+ app.provide(routerViewLocationKey, currentRoute);
1516
+ const unmountApp = app.unmount;
1517
+ installedApps.add(app);
1518
+ app.unmount = function() {
1519
+ installedApps.delete(app);
1520
+ if (installedApps.size < 1) {
1521
+ pendingLocation = START_LOCATION_NORMALIZED;
1522
+ removeHistoryListener && removeHistoryListener();
1523
+ removeHistoryListener = null;
1524
+ currentRoute.value = START_LOCATION_NORMALIZED;
1525
+ started = false;
1526
+ ready = false;
1527
+ }
1528
+ unmountApp();
1529
+ };
1530
+ if ((process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) && isBrowser) addDevtools(app, router, matcher);
1531
+ }
1532
+ };
1533
+ function runGuardQueue(guards) {
1534
+ return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
1535
+ }
1536
+ return router;
1537
+ }
1538
+
1539
+ //#endregion
1540
+ //#region src/useApi.ts
1541
+ /**
1542
+ * Returns the router instance. Equivalent to using `$router` inside
1543
+ * templates.
1544
+ */
1545
+ function useRouter() {
1546
+ return inject(routerKey);
1547
+ }
1548
+ /**
1549
+ * Returns the current route location. Equivalent to using `$route` inside
1550
+ * templates.
1551
+ */
1552
+ function useRoute(_name) {
1553
+ return inject(routeLocationKey);
1554
+ }
1555
+
1556
+ //#endregion
1557
+ export { NavigationFailureType, RouterLink, RouterView, START_LOCATION_NORMALIZED as START_LOCATION, createMemoryHistory, createRouter, createRouterMatcher, createWebHashHistory, createWebHistory, isNavigationFailure, loadRouteLocation, matchedRouteKey, onBeforeRouteLeave, onBeforeRouteUpdate, parseQuery, routeLocationKey, routerKey, routerViewLocationKey, stringifyQuery, useLink, useRoute, useRouter, viewDepthKey };