testeranto 0.177.0 → 0.189.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 (768) hide show
  1. package/CNAME +1 -0
  2. package/README.html +302 -0
  3. package/README.md +24 -4
  4. package/dist/common/src/App.js +43 -0
  5. package/dist/common/src/Node.js +4 -8
  6. package/dist/common/src/PM/PM_WithEslintAndTsc.js +2 -33
  7. package/dist/common/src/PM/base.js +0 -1
  8. package/dist/common/src/PM/layers/base/PM_Base.js +1 -0
  9. package/dist/common/src/PM/layers/base/components/PageOperations.js +1 -0
  10. package/dist/common/src/PM/layers/base/components/PageOperations.testeranto.js +1 -0
  11. package/dist/common/src/PM/layers/linting/components/Linter.js +1 -0
  12. package/dist/common/src/PM/layers/linting/components/TypeChecker.js +1 -0
  13. package/dist/common/src/PM/layers/main/components/SidecarManager.js +1 -0
  14. package/dist/common/src/PM/layers/main/components/TestRunner.js +1 -0
  15. package/dist/common/src/PM/main.js +211 -109
  16. package/dist/common/src/PM/nodeSidecar.js +1 -0
  17. package/dist/common/src/PM/pure.js +15 -10
  18. package/dist/common/src/PM/pureSidecar.js +1 -1
  19. package/dist/common/src/PM/types.js +1 -0
  20. package/dist/common/src/PM/web.js +2 -1
  21. package/dist/common/src/Pure.js +1 -1
  22. package/dist/common/src/Pure.test.js +21 -19
  23. package/dist/common/src/build.js +30 -39
  24. package/dist/common/src/components/SunriseAnimation.js +291 -0
  25. package/dist/common/src/components/SunriseAnimation.test/interface.js +67 -0
  26. package/dist/common/src/components/SunriseAnimation.test/types.js +2 -0
  27. package/dist/common/src/components/TestStatusBadge.js +1 -21
  28. package/dist/common/src/components/pure/AppFrame.js +20 -0
  29. package/dist/common/src/components/pure/AppFrame.test/implementation.js +63 -0
  30. package/dist/common/src/components/pure/AppFrame.test/index.js +14 -0
  31. package/dist/common/src/components/pure/AppFrame.test/specification.js +25 -0
  32. package/dist/common/src/components/pure/AppFrame.test/types.js +3 -0
  33. package/dist/common/src/components/pure/FeaturesReporterView.js +23 -0
  34. package/dist/common/src/components/pure/FeaturesReporterView.test/implementation.js +84 -0
  35. package/dist/common/src/components/pure/FeaturesReporterView.test/index.js +14 -0
  36. package/dist/common/src/components/pure/FeaturesReporterView.test/specification.js +27 -0
  37. package/dist/common/src/components/pure/FeaturesReporterView.test/types.js +2 -0
  38. package/dist/common/src/components/pure/ModalContent.js +86 -0
  39. package/dist/common/src/components/pure/ModalContent.test/implementation.js +33 -0
  40. package/dist/common/src/components/pure/ModalContent.test/index.js +12 -0
  41. package/dist/common/src/components/pure/ModalContent.test/specification.js +19 -0
  42. package/dist/common/src/components/pure/ModalContent.test/types.js +4 -0
  43. package/dist/common/src/components/pure/ProjectPageView.js +53 -76
  44. package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +118 -33
  45. package/dist/common/src/components/pure/ProjectPageView.test/index.js +5 -1
  46. package/dist/common/src/components/pure/ProjectPageView.test/specification.js +15 -2
  47. package/dist/common/src/components/pure/ProjectPageView.test/types.js +2 -0
  48. package/dist/common/src/components/pure/ProjectsPageView.js +66 -0
  49. package/dist/common/src/components/pure/SettingsButton.js +83 -0
  50. package/dist/common/src/components/pure/TestPageView.js +134 -0
  51. package/dist/common/src/components/pure/TestPageView.test/implementation.js +202 -0
  52. package/dist/common/src/components/pure/TestPageView.test/index.js +15 -0
  53. package/dist/common/src/components/pure/TestPageView.test/specification.js +26 -0
  54. package/dist/common/src/components/pure/TestPageView.test/types.js +4 -0
  55. package/dist/common/src/components/pure/ThemeCard.js +15 -0
  56. package/dist/common/src/components/stateful/FeaturesReporter.js +59 -0
  57. package/dist/common/src/components/stateful/ProjectPage.js +100 -0
  58. package/dist/common/src/components/stateful/ProjectsPage.js +92 -0
  59. package/dist/common/src/components/stateful/TestPage.js +133 -0
  60. package/dist/common/src/defaultConfig.js +1 -0
  61. package/dist/common/src/esbuildConfigs/web.js +1 -1
  62. package/dist/common/src/lib/BaseSuite.js +1 -0
  63. package/dist/common/src/lib/BaseSuite.test/mock.js +0 -11
  64. package/dist/common/src/lib/BaseSuite.test/test.js +11 -22
  65. package/dist/common/src/lib/Sidecar.js +1 -0
  66. package/dist/common/src/lib/abstractBase.js +13 -6
  67. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +0 -6
  68. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +3 -1
  69. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.mock.js +28 -17
  70. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.pure.js +2 -2
  71. package/dist/common/src/lib/basebuilder.js +32 -30
  72. package/dist/common/src/lib/classBuilder.js +2 -0
  73. package/dist/common/src/lib/core.js +0 -1
  74. package/dist/common/src/lib/core.test/MockCore.js +0 -14
  75. package/dist/common/src/lib/core.test/core.test.adapter.js +2 -9
  76. package/dist/common/src/lib/core.test/core.test.implementation.js +3 -7
  77. package/dist/common/src/lib/index.js +2 -0
  78. package/dist/common/src/lib/pmProxy.js +0 -2
  79. package/dist/common/src/lib/pmProxy.test/adapter.js +8 -2
  80. package/dist/common/src/lib/pmProxy.test/implementation.js +33 -4
  81. package/dist/common/src/lib/pmProxy.test/mockPMBase.js +9 -0
  82. package/dist/common/src/mothership/index.js +5 -0
  83. package/dist/common/src/mothership/test.js +44 -25
  84. package/dist/common/src/types/features.js +34 -0
  85. package/dist/common/src/utils/api.js +42 -23
  86. package/dist/common/src/utils/featureUtils.js +29 -0
  87. package/dist/common/src/utils/logFiles.js +25 -0
  88. package/dist/common/src/utils/makePrompt.js +115 -0
  89. package/dist/common/src/web.html.js +2 -6
  90. package/dist/common/testeranto.config.js +62 -34
  91. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  92. package/dist/module/src/App.js +9 -17
  93. package/dist/module/src/Node.js +4 -8
  94. package/dist/module/src/PM/PM_WithEslintAndTsc.js +3 -34
  95. package/dist/module/src/PM/base.js +0 -1
  96. package/dist/module/src/PM/layers/base/PM_Base.js +1 -0
  97. package/dist/module/src/PM/layers/base/components/PageOperations.js +1 -0
  98. package/dist/module/src/PM/layers/base/components/PageOperations.testeranto.js +1 -0
  99. package/dist/module/src/PM/layers/linting/components/Linter.js +1 -0
  100. package/dist/module/src/PM/layers/linting/components/TypeChecker.js +1 -0
  101. package/dist/module/src/PM/layers/main/components/SidecarManager.js +1 -0
  102. package/dist/module/src/PM/layers/main/components/TestRunner.js +1 -0
  103. package/dist/module/src/PM/main.js +207 -105
  104. package/dist/module/src/PM/nodeSidecar.js +1 -0
  105. package/dist/module/src/PM/pure.js +15 -10
  106. package/dist/module/src/PM/pureSidecar.js +1 -1
  107. package/dist/module/src/PM/types.js +1 -0
  108. package/dist/module/src/PM/web.js +2 -1
  109. package/dist/module/src/Pure.js +1 -1
  110. package/dist/module/src/Pure.test.js +21 -19
  111. package/dist/module/src/build.js +25 -37
  112. package/dist/module/src/components/SunriseAnimation.test/interface.js +32 -1
  113. package/dist/module/src/components/TestStatusBadge.js +1 -21
  114. package/dist/module/src/components/pure/AppFrame.js +13 -0
  115. package/dist/module/src/components/pure/AppFrame.test/implementation.js +57 -0
  116. package/dist/module/src/components/pure/AppFrame.test/index.js +9 -0
  117. package/dist/module/src/components/pure/AppFrame.test/specification.js +21 -0
  118. package/dist/module/src/components/pure/AppFrame.test/types.js +2 -0
  119. package/dist/module/src/components/pure/FeaturesReporterView.js +16 -0
  120. package/dist/module/src/components/pure/FeaturesReporterView.test/implementation.js +81 -0
  121. package/dist/module/src/components/pure/FeaturesReporterView.test/index.js +9 -0
  122. package/dist/module/src/components/pure/FeaturesReporterView.test/specification.js +23 -0
  123. package/dist/module/src/components/pure/ModalContent.js +79 -0
  124. package/dist/module/src/components/pure/ModalContent.test/implementation.js +30 -0
  125. package/dist/module/src/components/pure/ModalContent.test/index.js +7 -0
  126. package/dist/module/src/components/pure/ModalContent.test/specification.js +15 -0
  127. package/dist/module/src/components/pure/ModalContent.test/types.js +3 -0
  128. package/dist/module/src/components/pure/ProjectPageView.js +54 -77
  129. package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +118 -33
  130. package/dist/module/src/components/pure/ProjectPageView.test/index.js +5 -1
  131. package/dist/module/src/components/pure/ProjectPageView.test/specification.js +15 -2
  132. package/dist/module/src/components/pure/ProjectPageView.test/types.js +2 -0
  133. package/dist/module/src/components/pure/ProjectsPageView.js +5 -4
  134. package/dist/module/src/components/pure/SettingsButton.js +43 -0
  135. package/dist/module/src/components/pure/TestPageView.js +100 -121
  136. package/dist/module/src/components/pure/TestPageView.test/implementation.js +166 -0
  137. package/dist/module/src/components/pure/TestPageView.test/index.js +10 -0
  138. package/dist/module/src/components/pure/TestPageView.test/specification.js +22 -0
  139. package/dist/module/src/components/pure/TestPageView.test/types.js +3 -0
  140. package/dist/module/src/components/pure/ThemeCard.js +8 -0
  141. package/dist/module/src/components/stateful/FeaturesReporter.js +22 -0
  142. package/dist/module/src/components/stateful/ProjectPage.js +1 -1
  143. package/dist/module/src/components/stateful/TestPage.js +25 -11
  144. package/dist/module/src/defaultConfig.js +1 -0
  145. package/dist/module/src/esbuildConfigs/web.js +1 -1
  146. package/dist/module/src/lib/BaseSuite.js +1 -0
  147. package/dist/module/src/lib/BaseSuite.test/mock.js +0 -11
  148. package/dist/module/src/lib/BaseSuite.test/test.js +11 -22
  149. package/dist/module/src/lib/Sidecar.js +1 -0
  150. package/dist/module/src/lib/abstractBase.js +13 -6
  151. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +0 -6
  152. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +3 -1
  153. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.mock.js +28 -17
  154. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.pure.js +1 -1
  155. package/dist/module/src/lib/basebuilder.js +32 -30
  156. package/dist/module/src/lib/classBuilder.js +2 -0
  157. package/dist/module/src/lib/core.js +0 -1
  158. package/dist/module/src/lib/core.test/MockCore.js +0 -14
  159. package/dist/module/src/lib/core.test/core.test.adapter.js +2 -9
  160. package/dist/module/src/lib/core.test/core.test.implementation.js +3 -7
  161. package/dist/module/src/lib/index.js +2 -0
  162. package/dist/module/src/lib/pmProxy.js +0 -2
  163. package/dist/module/src/lib/pmProxy.test/adapter.js +8 -2
  164. package/dist/module/src/lib/pmProxy.test/implementation.js +33 -4
  165. package/dist/module/src/lib/pmProxy.test/mockPMBase.js +9 -0
  166. package/dist/module/src/mothership/index.js +5 -0
  167. package/dist/module/src/mothership/test.js +44 -25
  168. package/dist/module/src/types/features.js +31 -0
  169. package/dist/module/src/utils/api.js +41 -21
  170. package/dist/module/src/utils/featureUtils.js +24 -0
  171. package/dist/module/src/utils/logFiles.js +21 -0
  172. package/dist/module/src/utils/makePrompt.js +108 -0
  173. package/dist/module/src/web.html.js +2 -6
  174. package/dist/module/testeranto.config.js +62 -34
  175. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  176. package/dist/prebuild/App.css +444 -12
  177. package/dist/prebuild/App.js +1318 -1053
  178. package/dist/prebuild/build.mjs +87 -103
  179. package/dist/prebuild/mothership/index.mjs +5 -0
  180. package/dist/prebuild/run.mjs +342 -211
  181. package/dist/tsconfig.tsbuildinfo +1 -0
  182. package/dist/types/App.d.ts +1 -0
  183. package/dist/types/PM/layers/main/components/SidecarManager.d.ts +0 -0
  184. package/dist/types/PM/layers/main/components/TestRunner.d.ts +0 -0
  185. package/dist/types/{src/PM → PM}/main.d.ts +18 -3
  186. package/dist/types/{src/PM → PM}/pure.d.ts +7 -4
  187. package/dist/types/PM/types.d.ts +0 -0
  188. package/dist/types/{src/PM → PM}/web.d.ts +1 -1
  189. package/dist/types/{src/Types.d.ts → Types.d.ts} +1 -0
  190. package/dist/types/components/SunriseAnimation.d.ts +5 -0
  191. package/dist/types/components/SunriseAnimation.test/implementation.d.ts +0 -0
  192. package/dist/types/components/SunriseAnimation.test/index.d.ts +0 -0
  193. package/dist/types/components/SunriseAnimation.test/interface.d.ts +11 -0
  194. package/dist/types/components/SunriseAnimation.test/specification.d.ts +0 -0
  195. package/dist/types/components/SunriseAnimation.test/types.d.ts +39 -0
  196. package/dist/types/components/pure/AppFrame.d.ts +9 -0
  197. package/dist/types/components/pure/AppFrame.test/implementation.d.ts +3 -0
  198. package/dist/types/components/pure/AppFrame.test/index.d.ts +5 -0
  199. package/dist/types/components/pure/AppFrame.test/types.d.ts +33 -0
  200. package/dist/types/components/pure/FeaturesReporterView.d.ts +7 -0
  201. package/dist/types/{src/components/pure/ProjectPageView.test → components/pure/FeaturesReporterView.test}/index.d.ts +1 -2
  202. package/dist/types/components/pure/FeaturesReporterView.test/specification.d.ts +3 -0
  203. package/dist/types/components/pure/FeaturesReporterView.test/types.d.ts +54 -0
  204. package/dist/types/components/pure/ModalContent.d.ts +7 -0
  205. package/dist/types/components/pure/ModalContent.test/implementation.d.ts +3 -0
  206. package/dist/types/components/pure/ModalContent.test/index.d.ts +2 -0
  207. package/dist/types/components/pure/ModalContent.test/specification.d.ts +3 -0
  208. package/dist/types/components/pure/ModalContent.test/types.d.ts +45 -0
  209. package/dist/types/components/pure/ProjectPageView.d.ts +14 -0
  210. package/dist/types/components/pure/ProjectPageView.test/implementation.d.ts +3 -0
  211. package/dist/types/components/pure/ProjectPageView.test/index.d.ts +2 -0
  212. package/dist/types/components/pure/ProjectPageView.test/specification.d.ts +3 -0
  213. package/dist/types/components/pure/ProjectPageView.test/types.d.ts +57 -0
  214. package/dist/types/components/pure/ProjectsPageView.d.ts +29 -0
  215. package/dist/types/components/pure/SettingsButton.d.ts +3 -0
  216. package/dist/types/components/pure/TestPageView.d.ts +15 -0
  217. package/dist/types/components/pure/TestPageView.test/implementation.d.ts +11 -0
  218. package/dist/types/components/pure/TestPageView.test/index.d.ts +32 -0
  219. package/dist/types/components/pure/TestPageView.test/specification.d.ts +11 -0
  220. package/dist/types/components/pure/TestPageView.test/types.d.ts +65 -0
  221. package/dist/types/components/pure/ThemeCard.d.ts +9 -0
  222. package/dist/types/components/stateful/FeaturesReporter.d.ts +2 -0
  223. package/dist/types/components/stateful/ProjectPage.d.ts +1 -0
  224. package/dist/types/components/stateful/ProjectsPage.d.ts +1 -0
  225. package/dist/types/components/stateful/TestPage.d.ts +1 -0
  226. package/dist/types/init-docs.d.ts +1 -0
  227. package/dist/types/{src/lib → lib}/abstractBase.d.ts +1 -1
  228. package/dist/types/{src/lib → lib}/abstractBase.test/MockGiven.d.ts +1 -1
  229. package/dist/types/lib/baseBuilder.test/baseBuilder.test.pure.d.ts +3 -0
  230. package/dist/types/{src/lib → lib}/index.d.ts +7 -7
  231. package/dist/types/run.d.ts +1 -0
  232. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  233. package/dist/types/types/features.d.ts +7 -0
  234. package/dist/types/{src/utils → utils}/api.d.ts +1 -5
  235. package/dist/types/utils/featureUtils.d.ts +6 -0
  236. package/dist/types/utils/logFiles.d.ts +7 -0
  237. package/dist/types/utils/makePrompt.d.ts +2 -0
  238. package/dist/types/{src/web.html.d.ts → web.html.d.ts} +1 -1
  239. package/docs/index.md +17 -0
  240. package/docs/testing.prompt.txt +1 -3
  241. package/docs.html +28 -10
  242. package/index.d.ts +38 -13
  243. package/index.html +59 -205
  244. package/marketing.md +166 -0
  245. package/package.json +15 -7
  246. package/scripts/compile-docs.js +24 -14
  247. package/smil30/SMIL-anim.mod.xsd +163 -0
  248. package/smil30/SMIL-control.mod.xsd +73 -0
  249. package/smil30/SMIL-layout.mod.xsd +149 -0
  250. package/smil30/SMIL-link.mod.xsd +145 -0
  251. package/smil30/SMIL-media.mod.xsd +1646 -0
  252. package/smil30/SMIL-metainformation.mod.xsd +45 -0
  253. package/smil30/SMIL-smiltext.mod.xsd +353 -0
  254. package/smil30/SMIL-state.mod.xsd +133 -0
  255. package/smil30/SMIL-struct.mod.xsd +70 -0
  256. package/smil30/SMIL-timing.mod.xsd +105 -0
  257. package/smil30/SMIL-transition.mod.xsd +229 -0
  258. package/smil30/SMIL.xsd +63 -0
  259. package/smil30/its.xsd +42 -0
  260. package/smil30/smil-attribs-1.mod.xsd +610 -0
  261. package/smil30/smil-datatypes-1.mod.xsd +72 -0
  262. package/smil30/smil-framework-1.mod.xsd +45 -0
  263. package/smil30/xml.xsd +16 -0
  264. package/src/App.scss +4 -13
  265. package/src/App.tsx +11 -25
  266. package/src/Node.ts +6 -9
  267. package/src/PM/PM_WithEslintAndTsc.ts +7 -93
  268. package/src/PM/__tests__/nodeSidecar.testeranto.ts +2 -0
  269. package/src/PM/base.ts +0 -3
  270. package/src/PM/layers/base/PM_Base.ts +0 -0
  271. package/src/PM/layers/base/components/PageOperations.testeranto.ts +0 -0
  272. package/src/PM/layers/base/components/PageOperations.ts +0 -0
  273. package/src/PM/layers/linting/components/Linter.ts +0 -0
  274. package/src/PM/layers/linting/components/TypeChecker.ts +0 -0
  275. package/src/PM/layers/main/components/SidecarManager.ts +0 -0
  276. package/src/PM/layers/main/components/TestRunner.ts +0 -0
  277. package/src/PM/main.ts +249 -120
  278. package/src/PM/nodeSidecar.ts +1 -0
  279. package/src/PM/pure.ts +15 -21
  280. package/src/PM/pureSidecar.ts +1 -1
  281. package/src/PM/types.ts +0 -0
  282. package/src/PM/web.ts +2 -1
  283. package/src/Pure.test.ts +21 -20
  284. package/src/Pure.ts +1 -1
  285. package/src/README.md +66 -0
  286. package/src/Types.ts +1 -0
  287. package/src/build.ts +28 -54
  288. package/src/components/{pure/ProjectPageView.test/index.ts → SunriseAnimation.test/index.tsx} +7 -4
  289. package/src/components/SunriseAnimation.test/interface.ts +49 -0
  290. package/src/components/SunriseAnimation.test/types.ts +53 -0
  291. package/src/components/TestStatusBadge.tsx +2 -23
  292. package/src/components/pure/AppFrame.test/implementation.tsx +72 -0
  293. package/src/components/pure/AppFrame.test/index.tsx +22 -0
  294. package/src/components/pure/AppFrame.test/specification.ts +35 -0
  295. package/src/components/pure/AppFrame.test/types.ts +65 -0
  296. package/src/components/pure/AppFrame.tsx +29 -0
  297. package/src/components/pure/FeaturesReporterView.test/implementation.tsx +106 -0
  298. package/src/components/pure/FeaturesReporterView.test/index.tsx +18 -0
  299. package/src/components/pure/FeaturesReporterView.test/specification.ts +39 -0
  300. package/src/components/pure/FeaturesReporterView.test/types.ts +77 -0
  301. package/src/components/pure/FeaturesReporterView.tsx +37 -0
  302. package/src/components/pure/ModalContent.test/implementation.tsx +43 -0
  303. package/src/components/pure/ModalContent.test/index.tsx +15 -0
  304. package/src/components/pure/ModalContent.test/specification.ts +27 -0
  305. package/src/components/pure/ModalContent.test/types.ts +72 -0
  306. package/src/components/pure/ModalContent.tsx +182 -0
  307. package/src/components/pure/ProjectPageView.test/implementation.tsx +135 -36
  308. package/src/components/pure/ProjectPageView.test/index.tsx +20 -0
  309. package/src/components/pure/ProjectPageView.test/specification.ts +15 -2
  310. package/src/components/pure/ProjectPageView.test/types.ts +57 -13
  311. package/src/components/pure/ProjectPageView.tsx +155 -121
  312. package/src/components/pure/ProjectsPageView.tsx +36 -5
  313. package/src/components/pure/SettingsButton.md +1 -0
  314. package/src/components/pure/SettingsButton.tsx +66 -0
  315. package/src/components/pure/TestPageView.test/implementation.ts +194 -0
  316. package/src/components/pure/TestPageView.test/index.tsx +20 -0
  317. package/src/components/pure/TestPageView.test/specification.ts +59 -0
  318. package/src/components/pure/TestPageView.test/types.ts +92 -0
  319. package/src/components/pure/TestPageView.tsx +272 -283
  320. package/src/components/pure/ThemeCard.tsx +34 -0
  321. package/src/components/stateful/FeaturesReporter.tsx +24 -0
  322. package/src/components/stateful/ProjectPage.tsx +4 -3
  323. package/src/components/stateful/TestPage.tsx +27 -18
  324. package/src/defaultConfig.ts +1 -0
  325. package/src/esbuildConfigs/web.ts +2 -1
  326. package/src/lib/BaseSuite.test/mock.ts +1 -27
  327. package/src/lib/BaseSuite.test/test.ts +15 -37
  328. package/src/lib/BaseSuite.ts +3 -0
  329. package/src/lib/Sidecar.ts +2 -0
  330. package/src/lib/abstractBase.test/MockGiven.ts +1 -1
  331. package/src/lib/abstractBase.ts +15 -7
  332. package/src/lib/baseBuilder.test/baseBuilder.test.adapter.ts +0 -6
  333. package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +3 -1
  334. package/src/lib/baseBuilder.test/baseBuilder.test.mock.ts +27 -17
  335. package/src/lib/baseBuilder.test/baseBuilder.test.pure.ts +1 -1
  336. package/src/lib/basebuilder.ts +46 -47
  337. package/src/lib/classBuilder.ts +3 -0
  338. package/src/lib/core.test/MockCore.ts +0 -23
  339. package/src/lib/core.test/core.test.adapter.ts +6 -12
  340. package/src/lib/core.test/core.test.implementation.ts +7 -10
  341. package/src/lib/core.ts +2 -1
  342. package/src/lib/index.ts +9 -8
  343. package/src/lib/pmProxy.test/adapter.ts +8 -2
  344. package/src/lib/pmProxy.test/implementation.ts +40 -7
  345. package/src/lib/pmProxy.test/mockPMBase.ts +11 -0
  346. package/src/lib/pmProxy.ts +2 -2
  347. package/src/lib/types.ts +2 -0
  348. package/src/mothership/index.ts +6 -0
  349. package/src/mothership/test.ts +53 -26
  350. package/src/style.md +2 -0
  351. package/src/style.scss +16 -0
  352. package/src/templates/frontpage.html +54 -0
  353. package/src/themes.scss +9 -9
  354. package/src/types/features.ts +38 -0
  355. package/src/utils/api.ts +59 -29
  356. package/src/utils/featureUtils.tsx +42 -0
  357. package/src/utils/logFiles.ts +26 -0
  358. package/src/utils/makePrompt.ts +148 -0
  359. package/src/web.html.ts +6 -6
  360. package/style.css +28 -9
  361. package/testeranto/App.css +444 -12
  362. package/testeranto/App.js +1318 -1053
  363. package/testeranto/bundles/node/core/chunk-JBB5E3XJ.mjs +258 -0
  364. package/testeranto/bundles/node/core/chunk-L67RWZ4W.mjs +899 -0
  365. package/testeranto/bundles/node/core/chunk-ZQRRQYS4.mjs +92 -0
  366. package/testeranto/bundles/node/core/metafile.json +5729 -2
  367. package/testeranto/bundles/node/core/src/lib/BaseSuite.test/node.test.mjs +307 -0
  368. package/testeranto/bundles/node/core/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +247 -0
  369. package/testeranto/bundles/node/core/src/lib/classBuilder.test/classBuilder.test.mjs +423 -0
  370. package/testeranto/bundles/node/core/src/lib/core.test/core.test.mjs +505 -0
  371. package/testeranto/bundles/node/core/src/lib/pmProxy.test/index.mjs +4804 -0
  372. package/testeranto/bundles/node/core/src/mothership/test.mjs +24588 -0
  373. package/testeranto/bundles/pure/core/chunk-KHJ35R7C.mjs +997 -0
  374. package/testeranto/bundles/pure/core/metafile.json +870 -3
  375. package/testeranto/bundles/pure/core/src/Pure.test.mjs +428 -0
  376. package/testeranto/bundles/pure/core/src/lib/BaseSuite.test/pure.test.mjs +379 -0
  377. package/testeranto/bundles/pure/core/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +235 -0
  378. package/testeranto/bundles/web/core/MPLUSRounded1c-Black-O75GP5JI.ttf +0 -0
  379. package/testeranto/bundles/web/core/MPLUSRounded1c-Bold-R524Q5BH.ttf +0 -0
  380. package/testeranto/bundles/web/core/MPLUSRounded1c-ExtraBold-C6GRMYVT.ttf +0 -0
  381. package/testeranto/bundles/web/core/MPLUSRounded1c-Light-WKN65Y2C.ttf +0 -0
  382. package/testeranto/bundles/web/core/MPLUSRounded1c-Medium-ZC4DWL7C.ttf +0 -0
  383. package/testeranto/bundles/web/core/MPLUSRounded1c-Regular-DT6EKZ3S.ttf +0 -0
  384. package/testeranto/bundles/web/core/MPLUSRounded1c-Thin-YWDNVG6M.ttf +0 -0
  385. package/testeranto/bundles/web/core/chunk-BADF3AZF.mjs +108 -0
  386. package/testeranto/bundles/web/core/chunk-BXV27S2S.mjs +6252 -0
  387. package/testeranto/bundles/web/core/chunk-EIYZKF2C.mjs +223 -0
  388. package/testeranto/bundles/web/core/chunk-FNXFUNA7.mjs +28528 -0
  389. package/testeranto/bundles/web/core/chunk-LU364HVS.mjs +3311 -0
  390. package/testeranto/bundles/web/core/chunk-QWII7WIM.mjs +2281 -0
  391. package/testeranto/bundles/web/core/chunk-VAYOSMXI.mjs +21775 -0
  392. package/testeranto/bundles/web/core/metafile.json +7883 -4742
  393. package/testeranto/bundles/web/core/src/components/pure/AppFrame.test/index.css +12105 -0
  394. package/testeranto/bundles/web/core/src/components/pure/AppFrame.test/index.html +15 -0
  395. package/testeranto/bundles/web/core/src/components/pure/AppFrame.test/index.mjs +517 -0
  396. package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.html +15 -0
  397. package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.mjs +166 -0
  398. package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.css +12105 -0
  399. package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.html +15 -0
  400. package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.mjs +93 -0
  401. package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.css +12105 -0
  402. package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.html +1 -5
  403. package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.mjs +280 -39928
  404. package/testeranto/bundles/web/core/src/components/pure/TestPageView.test/index.css +12105 -0
  405. package/testeranto/bundles/web/core/src/components/pure/TestPageView.test/index.html +15 -0
  406. package/testeranto/bundles/web/core/src/components/pure/TestPageView.test/index.mjs +483 -0
  407. package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.html +15 -0
  408. package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.mjs +394 -0
  409. package/testeranto/bundles/web/core/src/lib/baseBuilder.test/baseBuilder.test.web.html +15 -0
  410. package/testeranto/bundles/web/core/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +256 -0
  411. package/testeranto/reports/core/config.json +127 -2
  412. package/testeranto/reports/core/src/Pure.test/pure/exit.log +0 -0
  413. package/testeranto/reports/core/src/Pure.test/pure/lint_errors.txt +0 -0
  414. package/testeranto/reports/core/src/Pure.test/pure/message.txt +17 -0
  415. package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +14 -0
  416. package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +106 -0
  417. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/debug.log +0 -0
  418. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/error.log +22 -0
  419. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/exit.log +1 -0
  420. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/info.log +4 -0
  421. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/lint_errors.txt +2 -0
  422. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/message.txt +17 -0
  423. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/prompt.txt +18 -0
  424. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/tests.json +57 -0
  425. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/type_errors.txt +55 -0
  426. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/warn.log +0 -0
  427. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/debug.log +0 -0
  428. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/error.log +56 -0
  429. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/exit.log +1 -0
  430. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/info.log +2 -0
  431. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/lint_errors.txt +0 -0
  432. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/message.txt +17 -0
  433. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/prompt.txt +16 -0
  434. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/suite-0/given-basicRender/then-4/butThen/features-reporter.png +0 -0
  435. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/tests.json +76 -0
  436. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/type_errors.txt +80 -0
  437. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/warn.log +0 -0
  438. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/debug.log +0 -0
  439. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/error.log +0 -0
  440. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/exit.log +0 -0
  441. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/info.log +4 -0
  442. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/lint_errors.txt +0 -0
  443. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/message.txt +17 -0
  444. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/prompt.txt +15 -0
  445. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/suite-0/given-basicRender/then-2/butThen/modal-content.png +0 -0
  446. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/tests.json +42 -0
  447. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/type_errors.txt +65 -0
  448. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/warn.log +0 -0
  449. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/debug.log +0 -0
  450. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/error.log +33 -0
  451. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/exit.log +1 -0
  452. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/info.log +4 -0
  453. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +2 -18
  454. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +16 -1
  455. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +3 -14
  456. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-basicRender/then-6/butThen/happy-state.png +0 -0
  457. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-errorHandling/then-1/butThen/error-state.png +0 -0
  458. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/tests.json +99 -0
  459. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +69 -28
  460. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/warn.log +0 -0
  461. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/debug.log +0 -0
  462. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/error.log +0 -0
  463. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/exit.log +1 -0
  464. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/info.log +2 -0
  465. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/lint_errors.txt +0 -0
  466. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/message.txt +17 -0
  467. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/prompt.txt +18 -0
  468. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/tests.json +69 -0
  469. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/type_errors.txt +111 -0
  470. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/warn.log +0 -0
  471. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/exit.log +1 -0
  472. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -0
  473. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/message.txt +17 -0
  474. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +14 -0
  475. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/stderr.log +0 -0
  476. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/stdout.log +0 -0
  477. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/tests.json +31 -0
  478. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/type_errors.txt +113 -0
  479. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/exit.log +0 -0
  480. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -0
  481. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/message.txt +17 -0
  482. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +15 -0
  483. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +113 -0
  484. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/debug.log +0 -0
  485. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/error.log +1 -0
  486. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/exit.log +1 -0
  487. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/info.log +0 -0
  488. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +0 -0
  489. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/message.txt +17 -0
  490. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/prompt.txt +15 -0
  491. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/tests.json +31 -0
  492. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/type_errors.txt +113 -0
  493. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/warn.log +0 -0
  494. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/exit.log +1 -0
  495. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +0 -0
  496. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +17 -0
  497. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +17 -0
  498. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/stderr.log +0 -0
  499. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/stdout.log +2 -0
  500. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-0/butThen/hello.txt +1 -0
  501. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-1/butThen/artifact_test.txt +1 -0
  502. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +71 -0
  503. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +65 -0
  504. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/exit.log +0 -0
  505. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +0 -0
  506. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +17 -0
  507. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +17 -0
  508. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +65 -0
  509. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/debug.log +0 -0
  510. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/error.log +1 -0
  511. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/exit.log +1 -0
  512. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/info.log +0 -0
  513. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +0 -0
  514. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/message.txt +17 -0
  515. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +17 -0
  516. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/suite-0/given-testInitialization/then-0/butThen/hello.txt +1 -0
  517. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/suite-0/given-testInitialization/then-1/butThen/artifact_test.txt +1 -0
  518. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +71 -0
  519. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +65 -0
  520. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/warn.log +0 -0
  521. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/exit.log +1 -0
  522. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.txt +0 -0
  523. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/message.txt +17 -0
  524. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +17 -0
  525. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/stderr.log +0 -0
  526. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/stdout.log +619 -0
  527. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/tests.json +165 -0
  528. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +140 -0
  529. package/testeranto/reports/core/src/lib/core.test/core.test/node/exit.log +1 -0
  530. package/testeranto/reports/core/src/lib/core.test/core.test/node/lint_errors.txt +21 -0
  531. package/testeranto/reports/core/src/lib/core.test/core.test/node/message.txt +17 -0
  532. package/testeranto/reports/core/src/lib/core.test/core.test/node/prompt.txt +19 -0
  533. package/testeranto/reports/core/src/lib/core.test/core.test/node/stderr.log +0 -0
  534. package/testeranto/reports/core/src/lib/core.test/core.test/node/stdout.log +0 -0
  535. package/testeranto/reports/core/src/lib/core.test/core.test/node/type_errors.txt +64 -0
  536. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/exit.log +1 -0
  537. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/lint_errors.txt +23 -0
  538. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/message.txt +17 -0
  539. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/prompt.txt +17 -0
  540. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stderr.log +0 -0
  541. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +0 -0
  542. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/tests.json +162 -0
  543. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +78 -0
  544. package/testeranto/reports/core/src/mothership/test/node/exit.log +1 -0
  545. package/testeranto/reports/core/src/mothership/test/node/lint_errors.txt +0 -0
  546. package/testeranto/reports/core/src/mothership/test/node/message.txt +17 -0
  547. package/testeranto/reports/core/src/mothership/test/node/prompt.txt +14 -0
  548. package/testeranto/reports/core/src/mothership/test/node/stderr.log +27 -0
  549. package/testeranto/reports/core/src/mothership/test/node/stdout.log +8 -0
  550. package/testeranto/reports/core/src/mothership/test/node/tests.json +36 -0
  551. package/testeranto/reports/core/src/mothership/test/node/type_errors.txt +38 -0
  552. package/testeranto/reports/core/summary.json +109 -4
  553. package/testeranto.config.ts +64 -34
  554. package/tsc.log +356 -210
  555. package/tsconfig.common.json +4 -2
  556. package/tsconfig.json +9 -7
  557. package/tsconfig.module.json +3 -2
  558. package/tsconfig.types.json +3 -1
  559. package/videos/download-smil-xsd.sh +29 -0
  560. package/videos/project0/index.md +72 -0
  561. package/videos/project0/narration.json +7 -0
  562. package/videos/project0/narration.ssml +58 -0
  563. package/videos/project0/package.json +21 -0
  564. package/videos/project0/presentation.smil +25 -0
  565. package/videos/project0/smil30/SMIL-anim.mod.xsd +163 -0
  566. package/videos/project0/smil30/SMIL-anim.mod.xsd.1 +163 -0
  567. package/videos/project0/smil30/SMIL-anim.mod.xsd.2 +163 -0
  568. package/videos/project0/smil30/SMIL-control.mod.xsd +73 -0
  569. package/videos/project0/smil30/SMIL-control.mod.xsd.1 +73 -0
  570. package/videos/project0/smil30/SMIL-control.mod.xsd.2 +73 -0
  571. package/videos/project0/smil30/SMIL-layout.mod.xsd +149 -0
  572. package/videos/project0/smil30/SMIL-layout.mod.xsd.1 +149 -0
  573. package/videos/project0/smil30/SMIL-layout.mod.xsd.2 +149 -0
  574. package/videos/project0/smil30/SMIL-link.mod.xsd +145 -0
  575. package/videos/project0/smil30/SMIL-link.mod.xsd.1 +145 -0
  576. package/videos/project0/smil30/SMIL-link.mod.xsd.2 +145 -0
  577. package/videos/project0/smil30/SMIL-media.mod.xsd +1646 -0
  578. package/videos/project0/smil30/SMIL-media.mod.xsd.1 +1646 -0
  579. package/videos/project0/smil30/SMIL-media.mod.xsd.2 +1646 -0
  580. package/videos/project0/smil30/SMIL-metainformation.mod.xsd +45 -0
  581. package/videos/project0/smil30/SMIL-metainformation.mod.xsd.1 +45 -0
  582. package/videos/project0/smil30/SMIL-metainformation.mod.xsd.2 +45 -0
  583. package/videos/project0/smil30/SMIL-smiltext.mod.xsd +353 -0
  584. package/videos/project0/smil30/SMIL-smiltext.mod.xsd.1 +353 -0
  585. package/videos/project0/smil30/SMIL-smiltext.mod.xsd.2 +353 -0
  586. package/videos/project0/smil30/SMIL-state.mod.xsd +133 -0
  587. package/videos/project0/smil30/SMIL-state.mod.xsd.1 +133 -0
  588. package/videos/project0/smil30/SMIL-state.mod.xsd.2 +133 -0
  589. package/videos/project0/smil30/SMIL-struct.mod.xsd +70 -0
  590. package/videos/project0/smil30/SMIL-struct.mod.xsd.1 +70 -0
  591. package/videos/project0/smil30/SMIL-struct.mod.xsd.2 +70 -0
  592. package/videos/project0/smil30/SMIL-timing.mod.xsd +105 -0
  593. package/videos/project0/smil30/SMIL-timing.mod.xsd.1 +105 -0
  594. package/videos/project0/smil30/SMIL-timing.mod.xsd.2 +105 -0
  595. package/videos/project0/smil30/SMIL-transition.mod.xsd +229 -0
  596. package/videos/project0/smil30/SMIL-transition.mod.xsd.1 +229 -0
  597. package/videos/project0/smil30/SMIL-transition.mod.xsd.2 +229 -0
  598. package/videos/project0/smil30/SMIL.xsd +63 -0
  599. package/videos/project0/smil30/SMIL.xsd.1 +63 -0
  600. package/videos/project0/smil30/SMIL.xsd.2 +63 -0
  601. package/videos/project0/smil30/its.xsd +42 -0
  602. package/videos/project0/smil30/its.xsd.1 +42 -0
  603. package/videos/project0/smil30/its.xsd.2 +42 -0
  604. package/videos/project0/smil30/smil-attribs-1.mod.xsd +610 -0
  605. package/videos/project0/smil30/smil-attribs-1.mod.xsd.1 +610 -0
  606. package/videos/project0/smil30/smil-attribs-1.mod.xsd.2 +610 -0
  607. package/videos/project0/smil30/smil-datatypes-1.mod.xsd +72 -0
  608. package/videos/project0/smil30/smil-datatypes-1.mod.xsd.1 +72 -0
  609. package/videos/project0/smil30/smil-datatypes-1.mod.xsd.2 +72 -0
  610. package/videos/project0/smil30/smil-framework-1.mod.xsd +45 -0
  611. package/videos/project0/smil30/smil-framework-1.mod.xsd.1 +45 -0
  612. package/videos/project0/smil30/smil-framework-1.mod.xsd.2 +45 -0
  613. package/videos/project0/smil30/smil-profile-model-1.mod.xsd +1331 -0
  614. package/videos/project0/smil30/smil-profile-model-1.mod.xsd.1 +1331 -0
  615. package/videos/project0/smil30/smil-qname-1.mod.xsd +121 -0
  616. package/videos/project0/smil30/smil-qname-1.mod.xsd.1 +121 -0
  617. package/videos/project0/smil30/xml.xsd +16 -0
  618. package/videos/project0/smil30/xml.xsd.1 +16 -0
  619. package/videos/project0/smil30/xml.xsd.2 +16 -0
  620. package/videos/project0/smil30.xsd +137 -0
  621. package/videos/project0/src/audio/metadata.json +5 -0
  622. package/videos/project0/src/audio/narration.mp3 +0 -0
  623. package/videos/project0/src/motion-canvas.d.ts +1 -0
  624. package/videos/project0/src/project.meta +31 -0
  625. package/videos/project0/src/project.ts +13 -0
  626. package/videos/project0/src/scenes/example.meta +5 -0
  627. package/videos/project0/src/scenes/scene1.meta +3 -0
  628. package/videos/project0/src/scenes/scene1.tsx +129 -0
  629. package/videos/project0/src/scenes/scene2.tsx +132 -0
  630. package/videos/project0/src/scenes/scene3.meta +26 -0
  631. package/videos/project0/src/scenes/scene3.tsx +188 -0
  632. package/videos/project0/tsconfig.json +4 -0
  633. package/videos/project0/vite.config.ts +10 -0
  634. package/videos/trash/output/project.mp4 +0 -0
  635. package/videos/trash/text.mp4 +0 -0
  636. package/videos/trash/video/project.tsx +549 -0
  637. package/videos/trash/video/render.ts +15 -0
  638. package/videos/trash/vite.config.ts +10 -0
  639. package/videos/tts.js +109 -0
  640. package/dist/common/src/components/pure/ProjectPageView.test/adapter.js +0 -20
  641. package/dist/common/src/lib/dailyAnimation.js +0 -130
  642. package/dist/module/src/Footer.js +0 -5
  643. package/dist/module/src/ProjectPage.js +0 -319
  644. package/dist/module/src/ProjectsPage.js +0 -1
  645. package/dist/module/src/SettingsButton.js +0 -157
  646. package/dist/module/src/TestPage.js +0 -271
  647. package/dist/module/src/TestReport.js +0 -368
  648. package/dist/module/src/components/pure/ProjectPageView.test/adapter.js +0 -17
  649. package/dist/module/src/lib/dailyAnimation.js +0 -130
  650. package/dist/types/src/components/pure/ProjectPageView.d.ts +0 -14
  651. package/dist/types/src/components/pure/ProjectPageView.test/adapter.d.ts +0 -3
  652. package/dist/types/src/components/pure/ProjectPageView.test/types.d.ts +0 -39
  653. package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.pure.d.ts +0 -3
  654. package/dist/types/testeranto.config.d.ts +0 -3
  655. package/docs/testing.ai.txt +0 -106
  656. package/src/Footer.tsx +0 -8
  657. package/src/Project.scss +0 -1
  658. package/src/ProjectPage.tsx +0 -459
  659. package/src/ProjectsPage.tsx +0 -1
  660. package/src/ReportApp.scss +0 -1
  661. package/src/SettingsButton.tsx +0 -268
  662. package/src/TestPage.tsx +0 -476
  663. package/src/TestReport.scss +0 -24
  664. package/src/TestReport.tsx +0 -411
  665. package/src/components/pure/ProjectPageView.test/adapter.ts +0 -21
  666. package/src/lib/dailyAnimation.ts +0 -147
  667. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/logs.txt +0 -59
  668. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-basicRender/then-0/butThen/happyPath.png +0 -0
  669. /package/dist/common/src/{NavBar.js → components/pure/NavBar.js} +0 -0
  670. /package/dist/{types/src/ReportServer.d.ts → module/src/components/SunriseAnimation.test/types.js} +0 -0
  671. /package/dist/{types/src/build.d.ts → module/src/components/pure/FeaturesReporterView.test/types.js} +0 -0
  672. /package/dist/module/src/{NavBar.js → components/pure/NavBar.js} +0 -0
  673. /package/dist/types/{src/CoreTypes.d.ts → CoreTypes.d.ts} +0 -0
  674. /package/dist/types/{src/Init.d.ts → Init.d.ts} +0 -0
  675. /package/dist/types/{src/Node.d.ts → Node.d.ts} +0 -0
  676. /package/dist/types/{src/NodeSidecar.d.ts → NodeSidecar.d.ts} +0 -0
  677. /package/dist/types/{src/PM → PM}/PM_WithEslintAndTsc.d.ts +0 -0
  678. /package/dist/types/{src/PM → PM}/__tests__/nodeSidecar.testeranto.d.ts +0 -0
  679. /package/dist/types/{src/PM → PM}/__tests__/pureSidecar.testeranto.d.ts +0 -0
  680. /package/dist/types/{src/PM → PM}/__tests__/webSidecar.testeranto.d.ts +0 -0
  681. /package/dist/types/{src/PM → PM}/base.d.ts +0 -0
  682. /package/dist/types/{src/PM → PM}/index.d.ts +0 -0
  683. /package/dist/types/{src/components/SunriseAnimation.test/implementation.d.ts → PM/layers/base/PM_Base.d.ts} +0 -0
  684. /package/dist/types/{src/components/SunriseAnimation.test/index.d.ts → PM/layers/base/components/PageOperations.d.ts} +0 -0
  685. /package/dist/types/{src/components/SunriseAnimation.test/interface.d.ts → PM/layers/base/components/PageOperations.testeranto.d.ts} +0 -0
  686. /package/dist/types/{src/components/SunriseAnimation.test/specification.d.ts → PM/layers/linting/components/Linter.d.ts} +0 -0
  687. /package/dist/types/{src/lib/dailyAnimation.d.ts → PM/layers/linting/components/TypeChecker.d.ts} +0 -0
  688. /package/dist/types/{src/PM → PM}/node.d.ts +0 -0
  689. /package/dist/types/{src/PM → PM}/nodeSidecar.d.ts +0 -0
  690. /package/dist/types/{src/PM → PM}/pureSidecar.d.ts +0 -0
  691. /package/dist/types/{src/PM → PM}/sidecar.d.ts +0 -0
  692. /package/dist/types/{src/PM → PM}/webSidecar.d.ts +0 -0
  693. /package/dist/types/{src/Pure.d.ts → Pure.d.ts} +0 -0
  694. /package/dist/types/{src/Pure.test.d.ts → Pure.test.d.ts} +0 -0
  695. /package/dist/types/{src/PureSidecar.d.ts → PureSidecar.d.ts} +0 -0
  696. /package/dist/types/{src/init-docs.d.ts → ReportServer.d.ts} +0 -0
  697. /package/dist/types/{src/ReportServer.test.ts → ReportServer.test.ts}/index.d.ts +0 -0
  698. /package/dist/types/{src/ReportServerLib.d.ts → ReportServerLib.d.ts} +0 -0
  699. /package/dist/types/{src/Web.d.ts → Web.d.ts} +0 -0
  700. /package/dist/types/{src/WebSidecar.d.ts → WebSidecar.d.ts} +0 -0
  701. /package/dist/types/{src/run.d.ts → build.d.ts} +0 -0
  702. /package/dist/types/{src/components → components}/TestStatusBadge.d.ts +0 -0
  703. /package/dist/types/{src/components/pure/ProjectPageView.test → components/pure/AppFrame.test}/specification.d.ts +0 -0
  704. /package/dist/types/{src/components/pure/ProjectPageView.test → components/pure/FeaturesReporterView.test}/implementation.d.ts +0 -0
  705. /package/dist/types/{src → components/pure}/NavBar.d.ts +0 -0
  706. /package/dist/types/{src/defaultConfig.d.ts → defaultConfig.d.ts} +0 -0
  707. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/consoleDetectorPlugin.d.ts +0 -0
  708. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/eslint-formatter-testeranto.d.ts +0 -0
  709. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.d.ts +0 -0
  710. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/index.d.ts +0 -0
  711. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/inputFilesPlugin.d.ts +0 -0
  712. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/nativeImportDetectorPlugin.d.ts +0 -0
  713. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/node.d.ts +0 -0
  714. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/pure.d.ts +0 -0
  715. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/rebuildPlugin.d.ts +0 -0
  716. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/web.d.ts +0 -0
  717. /package/dist/types/{src/lib → lib}/BaseSuite.d.ts +0 -0
  718. /package/dist/types/{src/lib → lib}/BaseSuite.test/mock.d.ts +0 -0
  719. /package/dist/types/{src/lib → lib}/BaseSuite.test/node.test.d.ts +0 -0
  720. /package/dist/types/{src/lib → lib}/BaseSuite.test/pure.test.d.ts +0 -0
  721. /package/dist/types/{src/lib → lib}/BaseSuite.test/test.d.ts +0 -0
  722. /package/dist/types/{src/lib → lib}/BaseSuite.test/web.test.d.ts +0 -0
  723. /package/dist/types/{src/lib → lib}/Sidecar.d.ts +0 -0
  724. /package/dist/types/{src/lib → lib}/abstractBase.test/MockThen.d.ts +0 -0
  725. /package/dist/types/{src/lib → lib}/abstractBase.test/MockWhen.d.ts +0 -0
  726. /package/dist/types/{src/lib → lib}/abstractBase.test/adapter.d.ts +0 -0
  727. /package/dist/types/{src/lib → lib}/abstractBase.test/implementation.d.ts +0 -0
  728. /package/dist/types/{src/lib → lib}/abstractBase.test/index.d.ts +0 -0
  729. /package/dist/types/{src/lib → lib}/abstractBase.test/specification.d.ts +0 -0
  730. /package/dist/types/{src/lib → lib}/abstractBase.test/types.d.ts +0 -0
  731. /package/dist/types/{src/lib → lib}/baseBuilder.test/baseBuilder.test.adapter.d.ts +0 -0
  732. /package/dist/types/{src/lib → lib}/baseBuilder.test/baseBuilder.test.implementation.d.ts +0 -0
  733. /package/dist/types/{src/lib → lib}/baseBuilder.test/baseBuilder.test.mock.d.ts +0 -0
  734. /package/dist/types/{src/lib → lib}/baseBuilder.test/baseBuilder.test.node.d.ts +0 -0
  735. /package/dist/types/{src/lib → lib}/baseBuilder.test/baseBuilder.test.specification.d.ts +0 -0
  736. /package/dist/types/{src/lib → lib}/baseBuilder.test/baseBuilder.test.types.d.ts +0 -0
  737. /package/dist/types/{src/lib → lib}/baseBuilder.test/baseBuilder.test.web.d.ts +0 -0
  738. /package/dist/types/{src/lib → lib}/basebuilder.d.ts +0 -0
  739. /package/dist/types/{src/lib → lib}/classBuilder.d.ts +0 -0
  740. /package/dist/types/{src/lib → lib}/classBuilder.test/classBuilder.test.adapter.d.ts +0 -0
  741. /package/dist/types/{src/lib → lib}/classBuilder.test/classBuilder.test.d.ts +0 -0
  742. /package/dist/types/{src/lib → lib}/classBuilder.test/classBuilder.test.implementation.d.ts +0 -0
  743. /package/dist/types/{src/lib → lib}/classBuilder.test/classBuilder.test.specification.d.ts +0 -0
  744. /package/dist/types/{src/lib → lib}/classBuilder.test/classBuilder.test.types.d.ts +0 -0
  745. /package/dist/types/{src/lib → lib}/classBuilder.test/mock.d.ts +0 -0
  746. /package/dist/types/{src/lib → lib}/core.d.ts +0 -0
  747. /package/dist/types/{src/lib → lib}/core.test/MockCore.d.ts +0 -0
  748. /package/dist/types/{src/lib → lib}/core.test/core.test.adapter.d.ts +0 -0
  749. /package/dist/types/{src/lib → lib}/core.test/core.test.d.ts +0 -0
  750. /package/dist/types/{src/lib → lib}/core.test/core.test.implementation.d.ts +0 -0
  751. /package/dist/types/{src/lib → lib}/core.test/core.test.specification.d.ts +0 -0
  752. /package/dist/types/{src/lib → lib}/core.test/core.test.types.d.ts +0 -0
  753. /package/dist/types/{src/lib → lib}/mocks.test.d.ts +0 -0
  754. /package/dist/types/{src/lib → lib}/pmProxy.d.ts +0 -0
  755. /package/dist/types/{src/lib → lib}/pmProxy.test/adapter.d.ts +0 -0
  756. /package/dist/types/{src/lib → lib}/pmProxy.test/implementation.d.ts +0 -0
  757. /package/dist/types/{src/lib → lib}/pmProxy.test/index.d.ts +0 -0
  758. /package/dist/types/{src/lib → lib}/pmProxy.test/mockPM.d.ts +0 -0
  759. /package/dist/types/{src/lib → lib}/pmProxy.test/mockPMBase.d.ts +0 -0
  760. /package/dist/types/{src/lib → lib}/pmProxy.test/specification.d.ts +0 -0
  761. /package/dist/types/{src/lib → lib}/pmProxy.test/types.d.ts +0 -0
  762. /package/dist/types/{src/lib → lib}/types.d.ts +0 -0
  763. /package/dist/types/{src/mothership → mothership}/index.d.ts +0 -0
  764. /package/dist/types/{src/mothership → mothership}/test.d.ts +0 -0
  765. /package/dist/types/{src/utils → utils}/buildTemplates.d.ts +0 -0
  766. /package/dist/types/{src/utils → utils}/queue.d.ts +0 -0
  767. /package/dist/types/{src/utils.d.ts → utils.d.ts} +0 -0
  768. /package/src/{NavBar.tsx → components/pure/NavBar.tsx} +0 -0
@@ -0,0 +1,2281 @@
1
+ import {
2
+ require_react
3
+ } from "./chunk-BXV27S2S.mjs";
4
+ import {
5
+ __toESM,
6
+ init_buffer,
7
+ init_dirname,
8
+ init_process
9
+ } from "./chunk-LU364HVS.mjs";
10
+
11
+ // node_modules/react-router/dist/development/chunk-ZYFC6VSF.mjs
12
+ init_dirname();
13
+ init_buffer();
14
+ init_process();
15
+ var React = __toESM(require_react(), 1);
16
+ var React2 = __toESM(require_react(), 1);
17
+ var React3 = __toESM(require_react(), 1);
18
+ var React4 = __toESM(require_react(), 1);
19
+ var React9 = __toESM(require_react(), 1);
20
+ var React8 = __toESM(require_react(), 1);
21
+ var React7 = __toESM(require_react(), 1);
22
+ var React6 = __toESM(require_react(), 1);
23
+ var React5 = __toESM(require_react(), 1);
24
+ var React10 = __toESM(require_react(), 1);
25
+ var React11 = __toESM(require_react(), 1);
26
+ function createMemoryHistory(options = {}) {
27
+ let { initialEntries = ["/"], initialIndex, v5Compat = false } = options;
28
+ let entries;
29
+ entries = initialEntries.map(
30
+ (entry, index2) => createMemoryLocation(
31
+ entry,
32
+ typeof entry === "string" ? null : entry.state,
33
+ index2 === 0 ? "default" : void 0
34
+ )
35
+ );
36
+ let index = clampIndex(
37
+ initialIndex == null ? entries.length - 1 : initialIndex
38
+ );
39
+ let action = "POP";
40
+ let listener = null;
41
+ function clampIndex(n) {
42
+ return Math.min(Math.max(n, 0), entries.length - 1);
43
+ }
44
+ function getCurrentLocation() {
45
+ return entries[index];
46
+ }
47
+ function createMemoryLocation(to, state = null, key) {
48
+ let location = createLocation(
49
+ entries ? getCurrentLocation().pathname : "/",
50
+ to,
51
+ state,
52
+ key
53
+ );
54
+ warning(
55
+ location.pathname.charAt(0) === "/",
56
+ `relative pathnames are not supported in memory history: ${JSON.stringify(
57
+ to
58
+ )}`
59
+ );
60
+ return location;
61
+ }
62
+ function createHref2(to) {
63
+ return typeof to === "string" ? to : createPath(to);
64
+ }
65
+ let history = {
66
+ get index() {
67
+ return index;
68
+ },
69
+ get action() {
70
+ return action;
71
+ },
72
+ get location() {
73
+ return getCurrentLocation();
74
+ },
75
+ createHref: createHref2,
76
+ createURL(to) {
77
+ return new URL(createHref2(to), "http://localhost");
78
+ },
79
+ encodeLocation(to) {
80
+ let path = typeof to === "string" ? parsePath(to) : to;
81
+ return {
82
+ pathname: path.pathname || "",
83
+ search: path.search || "",
84
+ hash: path.hash || ""
85
+ };
86
+ },
87
+ push(to, state) {
88
+ action = "PUSH";
89
+ let nextLocation = createMemoryLocation(to, state);
90
+ index += 1;
91
+ entries.splice(index, entries.length, nextLocation);
92
+ if (v5Compat && listener) {
93
+ listener({ action, location: nextLocation, delta: 1 });
94
+ }
95
+ },
96
+ replace(to, state) {
97
+ action = "REPLACE";
98
+ let nextLocation = createMemoryLocation(to, state);
99
+ entries[index] = nextLocation;
100
+ if (v5Compat && listener) {
101
+ listener({ action, location: nextLocation, delta: 0 });
102
+ }
103
+ },
104
+ go(delta) {
105
+ action = "POP";
106
+ let nextIndex = clampIndex(index + delta);
107
+ let nextLocation = entries[nextIndex];
108
+ index = nextIndex;
109
+ if (listener) {
110
+ listener({ action, location: nextLocation, delta });
111
+ }
112
+ },
113
+ listen(fn) {
114
+ listener = fn;
115
+ return () => {
116
+ listener = null;
117
+ };
118
+ }
119
+ };
120
+ return history;
121
+ }
122
+ function invariant(value, message) {
123
+ if (value === false || value === null || typeof value === "undefined") {
124
+ throw new Error(message);
125
+ }
126
+ }
127
+ function warning(cond, message) {
128
+ if (!cond) {
129
+ if (typeof console !== "undefined")
130
+ console.warn(message);
131
+ try {
132
+ throw new Error(message);
133
+ } catch (e) {
134
+ }
135
+ }
136
+ }
137
+ function createKey() {
138
+ return Math.random().toString(36).substring(2, 10);
139
+ }
140
+ function createLocation(current, to, state = null, key) {
141
+ let location = {
142
+ pathname: typeof current === "string" ? current : current.pathname,
143
+ search: "",
144
+ hash: "",
145
+ ...typeof to === "string" ? parsePath(to) : to,
146
+ state,
147
+ // TODO: This could be cleaned up. push/replace should probably just take
148
+ // full Locations now and avoid the need to run through this flow at all
149
+ // But that's a pretty big refactor to the current test suite so going to
150
+ // keep as is for the time being and just let any incoming keys take precedence
151
+ key: to && to.key || key || createKey()
152
+ };
153
+ return location;
154
+ }
155
+ function createPath({
156
+ pathname = "/",
157
+ search = "",
158
+ hash = ""
159
+ }) {
160
+ if (search && search !== "?")
161
+ pathname += search.charAt(0) === "?" ? search : "?" + search;
162
+ if (hash && hash !== "#")
163
+ pathname += hash.charAt(0) === "#" ? hash : "#" + hash;
164
+ return pathname;
165
+ }
166
+ function parsePath(path) {
167
+ let parsedPath = {};
168
+ if (path) {
169
+ let hashIndex = path.indexOf("#");
170
+ if (hashIndex >= 0) {
171
+ parsedPath.hash = path.substring(hashIndex);
172
+ path = path.substring(0, hashIndex);
173
+ }
174
+ let searchIndex = path.indexOf("?");
175
+ if (searchIndex >= 0) {
176
+ parsedPath.search = path.substring(searchIndex);
177
+ path = path.substring(0, searchIndex);
178
+ }
179
+ if (path) {
180
+ parsedPath.pathname = path;
181
+ }
182
+ }
183
+ return parsedPath;
184
+ }
185
+ var _map;
186
+ _map = /* @__PURE__ */ new WeakMap();
187
+ function matchRoutes(routes, locationArg, basename = "/") {
188
+ return matchRoutesImpl(routes, locationArg, basename, false);
189
+ }
190
+ function matchRoutesImpl(routes, locationArg, basename, allowPartial) {
191
+ let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
192
+ let pathname = stripBasename(location.pathname || "/", basename);
193
+ if (pathname == null) {
194
+ return null;
195
+ }
196
+ let branches = flattenRoutes(routes);
197
+ rankRouteBranches(branches);
198
+ let matches = null;
199
+ for (let i = 0; matches == null && i < branches.length; ++i) {
200
+ let decoded = decodePath(pathname);
201
+ matches = matchRouteBranch(
202
+ branches[i],
203
+ decoded,
204
+ allowPartial
205
+ );
206
+ }
207
+ return matches;
208
+ }
209
+ function convertRouteMatchToUiMatch(match, loaderData) {
210
+ let { route, pathname, params } = match;
211
+ return {
212
+ id: route.id,
213
+ pathname,
214
+ params,
215
+ data: loaderData[route.id],
216
+ loaderData: loaderData[route.id],
217
+ handle: route.handle
218
+ };
219
+ }
220
+ function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "") {
221
+ let flattenRoute = (route, index, relativePath) => {
222
+ let meta = {
223
+ relativePath: relativePath === void 0 ? route.path || "" : relativePath,
224
+ caseSensitive: route.caseSensitive === true,
225
+ childrenIndex: index,
226
+ route
227
+ };
228
+ if (meta.relativePath.startsWith("/")) {
229
+ invariant(
230
+ meta.relativePath.startsWith(parentPath),
231
+ `Absolute route path "${meta.relativePath}" nested under path "${parentPath}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
232
+ );
233
+ meta.relativePath = meta.relativePath.slice(parentPath.length);
234
+ }
235
+ let path = joinPaths([parentPath, meta.relativePath]);
236
+ let routesMeta = parentsMeta.concat(meta);
237
+ if (route.children && route.children.length > 0) {
238
+ invariant(
239
+ // Our types know better, but runtime JS may not!
240
+ // @ts-expect-error
241
+ route.index !== true,
242
+ `Index routes must not have child routes. Please remove all child routes from route path "${path}".`
243
+ );
244
+ flattenRoutes(route.children, branches, routesMeta, path);
245
+ }
246
+ if (route.path == null && !route.index) {
247
+ return;
248
+ }
249
+ branches.push({
250
+ path,
251
+ score: computeScore(path, route.index),
252
+ routesMeta
253
+ });
254
+ };
255
+ routes.forEach((route, index) => {
256
+ if (route.path === "" || !route.path?.includes("?")) {
257
+ flattenRoute(route, index);
258
+ } else {
259
+ for (let exploded of explodeOptionalSegments(route.path)) {
260
+ flattenRoute(route, index, exploded);
261
+ }
262
+ }
263
+ });
264
+ return branches;
265
+ }
266
+ function explodeOptionalSegments(path) {
267
+ let segments = path.split("/");
268
+ if (segments.length === 0)
269
+ return [];
270
+ let [first, ...rest] = segments;
271
+ let isOptional = first.endsWith("?");
272
+ let required = first.replace(/\?$/, "");
273
+ if (rest.length === 0) {
274
+ return isOptional ? [required, ""] : [required];
275
+ }
276
+ let restExploded = explodeOptionalSegments(rest.join("/"));
277
+ let result = [];
278
+ result.push(
279
+ ...restExploded.map(
280
+ (subpath) => subpath === "" ? required : [required, subpath].join("/")
281
+ )
282
+ );
283
+ if (isOptional) {
284
+ result.push(...restExploded);
285
+ }
286
+ return result.map(
287
+ (exploded) => path.startsWith("/") && exploded === "" ? "/" : exploded
288
+ );
289
+ }
290
+ function rankRouteBranches(branches) {
291
+ branches.sort(
292
+ (a, b) => a.score !== b.score ? b.score - a.score : compareIndexes(
293
+ a.routesMeta.map((meta) => meta.childrenIndex),
294
+ b.routesMeta.map((meta) => meta.childrenIndex)
295
+ )
296
+ );
297
+ }
298
+ var paramRe = /^:[\w-]+$/;
299
+ var dynamicSegmentValue = 3;
300
+ var indexRouteValue = 2;
301
+ var emptySegmentValue = 1;
302
+ var staticSegmentValue = 10;
303
+ var splatPenalty = -2;
304
+ var isSplat = (s) => s === "*";
305
+ function computeScore(path, index) {
306
+ let segments = path.split("/");
307
+ let initialScore = segments.length;
308
+ if (segments.some(isSplat)) {
309
+ initialScore += splatPenalty;
310
+ }
311
+ if (index) {
312
+ initialScore += indexRouteValue;
313
+ }
314
+ return segments.filter((s) => !isSplat(s)).reduce(
315
+ (score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue),
316
+ initialScore
317
+ );
318
+ }
319
+ function compareIndexes(a, b) {
320
+ let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);
321
+ return siblings ? (
322
+ // If two routes are siblings, we should try to match the earlier sibling
323
+ // first. This allows people to have fine-grained control over the matching
324
+ // behavior by simply putting routes with identical paths in the order they
325
+ // want them tried.
326
+ a[a.length - 1] - b[b.length - 1]
327
+ ) : (
328
+ // Otherwise, it doesn't really make sense to rank non-siblings by index,
329
+ // so they sort equally.
330
+ 0
331
+ );
332
+ }
333
+ function matchRouteBranch(branch, pathname, allowPartial = false) {
334
+ let { routesMeta } = branch;
335
+ let matchedParams = {};
336
+ let matchedPathname = "/";
337
+ let matches = [];
338
+ for (let i = 0; i < routesMeta.length; ++i) {
339
+ let meta = routesMeta[i];
340
+ let end = i === routesMeta.length - 1;
341
+ let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
342
+ let match = matchPath(
343
+ { path: meta.relativePath, caseSensitive: meta.caseSensitive, end },
344
+ remainingPathname
345
+ );
346
+ let route = meta.route;
347
+ if (!match && end && allowPartial && !routesMeta[routesMeta.length - 1].route.index) {
348
+ match = matchPath(
349
+ {
350
+ path: meta.relativePath,
351
+ caseSensitive: meta.caseSensitive,
352
+ end: false
353
+ },
354
+ remainingPathname
355
+ );
356
+ }
357
+ if (!match) {
358
+ return null;
359
+ }
360
+ Object.assign(matchedParams, match.params);
361
+ matches.push({
362
+ // TODO: Can this as be avoided?
363
+ params: matchedParams,
364
+ pathname: joinPaths([matchedPathname, match.pathname]),
365
+ pathnameBase: normalizePathname(
366
+ joinPaths([matchedPathname, match.pathnameBase])
367
+ ),
368
+ route
369
+ });
370
+ if (match.pathnameBase !== "/") {
371
+ matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);
372
+ }
373
+ }
374
+ return matches;
375
+ }
376
+ function matchPath(pattern, pathname) {
377
+ if (typeof pattern === "string") {
378
+ pattern = { path: pattern, caseSensitive: false, end: true };
379
+ }
380
+ let [matcher, compiledParams] = compilePath(
381
+ pattern.path,
382
+ pattern.caseSensitive,
383
+ pattern.end
384
+ );
385
+ let match = pathname.match(matcher);
386
+ if (!match)
387
+ return null;
388
+ let matchedPathname = match[0];
389
+ let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
390
+ let captureGroups = match.slice(1);
391
+ let params = compiledParams.reduce(
392
+ (memo2, { paramName, isOptional }, index) => {
393
+ if (paramName === "*") {
394
+ let splatValue = captureGroups[index] || "";
395
+ pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
396
+ }
397
+ const value = captureGroups[index];
398
+ if (isOptional && !value) {
399
+ memo2[paramName] = void 0;
400
+ } else {
401
+ memo2[paramName] = (value || "").replace(/%2F/g, "/");
402
+ }
403
+ return memo2;
404
+ },
405
+ {}
406
+ );
407
+ return {
408
+ params,
409
+ pathname: matchedPathname,
410
+ pathnameBase,
411
+ pattern
412
+ };
413
+ }
414
+ function compilePath(path, caseSensitive = false, end = true) {
415
+ warning(
416
+ path === "*" || !path.endsWith("*") || path.endsWith("/*"),
417
+ `Route path "${path}" will be treated as if it were "${path.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${path.replace(/\*$/, "/*")}".`
418
+ );
419
+ let params = [];
420
+ let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
421
+ /\/:([\w-]+)(\?)?/g,
422
+ (_, paramName, isOptional) => {
423
+ params.push({ paramName, isOptional: isOptional != null });
424
+ return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)";
425
+ }
426
+ );
427
+ if (path.endsWith("*")) {
428
+ params.push({ paramName: "*" });
429
+ regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$";
430
+ } else if (end) {
431
+ regexpSource += "\\/*$";
432
+ } else if (path !== "" && path !== "/") {
433
+ regexpSource += "(?:(?=\\/|$))";
434
+ } else {
435
+ }
436
+ let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i");
437
+ return [matcher, params];
438
+ }
439
+ function decodePath(value) {
440
+ try {
441
+ return value.split("/").map((v) => decodeURIComponent(v).replace(/\//g, "%2F")).join("/");
442
+ } catch (error) {
443
+ warning(
444
+ false,
445
+ `The URL path "${value}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${error}).`
446
+ );
447
+ return value;
448
+ }
449
+ }
450
+ function stripBasename(pathname, basename) {
451
+ if (basename === "/")
452
+ return pathname;
453
+ if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
454
+ return null;
455
+ }
456
+ let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
457
+ let nextChar = pathname.charAt(startIndex);
458
+ if (nextChar && nextChar !== "/") {
459
+ return null;
460
+ }
461
+ return pathname.slice(startIndex) || "/";
462
+ }
463
+ function resolvePath(to, fromPathname = "/") {
464
+ let {
465
+ pathname: toPathname,
466
+ search = "",
467
+ hash = ""
468
+ } = typeof to === "string" ? parsePath(to) : to;
469
+ let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
470
+ return {
471
+ pathname,
472
+ search: normalizeSearch(search),
473
+ hash: normalizeHash(hash)
474
+ };
475
+ }
476
+ function resolvePathname(relativePath, fromPathname) {
477
+ let segments = fromPathname.replace(/\/+$/, "").split("/");
478
+ let relativeSegments = relativePath.split("/");
479
+ relativeSegments.forEach((segment) => {
480
+ if (segment === "..") {
481
+ if (segments.length > 1)
482
+ segments.pop();
483
+ } else if (segment !== ".") {
484
+ segments.push(segment);
485
+ }
486
+ });
487
+ return segments.length > 1 ? segments.join("/") : "/";
488
+ }
489
+ function getInvalidPathError(char, field, dest, path) {
490
+ return `Cannot include a '${char}' character in a manually specified \`to.${field}\` field [${JSON.stringify(
491
+ path
492
+ )}]. Please separate it out to the \`to.${dest}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
493
+ }
494
+ function getPathContributingMatches(matches) {
495
+ return matches.filter(
496
+ (match, index) => index === 0 || match.route.path && match.route.path.length > 0
497
+ );
498
+ }
499
+ function getResolveToMatches(matches) {
500
+ let pathMatches = getPathContributingMatches(matches);
501
+ return pathMatches.map(
502
+ (match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase
503
+ );
504
+ }
505
+ function resolveTo(toArg, routePathnames, locationPathname, isPathRelative = false) {
506
+ let to;
507
+ if (typeof toArg === "string") {
508
+ to = parsePath(toArg);
509
+ } else {
510
+ to = { ...toArg };
511
+ invariant(
512
+ !to.pathname || !to.pathname.includes("?"),
513
+ getInvalidPathError("?", "pathname", "search", to)
514
+ );
515
+ invariant(
516
+ !to.pathname || !to.pathname.includes("#"),
517
+ getInvalidPathError("#", "pathname", "hash", to)
518
+ );
519
+ invariant(
520
+ !to.search || !to.search.includes("#"),
521
+ getInvalidPathError("#", "search", "hash", to)
522
+ );
523
+ }
524
+ let isEmptyPath = toArg === "" || to.pathname === "";
525
+ let toPathname = isEmptyPath ? "/" : to.pathname;
526
+ let from;
527
+ if (toPathname == null) {
528
+ from = locationPathname;
529
+ } else {
530
+ let routePathnameIndex = routePathnames.length - 1;
531
+ if (!isPathRelative && toPathname.startsWith("..")) {
532
+ let toSegments = toPathname.split("/");
533
+ while (toSegments[0] === "..") {
534
+ toSegments.shift();
535
+ routePathnameIndex -= 1;
536
+ }
537
+ to.pathname = toSegments.join("/");
538
+ }
539
+ from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
540
+ }
541
+ let path = resolvePath(to, from);
542
+ let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
543
+ let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
544
+ if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
545
+ path.pathname += "/";
546
+ }
547
+ return path;
548
+ }
549
+ var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
550
+ var normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
551
+ var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
552
+ var normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
553
+ function isRouteErrorResponse(error) {
554
+ return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
555
+ }
556
+ var validMutationMethodsArr = [
557
+ "POST",
558
+ "PUT",
559
+ "PATCH",
560
+ "DELETE"
561
+ ];
562
+ var validMutationMethods = new Set(
563
+ validMutationMethodsArr
564
+ );
565
+ var validRequestMethodsArr = [
566
+ "GET",
567
+ ...validMutationMethodsArr
568
+ ];
569
+ var validRequestMethods = new Set(validRequestMethodsArr);
570
+ var ResetLoaderDataSymbol = Symbol("ResetLoaderData");
571
+ var DataRouterContext = React.createContext(null);
572
+ DataRouterContext.displayName = "DataRouter";
573
+ var DataRouterStateContext = React.createContext(null);
574
+ DataRouterStateContext.displayName = "DataRouterState";
575
+ var RSCRouterContext = React.createContext(false);
576
+ var ViewTransitionContext = React.createContext({
577
+ isTransitioning: false
578
+ });
579
+ ViewTransitionContext.displayName = "ViewTransition";
580
+ var FetchersContext = React.createContext(
581
+ /* @__PURE__ */ new Map()
582
+ );
583
+ FetchersContext.displayName = "Fetchers";
584
+ var AwaitContext = React.createContext(null);
585
+ AwaitContext.displayName = "Await";
586
+ var NavigationContext = React.createContext(
587
+ null
588
+ );
589
+ NavigationContext.displayName = "Navigation";
590
+ var LocationContext = React.createContext(
591
+ null
592
+ );
593
+ LocationContext.displayName = "Location";
594
+ var RouteContext = React.createContext({
595
+ outlet: null,
596
+ matches: [],
597
+ isDataRoute: false
598
+ });
599
+ RouteContext.displayName = "Route";
600
+ var RouteErrorContext = React.createContext(null);
601
+ RouteErrorContext.displayName = "RouteError";
602
+ var ENABLE_DEV_WARNINGS = true;
603
+ function useHref(to, { relative } = {}) {
604
+ invariant(
605
+ useInRouterContext(),
606
+ // TODO: This error is probably because they somehow have 2 versions of the
607
+ // router loaded. We can help them understand how to avoid that.
608
+ `useHref() may be used only in the context of a <Router> component.`
609
+ );
610
+ let { basename, navigator } = React2.useContext(NavigationContext);
611
+ let { hash, pathname, search } = useResolvedPath(to, { relative });
612
+ let joinedPathname = pathname;
613
+ if (basename !== "/") {
614
+ joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
615
+ }
616
+ return navigator.createHref({ pathname: joinedPathname, search, hash });
617
+ }
618
+ function useInRouterContext() {
619
+ return React2.useContext(LocationContext) != null;
620
+ }
621
+ function useLocation() {
622
+ invariant(
623
+ useInRouterContext(),
624
+ // TODO: This error is probably because they somehow have 2 versions of the
625
+ // router loaded. We can help them understand how to avoid that.
626
+ `useLocation() may be used only in the context of a <Router> component.`
627
+ );
628
+ return React2.useContext(LocationContext).location;
629
+ }
630
+ var navigateEffectWarning = `You should call navigate() in a React.useEffect(), not when your component is first rendered.`;
631
+ function useIsomorphicLayoutEffect(cb) {
632
+ let isStatic = React2.useContext(NavigationContext).static;
633
+ if (!isStatic) {
634
+ React2.useLayoutEffect(cb);
635
+ }
636
+ }
637
+ function useNavigate() {
638
+ let { isDataRoute } = React2.useContext(RouteContext);
639
+ return isDataRoute ? useNavigateStable() : useNavigateUnstable();
640
+ }
641
+ function useNavigateUnstable() {
642
+ invariant(
643
+ useInRouterContext(),
644
+ // TODO: This error is probably because they somehow have 2 versions of the
645
+ // router loaded. We can help them understand how to avoid that.
646
+ `useNavigate() may be used only in the context of a <Router> component.`
647
+ );
648
+ let dataRouterContext = React2.useContext(DataRouterContext);
649
+ let { basename, navigator } = React2.useContext(NavigationContext);
650
+ let { matches } = React2.useContext(RouteContext);
651
+ let { pathname: locationPathname } = useLocation();
652
+ let routePathnamesJson = JSON.stringify(getResolveToMatches(matches));
653
+ let activeRef = React2.useRef(false);
654
+ useIsomorphicLayoutEffect(() => {
655
+ activeRef.current = true;
656
+ });
657
+ let navigate = React2.useCallback(
658
+ (to, options = {}) => {
659
+ warning(activeRef.current, navigateEffectWarning);
660
+ if (!activeRef.current)
661
+ return;
662
+ if (typeof to === "number") {
663
+ navigator.go(to);
664
+ return;
665
+ }
666
+ let path = resolveTo(
667
+ to,
668
+ JSON.parse(routePathnamesJson),
669
+ locationPathname,
670
+ options.relative === "path"
671
+ );
672
+ if (dataRouterContext == null && basename !== "/") {
673
+ path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
674
+ }
675
+ (!!options.replace ? navigator.replace : navigator.push)(
676
+ path,
677
+ options.state,
678
+ options
679
+ );
680
+ },
681
+ [
682
+ basename,
683
+ navigator,
684
+ routePathnamesJson,
685
+ locationPathname,
686
+ dataRouterContext
687
+ ]
688
+ );
689
+ return navigate;
690
+ }
691
+ var OutletContext = React2.createContext(null);
692
+ function useResolvedPath(to, { relative } = {}) {
693
+ let { matches } = React2.useContext(RouteContext);
694
+ let { pathname: locationPathname } = useLocation();
695
+ let routePathnamesJson = JSON.stringify(getResolveToMatches(matches));
696
+ return React2.useMemo(
697
+ () => resolveTo(
698
+ to,
699
+ JSON.parse(routePathnamesJson),
700
+ locationPathname,
701
+ relative === "path"
702
+ ),
703
+ [to, routePathnamesJson, locationPathname, relative]
704
+ );
705
+ }
706
+ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
707
+ invariant(
708
+ useInRouterContext(),
709
+ // TODO: This error is probably because they somehow have 2 versions of the
710
+ // router loaded. We can help them understand how to avoid that.
711
+ `useRoutes() may be used only in the context of a <Router> component.`
712
+ );
713
+ let { navigator } = React2.useContext(NavigationContext);
714
+ let { matches: parentMatches } = React2.useContext(RouteContext);
715
+ let routeMatch = parentMatches[parentMatches.length - 1];
716
+ let parentParams = routeMatch ? routeMatch.params : {};
717
+ let parentPathname = routeMatch ? routeMatch.pathname : "/";
718
+ let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
719
+ let parentRoute = routeMatch && routeMatch.route;
720
+ if (ENABLE_DEV_WARNINGS) {
721
+ let parentPath = parentRoute && parentRoute.path || "";
722
+ warningOnce(
723
+ parentPathname,
724
+ !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
725
+ `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
726
+
727
+ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
728
+ );
729
+ }
730
+ let locationFromContext = useLocation();
731
+ let location;
732
+ if (locationArg) {
733
+ let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
734
+ invariant(
735
+ parentPathnameBase === "/" || parsedLocationArg.pathname?.startsWith(parentPathnameBase),
736
+ `When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${parentPathnameBase}" but pathname "${parsedLocationArg.pathname}" was given in the \`location\` prop.`
737
+ );
738
+ location = parsedLocationArg;
739
+ } else {
740
+ location = locationFromContext;
741
+ }
742
+ let pathname = location.pathname || "/";
743
+ let remainingPathname = pathname;
744
+ if (parentPathnameBase !== "/") {
745
+ let parentSegments = parentPathnameBase.replace(/^\//, "").split("/");
746
+ let segments = pathname.replace(/^\//, "").split("/");
747
+ remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
748
+ }
749
+ let matches = matchRoutes(routes, { pathname: remainingPathname });
750
+ if (ENABLE_DEV_WARNINGS) {
751
+ warning(
752
+ parentRoute || matches != null,
753
+ `No routes matched location "${location.pathname}${location.search}${location.hash}" `
754
+ );
755
+ warning(
756
+ matches == null || matches[matches.length - 1].route.element !== void 0 || matches[matches.length - 1].route.Component !== void 0 || matches[matches.length - 1].route.lazy !== void 0,
757
+ `Matched leaf route at location "${location.pathname}${location.search}${location.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
758
+ );
759
+ }
760
+ let renderedMatches = _renderMatches(
761
+ matches && matches.map(
762
+ (match) => Object.assign({}, match, {
763
+ params: Object.assign({}, parentParams, match.params),
764
+ pathname: joinPaths([
765
+ parentPathnameBase,
766
+ // Re-encode pathnames that were decoded inside matchRoutes
767
+ navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname
768
+ ]),
769
+ pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([
770
+ parentPathnameBase,
771
+ // Re-encode pathnames that were decoded inside matchRoutes
772
+ navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase
773
+ ])
774
+ })
775
+ ),
776
+ parentMatches,
777
+ dataRouterState,
778
+ future
779
+ );
780
+ if (locationArg && renderedMatches) {
781
+ return /* @__PURE__ */ React2.createElement(
782
+ LocationContext.Provider,
783
+ {
784
+ value: {
785
+ location: {
786
+ pathname: "/",
787
+ search: "",
788
+ hash: "",
789
+ state: null,
790
+ key: "default",
791
+ ...location
792
+ },
793
+ navigationType: "POP"
794
+ /* Pop */
795
+ }
796
+ },
797
+ renderedMatches
798
+ );
799
+ }
800
+ return renderedMatches;
801
+ }
802
+ function DefaultErrorComponent() {
803
+ let error = useRouteError();
804
+ let message = isRouteErrorResponse(error) ? `${error.status} ${error.statusText}` : error instanceof Error ? error.message : JSON.stringify(error);
805
+ let stack = error instanceof Error ? error.stack : null;
806
+ let lightgrey = "rgba(200,200,200, 0.5)";
807
+ let preStyles = { padding: "0.5rem", backgroundColor: lightgrey };
808
+ let codeStyles = { padding: "2px 4px", backgroundColor: lightgrey };
809
+ let devInfo = null;
810
+ if (ENABLE_DEV_WARNINGS) {
811
+ console.error(
812
+ "Error handled by React Router default ErrorBoundary:",
813
+ error
814
+ );
815
+ devInfo = /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("p", null, "\u{1F4BF} Hey developer \u{1F44B}"), /* @__PURE__ */ React2.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ React2.createElement("code", { style: codeStyles }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ React2.createElement("code", { style: codeStyles }, "errorElement"), " prop on your route."));
816
+ }
817
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ React2.createElement("h3", { style: { fontStyle: "italic" } }, message), stack ? /* @__PURE__ */ React2.createElement("pre", { style: preStyles }, stack) : null, devInfo);
818
+ }
819
+ var defaultErrorElement = /* @__PURE__ */ React2.createElement(DefaultErrorComponent, null);
820
+ var RenderErrorBoundary = class extends React2.Component {
821
+ constructor(props) {
822
+ super(props);
823
+ this.state = {
824
+ location: props.location,
825
+ revalidation: props.revalidation,
826
+ error: props.error
827
+ };
828
+ }
829
+ static getDerivedStateFromError(error) {
830
+ return { error };
831
+ }
832
+ static getDerivedStateFromProps(props, state) {
833
+ if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") {
834
+ return {
835
+ error: props.error,
836
+ location: props.location,
837
+ revalidation: props.revalidation
838
+ };
839
+ }
840
+ return {
841
+ error: props.error !== void 0 ? props.error : state.error,
842
+ location: state.location,
843
+ revalidation: props.revalidation || state.revalidation
844
+ };
845
+ }
846
+ componentDidCatch(error, errorInfo) {
847
+ console.error(
848
+ "React Router caught the following error during render",
849
+ error,
850
+ errorInfo
851
+ );
852
+ }
853
+ render() {
854
+ return this.state.error !== void 0 ? /* @__PURE__ */ React2.createElement(RouteContext.Provider, { value: this.props.routeContext }, /* @__PURE__ */ React2.createElement(
855
+ RouteErrorContext.Provider,
856
+ {
857
+ value: this.state.error,
858
+ children: this.props.component
859
+ }
860
+ )) : this.props.children;
861
+ }
862
+ };
863
+ function RenderedRoute({ routeContext, match, children }) {
864
+ let dataRouterContext = React2.useContext(DataRouterContext);
865
+ if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {
866
+ dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;
867
+ }
868
+ return /* @__PURE__ */ React2.createElement(RouteContext.Provider, { value: routeContext }, children);
869
+ }
870
+ function _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null) {
871
+ if (matches == null) {
872
+ if (!dataRouterState) {
873
+ return null;
874
+ }
875
+ if (dataRouterState.errors) {
876
+ matches = dataRouterState.matches;
877
+ } else if (parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {
878
+ matches = dataRouterState.matches;
879
+ } else {
880
+ return null;
881
+ }
882
+ }
883
+ let renderedMatches = matches;
884
+ let errors = dataRouterState?.errors;
885
+ if (errors != null) {
886
+ let errorIndex = renderedMatches.findIndex(
887
+ (m) => m.route.id && errors?.[m.route.id] !== void 0
888
+ );
889
+ invariant(
890
+ errorIndex >= 0,
891
+ `Could not find a matching route for errors on route IDs: ${Object.keys(
892
+ errors
893
+ ).join(",")}`
894
+ );
895
+ renderedMatches = renderedMatches.slice(
896
+ 0,
897
+ Math.min(renderedMatches.length, errorIndex + 1)
898
+ );
899
+ }
900
+ let renderFallback = false;
901
+ let fallbackIndex = -1;
902
+ if (dataRouterState) {
903
+ for (let i = 0; i < renderedMatches.length; i++) {
904
+ let match = renderedMatches[i];
905
+ if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {
906
+ fallbackIndex = i;
907
+ }
908
+ if (match.route.id) {
909
+ let { loaderData, errors: errors2 } = dataRouterState;
910
+ let needsToRunLoader = match.route.loader && !loaderData.hasOwnProperty(match.route.id) && (!errors2 || errors2[match.route.id] === void 0);
911
+ if (match.route.lazy || needsToRunLoader) {
912
+ renderFallback = true;
913
+ if (fallbackIndex >= 0) {
914
+ renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
915
+ } else {
916
+ renderedMatches = [renderedMatches[0]];
917
+ }
918
+ break;
919
+ }
920
+ }
921
+ }
922
+ }
923
+ return renderedMatches.reduceRight(
924
+ (outlet, match, index) => {
925
+ let error;
926
+ let shouldRenderHydrateFallback = false;
927
+ let errorElement = null;
928
+ let hydrateFallbackElement = null;
929
+ if (dataRouterState) {
930
+ error = errors && match.route.id ? errors[match.route.id] : void 0;
931
+ errorElement = match.route.errorElement || defaultErrorElement;
932
+ if (renderFallback) {
933
+ if (fallbackIndex < 0 && index === 0) {
934
+ warningOnce(
935
+ "route-fallback",
936
+ false,
937
+ "No `HydrateFallback` element provided to render during initial hydration"
938
+ );
939
+ shouldRenderHydrateFallback = true;
940
+ hydrateFallbackElement = null;
941
+ } else if (fallbackIndex === index) {
942
+ shouldRenderHydrateFallback = true;
943
+ hydrateFallbackElement = match.route.hydrateFallbackElement || null;
944
+ }
945
+ }
946
+ }
947
+ let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1));
948
+ let getChildren = () => {
949
+ let children;
950
+ if (error) {
951
+ children = errorElement;
952
+ } else if (shouldRenderHydrateFallback) {
953
+ children = hydrateFallbackElement;
954
+ } else if (match.route.Component) {
955
+ children = /* @__PURE__ */ React2.createElement(match.route.Component, null);
956
+ } else if (match.route.element) {
957
+ children = match.route.element;
958
+ } else {
959
+ children = outlet;
960
+ }
961
+ return /* @__PURE__ */ React2.createElement(
962
+ RenderedRoute,
963
+ {
964
+ match,
965
+ routeContext: {
966
+ outlet,
967
+ matches: matches2,
968
+ isDataRoute: dataRouterState != null
969
+ },
970
+ children
971
+ }
972
+ );
973
+ };
974
+ return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /* @__PURE__ */ React2.createElement(
975
+ RenderErrorBoundary,
976
+ {
977
+ location: dataRouterState.location,
978
+ revalidation: dataRouterState.revalidation,
979
+ component: errorElement,
980
+ error,
981
+ children: getChildren(),
982
+ routeContext: { outlet: null, matches: matches2, isDataRoute: true }
983
+ }
984
+ ) : getChildren();
985
+ },
986
+ null
987
+ );
988
+ }
989
+ function getDataRouterConsoleError(hookName) {
990
+ return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
991
+ }
992
+ function useDataRouterContext(hookName) {
993
+ let ctx = React2.useContext(DataRouterContext);
994
+ invariant(ctx, getDataRouterConsoleError(hookName));
995
+ return ctx;
996
+ }
997
+ function useDataRouterState(hookName) {
998
+ let state = React2.useContext(DataRouterStateContext);
999
+ invariant(state, getDataRouterConsoleError(hookName));
1000
+ return state;
1001
+ }
1002
+ function useRouteContext(hookName) {
1003
+ let route = React2.useContext(RouteContext);
1004
+ invariant(route, getDataRouterConsoleError(hookName));
1005
+ return route;
1006
+ }
1007
+ function useCurrentRouteId(hookName) {
1008
+ let route = useRouteContext(hookName);
1009
+ let thisRoute = route.matches[route.matches.length - 1];
1010
+ invariant(
1011
+ thisRoute.route.id,
1012
+ `${hookName} can only be used on routes that contain a unique "id"`
1013
+ );
1014
+ return thisRoute.route.id;
1015
+ }
1016
+ function useRouteId() {
1017
+ return useCurrentRouteId(
1018
+ "useRouteId"
1019
+ /* UseRouteId */
1020
+ );
1021
+ }
1022
+ function useNavigation() {
1023
+ let state = useDataRouterState(
1024
+ "useNavigation"
1025
+ /* UseNavigation */
1026
+ );
1027
+ return state.navigation;
1028
+ }
1029
+ function useMatches() {
1030
+ let { matches, loaderData } = useDataRouterState(
1031
+ "useMatches"
1032
+ /* UseMatches */
1033
+ );
1034
+ return React2.useMemo(
1035
+ () => matches.map((m) => convertRouteMatchToUiMatch(m, loaderData)),
1036
+ [matches, loaderData]
1037
+ );
1038
+ }
1039
+ function useRouteError() {
1040
+ let error = React2.useContext(RouteErrorContext);
1041
+ let state = useDataRouterState(
1042
+ "useRouteError"
1043
+ /* UseRouteError */
1044
+ );
1045
+ let routeId = useCurrentRouteId(
1046
+ "useRouteError"
1047
+ /* UseRouteError */
1048
+ );
1049
+ if (error !== void 0) {
1050
+ return error;
1051
+ }
1052
+ return state.errors?.[routeId];
1053
+ }
1054
+ function useNavigateStable() {
1055
+ let { router } = useDataRouterContext(
1056
+ "useNavigate"
1057
+ /* UseNavigateStable */
1058
+ );
1059
+ let id = useCurrentRouteId(
1060
+ "useNavigate"
1061
+ /* UseNavigateStable */
1062
+ );
1063
+ let activeRef = React2.useRef(false);
1064
+ useIsomorphicLayoutEffect(() => {
1065
+ activeRef.current = true;
1066
+ });
1067
+ let navigate = React2.useCallback(
1068
+ async (to, options = {}) => {
1069
+ warning(activeRef.current, navigateEffectWarning);
1070
+ if (!activeRef.current)
1071
+ return;
1072
+ if (typeof to === "number") {
1073
+ router.navigate(to);
1074
+ } else {
1075
+ await router.navigate(to, { fromRouteId: id, ...options });
1076
+ }
1077
+ },
1078
+ [router, id]
1079
+ );
1080
+ return navigate;
1081
+ }
1082
+ var alreadyWarned = {};
1083
+ function warningOnce(key, cond, message) {
1084
+ if (!cond && !alreadyWarned[key]) {
1085
+ alreadyWarned[key] = true;
1086
+ warning(false, message);
1087
+ }
1088
+ }
1089
+ var MemoizedDataRoutes = React3.memo(DataRoutes);
1090
+ function DataRoutes({
1091
+ routes,
1092
+ future,
1093
+ state
1094
+ }) {
1095
+ return useRoutesImpl(routes, void 0, state, future);
1096
+ }
1097
+ function MemoryRouter({
1098
+ basename,
1099
+ children,
1100
+ initialEntries,
1101
+ initialIndex
1102
+ }) {
1103
+ let historyRef = React3.useRef();
1104
+ if (historyRef.current == null) {
1105
+ historyRef.current = createMemoryHistory({
1106
+ initialEntries,
1107
+ initialIndex,
1108
+ v5Compat: true
1109
+ });
1110
+ }
1111
+ let history = historyRef.current;
1112
+ let [state, setStateImpl] = React3.useState({
1113
+ action: history.action,
1114
+ location: history.location
1115
+ });
1116
+ let setState = React3.useCallback(
1117
+ (newState) => {
1118
+ React3.startTransition(() => setStateImpl(newState));
1119
+ },
1120
+ [setStateImpl]
1121
+ );
1122
+ React3.useLayoutEffect(() => history.listen(setState), [history, setState]);
1123
+ return /* @__PURE__ */ React3.createElement(
1124
+ Router,
1125
+ {
1126
+ basename,
1127
+ children,
1128
+ location: state.location,
1129
+ navigationType: state.action,
1130
+ navigator: history
1131
+ }
1132
+ );
1133
+ }
1134
+ function Router({
1135
+ basename: basenameProp = "/",
1136
+ children = null,
1137
+ location: locationProp,
1138
+ navigationType = "POP",
1139
+ navigator,
1140
+ static: staticProp = false
1141
+ }) {
1142
+ invariant(
1143
+ !useInRouterContext(),
1144
+ `You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`
1145
+ );
1146
+ let basename = basenameProp.replace(/^\/*/, "/");
1147
+ let navigationContext = React3.useMemo(
1148
+ () => ({
1149
+ basename,
1150
+ navigator,
1151
+ static: staticProp,
1152
+ future: {}
1153
+ }),
1154
+ [basename, navigator, staticProp]
1155
+ );
1156
+ if (typeof locationProp === "string") {
1157
+ locationProp = parsePath(locationProp);
1158
+ }
1159
+ let {
1160
+ pathname = "/",
1161
+ search = "",
1162
+ hash = "",
1163
+ state = null,
1164
+ key = "default"
1165
+ } = locationProp;
1166
+ let locationContext = React3.useMemo(() => {
1167
+ let trailingPathname = stripBasename(pathname, basename);
1168
+ if (trailingPathname == null) {
1169
+ return null;
1170
+ }
1171
+ return {
1172
+ location: {
1173
+ pathname: trailingPathname,
1174
+ search,
1175
+ hash,
1176
+ state,
1177
+ key
1178
+ },
1179
+ navigationType
1180
+ };
1181
+ }, [basename, pathname, search, hash, state, key, navigationType]);
1182
+ warning(
1183
+ locationContext != null,
1184
+ `<Router basename="${basename}"> is not able to match the URL "${pathname}${search}${hash}" because it does not start with the basename, so the <Router> won't render anything.`
1185
+ );
1186
+ if (locationContext == null) {
1187
+ return null;
1188
+ }
1189
+ return /* @__PURE__ */ React3.createElement(NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ React3.createElement(LocationContext.Provider, { children, value: locationContext }));
1190
+ }
1191
+ var defaultMethod = "get";
1192
+ var defaultEncType = "application/x-www-form-urlencoded";
1193
+ function isHtmlElement(object) {
1194
+ return object != null && typeof object.tagName === "string";
1195
+ }
1196
+ function isButtonElement(object) {
1197
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
1198
+ }
1199
+ function isFormElement(object) {
1200
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
1201
+ }
1202
+ function isInputElement(object) {
1203
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
1204
+ }
1205
+ function isModifiedEvent(event) {
1206
+ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
1207
+ }
1208
+ function shouldProcessLinkClick(event, target) {
1209
+ return event.button === 0 && // Ignore everything but left clicks
1210
+ (!target || target === "_self") && // Let browser handle "target=_blank" etc.
1211
+ !isModifiedEvent(event);
1212
+ }
1213
+ var _formDataSupportsSubmitter = null;
1214
+ function isFormDataSubmitterSupported() {
1215
+ if (_formDataSupportsSubmitter === null) {
1216
+ try {
1217
+ new FormData(
1218
+ document.createElement("form"),
1219
+ // @ts-expect-error if FormData supports the submitter parameter, this will throw
1220
+ 0
1221
+ );
1222
+ _formDataSupportsSubmitter = false;
1223
+ } catch (e) {
1224
+ _formDataSupportsSubmitter = true;
1225
+ }
1226
+ }
1227
+ return _formDataSupportsSubmitter;
1228
+ }
1229
+ var supportedFormEncTypes = /* @__PURE__ */ new Set([
1230
+ "application/x-www-form-urlencoded",
1231
+ "multipart/form-data",
1232
+ "text/plain"
1233
+ ]);
1234
+ function getFormEncType(encType) {
1235
+ if (encType != null && !supportedFormEncTypes.has(encType)) {
1236
+ warning(
1237
+ false,
1238
+ `"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
1239
+ );
1240
+ return null;
1241
+ }
1242
+ return encType;
1243
+ }
1244
+ function getFormSubmissionInfo(target, basename) {
1245
+ let method;
1246
+ let action;
1247
+ let encType;
1248
+ let formData;
1249
+ let body;
1250
+ if (isFormElement(target)) {
1251
+ let attr = target.getAttribute("action");
1252
+ action = attr ? stripBasename(attr, basename) : null;
1253
+ method = target.getAttribute("method") || defaultMethod;
1254
+ encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
1255
+ formData = new FormData(target);
1256
+ } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
1257
+ let form = target.form;
1258
+ if (form == null) {
1259
+ throw new Error(
1260
+ `Cannot submit a <button> or <input type="submit"> without a <form>`
1261
+ );
1262
+ }
1263
+ let attr = target.getAttribute("formaction") || form.getAttribute("action");
1264
+ action = attr ? stripBasename(attr, basename) : null;
1265
+ method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
1266
+ encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
1267
+ formData = new FormData(form, target);
1268
+ if (!isFormDataSubmitterSupported()) {
1269
+ let { name, type, value } = target;
1270
+ if (type === "image") {
1271
+ let prefix = name ? `${name}.` : "";
1272
+ formData.append(`${prefix}x`, "0");
1273
+ formData.append(`${prefix}y`, "0");
1274
+ } else if (name) {
1275
+ formData.append(name, value);
1276
+ }
1277
+ }
1278
+ } else if (isHtmlElement(target)) {
1279
+ throw new Error(
1280
+ `Cannot submit element that is not <form>, <button>, or <input type="submit|image">`
1281
+ );
1282
+ } else {
1283
+ method = defaultMethod;
1284
+ action = null;
1285
+ encType = defaultEncType;
1286
+ body = target;
1287
+ }
1288
+ if (formData && encType === "text/plain") {
1289
+ body = formData;
1290
+ formData = void 0;
1291
+ }
1292
+ return { action, method: method.toLowerCase(), encType, formData, body };
1293
+ }
1294
+ var objectProtoNames = Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
1295
+ function invariant2(value, message) {
1296
+ if (value === false || value === null || typeof value === "undefined") {
1297
+ throw new Error(message);
1298
+ }
1299
+ }
1300
+ var SingleFetchRedirectSymbol = Symbol("SingleFetchRedirect");
1301
+ function singleFetchUrl(reqUrl, basename, extension) {
1302
+ let url = typeof reqUrl === "string" ? new URL(
1303
+ reqUrl,
1304
+ // This can be called during the SSR flow via PrefetchPageLinksImpl so
1305
+ // don't assume window is available
1306
+ typeof window === "undefined" ? "server://singlefetch/" : window.location.origin
1307
+ ) : reqUrl;
1308
+ if (url.pathname === "/") {
1309
+ url.pathname = `_root.${extension}`;
1310
+ } else if (basename && stripBasename(url.pathname, basename) === "/") {
1311
+ url.pathname = `${basename.replace(/\/$/, "")}/_root.${extension}`;
1312
+ } else {
1313
+ url.pathname = `${url.pathname.replace(/\/$/, "")}.${extension}`;
1314
+ }
1315
+ return url;
1316
+ }
1317
+ async function loadRouteModule(route, routeModulesCache) {
1318
+ if (route.id in routeModulesCache) {
1319
+ return routeModulesCache[route.id];
1320
+ }
1321
+ try {
1322
+ let routeModule = await import(
1323
+ /* @vite-ignore */
1324
+ /* webpackIgnore: true */
1325
+ route.module
1326
+ );
1327
+ routeModulesCache[route.id] = routeModule;
1328
+ return routeModule;
1329
+ } catch (error) {
1330
+ console.error(
1331
+ `Error loading route module \`${route.module}\`, reloading page...`
1332
+ );
1333
+ console.error(error);
1334
+ if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && // @ts-expect-error
1335
+ import.meta.hot) {
1336
+ throw error;
1337
+ }
1338
+ window.location.reload();
1339
+ return new Promise(() => {
1340
+ });
1341
+ }
1342
+ }
1343
+ function isPageLinkDescriptor(object) {
1344
+ return object != null && typeof object.page === "string";
1345
+ }
1346
+ function isHtmlLinkDescriptor(object) {
1347
+ if (object == null) {
1348
+ return false;
1349
+ }
1350
+ if (object.href == null) {
1351
+ return object.rel === "preload" && typeof object.imageSrcSet === "string" && typeof object.imageSizes === "string";
1352
+ }
1353
+ return typeof object.rel === "string" && typeof object.href === "string";
1354
+ }
1355
+ async function getKeyedPrefetchLinks(matches, manifest, routeModules) {
1356
+ let links = await Promise.all(
1357
+ matches.map(async (match) => {
1358
+ let route = manifest.routes[match.route.id];
1359
+ if (route) {
1360
+ let mod = await loadRouteModule(route, routeModules);
1361
+ return mod.links ? mod.links() : [];
1362
+ }
1363
+ return [];
1364
+ })
1365
+ );
1366
+ return dedupeLinkDescriptors(
1367
+ links.flat(1).filter(isHtmlLinkDescriptor).filter((link) => link.rel === "stylesheet" || link.rel === "preload").map(
1368
+ (link) => link.rel === "stylesheet" ? { ...link, rel: "prefetch", as: "style" } : { ...link, rel: "prefetch" }
1369
+ )
1370
+ );
1371
+ }
1372
+ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, location, mode) {
1373
+ let isNew = (match, index) => {
1374
+ if (!currentMatches[index])
1375
+ return true;
1376
+ return match.route.id !== currentMatches[index].route.id;
1377
+ };
1378
+ let matchPathChanged = (match, index) => {
1379
+ return (
1380
+ // param change, /users/123 -> /users/456
1381
+ currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
1382
+ // e.g. /files/images/avatar.jpg -> files/finances.xls
1383
+ currentMatches[index].route.path?.endsWith("*") && currentMatches[index].params["*"] !== match.params["*"]
1384
+ );
1385
+ };
1386
+ if (mode === "assets") {
1387
+ return nextMatches.filter(
1388
+ (match, index) => isNew(match, index) || matchPathChanged(match, index)
1389
+ );
1390
+ }
1391
+ if (mode === "data") {
1392
+ return nextMatches.filter((match, index) => {
1393
+ let manifestRoute = manifest.routes[match.route.id];
1394
+ if (!manifestRoute || !manifestRoute.hasLoader) {
1395
+ return false;
1396
+ }
1397
+ if (isNew(match, index) || matchPathChanged(match, index)) {
1398
+ return true;
1399
+ }
1400
+ if (match.route.shouldRevalidate) {
1401
+ let routeChoice = match.route.shouldRevalidate({
1402
+ currentUrl: new URL(
1403
+ location.pathname + location.search + location.hash,
1404
+ window.origin
1405
+ ),
1406
+ currentParams: currentMatches[0]?.params || {},
1407
+ nextUrl: new URL(page, window.origin),
1408
+ nextParams: match.params,
1409
+ defaultShouldRevalidate: true
1410
+ });
1411
+ if (typeof routeChoice === "boolean") {
1412
+ return routeChoice;
1413
+ }
1414
+ }
1415
+ return true;
1416
+ });
1417
+ }
1418
+ return [];
1419
+ }
1420
+ function getModuleLinkHrefs(matches, manifest, { includeHydrateFallback } = {}) {
1421
+ return dedupeHrefs(
1422
+ matches.map((match) => {
1423
+ let route = manifest.routes[match.route.id];
1424
+ if (!route)
1425
+ return [];
1426
+ let hrefs = [route.module];
1427
+ if (route.clientActionModule) {
1428
+ hrefs = hrefs.concat(route.clientActionModule);
1429
+ }
1430
+ if (route.clientLoaderModule) {
1431
+ hrefs = hrefs.concat(route.clientLoaderModule);
1432
+ }
1433
+ if (includeHydrateFallback && route.hydrateFallbackModule) {
1434
+ hrefs = hrefs.concat(route.hydrateFallbackModule);
1435
+ }
1436
+ if (route.imports) {
1437
+ hrefs = hrefs.concat(route.imports);
1438
+ }
1439
+ return hrefs;
1440
+ }).flat(1)
1441
+ );
1442
+ }
1443
+ function dedupeHrefs(hrefs) {
1444
+ return [...new Set(hrefs)];
1445
+ }
1446
+ function sortKeys(obj) {
1447
+ let sorted = {};
1448
+ let keys = Object.keys(obj).sort();
1449
+ for (let key of keys) {
1450
+ sorted[key] = obj[key];
1451
+ }
1452
+ return sorted;
1453
+ }
1454
+ function dedupeLinkDescriptors(descriptors, preloads) {
1455
+ let set = /* @__PURE__ */ new Set();
1456
+ let preloadsSet = new Set(preloads);
1457
+ return descriptors.reduce((deduped, descriptor) => {
1458
+ let alreadyModulePreload = preloads && !isPageLinkDescriptor(descriptor) && descriptor.as === "script" && descriptor.href && preloadsSet.has(descriptor.href);
1459
+ if (alreadyModulePreload) {
1460
+ return deduped;
1461
+ }
1462
+ let key = JSON.stringify(sortKeys(descriptor));
1463
+ if (!set.has(key)) {
1464
+ set.add(key);
1465
+ deduped.push({ key, link: descriptor });
1466
+ }
1467
+ return deduped;
1468
+ }, []);
1469
+ }
1470
+ function useDataRouterContext2() {
1471
+ let context = React8.useContext(DataRouterContext);
1472
+ invariant2(
1473
+ context,
1474
+ "You must render this element inside a <DataRouterContext.Provider> element"
1475
+ );
1476
+ return context;
1477
+ }
1478
+ function useDataRouterStateContext() {
1479
+ let context = React8.useContext(DataRouterStateContext);
1480
+ invariant2(
1481
+ context,
1482
+ "You must render this element inside a <DataRouterStateContext.Provider> element"
1483
+ );
1484
+ return context;
1485
+ }
1486
+ var FrameworkContext = React8.createContext(void 0);
1487
+ FrameworkContext.displayName = "FrameworkContext";
1488
+ function useFrameworkContext() {
1489
+ let context = React8.useContext(FrameworkContext);
1490
+ invariant2(
1491
+ context,
1492
+ "You must render this element inside a <HydratedRouter> element"
1493
+ );
1494
+ return context;
1495
+ }
1496
+ function usePrefetchBehavior(prefetch, theirElementProps) {
1497
+ let frameworkContext = React8.useContext(FrameworkContext);
1498
+ let [maybePrefetch, setMaybePrefetch] = React8.useState(false);
1499
+ let [shouldPrefetch, setShouldPrefetch] = React8.useState(false);
1500
+ let { onFocus, onBlur, onMouseEnter, onMouseLeave, onTouchStart } = theirElementProps;
1501
+ let ref = React8.useRef(null);
1502
+ React8.useEffect(() => {
1503
+ if (prefetch === "render") {
1504
+ setShouldPrefetch(true);
1505
+ }
1506
+ if (prefetch === "viewport") {
1507
+ let callback = (entries) => {
1508
+ entries.forEach((entry) => {
1509
+ setShouldPrefetch(entry.isIntersecting);
1510
+ });
1511
+ };
1512
+ let observer = new IntersectionObserver(callback, { threshold: 0.5 });
1513
+ if (ref.current)
1514
+ observer.observe(ref.current);
1515
+ return () => {
1516
+ observer.disconnect();
1517
+ };
1518
+ }
1519
+ }, [prefetch]);
1520
+ React8.useEffect(() => {
1521
+ if (maybePrefetch) {
1522
+ let id = setTimeout(() => {
1523
+ setShouldPrefetch(true);
1524
+ }, 100);
1525
+ return () => {
1526
+ clearTimeout(id);
1527
+ };
1528
+ }
1529
+ }, [maybePrefetch]);
1530
+ let setIntent = () => {
1531
+ setMaybePrefetch(true);
1532
+ };
1533
+ let cancelIntent = () => {
1534
+ setMaybePrefetch(false);
1535
+ setShouldPrefetch(false);
1536
+ };
1537
+ if (!frameworkContext) {
1538
+ return [false, ref, {}];
1539
+ }
1540
+ if (prefetch !== "intent") {
1541
+ return [shouldPrefetch, ref, {}];
1542
+ }
1543
+ return [
1544
+ shouldPrefetch,
1545
+ ref,
1546
+ {
1547
+ onFocus: composeEventHandlers(onFocus, setIntent),
1548
+ onBlur: composeEventHandlers(onBlur, cancelIntent),
1549
+ onMouseEnter: composeEventHandlers(onMouseEnter, setIntent),
1550
+ onMouseLeave: composeEventHandlers(onMouseLeave, cancelIntent),
1551
+ onTouchStart: composeEventHandlers(onTouchStart, setIntent)
1552
+ }
1553
+ ];
1554
+ }
1555
+ function composeEventHandlers(theirHandler, ourHandler) {
1556
+ return (event) => {
1557
+ theirHandler && theirHandler(event);
1558
+ if (!event.defaultPrevented) {
1559
+ ourHandler(event);
1560
+ }
1561
+ };
1562
+ }
1563
+ function PrefetchPageLinks({ page, ...linkProps }) {
1564
+ let { router } = useDataRouterContext2();
1565
+ let matches = React8.useMemo(
1566
+ () => matchRoutes(router.routes, page, router.basename),
1567
+ [router.routes, page, router.basename]
1568
+ );
1569
+ if (!matches) {
1570
+ return null;
1571
+ }
1572
+ return /* @__PURE__ */ React8.createElement(PrefetchPageLinksImpl, { page, matches, ...linkProps });
1573
+ }
1574
+ function useKeyedPrefetchLinks(matches) {
1575
+ let { manifest, routeModules } = useFrameworkContext();
1576
+ let [keyedPrefetchLinks, setKeyedPrefetchLinks] = React8.useState([]);
1577
+ React8.useEffect(() => {
1578
+ let interrupted = false;
1579
+ void getKeyedPrefetchLinks(matches, manifest, routeModules).then(
1580
+ (links) => {
1581
+ if (!interrupted) {
1582
+ setKeyedPrefetchLinks(links);
1583
+ }
1584
+ }
1585
+ );
1586
+ return () => {
1587
+ interrupted = true;
1588
+ };
1589
+ }, [matches, manifest, routeModules]);
1590
+ return keyedPrefetchLinks;
1591
+ }
1592
+ function PrefetchPageLinksImpl({
1593
+ page,
1594
+ matches: nextMatches,
1595
+ ...linkProps
1596
+ }) {
1597
+ let location = useLocation();
1598
+ let { manifest, routeModules } = useFrameworkContext();
1599
+ let { basename } = useDataRouterContext2();
1600
+ let { loaderData, matches } = useDataRouterStateContext();
1601
+ let newMatchesForData = React8.useMemo(
1602
+ () => getNewMatchesForLinks(
1603
+ page,
1604
+ nextMatches,
1605
+ matches,
1606
+ manifest,
1607
+ location,
1608
+ "data"
1609
+ ),
1610
+ [page, nextMatches, matches, manifest, location]
1611
+ );
1612
+ let newMatchesForAssets = React8.useMemo(
1613
+ () => getNewMatchesForLinks(
1614
+ page,
1615
+ nextMatches,
1616
+ matches,
1617
+ manifest,
1618
+ location,
1619
+ "assets"
1620
+ ),
1621
+ [page, nextMatches, matches, manifest, location]
1622
+ );
1623
+ let dataHrefs = React8.useMemo(() => {
1624
+ if (page === location.pathname + location.search + location.hash) {
1625
+ return [];
1626
+ }
1627
+ let routesParams = /* @__PURE__ */ new Set();
1628
+ let foundOptOutRoute = false;
1629
+ nextMatches.forEach((m) => {
1630
+ let manifestRoute = manifest.routes[m.route.id];
1631
+ if (!manifestRoute || !manifestRoute.hasLoader) {
1632
+ return;
1633
+ }
1634
+ if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && routeModules[m.route.id]?.shouldRevalidate) {
1635
+ foundOptOutRoute = true;
1636
+ } else if (manifestRoute.hasClientLoader) {
1637
+ foundOptOutRoute = true;
1638
+ } else {
1639
+ routesParams.add(m.route.id);
1640
+ }
1641
+ });
1642
+ if (routesParams.size === 0) {
1643
+ return [];
1644
+ }
1645
+ let url = singleFetchUrl(page, basename, "data");
1646
+ if (foundOptOutRoute && routesParams.size > 0) {
1647
+ url.searchParams.set(
1648
+ "_routes",
1649
+ nextMatches.filter((m) => routesParams.has(m.route.id)).map((m) => m.route.id).join(",")
1650
+ );
1651
+ }
1652
+ return [url.pathname + url.search];
1653
+ }, [
1654
+ basename,
1655
+ loaderData,
1656
+ location,
1657
+ manifest,
1658
+ newMatchesForData,
1659
+ nextMatches,
1660
+ page,
1661
+ routeModules
1662
+ ]);
1663
+ let moduleHrefs = React8.useMemo(
1664
+ () => getModuleLinkHrefs(newMatchesForAssets, manifest),
1665
+ [newMatchesForAssets, manifest]
1666
+ );
1667
+ let keyedPrefetchLinks = useKeyedPrefetchLinks(newMatchesForAssets);
1668
+ return /* @__PURE__ */ React8.createElement(React8.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ React8.createElement("link", { key: href, rel: "prefetch", as: "fetch", href, ...linkProps })), moduleHrefs.map((href) => /* @__PURE__ */ React8.createElement("link", { key: href, rel: "modulepreload", href, ...linkProps })), keyedPrefetchLinks.map(({ key, link }) => (
1669
+ // these don't spread `linkProps` because they are full link descriptors
1670
+ // already with their own props
1671
+ /* @__PURE__ */ React8.createElement("link", { key, nonce: linkProps.nonce, ...link })
1672
+ )));
1673
+ }
1674
+ function mergeRefs(...refs) {
1675
+ return (value) => {
1676
+ refs.forEach((ref) => {
1677
+ if (typeof ref === "function") {
1678
+ ref(value);
1679
+ } else if (ref != null) {
1680
+ ref.current = value;
1681
+ }
1682
+ });
1683
+ };
1684
+ }
1685
+ var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
1686
+ try {
1687
+ if (isBrowser) {
1688
+ window.__reactRouterVersion = // @ts-expect-error
1689
+ "7.8.0";
1690
+ }
1691
+ } catch (e) {
1692
+ }
1693
+ function HistoryRouter({
1694
+ basename,
1695
+ children,
1696
+ history
1697
+ }) {
1698
+ let [state, setStateImpl] = React10.useState({
1699
+ action: history.action,
1700
+ location: history.location
1701
+ });
1702
+ let setState = React10.useCallback(
1703
+ (newState) => {
1704
+ React10.startTransition(() => setStateImpl(newState));
1705
+ },
1706
+ [setStateImpl]
1707
+ );
1708
+ React10.useLayoutEffect(() => history.listen(setState), [history, setState]);
1709
+ return /* @__PURE__ */ React10.createElement(
1710
+ Router,
1711
+ {
1712
+ basename,
1713
+ children,
1714
+ location: state.location,
1715
+ navigationType: state.action,
1716
+ navigator: history
1717
+ }
1718
+ );
1719
+ }
1720
+ HistoryRouter.displayName = "unstable_HistoryRouter";
1721
+ var ABSOLUTE_URL_REGEX2 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
1722
+ var Link = React10.forwardRef(
1723
+ function LinkWithRef({
1724
+ onClick,
1725
+ discover = "render",
1726
+ prefetch = "none",
1727
+ relative,
1728
+ reloadDocument,
1729
+ replace: replace2,
1730
+ state,
1731
+ target,
1732
+ to,
1733
+ preventScrollReset,
1734
+ viewTransition,
1735
+ ...rest
1736
+ }, forwardedRef) {
1737
+ let { basename } = React10.useContext(NavigationContext);
1738
+ let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX2.test(to);
1739
+ let absoluteHref;
1740
+ let isExternal = false;
1741
+ if (typeof to === "string" && isAbsolute) {
1742
+ absoluteHref = to;
1743
+ if (isBrowser) {
1744
+ try {
1745
+ let currentUrl = new URL(window.location.href);
1746
+ let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
1747
+ let path = stripBasename(targetUrl.pathname, basename);
1748
+ if (targetUrl.origin === currentUrl.origin && path != null) {
1749
+ to = path + targetUrl.search + targetUrl.hash;
1750
+ } else {
1751
+ isExternal = true;
1752
+ }
1753
+ } catch (e) {
1754
+ warning(
1755
+ false,
1756
+ `<Link to="${to}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
1757
+ );
1758
+ }
1759
+ }
1760
+ }
1761
+ let href = useHref(to, { relative });
1762
+ let [shouldPrefetch, prefetchRef, prefetchHandlers] = usePrefetchBehavior(
1763
+ prefetch,
1764
+ rest
1765
+ );
1766
+ let internalOnClick = useLinkClickHandler(to, {
1767
+ replace: replace2,
1768
+ state,
1769
+ target,
1770
+ preventScrollReset,
1771
+ relative,
1772
+ viewTransition
1773
+ });
1774
+ function handleClick(event) {
1775
+ if (onClick)
1776
+ onClick(event);
1777
+ if (!event.defaultPrevented) {
1778
+ internalOnClick(event);
1779
+ }
1780
+ }
1781
+ let link = (
1782
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
1783
+ /* @__PURE__ */ React10.createElement(
1784
+ "a",
1785
+ {
1786
+ ...rest,
1787
+ ...prefetchHandlers,
1788
+ href: absoluteHref || href,
1789
+ onClick: isExternal || reloadDocument ? onClick : handleClick,
1790
+ ref: mergeRefs(forwardedRef, prefetchRef),
1791
+ target,
1792
+ "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
1793
+ }
1794
+ )
1795
+ );
1796
+ return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React10.createElement(React10.Fragment, null, link, /* @__PURE__ */ React10.createElement(PrefetchPageLinks, { page: href })) : link;
1797
+ }
1798
+ );
1799
+ Link.displayName = "Link";
1800
+ var NavLink = React10.forwardRef(
1801
+ function NavLinkWithRef({
1802
+ "aria-current": ariaCurrentProp = "page",
1803
+ caseSensitive = false,
1804
+ className: classNameProp = "",
1805
+ end = false,
1806
+ style: styleProp,
1807
+ to,
1808
+ viewTransition,
1809
+ children,
1810
+ ...rest
1811
+ }, ref) {
1812
+ let path = useResolvedPath(to, { relative: rest.relative });
1813
+ let location = useLocation();
1814
+ let routerState = React10.useContext(DataRouterStateContext);
1815
+ let { navigator, basename } = React10.useContext(NavigationContext);
1816
+ let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
1817
+ // eslint-disable-next-line react-hooks/rules-of-hooks
1818
+ useViewTransitionState(path) && viewTransition === true;
1819
+ let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;
1820
+ let locationPathname = location.pathname;
1821
+ let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
1822
+ if (!caseSensitive) {
1823
+ locationPathname = locationPathname.toLowerCase();
1824
+ nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
1825
+ toPathname = toPathname.toLowerCase();
1826
+ }
1827
+ if (nextLocationPathname && basename) {
1828
+ nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;
1829
+ }
1830
+ const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
1831
+ let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
1832
+ let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
1833
+ let renderProps = {
1834
+ isActive,
1835
+ isPending,
1836
+ isTransitioning
1837
+ };
1838
+ let ariaCurrent = isActive ? ariaCurrentProp : void 0;
1839
+ let className;
1840
+ if (typeof classNameProp === "function") {
1841
+ className = classNameProp(renderProps);
1842
+ } else {
1843
+ className = [
1844
+ classNameProp,
1845
+ isActive ? "active" : null,
1846
+ isPending ? "pending" : null,
1847
+ isTransitioning ? "transitioning" : null
1848
+ ].filter(Boolean).join(" ");
1849
+ }
1850
+ let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
1851
+ return /* @__PURE__ */ React10.createElement(
1852
+ Link,
1853
+ {
1854
+ ...rest,
1855
+ "aria-current": ariaCurrent,
1856
+ className,
1857
+ ref,
1858
+ style,
1859
+ to,
1860
+ viewTransition
1861
+ },
1862
+ typeof children === "function" ? children(renderProps) : children
1863
+ );
1864
+ }
1865
+ );
1866
+ NavLink.displayName = "NavLink";
1867
+ var Form = React10.forwardRef(
1868
+ ({
1869
+ discover = "render",
1870
+ fetcherKey,
1871
+ navigate,
1872
+ reloadDocument,
1873
+ replace: replace2,
1874
+ state,
1875
+ method = defaultMethod,
1876
+ action,
1877
+ onSubmit,
1878
+ relative,
1879
+ preventScrollReset,
1880
+ viewTransition,
1881
+ ...props
1882
+ }, forwardedRef) => {
1883
+ let submit = useSubmit();
1884
+ let formAction = useFormAction(action, { relative });
1885
+ let formMethod = method.toLowerCase() === "get" ? "get" : "post";
1886
+ let isAbsolute = typeof action === "string" && ABSOLUTE_URL_REGEX2.test(action);
1887
+ let submitHandler = (event) => {
1888
+ onSubmit && onSubmit(event);
1889
+ if (event.defaultPrevented)
1890
+ return;
1891
+ event.preventDefault();
1892
+ let submitter = event.nativeEvent.submitter;
1893
+ let submitMethod = submitter?.getAttribute("formmethod") || method;
1894
+ submit(submitter || event.currentTarget, {
1895
+ fetcherKey,
1896
+ method: submitMethod,
1897
+ navigate,
1898
+ replace: replace2,
1899
+ state,
1900
+ relative,
1901
+ preventScrollReset,
1902
+ viewTransition
1903
+ });
1904
+ };
1905
+ return /* @__PURE__ */ React10.createElement(
1906
+ "form",
1907
+ {
1908
+ ref: forwardedRef,
1909
+ method: formMethod,
1910
+ action: formAction,
1911
+ onSubmit: reloadDocument ? onSubmit : submitHandler,
1912
+ ...props,
1913
+ "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
1914
+ }
1915
+ );
1916
+ }
1917
+ );
1918
+ Form.displayName = "Form";
1919
+ function ScrollRestoration({
1920
+ getKey,
1921
+ storageKey,
1922
+ ...props
1923
+ }) {
1924
+ let remixContext = React10.useContext(FrameworkContext);
1925
+ let { basename } = React10.useContext(NavigationContext);
1926
+ let location = useLocation();
1927
+ let matches = useMatches();
1928
+ useScrollRestoration({ getKey, storageKey });
1929
+ let ssrKey = React10.useMemo(
1930
+ () => {
1931
+ if (!remixContext || !getKey)
1932
+ return null;
1933
+ let userKey = getScrollRestorationKey(
1934
+ location,
1935
+ matches,
1936
+ basename,
1937
+ getKey
1938
+ );
1939
+ return userKey !== location.key ? userKey : null;
1940
+ },
1941
+ // Nah, we only need this the first time for the SSR render
1942
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1943
+ []
1944
+ );
1945
+ if (!remixContext || remixContext.isSpaMode) {
1946
+ return null;
1947
+ }
1948
+ let restoreScroll = ((storageKey2, restoreKey) => {
1949
+ if (!window.history.state || !window.history.state.key) {
1950
+ let key = Math.random().toString(32).slice(2);
1951
+ window.history.replaceState({ key }, "");
1952
+ }
1953
+ try {
1954
+ let positions = JSON.parse(sessionStorage.getItem(storageKey2) || "{}");
1955
+ let storedY = positions[restoreKey || window.history.state.key];
1956
+ if (typeof storedY === "number") {
1957
+ window.scrollTo(0, storedY);
1958
+ }
1959
+ } catch (error) {
1960
+ console.error(error);
1961
+ sessionStorage.removeItem(storageKey2);
1962
+ }
1963
+ }).toString();
1964
+ return /* @__PURE__ */ React10.createElement(
1965
+ "script",
1966
+ {
1967
+ ...props,
1968
+ suppressHydrationWarning: true,
1969
+ dangerouslySetInnerHTML: {
1970
+ __html: `(${restoreScroll})(${JSON.stringify(
1971
+ storageKey || SCROLL_RESTORATION_STORAGE_KEY
1972
+ )}, ${JSON.stringify(ssrKey)})`
1973
+ }
1974
+ }
1975
+ );
1976
+ }
1977
+ ScrollRestoration.displayName = "ScrollRestoration";
1978
+ function getDataRouterConsoleError2(hookName) {
1979
+ return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1980
+ }
1981
+ function useDataRouterContext3(hookName) {
1982
+ let ctx = React10.useContext(DataRouterContext);
1983
+ invariant(ctx, getDataRouterConsoleError2(hookName));
1984
+ return ctx;
1985
+ }
1986
+ function useDataRouterState2(hookName) {
1987
+ let state = React10.useContext(DataRouterStateContext);
1988
+ invariant(state, getDataRouterConsoleError2(hookName));
1989
+ return state;
1990
+ }
1991
+ function useLinkClickHandler(to, {
1992
+ target,
1993
+ replace: replaceProp,
1994
+ state,
1995
+ preventScrollReset,
1996
+ relative,
1997
+ viewTransition
1998
+ } = {}) {
1999
+ let navigate = useNavigate();
2000
+ let location = useLocation();
2001
+ let path = useResolvedPath(to, { relative });
2002
+ return React10.useCallback(
2003
+ (event) => {
2004
+ if (shouldProcessLinkClick(event, target)) {
2005
+ event.preventDefault();
2006
+ let replace2 = replaceProp !== void 0 ? replaceProp : createPath(location) === createPath(path);
2007
+ navigate(to, {
2008
+ replace: replace2,
2009
+ state,
2010
+ preventScrollReset,
2011
+ relative,
2012
+ viewTransition
2013
+ });
2014
+ }
2015
+ },
2016
+ [
2017
+ location,
2018
+ navigate,
2019
+ path,
2020
+ replaceProp,
2021
+ state,
2022
+ target,
2023
+ to,
2024
+ preventScrollReset,
2025
+ relative,
2026
+ viewTransition
2027
+ ]
2028
+ );
2029
+ }
2030
+ var fetcherId = 0;
2031
+ var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
2032
+ function useSubmit() {
2033
+ let { router } = useDataRouterContext3(
2034
+ "useSubmit"
2035
+ /* UseSubmit */
2036
+ );
2037
+ let { basename } = React10.useContext(NavigationContext);
2038
+ let currentRouteId = useRouteId();
2039
+ return React10.useCallback(
2040
+ async (target, options = {}) => {
2041
+ let { action, method, encType, formData, body } = getFormSubmissionInfo(
2042
+ target,
2043
+ basename
2044
+ );
2045
+ if (options.navigate === false) {
2046
+ let key = options.fetcherKey || getUniqueFetcherId();
2047
+ await router.fetch(key, currentRouteId, options.action || action, {
2048
+ preventScrollReset: options.preventScrollReset,
2049
+ formData,
2050
+ body,
2051
+ formMethod: options.method || method,
2052
+ formEncType: options.encType || encType,
2053
+ flushSync: options.flushSync
2054
+ });
2055
+ } else {
2056
+ await router.navigate(options.action || action, {
2057
+ preventScrollReset: options.preventScrollReset,
2058
+ formData,
2059
+ body,
2060
+ formMethod: options.method || method,
2061
+ formEncType: options.encType || encType,
2062
+ replace: options.replace,
2063
+ state: options.state,
2064
+ fromRouteId: currentRouteId,
2065
+ flushSync: options.flushSync,
2066
+ viewTransition: options.viewTransition
2067
+ });
2068
+ }
2069
+ },
2070
+ [router, basename, currentRouteId]
2071
+ );
2072
+ }
2073
+ function useFormAction(action, { relative } = {}) {
2074
+ let { basename } = React10.useContext(NavigationContext);
2075
+ let routeContext = React10.useContext(RouteContext);
2076
+ invariant(routeContext, "useFormAction must be used inside a RouteContext");
2077
+ let [match] = routeContext.matches.slice(-1);
2078
+ let path = { ...useResolvedPath(action ? action : ".", { relative }) };
2079
+ let location = useLocation();
2080
+ if (action == null) {
2081
+ path.search = location.search;
2082
+ let params = new URLSearchParams(path.search);
2083
+ let indexValues = params.getAll("index");
2084
+ let hasNakedIndexParam = indexValues.some((v) => v === "");
2085
+ if (hasNakedIndexParam) {
2086
+ params.delete("index");
2087
+ indexValues.filter((v) => v).forEach((v) => params.append("index", v));
2088
+ let qs = params.toString();
2089
+ path.search = qs ? `?${qs}` : "";
2090
+ }
2091
+ }
2092
+ if ((!action || action === ".") && match.route.index) {
2093
+ path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
2094
+ }
2095
+ if (basename !== "/") {
2096
+ path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
2097
+ }
2098
+ return createPath(path);
2099
+ }
2100
+ var SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
2101
+ var savedScrollPositions = {};
2102
+ function getScrollRestorationKey(location, matches, basename, getKey) {
2103
+ let key = null;
2104
+ if (getKey) {
2105
+ if (basename !== "/") {
2106
+ key = getKey(
2107
+ {
2108
+ ...location,
2109
+ pathname: stripBasename(location.pathname, basename) || location.pathname
2110
+ },
2111
+ matches
2112
+ );
2113
+ } else {
2114
+ key = getKey(location, matches);
2115
+ }
2116
+ }
2117
+ if (key == null) {
2118
+ key = location.key;
2119
+ }
2120
+ return key;
2121
+ }
2122
+ function useScrollRestoration({
2123
+ getKey,
2124
+ storageKey
2125
+ } = {}) {
2126
+ let { router } = useDataRouterContext3(
2127
+ "useScrollRestoration"
2128
+ /* UseScrollRestoration */
2129
+ );
2130
+ let { restoreScrollPosition, preventScrollReset } = useDataRouterState2(
2131
+ "useScrollRestoration"
2132
+ /* UseScrollRestoration */
2133
+ );
2134
+ let { basename } = React10.useContext(NavigationContext);
2135
+ let location = useLocation();
2136
+ let matches = useMatches();
2137
+ let navigation = useNavigation();
2138
+ React10.useEffect(() => {
2139
+ window.history.scrollRestoration = "manual";
2140
+ return () => {
2141
+ window.history.scrollRestoration = "auto";
2142
+ };
2143
+ }, []);
2144
+ usePageHide(
2145
+ React10.useCallback(() => {
2146
+ if (navigation.state === "idle") {
2147
+ let key = getScrollRestorationKey(location, matches, basename, getKey);
2148
+ savedScrollPositions[key] = window.scrollY;
2149
+ }
2150
+ try {
2151
+ sessionStorage.setItem(
2152
+ storageKey || SCROLL_RESTORATION_STORAGE_KEY,
2153
+ JSON.stringify(savedScrollPositions)
2154
+ );
2155
+ } catch (error) {
2156
+ warning(
2157
+ false,
2158
+ `Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
2159
+ );
2160
+ }
2161
+ window.history.scrollRestoration = "auto";
2162
+ }, [navigation.state, getKey, basename, location, matches, storageKey])
2163
+ );
2164
+ if (typeof document !== "undefined") {
2165
+ React10.useLayoutEffect(() => {
2166
+ try {
2167
+ let sessionPositions = sessionStorage.getItem(
2168
+ storageKey || SCROLL_RESTORATION_STORAGE_KEY
2169
+ );
2170
+ if (sessionPositions) {
2171
+ savedScrollPositions = JSON.parse(sessionPositions);
2172
+ }
2173
+ } catch (e) {
2174
+ }
2175
+ }, [storageKey]);
2176
+ React10.useLayoutEffect(() => {
2177
+ let disableScrollRestoration = router?.enableScrollRestoration(
2178
+ savedScrollPositions,
2179
+ () => window.scrollY,
2180
+ getKey ? (location2, matches2) => getScrollRestorationKey(location2, matches2, basename, getKey) : void 0
2181
+ );
2182
+ return () => disableScrollRestoration && disableScrollRestoration();
2183
+ }, [router, basename, getKey]);
2184
+ React10.useLayoutEffect(() => {
2185
+ if (restoreScrollPosition === false) {
2186
+ return;
2187
+ }
2188
+ if (typeof restoreScrollPosition === "number") {
2189
+ window.scrollTo(0, restoreScrollPosition);
2190
+ return;
2191
+ }
2192
+ try {
2193
+ if (location.hash) {
2194
+ let el = document.getElementById(
2195
+ decodeURIComponent(location.hash.slice(1))
2196
+ );
2197
+ if (el) {
2198
+ el.scrollIntoView();
2199
+ return;
2200
+ }
2201
+ }
2202
+ } catch {
2203
+ warning(
2204
+ false,
2205
+ `"${location.hash.slice(
2206
+ 1
2207
+ )}" is not a decodable element ID. The view will not scroll to it.`
2208
+ );
2209
+ }
2210
+ if (preventScrollReset === true) {
2211
+ return;
2212
+ }
2213
+ window.scrollTo(0, 0);
2214
+ }, [location, restoreScrollPosition, preventScrollReset]);
2215
+ }
2216
+ }
2217
+ function usePageHide(callback, options) {
2218
+ let { capture } = options || {};
2219
+ React10.useEffect(() => {
2220
+ let opts = capture != null ? { capture } : void 0;
2221
+ window.addEventListener("pagehide", callback, opts);
2222
+ return () => {
2223
+ window.removeEventListener("pagehide", callback, opts);
2224
+ };
2225
+ }, [callback, capture]);
2226
+ }
2227
+ function useViewTransitionState(to, { relative } = {}) {
2228
+ let vtContext = React10.useContext(ViewTransitionContext);
2229
+ invariant(
2230
+ vtContext != null,
2231
+ "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
2232
+ );
2233
+ let { basename } = useDataRouterContext3(
2234
+ "useViewTransitionState"
2235
+ /* useViewTransitionState */
2236
+ );
2237
+ let path = useResolvedPath(to, { relative });
2238
+ if (!vtContext.isTransitioning) {
2239
+ return false;
2240
+ }
2241
+ let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
2242
+ let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
2243
+ return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;
2244
+ }
2245
+
2246
+ // node_modules/react-router/dist/development/index.mjs
2247
+ init_dirname();
2248
+ init_buffer();
2249
+ init_process();
2250
+ "use client";
2251
+
2252
+ export {
2253
+ MemoryRouter,
2254
+ Link
2255
+ };
2256
+ /*! Bundled license information:
2257
+
2258
+ react-router/dist/development/chunk-ZYFC6VSF.mjs:
2259
+ (**
2260
+ * react-router v7.8.0
2261
+ *
2262
+ * Copyright (c) Remix Software Inc.
2263
+ *
2264
+ * This source code is licensed under the MIT license found in the
2265
+ * LICENSE.md file in the root directory of this source tree.
2266
+ *
2267
+ * @license MIT
2268
+ *)
2269
+
2270
+ react-router/dist/development/index.mjs:
2271
+ (**
2272
+ * react-router v7.8.0
2273
+ *
2274
+ * Copyright (c) Remix Software Inc.
2275
+ *
2276
+ * This source code is licensed under the MIT license found in the
2277
+ * LICENSE.md file in the root directory of this source tree.
2278
+ *
2279
+ * @license MIT
2280
+ *)
2281
+ */