@codeyam/codeyam-cli 0.1.0-staging.d3e886e → 0.1.0-staging.d4f25c3

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 (730) hide show
  1. package/analyzer-template/.build-info.json +8 -8
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +23 -23
  4. package/analyzer-template/packages/ai/package.json +3 -3
  5. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +34 -3
  6. package/analyzer-template/packages/ai/src/lib/completionCall.ts +114 -113
  7. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +259 -5
  8. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
  9. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
  10. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +78 -2
  11. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
  12. package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +19 -7
  13. package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
  14. package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
  15. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +9 -1
  16. package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +0 -6
  17. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -0
  18. package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +65 -28
  19. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +83 -0
  20. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
  21. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +23 -4
  22. package/analyzer-template/packages/aws/package.json +10 -10
  23. package/analyzer-template/packages/database/index.ts +1 -0
  24. package/analyzer-template/packages/database/package.json +3 -3
  25. package/analyzer-template/packages/database/src/lib/kysely/db.ts +8 -0
  26. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +164 -0
  27. package/analyzer-template/packages/database/src/lib/loadCommits.ts +31 -20
  28. package/analyzer-template/packages/database/src/lib/loadEntities.ts +0 -6
  29. package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +0 -5
  30. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +94 -143
  31. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
  32. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
  33. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
  34. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
  35. package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
  36. package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
  37. package/analyzer-template/packages/github/dist/database/index.js +1 -0
  38. package/analyzer-template/packages/github/dist/database/index.js.map +1 -1
  39. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
  40. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
  41. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +5 -0
  42. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
  43. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +29 -0
  44. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
  45. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +149 -0
  46. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  47. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +5 -0
  48. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  49. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
  50. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +23 -13
  51. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
  52. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
  53. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +0 -6
  54. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
  55. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
  56. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  57. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  58. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  59. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +76 -90
  60. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  61. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
  62. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  63. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  64. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
  65. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  66. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  67. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
  68. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  69. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  70. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
  71. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  72. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  73. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  74. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  75. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
  76. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
  77. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +1 -0
  78. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  79. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +10 -0
  80. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  81. package/analyzer-template/packages/github/package.json +1 -1
  82. package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
  83. package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +1 -0
  84. package/analyzer-template/packages/types/src/types/Scenario.ts +10 -0
  85. package/analyzer-template/packages/ui-components/package.json +1 -1
  86. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  87. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  88. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
  89. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
  90. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +1 -0
  91. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  92. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +10 -0
  93. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  94. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  95. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +6 -2
  96. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  97. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +14 -2
  98. package/analyzer-template/playwright/captureFromUrl.ts +89 -82
  99. package/analyzer-template/project/constructMockCode.ts +168 -48
  100. package/analyzer-template/project/orchestrateCapture.ts +4 -1
  101. package/analyzer-template/project/reconcileMockDataKeys.ts +19 -14
  102. package/analyzer-template/project/start.ts +3 -0
  103. package/analyzer-template/project/startScenarioCapture.ts +9 -0
  104. package/analyzer-template/project/writeClientLogRoute.ts +125 -0
  105. package/analyzer-template/project/writeMockDataTsx.ts +17 -0
  106. package/analyzer-template/project/writeScenarioComponents.ts +96 -17
  107. package/analyzer-template/tsconfig.json +13 -1
  108. package/background/src/lib/virtualized/project/constructMockCode.js +143 -39
  109. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  110. package/background/src/lib/virtualized/project/orchestrateCapture.js +4 -1
  111. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  112. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +17 -11
  113. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  114. package/background/src/lib/virtualized/project/start.js +2 -0
  115. package/background/src/lib/virtualized/project/start.js.map +1 -1
  116. package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
  117. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  118. package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
  119. package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
  120. package/background/src/lib/virtualized/project/writeMockDataTsx.js +12 -0
  121. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  122. package/background/src/lib/virtualized/project/writeScenarioComponents.js +73 -12
  123. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  124. package/codeyam-cli/scripts/apply-setup.js +208 -11
  125. package/codeyam-cli/scripts/apply-setup.js.map +1 -1
  126. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
  127. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
  128. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
  129. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
  130. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
  131. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
  132. package/codeyam-cli/src/cli.js +41 -25
  133. package/codeyam-cli/src/cli.js.map +1 -1
  134. package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js +51 -0
  135. package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js.map +1 -0
  136. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +56 -0
  137. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
  138. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
  139. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
  140. package/codeyam-cli/src/commands/analyze.js +17 -7
  141. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  142. package/codeyam-cli/src/commands/default.js +14 -2
  143. package/codeyam-cli/src/commands/default.js.map +1 -1
  144. package/codeyam-cli/src/commands/editor.js +4630 -0
  145. package/codeyam-cli/src/commands/editor.js.map +1 -0
  146. package/codeyam-cli/src/commands/editorIsolateArgs.js +25 -0
  147. package/codeyam-cli/src/commands/editorIsolateArgs.js.map +1 -0
  148. package/codeyam-cli/src/commands/init.js +109 -45
  149. package/codeyam-cli/src/commands/init.js.map +1 -1
  150. package/codeyam-cli/src/commands/memory.js +89 -75
  151. package/codeyam-cli/src/commands/memory.js.map +1 -1
  152. package/codeyam-cli/src/commands/telemetry.js +37 -0
  153. package/codeyam-cli/src/commands/telemetry.js.map +1 -0
  154. package/codeyam-cli/src/data/techStacks.js +77 -0
  155. package/codeyam-cli/src/data/techStacks.js.map +1 -0
  156. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
  157. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
  158. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
  159. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
  160. package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
  161. package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
  162. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +137 -0
  163. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
  164. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +2379 -0
  165. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
  166. package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js +76 -0
  167. package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js.map +1 -0
  168. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
  169. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
  170. package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js +100 -0
  171. package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js.map +1 -0
  172. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +304 -0
  173. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
  174. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +194 -0
  175. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
  176. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +315 -0
  177. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -0
  178. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
  179. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
  180. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
  181. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
  182. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +594 -0
  183. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
  184. package/codeyam-cli/src/utils/__tests__/editorMigration.test.js +435 -0
  185. package/codeyam-cli/src/utils/__tests__/editorMigration.test.js.map +1 -0
  186. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
  187. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
  188. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
  189. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
  190. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +353 -0
  191. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
  192. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
  193. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
  194. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
  195. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
  196. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
  197. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
  198. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +1559 -0
  199. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
  200. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +280 -0
  201. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
  202. package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js +143 -0
  203. package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js.map +1 -0
  204. package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js +66 -0
  205. package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js.map +1 -0
  206. package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js +53 -0
  207. package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js.map +1 -0
  208. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1857 -0
  209. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
  210. package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
  211. package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
  212. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
  213. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
  214. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +26 -20
  215. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -1
  216. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +129 -0
  217. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
  218. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
  219. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
  220. package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
  221. package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
  222. package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js +118 -0
  223. package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js.map +1 -0
  224. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +284 -0
  225. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
  226. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
  227. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
  228. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +672 -0
  229. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
  230. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +51 -4
  231. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  232. package/codeyam-cli/src/utils/__tests__/telemetry.test.js +159 -0
  233. package/codeyam-cli/src/utils/__tests__/telemetry.test.js.map +1 -0
  234. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
  235. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
  236. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
  237. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
  238. package/codeyam-cli/src/utils/analysisRunner.js +3 -1
  239. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  240. package/codeyam-cli/src/utils/analyzer.js +9 -0
  241. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  242. package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
  243. package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
  244. package/codeyam-cli/src/utils/backgroundServer.js +105 -13
  245. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  246. package/codeyam-cli/src/utils/buildFlags.js +4 -0
  247. package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
  248. package/codeyam-cli/src/utils/database.js +37 -2
  249. package/codeyam-cli/src/utils/database.js.map +1 -1
  250. package/codeyam-cli/src/utils/devModeEvents.js +40 -0
  251. package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
  252. package/codeyam-cli/src/utils/devServerState.js +71 -0
  253. package/codeyam-cli/src/utils/devServerState.js.map +1 -0
  254. package/codeyam-cli/src/utils/editorApi.js +79 -0
  255. package/codeyam-cli/src/utils/editorApi.js.map +1 -0
  256. package/codeyam-cli/src/utils/editorAudit.js +480 -0
  257. package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
  258. package/codeyam-cli/src/utils/editorBroadcastViewport.js +26 -0
  259. package/codeyam-cli/src/utils/editorBroadcastViewport.js.map +1 -0
  260. package/codeyam-cli/src/utils/editorCapture.js +102 -0
  261. package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
  262. package/codeyam-cli/src/utils/editorDeleteScenario.js +67 -0
  263. package/codeyam-cli/src/utils/editorDeleteScenario.js.map +1 -0
  264. package/codeyam-cli/src/utils/editorDevServer.js +197 -0
  265. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
  266. package/codeyam-cli/src/utils/editorEntityChangeStatus.js +50 -0
  267. package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
  268. package/codeyam-cli/src/utils/editorEntityHelpers.js +144 -0
  269. package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -0
  270. package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
  271. package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
  272. package/codeyam-cli/src/utils/editorJournal.js +225 -0
  273. package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
  274. package/codeyam-cli/src/utils/editorLoaderHelpers.js +152 -0
  275. package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
  276. package/codeyam-cli/src/utils/editorMigration.js +224 -0
  277. package/codeyam-cli/src/utils/editorMigration.js.map +1 -0
  278. package/codeyam-cli/src/utils/editorMockState.js +248 -0
  279. package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
  280. package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
  281. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
  282. package/codeyam-cli/src/utils/editorPreview.js +137 -0
  283. package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
  284. package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
  285. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
  286. package/codeyam-cli/src/utils/editorScenarios.js +557 -0
  287. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
  288. package/codeyam-cli/src/utils/editorSeedAdapter.js +422 -0
  289. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
  290. package/codeyam-cli/src/utils/editorShouldRevalidate.js +21 -0
  291. package/codeyam-cli/src/utils/editorShouldRevalidate.js.map +1 -0
  292. package/codeyam-cli/src/utils/entityChangeStatus.js +366 -0
  293. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
  294. package/codeyam-cli/src/utils/entityChangeStatus.server.js +196 -0
  295. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
  296. package/codeyam-cli/src/utils/fileMetadata.js +5 -0
  297. package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
  298. package/codeyam-cli/src/utils/fileWatcher.js +63 -9
  299. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  300. package/codeyam-cli/src/utils/git.js +103 -0
  301. package/codeyam-cli/src/utils/git.js.map +1 -1
  302. package/codeyam-cli/src/utils/install-skills.js +71 -15
  303. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  304. package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
  305. package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
  306. package/codeyam-cli/src/utils/npmVersionCheck.js +2 -2
  307. package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -1
  308. package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
  309. package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
  310. package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
  311. package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
  312. package/codeyam-cli/src/utils/progress.js +2 -2
  313. package/codeyam-cli/src/utils/progress.js.map +1 -1
  314. package/codeyam-cli/src/utils/project.js +15 -5
  315. package/codeyam-cli/src/utils/project.js.map +1 -1
  316. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
  317. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
  318. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
  319. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
  320. package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
  321. package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
  322. package/codeyam-cli/src/utils/queue/job.js +70 -1
  323. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  324. package/codeyam-cli/src/utils/queue/manager.js +7 -6
  325. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  326. package/codeyam-cli/src/utils/requireSimulations.js +1 -1
  327. package/codeyam-cli/src/utils/requireSimulations.js.map +1 -1
  328. package/codeyam-cli/src/utils/routePatternMatching.js +129 -0
  329. package/codeyam-cli/src/utils/routePatternMatching.js.map +1 -0
  330. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +5 -6
  331. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -1
  332. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +1 -1
  333. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -1
  334. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +0 -1
  335. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -1
  336. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +2 -4
  337. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -1
  338. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +4 -6
  339. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -1
  340. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +1 -1
  341. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -1
  342. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js +83 -0
  343. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js.map +1 -0
  344. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +118 -0
  345. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
  346. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
  347. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js.map +1 -0
  348. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js +76 -0
  349. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -0
  350. package/codeyam-cli/src/utils/rules/index.js +1 -0
  351. package/codeyam-cli/src/utils/rules/index.js.map +1 -1
  352. package/codeyam-cli/src/utils/rules/parser.js +14 -4
  353. package/codeyam-cli/src/utils/rules/parser.js.map +1 -1
  354. package/codeyam-cli/src/utils/rules/pathMatcher.js +34 -3
  355. package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -1
  356. package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
  357. package/codeyam-cli/src/utils/rules/rulePlacement.js.map +1 -0
  358. package/codeyam-cli/src/utils/rules/sourceFiles.js +43 -0
  359. package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -0
  360. package/codeyam-cli/src/utils/scenarioCoverage.js +77 -0
  361. package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
  362. package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
  363. package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
  364. package/codeyam-cli/src/utils/scenariosManifest.js +285 -0
  365. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
  366. package/codeyam-cli/src/utils/serverState.js +57 -2
  367. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  368. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +83 -11
  369. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  370. package/codeyam-cli/src/utils/simulationGateMiddleware.js +166 -0
  371. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
  372. package/codeyam-cli/src/utils/slugUtils.js +25 -0
  373. package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
  374. package/codeyam-cli/src/utils/syncMocksMiddleware.js +7 -26
  375. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  376. package/codeyam-cli/src/utils/telemetry.js +106 -0
  377. package/codeyam-cli/src/utils/telemetry.js.map +1 -0
  378. package/codeyam-cli/src/utils/telemetryMiddleware.js +22 -0
  379. package/codeyam-cli/src/utils/telemetryMiddleware.js.map +1 -0
  380. package/codeyam-cli/src/utils/testRunner.js +158 -0
  381. package/codeyam-cli/src/utils/testRunner.js.map +1 -0
  382. package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
  383. package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
  384. package/codeyam-cli/src/utils/versionInfo.js +46 -0
  385. package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
  386. package/codeyam-cli/src/utils/webappDetection.js +35 -2
  387. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  388. package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js +35 -0
  389. package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js.map +1 -0
  390. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +80 -0
  391. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
  392. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +628 -0
  393. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
  394. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +217 -0
  395. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
  396. package/codeyam-cli/src/webserver/app/lib/clientErrors.js +71 -0
  397. package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
  398. package/codeyam-cli/src/webserver/app/lib/database.js +41 -27
  399. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  400. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  401. package/codeyam-cli/src/webserver/app/lib/git.js +397 -0
  402. package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
  403. package/codeyam-cli/src/webserver/app/types/editor.js +8 -0
  404. package/codeyam-cli/src/webserver/app/types/editor.js.map +1 -0
  405. package/codeyam-cli/src/webserver/backgroundServer.js +141 -42
  406. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  407. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CLe80MMu.js +1 -0
  408. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-bwuHPyTa.js → EntityItem-Crt_KN_U.js} +5 -5
  409. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CQgyEGV-.js +1 -0
  410. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BH0XDim7.js → EntityTypeIcon-CD7lGABo.js} +9 -9
  411. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-CgTNOhnu.js +1 -0
  412. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-CKeQT5Ty.js +25 -0
  413. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-D3s1MFkb.js +3 -0
  414. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BvMu2i-g.js → LoadingDots-By5zI316.js} +1 -1
  415. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-kgBTLoJD.js → LogViewer-CM5zg40N.js} +3 -3
  416. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-BzPgx-xO.js → ReportIssueModal-C2PLkej3.js} +4 -4
  417. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DanvyBPb.js +1 -0
  418. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-BX2Ny2Qj.js → ScenarioViewer-DUMfcNVK.js} +3 -3
  419. package/codeyam-cli/src/webserver/build/client/assets/Spinner-D0LgAaSa.js +34 -0
  420. package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CK7-NaPZ.js +1 -0
  421. package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-BA_Ry-rs.js +1 -0
  422. package/codeyam-cli/src/webserver/build/client/assets/{_index-BRx8ZGZo.js → _index-BAWd-Xjf.js} +4 -4
  423. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-4S4yPfFw.js → activity.(_tab)-BOARiB-g.js} +8 -8
  424. package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
  425. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
  426. package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-CHx25PAe.js +1 -0
  427. package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
  428. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-Bg3e7q4S.js +22 -0
  429. package/codeyam-cli/src/webserver/build/client/assets/api.dev-mode-events-l0sNRNKZ.js +1 -0
  430. package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
  431. package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
  432. package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
  433. package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
  434. package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
  435. package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
  436. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
  437. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
  438. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
  439. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
  440. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
  441. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
  442. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
  443. package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
  444. package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
  445. package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
  446. package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
  447. package/codeyam-cli/src/webserver/build/client/assets/api.editor-rename-scenario-l0sNRNKZ.js +1 -0
  448. package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-seed-state-l0sNRNKZ.js +1 -0
  449. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
  450. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
  451. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
  452. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-prompt-l0sNRNKZ.js +1 -0
  453. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
  454. package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
  455. package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
  456. package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-l0sNRNKZ.js +1 -0
  457. package/codeyam-cli/src/webserver/build/client/assets/api.rule-path-l0sNRNKZ.js +1 -0
  458. package/codeyam-cli/src/webserver/build/client/assets/{book-open-D4IPYH_y.js → book-open-CL-lMgHh.js} +2 -2
  459. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-CG65viiV.js → chevron-down-GmAjGS9-.js} +2 -2
  460. package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-BAdwhyCx.js +43 -0
  461. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-igfMr5DY.js → circle-check-DFcQkN5j.js} +2 -2
  462. package/codeyam-cli/src/webserver/build/client/assets/{copy-Coc4o_8c.js → copy-C6iF61Xs.js} +3 -3
  463. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-4ImjHTVC.js +41 -0
  464. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-C8y4mmyv.js +1 -0
  465. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +1 -0
  466. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-DN5ouXAl.js +58 -0
  467. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-oepecPae.js +41 -0
  468. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-B0h9AqE6.js → entity._sha._-Blfy9UlN.js} +11 -11
  469. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-KTQuL0aj.js +6 -0
  470. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C6eeL24i.js +6 -0
  471. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DQM8E7L4.js +6 -0
  472. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-PePWg17F.js → entity._sha_.edit._scenarioId-CAoXLsQr.js} +2 -2
  473. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-I-Wo99C_.js → entry.client-SuW9syRS.js} +6 -6
  474. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-Daa96Fr1.js +1 -0
  475. package/codeyam-cli/src/webserver/build/client/assets/files-D-xGrg29.js +1 -0
  476. package/codeyam-cli/src/webserver/build/client/assets/git-Bq_fbXP5.js +1 -0
  477. package/codeyam-cli/src/webserver/build/client/assets/globals-fAqOD9ex.css +1 -0
  478. package/codeyam-cli/src/webserver/build/client/assets/{index-_417gcQW.js → index-Bp1l4hSv.js} +1 -1
  479. package/codeyam-cli/src/webserver/build/client/assets/{index-CUM5iXwc.js → index-CWV9XZiG.js} +1 -1
  480. package/codeyam-cli/src/webserver/build/client/assets/index-DE3jI_dv.js +15 -0
  481. package/codeyam-cli/src/webserver/build/client/assets/jsx-runtime-D_zvdyIk.js +9 -0
  482. package/codeyam-cli/src/webserver/build/client/assets/labs-B_IX45ih.js +1 -0
  483. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-TzRHMVog.js → loader-circle-De-7qQ2u.js} +2 -2
  484. package/codeyam-cli/src/webserver/build/client/assets/manifest-389033be.js +1 -0
  485. package/codeyam-cli/src/webserver/build/client/assets/memory-Cx2xEx7s.js +101 -0
  486. package/codeyam-cli/src/webserver/build/client/assets/{pause-hjzB7t2z.js → pause-CFxEKL1u.js} +3 -3
  487. package/codeyam-cli/src/webserver/build/client/assets/root-DB3O9_9j.js +67 -0
  488. package/codeyam-cli/src/webserver/build/client/assets/{search-DcAwD_Ln.js → search-BdBb5aqc.js} +2 -2
  489. package/codeyam-cli/src/webserver/build/client/assets/settings-DdE-Untf.js +1 -0
  490. package/codeyam-cli/src/webserver/build/client/assets/simulations-DSCdE99u.js +1 -0
  491. package/codeyam-cli/src/webserver/build/client/assets/{terminal-DbEAHMbA.js → terminal-CrplD4b1.js} +3 -3
  492. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-CAD5b1o_.js → triangle-alert-DqJ0j69l.js} +2 -2
  493. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-DhXHbEjP.js +1 -0
  494. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-BNd5hYuW.js +2 -0
  495. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-Cy5Qg_UR.js +1 -0
  496. package/codeyam-cli/src/webserver/build/client/assets/useToast-5HR2j9ZE.js +1 -0
  497. package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
  498. package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
  499. package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-D_1MSYeW.js +13 -0
  500. package/codeyam-cli/src/webserver/build/server/assets/index-ckWaCf_v.js +1 -0
  501. package/codeyam-cli/src/webserver/build/server/assets/init-ld124R4Z.js +10 -0
  502. package/codeyam-cli/src/webserver/build/server/assets/progress-CHTtrxFG.js +1 -0
  503. package/codeyam-cli/src/webserver/build/server/assets/server-build-DzzNZGv_.js +551 -0
  504. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  505. package/codeyam-cli/src/webserver/build-info.json +5 -5
  506. package/codeyam-cli/src/webserver/devServer.js +39 -5
  507. package/codeyam-cli/src/webserver/devServer.js.map +1 -1
  508. package/codeyam-cli/src/webserver/editorProxy.js +976 -0
  509. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
  510. package/codeyam-cli/src/webserver/idleDetector.js +106 -0
  511. package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
  512. package/codeyam-cli/src/webserver/mockStateEvents.js +28 -0
  513. package/codeyam-cli/src/webserver/mockStateEvents.js.map +1 -0
  514. package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
  515. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
  516. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +266 -0
  517. package/codeyam-cli/src/webserver/server.js +341 -1
  518. package/codeyam-cli/src/webserver/server.js.map +1 -1
  519. package/codeyam-cli/src/webserver/terminalServer.js +831 -0
  520. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
  521. package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
  522. package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
  523. package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
  524. package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
  525. package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
  526. package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
  527. package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
  528. package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
  529. package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
  530. package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
  531. package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
  532. package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
  533. package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
  534. package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
  535. package/codeyam-cli/templates/codeyam-editor-claude.md +147 -0
  536. package/codeyam-cli/templates/codeyam-editor-reference.md +214 -0
  537. package/codeyam-cli/templates/editor-step-hook.py +321 -0
  538. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
  539. package/codeyam-cli/templates/expo-react-native/README.md +41 -0
  540. package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
  541. package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
  542. package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
  543. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
  544. package/codeyam-cli/templates/expo-react-native/app.json +18 -0
  545. package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
  546. package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
  547. package/codeyam-cli/templates/expo-react-native/global.css +3 -0
  548. package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
  549. package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
  550. package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
  551. package/codeyam-cli/templates/expo-react-native/package.json +38 -0
  552. package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
  553. package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
  554. package/codeyam-cli/templates/hooks/staleness-check.sh +43 -0
  555. package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
  556. package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
  557. package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
  558. package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
  559. package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
  560. package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
  561. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
  562. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
  563. package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
  564. package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
  565. package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
  566. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
  567. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
  568. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
  569. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
  570. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +24 -0
  571. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
  572. package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
  573. package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
  574. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +64 -0
  575. package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
  576. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +39 -0
  577. package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
  578. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
  579. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +40 -0
  580. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
  581. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +127 -0
  582. package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
  583. package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
  584. package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
  585. package/codeyam-cli/templates/nextjs-prisma-supabase/SUPABASE_SETUP.md +104 -0
  586. package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
  587. package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
  588. package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
  589. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
  590. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
  591. package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
  592. package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
  593. package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
  594. package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
  595. package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
  596. package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
  597. package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
  598. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
  599. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
  600. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
  601. package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
  602. package/codeyam-cli/templates/prompts/conversation-guidance.txt +44 -0
  603. package/codeyam-cli/templates/prompts/conversation-prompt.txt +28 -0
  604. package/codeyam-cli/templates/prompts/interruption-prompt.txt +31 -0
  605. package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +24 -0
  606. package/codeyam-cli/templates/rule-notification-hook.py +44 -17
  607. package/codeyam-cli/templates/rule-reflection-hook.py +25 -5
  608. package/codeyam-cli/templates/rules-instructions.md +34 -88
  609. package/codeyam-cli/templates/seed-adapters/supabase.ts +282 -0
  610. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
  611. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +211 -0
  612. package/codeyam-cli/templates/{codeyam-memory.md → skills/codeyam-memory/SKILL.md} +215 -0
  613. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
  614. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
  615. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
  616. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
  617. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
  618. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
  619. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
  620. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
  621. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
  622. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
  623. package/codeyam-cli/templates/{codeyam-new-rule.md → skills/codeyam-new-rule/SKILL.md} +0 -2
  624. package/package.json +22 -14
  625. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +22 -4
  626. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  627. package/packages/ai/src/lib/completionCall.js +10 -7
  628. package/packages/ai/src/lib/completionCall.js.map +1 -1
  629. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +234 -3
  630. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  631. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
  632. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
  633. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
  634. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
  635. package/packages/ai/src/lib/generateEntityScenarioData.js +57 -2
  636. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  637. package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
  638. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  639. package/packages/analyze/src/lib/ProjectAnalyzer.js +13 -4
  640. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  641. package/packages/analyze/src/lib/asts/index.js +4 -2
  642. package/packages/analyze/src/lib/asts/index.js.map +1 -1
  643. package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -0
  644. package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
  645. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +8 -1
  646. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  647. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +0 -5
  648. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
  649. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
  650. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  651. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +54 -27
  652. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -1
  653. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +65 -0
  654. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  655. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
  656. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
  657. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +18 -4
  658. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  659. package/packages/database/index.js +1 -0
  660. package/packages/database/index.js.map +1 -1
  661. package/packages/database/src/lib/kysely/db.js +5 -0
  662. package/packages/database/src/lib/kysely/db.js.map +1 -1
  663. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +149 -0
  664. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  665. package/packages/database/src/lib/loadCommits.js +23 -13
  666. package/packages/database/src/lib/loadCommits.js.map +1 -1
  667. package/packages/database/src/lib/loadEntities.js +0 -6
  668. package/packages/database/src/lib/loadEntities.js.map +1 -1
  669. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  670. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  671. package/packages/database/src/lib/updateCommitMetadata.js +76 -90
  672. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  673. package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  674. package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  675. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  676. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  677. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  678. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  679. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  680. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  681. package/packages/types/src/enums/ProjectFramework.js +2 -0
  682. package/packages/types/src/enums/ProjectFramework.js.map +1 -1
  683. package/packages/utils/src/lib/fs/rsyncCopy.js +6 -2
  684. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  685. package/scripts/npm-post-install.cjs +34 -0
  686. package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -120
  687. package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
  688. package/codeyam-cli/src/commands/list.js +0 -31
  689. package/codeyam-cli/src/commands/list.js.map +0 -1
  690. package/codeyam-cli/src/commands/webapp-info.js +0 -146
  691. package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
  692. package/codeyam-cli/src/utils/universal-mocks.js +0 -152
  693. package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
  694. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-jNYXRRNI.js +0 -1
  695. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CvzqMxcu.js +0 -1
  696. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-EhOseatT.js +0 -34
  697. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-yjIHlOGa.js +0 -25
  698. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-Cq5o8jL4.js +0 -3
  699. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-CwZrv-Ok.js +0 -1
  700. package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CDpEprKa.js +0 -1
  701. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DHKuQSmR.js +0 -17
  702. package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-DB3aFuEO.js +0 -51
  703. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-D1zB-pYc.js +0 -21
  704. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-JTAjQ54M.js +0 -1
  705. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DjLxr2JB.js +0 -6
  706. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CtYowLOt.js +0 -6
  707. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-9sMMAiWJ.js +0 -1
  708. package/codeyam-cli/src/webserver/build/client/assets/files-Co65J0s3.js +0 -1
  709. package/codeyam-cli/src/webserver/build/client/assets/git-BdHOxVfg.js +0 -15
  710. package/codeyam-cli/src/webserver/build/client/assets/globals-CCgBKWy4.css +0 -1
  711. package/codeyam-cli/src/webserver/build/client/assets/labs-BK0C1H1T.js +0 -1
  712. package/codeyam-cli/src/webserver/build/client/assets/manifest-390cb8fa.js +0 -1
  713. package/codeyam-cli/src/webserver/build/client/assets/memory-CzZySbBE.js +0 -78
  714. package/codeyam-cli/src/webserver/build/client/assets/root-DnbDhvTU.js +0 -62
  715. package/codeyam-cli/src/webserver/build/client/assets/settings-CclxrcPK.js +0 -1
  716. package/codeyam-cli/src/webserver/build/client/assets/simulations-DVNJVQgD.js +0 -1
  717. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BqgrAzs3.js +0 -1
  718. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-DAFqfEDH.js +0 -2
  719. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-DZlYx2c4.js +0 -1
  720. package/codeyam-cli/src/webserver/build/client/assets/useToast-ihdMtlf6.js +0 -1
  721. package/codeyam-cli/src/webserver/build/server/assets/index-CxaRxKVt.js +0 -1
  722. package/codeyam-cli/src/webserver/build/server/assets/server-build-D4DT0nM_.js +0 -259
  723. package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
  724. package/scripts/finalize-analyzer.cjs +0 -13
  725. /package/codeyam-cli/templates/{codeyam-diagnose.md → commands/codeyam-diagnose.md} +0 -0
  726. /package/codeyam-cli/templates/{codeyam-debug.md → skills/codeyam-debug/SKILL.md} +0 -0
  727. /package/codeyam-cli/templates/{codeyam-setup.md → skills/codeyam-setup/SKILL.md} +0 -0
  728. /package/codeyam-cli/templates/{codeyam-sim.md → skills/codeyam-sim/SKILL.md} +0 -0
  729. /package/codeyam-cli/templates/{codeyam-test.md → skills/codeyam-test/SKILL.md} +0 -0
  730. /package/codeyam-cli/templates/{codeyam-verify.md → skills/codeyam-verify/SKILL.md} +0 -0
@@ -1,51 +0,0 @@
1
- function Wa(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(n,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var us=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ya(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kt={exports:{}},ot={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Gr;function Va(){if(Gr)return ot;Gr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var l in a)l!=="key"&&(o[l]=a[l])}else o=a;return a=o.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:o}}return ot.Fragment=t,ot.jsx=r,ot.jsxs=r,ot}var Kr;function Ja(){return Kr||(Kr=1,Kt.exports=Va()),Kt.exports}var cs=Ja(),Xt={exports:{}},B={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Xr;function Ga(){if(Xr)return B;Xr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),m=Symbol.iterator;function g(p){return p===null||typeof p!="object"?null:(p=m&&p[m]||p["@@iterator"],typeof p=="function"?p:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,E={};function L(p,x,U){this.props=p,this.context=x,this.refs=E,this.updater=U||R}L.prototype.isReactComponent={},L.prototype.setState=function(p,x){if(typeof p!="object"&&typeof p!="function"&&p!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,p,x,"setState")},L.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function S(){}S.prototype=L.prototype;function D(p,x,U){this.props=p,this.context=x,this.refs=E,this.updater=U||R}var A=D.prototype=new S;A.constructor=D,b(A,L.prototype),A.isPureReactComponent=!0;var P=Array.isArray;function _(){}var y={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function F(p,x,U){var k=U.ref;return{$$typeof:e,type:p,key:x,ref:k!==void 0?k:null,props:U}}function J(p,x){return F(p.type,x,p.props)}function K(p){return typeof p=="object"&&p!==null&&p.$$typeof===e}function ae(p){var x={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(U){return x[U]})}var le=/\/+/g;function Q(p,x){return typeof p=="object"&&p!==null&&p.key!=null?ae(""+p.key):x.toString(36)}function ue(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(_,_):(p.status="pending",p.then(function(x){p.status==="pending"&&(p.status="fulfilled",p.value=x)},function(x){p.status==="pending"&&(p.status="rejected",p.reason=x)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function X(p,x,U,k,z){var G=typeof p;(G==="undefined"||G==="boolean")&&(p=null);var te=!1;if(p===null)te=!0;else switch(G){case"bigint":case"string":case"number":te=!0;break;case"object":switch(p.$$typeof){case e:case t:te=!0;break;case h:return te=p._init,X(te(p._payload),x,U,k,z)}}if(te)return z=z(p),te=k===""?"."+Q(p,0):k,P(z)?(U="",te!=null&&(U=te.replace(le,"$&/")+"/"),X(z,x,U,"",function(Wt){return Wt})):z!=null&&(K(z)&&(z=J(z,U+(z.key==null||p&&p.key===z.key?"":(""+z.key).replace(le,"$&/")+"/")+te)),x.push(z)),1;te=0;var de=k===""?".":k+":";if(P(p))for(var me=0;me<p.length;me++)k=p[me],G=de+Q(k,me),te+=X(k,x,U,G,z);else if(me=g(p),typeof me=="function")for(p=me.call(p),me=0;!(k=p.next()).done;)k=k.value,G=de+Q(k,me++),te+=X(k,x,U,G,z);else if(G==="object"){if(typeof p.then=="function")return X(ue(p),x,U,k,z);throw x=String(p),Error("Objects are not valid as a React child (found: "+(x==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":x)+"). If you meant to render a collection of children, use an array instead.")}return te}function ee(p,x,U){if(p==null)return p;var k=[],z=0;return X(p,k,"","",function(G){return x.call(U,G,z++)}),k}function re(p){if(p._status===-1){var x=p._result;x=x(),x.then(function(U){(p._status===0||p._status===-1)&&(p._status=1,p._result=U)},function(U){(p._status===0||p._status===-1)&&(p._status=2,p._result=U)}),p._status===-1&&(p._status=0,p._result=x)}if(p._status===1)return p._result.default;throw p._result}var ce=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var x=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(x))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},se={map:ee,forEach:function(p,x,U){ee(p,function(){x.apply(this,arguments)},U)},count:function(p){var x=0;return ee(p,function(){x++}),x},toArray:function(p){return ee(p,function(x){return x})||[]},only:function(p){if(!K(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return B.Activity=c,B.Children=se,B.Component=L,B.Fragment=r,B.Profiler=a,B.PureComponent=D,B.StrictMode=n,B.Suspense=s,B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=y,B.__COMPILER_RUNTIME={__proto__:null,c:function(p){return y.H.useMemoCache(p)}},B.cache=function(p){return function(){return p.apply(null,arguments)}},B.cacheSignal=function(){return null},B.cloneElement=function(p,x,U){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var k=b({},p.props),z=p.key;if(x!=null)for(G in x.key!==void 0&&(z=""+x.key),x)!M.call(x,G)||G==="key"||G==="__self"||G==="__source"||G==="ref"&&x.ref===void 0||(k[G]=x[G]);var G=arguments.length-2;if(G===1)k.children=U;else if(1<G){for(var te=Array(G),de=0;de<G;de++)te[de]=arguments[de+2];k.children=te}return F(p.type,z,k)},B.createContext=function(p){return p={$$typeof:i,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:o,_context:p},p},B.createElement=function(p,x,U){var k,z={},G=null;if(x!=null)for(k in x.key!==void 0&&(G=""+x.key),x)M.call(x,k)&&k!=="key"&&k!=="__self"&&k!=="__source"&&(z[k]=x[k]);var te=arguments.length-2;if(te===1)z.children=U;else if(1<te){for(var de=Array(te),me=0;me<te;me++)de[me]=arguments[me+2];z.children=de}if(p&&p.defaultProps)for(k in te=p.defaultProps,te)z[k]===void 0&&(z[k]=te[k]);return F(p,G,z)},B.createRef=function(){return{current:null}},B.forwardRef=function(p){return{$$typeof:l,render:p}},B.isValidElement=K,B.lazy=function(p){return{$$typeof:h,_payload:{_status:-1,_result:p},_init:re}},B.memo=function(p,x){return{$$typeof:u,type:p,compare:x===void 0?null:x}},B.startTransition=function(p){var x=y.T,U={};y.T=U;try{var k=p(),z=y.S;z!==null&&z(U,k),typeof k=="object"&&k!==null&&typeof k.then=="function"&&k.then(_,ce)}catch(G){ce(G)}finally{x!==null&&U.types!==null&&(x.types=U.types),y.T=x}},B.unstable_useCacheRefresh=function(){return y.H.useCacheRefresh()},B.use=function(p){return y.H.use(p)},B.useActionState=function(p,x,U){return y.H.useActionState(p,x,U)},B.useCallback=function(p,x){return y.H.useCallback(p,x)},B.useContext=function(p){return y.H.useContext(p)},B.useDebugValue=function(){},B.useDeferredValue=function(p,x){return y.H.useDeferredValue(p,x)},B.useEffect=function(p,x){return y.H.useEffect(p,x)},B.useEffectEvent=function(p){return y.H.useEffectEvent(p)},B.useId=function(){return y.H.useId()},B.useImperativeHandle=function(p,x,U){return y.H.useImperativeHandle(p,x,U)},B.useInsertionEffect=function(p,x){return y.H.useInsertionEffect(p,x)},B.useLayoutEffect=function(p,x){return y.H.useLayoutEffect(p,x)},B.useMemo=function(p,x){return y.H.useMemo(p,x)},B.useOptimistic=function(p,x){return y.H.useOptimistic(p,x)},B.useReducer=function(p,x,U){return y.H.useReducer(p,x,U)},B.useRef=function(p){return y.H.useRef(p)},B.useState=function(p){return y.H.useState(p)},B.useSyncExternalStore=function(p,x,U){return y.H.useSyncExternalStore(p,x,U)},B.useTransition=function(){return y.H.useTransition()},B.version="19.2.3",B}var qr;function Ka(){return qr||(qr=1,Xt.exports=Ga()),Xt.exports}var f=Ka();const Xa=Ya(f),qa=Wa({__proto__:null,default:Xa},[f]);/**
18
- * react-router v7.13.0
19
- *
20
- * Copyright (c) Remix Software Inc.
21
- *
22
- * This source code is licensed under the MIT license found in the
23
- * LICENSE.md file in the root directory of this source tree.
24
- *
25
- * @license MIT
26
- */var Mn=e=>{throw TypeError(e)},Qa=(e,t,r)=>t.has(e)||Mn("Cannot "+r),qt=(e,t,r)=>(Qa(e,t,"read from private field"),r?r.call(e):t.get(e)),Za=(e,t,r)=>t.has(e)?Mn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Qr="popstate";function ds(e={}){function t(n,a){let{pathname:o,search:i,hash:l}=n.location;return ft("",{pathname:o,search:i,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Me(a)}return to(t,r,null,e)}function W(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eo(){return Math.random().toString(36).substring(2,10)}function Zr(e,t){return{usr:e.state,key:e.key,idx:t}}function ft(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ke(t):t,state:r,key:t&&t.key||n||eo()}}function Me({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ke(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function to(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l="POP",s=null,u=h();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function h(){return(i.state||{idx:null}).idx}function c(){l="POP";let E=h(),L=E==null?null:E-u;u=E,s&&s({action:l,location:b.location,delta:L})}function m(E,L){l="PUSH";let S=ft(b.location,E,L);u=h()+1;let D=Zr(S,u),A=b.createHref(S);try{i.pushState(D,"",A)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(A)}o&&s&&s({action:l,location:b.location,delta:1})}function g(E,L){l="REPLACE";let S=ft(b.location,E,L);u=h();let D=Zr(S,u),A=b.createHref(S);i.replaceState(D,"",A),o&&s&&s({action:l,location:b.location,delta:0})}function R(E){return _n(E)}let b={get action(){return l},get location(){return e(a,i)},listen(E){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(Qr,c),s=E,()=>{a.removeEventListener(Qr,c),s=null}},createHref(E){return t(a,E)},createURL:R,encodeLocation(E){let L=R(E);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:m,replace:g,go(E){return i.go(E)}};return b}function _n(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),W(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Me(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var ut,en=class{constructor(e){if(Za(this,ut,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(qt(this,ut).has(e))return qt(this,ut).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){qt(this,ut).set(e,t)}};ut=new WeakMap;var ro=new Set(["lazy","caseSensitive","path","id","index","children"]);function no(e){return ro.has(e)}var ao=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function oo(e){return ao.has(e)}function io(e){return e.index===!0}function ht(e,t,r=[],n={},a=!1){return e.map((o,i)=>{let l=[...r,String(i)],s=typeof o.id=="string"?o.id:l.join("-");if(W(o.index!==!0||!o.children,"Cannot specify children on an index route"),W(a||!n[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),io(o)){let u={...o,id:s};return n[s]=tn(u,t(u)),u}else{let u={...o,id:s,children:void 0};return n[s]=tn(u,t(u)),o.children&&(u.children=ht(o.children,t,l,n,a)),u}})}function tn(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ae(e,t,r="/"){return ct(e,t,r,!1)}function ct(e,t,r,n){let a=typeof t=="string"?ke(t):t,o=be(a.pathname||"/",r);if(o==null)return null;let i=On(e);lo(i);let l=null;for(let s=0;l==null&&s<i.length;++s){let u=go(o);l=vo(i[s],u,n)}return l}function Dn(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function On(e,t=[],r=[],n="",a=!1){let o=(i,l,s=a,u)=>{let h={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(n)&&s)return;W(h.relativePath.startsWith(n),`Absolute route path "${h.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(n.length)}let c=Te([n,h.relativePath]),m=r.concat(h);i.children&&i.children.length>0&&(W(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),On(i.children,t,m,c,s)),!(i.path==null&&!i.index)&&t.push({path:c,score:po(c,i.index),routesMeta:m})};return e.forEach((i,l)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,l);else for(let u of In(i.path))o(i,l,!0,u)}),t}function In(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=In(n.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),a&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function lo(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:yo(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var so=/^:[\w-]+$/,uo=3,co=2,fo=1,ho=10,mo=-2,rn=e=>e==="*";function po(e,t){let r=e.split("/"),n=r.length;return r.some(rn)&&(n+=mo),t&&(n+=co),r.filter(a=>!rn(a)).reduce((a,o)=>a+(so.test(o)?uo:o===""?fo:ho),n)}function yo(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function vo(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let l=0;l<n.length;++l){let s=n[l],u=l===n.length-1,h=o==="/"?t:t.slice(o.length)||"/",c=Ft({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},h),m=s.route;if(!c&&u&&r&&!n[n.length-1].route.index&&(c=Ft({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},h)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:Te([o,c.pathname]),pathnameBase:Ro(Te([o,c.pathnameBase])),route:m}),c.pathnameBase!=="/"&&(o=Te([o,c.pathnameBase]))}return i}function Ft(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=An(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,{paramName:h,isOptional:c},m)=>{if(h==="*"){let R=l[m]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const g=l[m];return c&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function An(e,t=!1,r=!0){oe(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s)=>(n.push({paramName:l,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function go(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oe(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function be(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function wo({basename:e,pathname:t}){return t==="/"?e:Te([e,t])}var Fn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wr=e=>Fn.test(e);function Eo(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ke(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=nn(r.substring(1),"/"):o=nn(r,t)):o=t,{pathname:o,search:bo(n),hash:So(a)}}function nn(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Qt(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Nn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Er(e){let t=Nn(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function Rr(e,t,r,n=!1){let a;typeof e=="string"?a=ke(e):(a={...e},W(!a.pathname||!a.pathname.includes("?"),Qt("?","pathname","search",a)),W(!a.pathname||!a.pathname.includes("#"),Qt("#","pathname","hash",a)),W(!a.search||!a.search.includes("#"),Qt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,l;if(i==null)l=r;else{let c=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),c-=1;a.pathname=m.join("/")}l=c>=0?t[c]:"/"}let s=Eo(a,l),u=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||h)&&(s.pathname+="/"),s}var Te=e=>e.join("/").replace(/\/\/+/g,"/"),Ro=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,So=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,xo=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Co(e,t){return new xo(e,typeof t=="number"?{status:t}:t)}var Lo=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},je=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Ve(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function pt(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var $n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function kn(e,t){let r=e;if(typeof r!="string"||!Fn.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if($n)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),l=be(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:a=!0}catch{oe(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}var $e=Symbol("Uninstrumented");function Po(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let l of i)o[l]&&r[l].push(o[l])}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let a=Qe(r.lazy,t.lazy,()=>{});a&&(n.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let i=a[o],l=r[`lazy.${o}`];if(typeof i=="function"&&l.length>0){let s=Qe(l,i,()=>{});s&&(n.lazy=Object.assign(n.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&r[a].length>0){let i=o[$e]??o,l=Qe(r[a],i,(...s)=>an(s[0]));l&&(a==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[$e]=i,n[a]=l)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(a=>{let o=a[$e]??a,i=Qe(r.middleware,o,(...l)=>an(l[0]));return i?(i[$e]=o,i):a})),n}function To(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(a){let o=Object.keys(a);for(let i of o)a[i]&&r[i].push(a[i])}})),r.navigate.length>0){let n=e.navigate[$e]??e.navigate,a=Qe(r.navigate,n,(...o)=>{let[i,l]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Me(i):".",...on(e,l??{})}});a&&(a[$e]=n,e.navigate=a)}if(r.fetch.length>0){let n=e.fetch[$e]??e.fetch,a=Qe(r.fetch,n,(...o)=>{let[i,,l,s]=o;return{href:l??".",fetcherKey:i,...on(e,s??{})}});a&&(a[$e]=n,e.fetch=a)}return e}function Qe(e,t,r){return e.length===0?null:async(...n)=>{let a=await jn(e,r(...n),()=>t(...n),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function jn(e,t,r,n){let a=e[n],o;if(a){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=jn(e,t,r,n-1),o=await i,W(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(l,t)}catch(s){console.error("An instrumentation function threw an error:",s)}i||await l(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function an(e){let{request:t,context:r,params:n,unstable_pattern:a}=e;return{request:Mo(t),params:{...n},unstable_pattern:a,context:_o(r)}}function on(e,t){return{currentUrl:Me(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Mo(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function _o(e){if(Oo(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Do=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Oo(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Do}var Un=["POST","PUT","PATCH","DELETE"],Io=new Set(Un),Ao=["GET",...Un],Fo=new Set(Ao),Hn=new Set([301,302,303,307,308]),No=new Set([307,308]),Zt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},it={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},$o=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Bn="remix-router-transitions",Wn=Symbol("ResetLoaderData");function fs(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";W(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||$o,o=a;if(e.unstable_instrumentations){let d=e.unstable_instrumentations;o=v=>({...a(v),...Po(d.map(w=>w.route).filter(Boolean),v)})}let i={},l=ht(e.routes,o,void 0,i),s,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let h=e.dataStrategy||zo,c={...e.future},m=null,g=new Set,R=null,b=null,E=null,L=e.hydrationData!=null,S=Ae(l,e.history.location,u),D=!1,A=null,P;if(S==null&&!e.patchRoutesOnNavigation){let d=xe(404,{pathname:e.history.location.pathname}),{matches:v,route:w}=Ct(l);P=!0,S=v,A={[w.id]:d}}else if(S&&!e.hydrationData&&Et(S,l,e.history.location.pathname).active&&(S=null),S)if(S.some(d=>d.route.lazy))P=!1;else if(!S.some(d=>br(d.route)))P=!0;else{let d=e.hydrationData?e.hydrationData.loaderData:null,v=e.hydrationData?e.hydrationData.errors:null;if(v){let w=S.findIndex(C=>v[C.route.id]!==void 0);P=S.slice(0,w+1).every(C=>!lr(C.route,d,v))}else P=S.every(w=>!lr(w.route,d,v))}else{P=!1,S=[];let d=Et(null,l,e.history.location.pathname);d.active&&d.matches&&(D=!0,S=d.matches)}let _,y={historyAction:e.history.action,location:e.history.location,matches:S,initialized:P,navigation:Zt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||A,fetchers:new Map,blockers:new Map},M="POP",F=null,J=!1,K,ae=!1,le=new Map,Q=null,ue=!1,X=!1,ee=new Set,re=new Map,ce=0,se=-1,p=new Map,x=new Set,U=new Map,k=new Map,z=new Set,G=new Map,te,de=null;function me(){if(m=e.history.listen(({action:d,location:v,delta:w})=>{if(te){te(),te=void 0;return}oe(G.size===0||w!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let C=Br({currentLocation:y.location,nextLocation:v,historyAction:d});if(C&&w!=null){let T=new Promise(N=>{te=N});e.history.go(w*-1),wt(C,{state:"blocked",location:v,proceed(){wt(C,{state:"proceeding",proceed:void 0,reset:void 0,location:v}),T.then(()=>e.history.go(w))},reset(){let N=new Map(y.blockers);N.set(C,it),pe({blockers:N})}}),F==null||F.resolve(),F=null;return}return Ue(d,v)}),r){ii(t,le);let d=()=>li(t,le);t.addEventListener("pagehide",d),Q=()=>t.removeEventListener("pagehide",d)}return y.initialized||Ue("POP",y.location,{initialHydration:!0}),_}function Wt(){m&&m(),Q&&Q(),g.clear(),K&&K.abort(),y.fetchers.forEach((d,v)=>Vt(v)),y.blockers.forEach((d,v)=>zr(v))}function Ta(d){return g.add(d),()=>g.delete(d)}function pe(d,v={}){d.matches&&(d.matches=d.matches.map(T=>{let N=i[T.route.id],H=T.route;return H.element!==N.element||H.errorElement!==N.errorElement||H.hydrateFallbackElement!==N.hydrateFallbackElement?{...T,route:N}:T})),y={...y,...d};let w=[],C=[];y.fetchers.forEach((T,N)=>{T.state==="idle"&&(z.has(N)?w.push(N):C.push(N))}),z.forEach(T=>{!y.fetchers.has(T)&&!re.has(T)&&w.push(T)}),[...g].forEach(T=>T(y,{deletedFetchers:w,newErrors:d.errors??null,viewTransitionOpts:v.viewTransitionOpts,flushSync:v.flushSync===!0})),w.forEach(T=>Vt(T)),C.forEach(T=>y.fetchers.delete(T))}function Ke(d,v,{flushSync:w}={}){var Y,$;let C=y.actionData!=null&&y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&y.navigation.state==="loading"&&((Y=d.state)==null?void 0:Y._isRedirect)!==!0,T;v.actionData?Object.keys(v.actionData).length>0?T=v.actionData:T=null:C?T=y.actionData:T=null;let N=v.loaderData?yn(y.loaderData,v.loaderData,v.matches||[],v.errors):y.loaderData,H=y.blockers;H.size>0&&(H=new Map(H),H.forEach((V,q)=>H.set(q,it)));let O=ue?!1:Yr(d,v.matches||y.matches),I=J===!0||y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&(($=d.state)==null?void 0:$._isRedirect)!==!0;s&&(l=s,s=void 0),ue||M==="POP"||(M==="PUSH"?e.history.push(d,d.state):M==="REPLACE"&&e.history.replace(d,d.state));let j;if(M==="POP"){let V=le.get(y.location.pathname);V&&V.has(d.pathname)?j={currentLocation:y.location,nextLocation:d}:le.has(d.pathname)&&(j={currentLocation:d,nextLocation:y.location})}else if(ae){let V=le.get(y.location.pathname);V?V.add(d.pathname):(V=new Set([d.pathname]),le.set(y.location.pathname,V)),j={currentLocation:y.location,nextLocation:d}}pe({...v,actionData:T,loaderData:N,historyAction:M,location:d,initialized:!0,navigation:Zt,revalidation:"idle",restoreScrollPosition:O,preventScrollReset:I,blockers:H},{viewTransitionOpts:j,flushSync:w===!0}),M="POP",J=!1,ae=!1,ue=!1,X=!1,F==null||F.resolve(),F=null,de==null||de.resolve(),de=null}async function Fr(d,v){if(F==null||F.resolve(),F=null,typeof d=="number"){F||(F=wn());let q=F.promise;return e.history.go(d),q}let w=ir(y.location,y.matches,u,d,v==null?void 0:v.fromRouteId,v==null?void 0:v.relative),{path:C,submission:T,error:N}=ln(!1,w,v),H=y.location,O=ft(y.location,C,v&&v.state);O={...O,...e.history.encodeLocation(O)};let I=v&&v.replace!=null?v.replace:void 0,j="PUSH";I===!0?j="REPLACE":I===!1||T!=null&&ve(T.formMethod)&&T.formAction===y.location.pathname+y.location.search&&(j="REPLACE");let Y=v&&"preventScrollReset"in v?v.preventScrollReset===!0:void 0,$=(v&&v.flushSync)===!0,V=Br({currentLocation:H,nextLocation:O,historyAction:j});if(V){wt(V,{state:"blocked",location:O,proceed(){wt(V,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),Fr(d,v)},reset(){let q=new Map(y.blockers);q.set(V,it),pe({blockers:q})}});return}await Ue(j,O,{submission:T,pendingError:N,preventScrollReset:Y,replace:v&&v.replace,enableViewTransition:v&&v.viewTransition,flushSync:$,callSiteDefaultShouldRevalidate:v&&v.unstable_defaultShouldRevalidate})}function Ma(){de||(de=wn()),Yt(),pe({revalidation:"loading"});let d=de.promise;return y.navigation.state==="submitting"?d:y.navigation.state==="idle"?(Ue(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),d):(Ue(M||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:ae===!0}),d)}async function Ue(d,v,w){K&&K.abort(),K=null,M=d,ue=(w&&w.startUninterruptedRevalidation)===!0,Ua(y.location,y.matches),J=(w&&w.preventScrollReset)===!0,ae=(w&&w.enableViewTransition)===!0;let C=s||l,T=w&&w.overrideNavigation,N=w!=null&&w.initialHydration&&y.matches&&y.matches.length>0&&!D?y.matches:Ae(C,v,u),H=(w&&w.flushSync)===!0;if(N&&y.initialized&&!X&&Xo(y.location,v)&&!(w&&w.submission&&ve(w.submission.formMethod))){Ke(v,{matches:N},{flushSync:H});return}let O=Et(N,C,v.pathname);if(O.active&&O.matches&&(N=O.matches),!N){let{error:fe,notFoundMatches:ge,route:ne}=Jt(v.pathname);Ke(v,{matches:ge,loaderData:{},errors:{[ne.id]:fe}},{flushSync:H});return}K=new AbortController;let I=qe(e.history,v,K.signal,w&&w.submission),j=e.getContext?await e.getContext():new en,Y;if(w&&w.pendingError)Y=[Ne(N).route.id,{type:"error",error:w.pendingError}];else if(w&&w.submission&&ve(w.submission.formMethod)){let fe=await _a(I,v,w.submission,N,j,O.active,w&&w.initialHydration===!0,{replace:w.replace,flushSync:H});if(fe.shortCircuited)return;if(fe.pendingActionResult){let[ge,ne]=fe.pendingActionResult;if(Re(ne)&&Ve(ne.error)&&ne.error.status===404){K=null,Ke(v,{matches:fe.matches,loaderData:{},errors:{[ge]:ne.error}});return}}N=fe.matches||N,Y=fe.pendingActionResult,T=er(v,w.submission),H=!1,O.active=!1,I=qe(e.history,I.url,I.signal)}let{shortCircuited:$,matches:V,loaderData:q,errors:he}=await Da(I,v,N,j,O.active,T,w&&w.submission,w&&w.fetcherSubmission,w&&w.replace,w&&w.initialHydration===!0,H,Y,w&&w.callSiteDefaultShouldRevalidate);$||(K=null,Ke(v,{matches:V||N,...vn(Y),loaderData:q,errors:he}))}async function _a(d,v,w,C,T,N,H,O={}){Yt();let I=ai(v,w);if(pe({navigation:I},{flushSync:O.flushSync===!0}),N){let $=await Rt(C,v.pathname,d.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){if($.partialMatches.length===0){let{matches:q,route:he}=Ct(l);return{matches:q,pendingActionResult:[he.id,{type:"error",error:$.error}]}}let V=Ne($.partialMatches).route.id;return{matches:$.partialMatches,pendingActionResult:[V,{type:"error",error:$.error}]}}else if($.matches)C=$.matches;else{let{notFoundMatches:V,error:q,route:he}=Jt(v.pathname);return{matches:V,pendingActionResult:[he.id,{type:"error",error:q}]}}}let j,Y=Dt(C,v);if(!Y.route.action&&!Y.route.lazy)j={type:"error",error:xe(405,{method:d.method,pathname:v.pathname,routeId:Y.route.id})};else{let $=Ze(o,i,d,C,Y,H?[]:n,T),V=await rt(d,$,T,null);if(j=V[Y.route.id],!j){for(let q of C)if(V[q.route.id]){j=V[q.route.id];break}}if(d.signal.aborted)return{shortCircuited:!0}}if(Ye(j)){let $;return O&&O.replace!=null?$=O.replace:$=hn(j.response.headers.get("Location"),new URL(d.url),u,e.history)===y.location.pathname+y.location.search,await He(d,j,!0,{submission:w,replace:$}),{shortCircuited:!0}}if(Re(j)){let $=Ne(C,Y.route.id);return(O&&O.replace)!==!0&&(M="PUSH"),{matches:C,pendingActionResult:[$.route.id,j,Y.route.id]}}return{matches:C,pendingActionResult:[Y.route.id,j]}}async function Da(d,v,w,C,T,N,H,O,I,j,Y,$,V){let q=N||er(v,H),he=H||O||gn(q),fe=!ue&&!j;if(T){if(fe){let ye=Nr($);pe({navigation:q,...ye!==void 0?{actionData:ye}:{}},{flushSync:Y})}let Z=await Rt(w,v.pathname,d.signal);if(Z.type==="aborted")return{shortCircuited:!0};if(Z.type==="error"){if(Z.partialMatches.length===0){let{matches:Xe,route:We}=Ct(l);return{matches:Xe,loaderData:{},errors:{[We.id]:Z.error}}}let ye=Ne(Z.partialMatches).route.id;return{matches:Z.partialMatches,loaderData:{},errors:{[ye]:Z.error}}}else if(Z.matches)w=Z.matches;else{let{error:ye,notFoundMatches:Xe,route:We}=Jt(v.pathname);return{matches:Xe,loaderData:{},errors:{[We.id]:ye}}}}let ge=s||l,{dsMatches:ne,revalidatingFetchers:Se}=sn(d,C,o,i,e.history,y,w,he,v,j?[]:n,j===!0,X,ee,z,U,x,ge,u,e.patchRoutesOnNavigation!=null,$,V);if(se=++ce,!e.dataStrategy&&!ne.some(Z=>Z.shouldLoad)&&!ne.some(Z=>Z.route.middleware&&Z.route.middleware.length>0)&&Se.length===0){let Z=Ur();return Ke(v,{matches:w,loaderData:{},errors:$&&Re($[1])?{[$[0]]:$[1].error}:null,...vn($),...Z?{fetchers:new Map(y.fetchers)}:{}},{flushSync:Y}),{shortCircuited:!0}}if(fe){let Z={};if(!T){Z.navigation=q;let ye=Nr($);ye!==void 0&&(Z.actionData=ye)}Se.length>0&&(Z.fetchers=Oa(Se)),pe(Z,{flushSync:Y})}Se.forEach(Z=>{Oe(Z.key),Z.controller&&re.set(Z.key,Z.controller)});let ze=()=>Se.forEach(Z=>Oe(Z.key));K&&K.signal.addEventListener("abort",ze);let{loaderResults:nt,fetcherResults:Fe}=await $r(ne,Se,d,C);if(d.signal.aborted)return{shortCircuited:!0};K&&K.signal.removeEventListener("abort",ze),Se.forEach(Z=>re.delete(Z.key));let Pe=Lt(nt);if(Pe)return await He(d,Pe.result,!0,{replace:I}),{shortCircuited:!0};if(Pe=Lt(Fe),Pe)return x.add(Pe.key),await He(d,Pe.result,!0,{replace:I}),{shortCircuited:!0};let{loaderData:Gt,errors:at}=pn(y,w,nt,$,Se,Fe);j&&y.errors&&(at={...y.errors,...at});let Be=Ur(),bt=Hr(se),St=Be||bt||Se.length>0;return{matches:w,loaderData:Gt,errors:at,...St?{fetchers:new Map(y.fetchers)}:{}}}function Nr(d){if(d&&!Re(d[1]))return{[d[0]]:d[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function Oa(d){return d.forEach(v=>{let w=y.fetchers.get(v.key),C=lt(void 0,w?w.data:void 0);y.fetchers.set(v.key,C)}),new Map(y.fetchers)}async function Ia(d,v,w,C){Oe(d);let T=(C&&C.flushSync)===!0,N=s||l,H=ir(y.location,y.matches,u,w,v,C==null?void 0:C.relative),O=Ae(N,H,u),I=Et(O,N,H);if(I.active&&I.matches&&(O=I.matches),!O){De(d,v,xe(404,{pathname:H}),{flushSync:T});return}let{path:j,submission:Y,error:$}=ln(!0,H,C);if($){De(d,v,$,{flushSync:T});return}let V=e.getContext?await e.getContext():new en,q=(C&&C.preventScrollReset)===!0;if(Y&&ve(Y.formMethod)){await Aa(d,v,j,O,V,I.active,T,q,Y,C&&C.unstable_defaultShouldRevalidate);return}U.set(d,{routeId:v,path:j}),await Fa(d,v,j,O,V,I.active,T,q,Y)}async function Aa(d,v,w,C,T,N,H,O,I,j){Yt(),U.delete(d);let Y=y.fetchers.get(d);_e(d,oi(I,Y),{flushSync:H});let $=new AbortController,V=qe(e.history,w,$.signal,I);if(N){let ie=await Rt(C,new URL(V.url).pathname,V.signal,d);if(ie.type==="aborted")return;if(ie.type==="error"){De(d,v,ie.error,{flushSync:H});return}else if(ie.matches)C=ie.matches;else{De(d,v,xe(404,{pathname:w}),{flushSync:H});return}}let q=Dt(C,w);if(!q.route.action&&!q.route.lazy){let ie=xe(405,{method:I.formMethod,pathname:w,routeId:v});De(d,v,ie,{flushSync:H});return}re.set(d,$);let he=ce,fe=Ze(o,i,V,C,q,n,T),ge=await rt(V,fe,T,d),ne=ge[q.route.id];if(!ne){for(let ie of fe)if(ge[ie.route.id]){ne=ge[ie.route.id];break}}if(V.signal.aborted){re.get(d)===$&&re.delete(d);return}if(z.has(d)){if(Ye(ne)||Re(ne)){_e(d,Ie(void 0));return}}else{if(Ye(ne))if(re.delete(d),se>he){_e(d,Ie(void 0));return}else return x.add(d),_e(d,lt(I)),He(V,ne,!1,{fetcherSubmission:I,preventScrollReset:O});if(Re(ne)){De(d,v,ne.error);return}}let Se=y.navigation.location||y.location,ze=qe(e.history,Se,$.signal),nt=s||l,Fe=y.navigation.state!=="idle"?Ae(nt,y.navigation.location,u):y.matches;W(Fe,"Didn't find any matches after fetcher action");let Pe=++ce;p.set(d,Pe);let Gt=lt(I,ne.data);y.fetchers.set(d,Gt);let{dsMatches:at,revalidatingFetchers:Be}=sn(ze,T,o,i,e.history,y,Fe,I,Se,n,!1,X,ee,z,U,x,nt,u,e.patchRoutesOnNavigation!=null,[q.route.id,ne],j);Be.filter(ie=>ie.key!==d).forEach(ie=>{let xt=ie.key,Jr=y.fetchers.get(xt),Ba=lt(void 0,Jr?Jr.data:void 0);y.fetchers.set(xt,Ba),Oe(xt),ie.controller&&re.set(xt,ie.controller)}),pe({fetchers:new Map(y.fetchers)});let bt=()=>Be.forEach(ie=>Oe(ie.key));$.signal.addEventListener("abort",bt);let{loaderResults:St,fetcherResults:Z}=await $r(at,Be,ze,T);if($.signal.aborted)return;if($.signal.removeEventListener("abort",bt),p.delete(d),re.delete(d),Be.forEach(ie=>re.delete(ie.key)),y.fetchers.has(d)){let ie=Ie(ne.data);y.fetchers.set(d,ie)}let ye=Lt(St);if(ye)return He(ze,ye.result,!1,{preventScrollReset:O});if(ye=Lt(Z),ye)return x.add(ye.key),He(ze,ye.result,!1,{preventScrollReset:O});let{loaderData:Xe,errors:We}=pn(y,Fe,St,void 0,Be,Z);Hr(Pe),y.navigation.state==="loading"&&Pe>se?(W(M,"Expected pending action"),K&&K.abort(),Ke(y.navigation.location,{matches:Fe,loaderData:Xe,errors:We,fetchers:new Map(y.fetchers)})):(pe({errors:We,loaderData:yn(y.loaderData,Xe,Fe,We),fetchers:new Map(y.fetchers)}),X=!1)}async function Fa(d,v,w,C,T,N,H,O,I){let j=y.fetchers.get(d);_e(d,lt(I,j?j.data:void 0),{flushSync:H});let Y=new AbortController,$=qe(e.history,w,Y.signal);if(N){let ne=await Rt(C,new URL($.url).pathname,$.signal,d);if(ne.type==="aborted")return;if(ne.type==="error"){De(d,v,ne.error,{flushSync:H});return}else if(ne.matches)C=ne.matches;else{De(d,v,xe(404,{pathname:w}),{flushSync:H});return}}let V=Dt(C,w);re.set(d,Y);let q=ce,he=Ze(o,i,$,C,V,n,T),ge=(await rt($,he,T,d))[V.route.id];if(re.get(d)===Y&&re.delete(d),!$.signal.aborted){if(z.has(d)){_e(d,Ie(void 0));return}if(Ye(ge))if(se>q){_e(d,Ie(void 0));return}else{x.add(d),await He($,ge,!1,{preventScrollReset:O});return}if(Re(ge)){De(d,v,ge.error);return}_e(d,Ie(ge.data))}}async function He(d,v,w,{submission:C,fetcherSubmission:T,preventScrollReset:N,replace:H}={}){w||(F==null||F.resolve(),F=null),v.response.headers.has("X-Remix-Revalidate")&&(X=!0);let O=v.response.headers.get("Location");W(O,"Expected a Location header on the redirect Response"),O=hn(O,new URL(d.url),u,e.history);let I=ft(y.location,O,{_isRedirect:!0});if(r){let he=!1;if(v.response.headers.has("X-Remix-Reload-Document"))he=!0;else if(wr(O)){const fe=_n(O,!0);he=fe.origin!==t.location.origin||be(fe.pathname,u)==null}if(he){H?t.location.replace(O):t.location.assign(O);return}}K=null;let j=H===!0||v.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Y,formAction:$,formEncType:V}=y.navigation;!C&&!T&&Y&&$&&V&&(C=gn(y.navigation));let q=C||T;if(No.has(v.response.status)&&q&&ve(q.formMethod))await Ue(j,I,{submission:{...q,formAction:O},preventScrollReset:N||J,enableViewTransition:w?ae:void 0});else{let he=er(I,C);await Ue(j,I,{overrideNavigation:he,fetcherSubmission:T,preventScrollReset:N||J,enableViewTransition:w?ae:void 0})}}async function rt(d,v,w,C){var H;let T,N={};try{T=await Wo(h,d,v,C,w,!1)}catch(O){return v.filter(I=>I.shouldLoad).forEach(I=>{N[I.route.id]={type:"error",error:O}}),N}if(d.signal.aborted)return N;if(!ve(d.method))for(let O of v){if(((H=T[O.route.id])==null?void 0:H.type)==="error")break;!T.hasOwnProperty(O.route.id)&&!y.loaderData.hasOwnProperty(O.route.id)&&(!y.errors||!y.errors.hasOwnProperty(O.route.id))&&O.shouldCallHandler()&&(T[O.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${O.route.id}`)})}for(let[O,I]of Object.entries(T))if(ei(I)){let j=I.result;N[O]={type:"redirect",response:Go(j,d,O,v,u)}}else N[O]=await Jo(I);return N}async function $r(d,v,w,C){let T=rt(w,d,C,null),N=Promise.all(v.map(async I=>{if(I.matches&&I.match&&I.request&&I.controller){let Y=(await rt(I.request,I.matches,C,I.key))[I.match.route.id];return{[I.key]:Y}}else return Promise.resolve({[I.key]:{type:"error",error:xe(404,{pathname:I.path})}})})),H=await T,O=(await N).reduce((I,j)=>Object.assign(I,j),{});return{loaderResults:H,fetcherResults:O}}function Yt(){X=!0,U.forEach((d,v)=>{re.has(v)&&ee.add(v),Oe(v)})}function _e(d,v,w={}){y.fetchers.set(d,v),pe({fetchers:new Map(y.fetchers)},{flushSync:(w&&w.flushSync)===!0})}function De(d,v,w,C={}){let T=Ne(y.matches,v);Vt(d),pe({errors:{[T.route.id]:w},fetchers:new Map(y.fetchers)},{flushSync:(C&&C.flushSync)===!0})}function kr(d){return k.set(d,(k.get(d)||0)+1),z.has(d)&&z.delete(d),y.fetchers.get(d)||zn}function Na(d,v){Oe(d,v==null?void 0:v.reason),_e(d,Ie(null))}function Vt(d){let v=y.fetchers.get(d);re.has(d)&&!(v&&v.state==="loading"&&p.has(d))&&Oe(d),U.delete(d),p.delete(d),x.delete(d),z.delete(d),ee.delete(d),y.fetchers.delete(d)}function $a(d){let v=(k.get(d)||0)-1;v<=0?(k.delete(d),z.add(d)):k.set(d,v),pe({fetchers:new Map(y.fetchers)})}function Oe(d,v){let w=re.get(d);w&&(w.abort(v),re.delete(d))}function jr(d){for(let v of d){let w=kr(v),C=Ie(w.data);y.fetchers.set(v,C)}}function Ur(){let d=[],v=!1;for(let w of x){let C=y.fetchers.get(w);W(C,`Expected fetcher: ${w}`),C.state==="loading"&&(x.delete(w),d.push(w),v=!0)}return jr(d),v}function Hr(d){let v=[];for(let[w,C]of p)if(C<d){let T=y.fetchers.get(w);W(T,`Expected fetcher: ${w}`),T.state==="loading"&&(Oe(w),p.delete(w),v.push(w))}return jr(v),v.length>0}function ka(d,v){let w=y.blockers.get(d)||it;return G.get(d)!==v&&G.set(d,v),w}function zr(d){y.blockers.delete(d),G.delete(d)}function wt(d,v){let w=y.blockers.get(d)||it;W(w.state==="unblocked"&&v.state==="blocked"||w.state==="blocked"&&v.state==="blocked"||w.state==="blocked"&&v.state==="proceeding"||w.state==="blocked"&&v.state==="unblocked"||w.state==="proceeding"&&v.state==="unblocked",`Invalid blocker state transition: ${w.state} -> ${v.state}`);let C=new Map(y.blockers);C.set(d,v),pe({blockers:C})}function Br({currentLocation:d,nextLocation:v,historyAction:w}){if(G.size===0)return;G.size>1&&oe(!1,"A router only supports one blocker at a time");let C=Array.from(G.entries()),[T,N]=C[C.length-1],H=y.blockers.get(T);if(!(H&&H.state==="proceeding")&&N({currentLocation:d,nextLocation:v,historyAction:w}))return T}function Jt(d){let v=xe(404,{pathname:d}),w=s||l,{matches:C,route:T}=Ct(w);return{notFoundMatches:C,route:T,error:v}}function ja(d,v,w){if(R=d,E=v,b=w||null,!L&&y.navigation===Zt){L=!0;let C=Yr(y.location,y.matches);C!=null&&pe({restoreScrollPosition:C})}return()=>{R=null,E=null,b=null}}function Wr(d,v){return b&&b(d,v.map(C=>Dn(C,y.loaderData)))||d.key}function Ua(d,v){if(R&&E){let w=Wr(d,v);R[w]=E()}}function Yr(d,v){if(R){let w=Wr(d,v),C=R[w];if(typeof C=="number")return C}return null}function Et(d,v,w){if(e.patchRoutesOnNavigation)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:ct(v,w,u,!0)}}else return{active:!0,matches:ct(v,w,u,!0)||[]};return{active:!1,matches:null}}async function Rt(d,v,w,C){if(!e.patchRoutesOnNavigation)return{type:"success",matches:d};let T=d;for(;;){let N=s==null,H=s||l,O=i;try{await e.patchRoutesOnNavigation({signal:w,path:v,matches:T,fetcherKey:C,patch:(Y,$)=>{w.aborted||un(Y,$,H,O,o,!1)}})}catch(Y){return{type:"error",error:Y,partialMatches:T}}finally{N&&!w.aborted&&(l=[...l])}if(w.aborted)return{type:"aborted"};let I=Ae(H,v,u),j=null;if(I){if(Object.keys(I[0].params).length===0)return{type:"success",matches:I};if(j=ct(H,v,u,!0),!(j&&T.length<j.length&&Vr(T,j.slice(0,T.length))))return{type:"success",matches:I}}if(j||(j=ct(H,v,u,!0)),!j||Vr(T,j))return{type:"success",matches:null};T=j}}function Vr(d,v){return d.length===v.length&&d.every((w,C)=>w.route.id===v[C].route.id)}function Ha(d){i={},s=ht(d,o,void 0,i)}function za(d,v,w=!1){let C=s==null;un(d,v,s||l,i,o,w),C&&(l=[...l],pe({}))}return _={get basename(){return u},get future(){return c},get state(){return y},get routes(){return l},get window(){return t},initialize:me,subscribe:Ta,enableScrollRestoration:ja,navigate:Fr,fetch:Ia,revalidate:Ma,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:kr,resetFetcher:Na,deleteFetcher:$a,dispose:Wt,getBlocker:ka,deleteBlocker:zr,patchRoutes:za,_internalFetchControllers:re,_internalSetRoutes:Ha,_internalSetStateDoNotUseOrYouWillBreakYourApp(d){pe(d)}},e.unstable_instrumentations&&(_=To(_,e.unstable_instrumentations.map(d=>d.router).filter(Boolean))),_}function ko(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ir(e,t,r,n,a,o){let i,l;if(a){i=[];for(let u of t)if(i.push(u),u.route.id===a){l=u;break}}else i=t,l=t[t.length-1];let s=Rr(n||".",Er(i),be(e.pathname,r)||e.pathname,o==="path");if(n==null&&(s.search=e.search,s.hash=e.hash),(n==null||n===""||n===".")&&l){let u=Sr(s.search);if(l.route.index&&!u)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&u){let h=new URLSearchParams(s.search),c=h.getAll("index");h.delete("index"),c.filter(g=>g).forEach(g=>h.append("index",g));let m=h.toString();s.search=m?`?${m}`:""}}return r!=="/"&&(s.pathname=wo({basename:r,pathname:s.pathname})),Me(s)}function ln(e,t,r){if(!r||!ko(r))return{path:t};if(r.formMethod&&!ni(r.formMethod))return{path:t,error:xe(405,{method:r.formMethod})};let n=()=>({path:t,error:xe(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Xn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ve(o))return n();let c=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,[g,R])=>`${m}${g}=${R}
27
- `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:c}}}else if(r.formEncType==="application/json"){if(!ve(o))return n();try{let c=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:c,text:void 0}}}catch{return n()}}}W(typeof FormData=="function","FormData is not available in this environment");let l,s;if(r.formData)l=ur(r.formData),s=r.formData;else if(r.body instanceof FormData)l=ur(r.body),s=r.body;else if(r.body instanceof URLSearchParams)l=r.body,s=mn(l);else if(r.body==null)l=new URLSearchParams,s=new FormData;else try{l=new URLSearchParams(r.body),s=mn(l)}catch{return n()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(ve(u.formMethod))return{path:t,submission:u};let h=ke(t);return e&&h.search&&Sr(h.search)&&l.append("index",""),h.search=`?${l}`,{path:Me(h),submission:u}}function sn(e,t,r,n,a,o,i,l,s,u,h,c,m,g,R,b,E,L,S,D,A){var ue;let P=D?Re(D[1])?D[1].error:D[1].data:void 0,_=a.createURL(o.location),y=a.createURL(s),M;if(h&&o.errors){let X=Object.keys(o.errors)[0];M=i.findIndex(ee=>ee.route.id===X)}else if(D&&Re(D[1])){let X=D[0];M=i.findIndex(ee=>ee.route.id===X)-1}let F=D?D[1].statusCode:void 0,J=F&&F>=400,K={currentUrl:_,currentParams:((ue=o.matches[0])==null?void 0:ue.params)||{},nextUrl:y,nextParams:i[0].params,...l,actionResult:P,actionStatus:F},ae=pt(i),le=i.map((X,ee)=>{let{route:re}=X,ce=null;if(M!=null&&ee>M?ce=!1:re.lazy?ce=!0:br(re)?h?ce=lr(re,o.loaderData,o.errors):jo(o.loaderData,o.matches[ee],X)&&(ce=!0):ce=!1,ce!==null)return sr(r,n,e,ae,X,u,t,ce);let se=!1;typeof A=="boolean"?se=A:J?se=!1:(c||_.pathname+_.search===y.pathname+y.search||_.search!==y.search||Uo(o.matches[ee],X))&&(se=!0);let p={...K,defaultShouldRevalidate:se},x=dt(X,p);return sr(r,n,e,ae,X,u,t,x,p,A)}),Q=[];return R.forEach((X,ee)=>{if(h||!i.some(z=>z.route.id===X.routeId)||g.has(ee))return;let re=o.fetchers.get(ee),ce=re&&re.state!=="idle"&&re.data===void 0,se=Ae(E,X.path,L);if(!se){if(S&&ce)return;Q.push({key:ee,routeId:X.routeId,path:X.path,matches:null,match:null,request:null,controller:null});return}if(b.has(ee))return;let p=Dt(se,X.path),x=new AbortController,U=qe(a,X.path,x.signal),k=null;if(m.has(ee))m.delete(ee),k=Ze(r,n,U,se,p,u,t);else if(ce)c&&(k=Ze(r,n,U,se,p,u,t));else{let z;typeof A=="boolean"?z=A:J?z=!1:z=c;let G={...K,defaultShouldRevalidate:z};dt(p,G)&&(k=Ze(r,n,U,se,p,u,t,G))}k&&Q.push({key:ee,routeId:X.routeId,path:X.path,matches:k,match:p,request:U,controller:x})}),{dsMatches:le,revalidatingFetchers:Q}}function br(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function lr(e,t,r){if(e.lazy)return!0;if(!br(e))return!1;let n=t!=null&&e.id in t,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function jo(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function Uo(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function dt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function un(e,t,r,n,a,o){let i;if(e){let u=n[e];W(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r;let l=[],s=[];if(t.forEach(u=>{let h=i.find(c=>Yn(u,c));h?s.push({existingRoute:h,newRoute:u}):l.push(u)}),l.length>0){let u=ht(l,a,[e||"_","patch",String((i==null?void 0:i.length)||"0")],n);i.push(...u)}if(o&&s.length>0)for(let u=0;u<s.length;u++){let{existingRoute:h,newRoute:c}=s[u],m=h,[g]=ht([c],a,[],{},!0);Object.assign(m,{element:g.element?g.element:m.element,errorElement:g.errorElement?g.errorElement:m.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:m.hydrateFallbackElement})}}function Yn(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(o=>Yn(r,o))}):!1}var cn=new WeakMap,Vn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(W(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let i=cn.get(a);i||(i={},cn.set(a,i));let l=i[e];if(l)return l;let s=(async()=>{let u=no(e),c=a[e]!==void 0&&e!=="hasErrorBoundary";if(u)oe(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)oe(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let m=await o();m!=null&&(Object.assign(a,{[e]:m}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(m=>m===void 0)&&(a.lazy=void 0))})();return i[e]=s,s},dn=new WeakMap;function Ho(e,t,r,n,a){let o=r[e.id];if(W(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let h=dn.get(o);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let c=(async()=>{W(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),g={};for(let R in m){let b=m[R];if(b===void 0)continue;let E=oo(R),S=o[R]!==void 0&&R!=="hasErrorBoundary";E?oe(!E,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):S?oe(!S,`Route "${o.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):g[R]=b}Object.assign(o,g),Object.assign(o,{...n(o),lazy:void 0})})();return dn.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),l=[],s;for(let h of i){if(a&&a.includes(h))continue;let c=Vn({key:h,route:e,manifest:r,mapRouteProperties:n});c&&(l.push(c),h===t&&(s=c))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u==null||u.catch(()=>{}),s==null||s.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:s}}async function fn(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function zo(e){return e.matches.some(t=>t.route.middleware)?Jn(e,()=>fn(e)):fn(e)}function Jn(e,t){return Bo(e,t,n=>{if(ri(n))throw n;return n},Qo,r);function r(n,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:n}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(u=>u.route.id===a),0),Math.max(i.findIndex(u=>u.shouldCallHandler()),0)),s=Ne(i,i[l].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:n}})}}}async function Bo(e,t,r,n,a){let{matches:o,request:i,params:l,context:s,unstable_pattern:u}=e,h=o.flatMap(m=>m.route.middleware?m.route.middleware.map(g=>[m.route.id,g]):[]);return await Gn({request:i,params:l,context:s,unstable_pattern:u},h,t,r,n,a)}async function Gn(e,t,r,n,a,o,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let s=t[i];if(!s)return await r();let[u,h]=s,c,m=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await Gn(e,t,r,n,a,o,i+1)},c.value}catch(g){return c={value:await o(g,u,c)},c.value}};try{let g=await h(e,m),R=g!=null?n(g):void 0;return a(R)?R:c?R??c.value:(c={value:await m()},c.value)}catch(g){return await o(g,u,c)}}function Kn(e,t,r,n,a){let o=Vn({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=Ho(n.route,ve(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function sr(e,t,r,n,a,o,i,l,s=null,u){let h=!1,c=Kn(e,t,r,a,o);return{...a,_lazyPromises:c,shouldLoad:l,shouldRevalidateArgs:s,shouldCallHandler(m){return h=!0,s?typeof u=="boolean"?dt(a,{...s,defaultShouldRevalidate:u}):typeof m=="boolean"?dt(a,{...s,defaultShouldRevalidate:m}):dt(a,s):l},resolve(m){let{lazy:g,loader:R,middleware:b}=a.route,E=h||l||m&&!ve(r.method)&&(g||R),L=b&&b.length>0&&!R&&!g;return E&&(ve(r.method)||!L)?Yo({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:c==null?void 0:c.handler,lazyRoutePromise:c==null?void 0:c.route,handlerOverride:m,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Ze(e,t,r,n,a,o,i,l=null){return n.map(s=>s.route.id!==a.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:Kn(e,t,r,s,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:sr(e,t,r,pt(n),s,o,i,!0,l))}async function Wo(e,t,r,n,a,o){r.some(u=>{var h;return(h=u._lazyPromises)==null?void 0:h.middleware})&&await Promise.all(r.map(u=>{var h;return(h=u._lazyPromises)==null?void 0:h.middleware}));let i={request:t,unstable_pattern:pt(r),params:r[0].params,context:a,matches:r},s=await e({...i,fetcherKey:n,runClientMiddleware:u=>{let h=i;return Jn(h,()=>u({...h,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(u=>{var h,c;return[(h=u._lazyPromises)==null?void 0:h.handler,(c=u._lazyPromises)==null?void 0:c.route]}))}catch{}return s}async function Yo({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let l,s,u=ve(e.method),h=u?"action":"loader",c=m=>{let g,R=new Promise((L,S)=>g=S);s=()=>g(),e.signal.addEventListener("abort",s);let b=L=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${r.route.id}]`)):m({request:e,unstable_pattern:t,params:r.params,context:i},...L!==void 0?[L]:[]),E=(async()=>{try{return{type:"data",result:await(o?o(S=>b(S)):b())}}catch(L){return{type:"error",result:L}}})();return Promise.race([E,R])};try{let m=u?r.route.action:r.route.loader;if(n||a)if(m){let g,[R]=await Promise.all([c(m).catch(b=>{g=b}),n,a]);if(g!==void 0)throw g;l=R}else{await n;let g=u?r.route.action:r.route.loader;if(g)[l]=await Promise.all([c(g),a]);else if(h==="action"){let R=new URL(e.url),b=R.pathname+R.search;throw xe(405,{method:e.method,pathname:b,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(m)l=await c(m);else{let g=new URL(e.url),R=g.pathname+g.search;throw xe(404,{pathname:R})}}catch(m){return{type:"error",result:m}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function Vo(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Jo(e){var n,a,o,i,l;let{result:t,type:r}=e;if(kt(t)){let s;try{s=await Vo(t)}catch(u){return{type:"error",error:u}}return r==="error"?{type:"error",error:new je(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return r==="error"?cr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(n=t.init)==null?void 0:n.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:qo(t),statusCode:Ve(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ve(t)?t.status:void 0}:cr(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Go(e,t,r,n,a){let o=e.headers.get("Location");if(W(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!wr(o)){let i=n.slice(0,n.findIndex(l=>l.route.id===r)+1);o=ir(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function hn(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(wr(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(i.protocol))throw new Error("Invalid redirect location");let l=be(i.pathname,r)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}try{let o=n.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function qe(e,t,r,n){let a=e.createURL(Xn(t)).toString(),o={signal:r};if(n&&ve(n.formMethod)){let{formMethod:i,formEncType:l}=n;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(n.json)):l==="text/plain"?o.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?o.body=ur(n.formData):o.body=n.formData}return new Request(a,o)}function ur(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function mn(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Ko(e,t,r,n=!1,a=!1){let o={},i=null,l,s=!1,u={},h=r&&Re(r[1])?r[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let m=c.route.id,g=t[m];if(W(!Ye(g),"Cannot handle redirect results in processLoaderData"),Re(g)){let R=g.error;if(h!==void 0&&(R=h,h=void 0),i=i||{},a)i[m]=R;else{let b=Ne(e,m);i[b.route.id]==null&&(i[b.route.id]=R)}n||(o[m]=Wn),s||(s=!0,l=Ve(g.error)?g.error.status:500),g.headers&&(u[m]=g.headers)}else o[m]=g.data,g.statusCode&&g.statusCode!==200&&!s&&(l=g.statusCode),g.headers&&(u[m]=g.headers)}),h!==void 0&&r&&(i={[r[0]]:h},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:u}}function pn(e,t,r,n,a,o){let{loaderData:i,errors:l}=Ko(t,r,n);return a.filter(s=>!s.matches||s.matches.some(u=>u.shouldLoad)).forEach(s=>{let{key:u,match:h,controller:c}=s;if(c&&c.signal.aborted)return;let m=o[u];if(W(m,"Did not find corresponding fetcher result"),Re(m)){let g=Ne(e.matches,h==null?void 0:h.route.id);l&&l[g.route.id]||(l={...l,[g.route.id]:m.error}),e.fetchers.delete(u)}else if(Ye(m))W(!1,"Unhandled fetcher revalidation redirect");else{let g=Ie(m.data);e.fetchers.set(u,g)}}),{loaderData:i,errors:l}}function yn(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==Wn).reduce((o,[i,l])=>(o[i]=l,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function vn(e){return e?Re(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ne(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Ct(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xe(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",n&&t&&r?l=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:a==="invalid-body"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",l=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",n&&t&&r?l=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(l=`Invalid request method "${n.toUpperCase()}"`)),new je(e||500,i,new Error(l),!0)}function Lt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Ye(a))return{key:n,result:a}}}function Xn(e){let t=typeof e=="string"?ke(e):e;return Me({...t,hash:""})}function Xo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function qo(e){var t,r;return new je(((t=e.init)==null?void 0:t.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function Qo(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Zo(r))}function Zo(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function ei(e){return kt(e.result)&&Hn.has(e.result.status)}function Re(e){return e.type==="error"}function Ye(e){return(e&&e.type)==="redirect"}function cr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function kt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function ti(e){return Hn.has(e)}function ri(e){return kt(e)&&ti(e.status)&&e.headers.has("Location")}function ni(e){return Fo.has(e.toUpperCase())}function ve(e){return Io.has(e.toUpperCase())}function Sr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Dt(e,t){let r=typeof t=="string"?ke(t).search:t.search;if(e[e.length-1].route.index&&Sr(r||""))return e[e.length-1];let n=Nn(e);return n[n.length-1]}function gn(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function er(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ai(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function lt(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function oi(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ie(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ii(e,t){try{let r=e.sessionStorage.getItem(Bn);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function li(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Bn,JSON.stringify(r))}catch(n){oe(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function wn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Je=f.createContext(null);Je.displayName="DataRouter";var et=f.createContext(null);et.displayName="DataRouterState";var qn=f.createContext(!1);function Qn(){return f.useContext(qn)}var xr=f.createContext({isTransitioning:!1});xr.displayName="ViewTransition";var Cr=f.createContext(new Map);Cr.displayName="Fetchers";var si=f.createContext(null);si.displayName="Await";var Ee=f.createContext(null);Ee.displayName="Navigation";var jt=f.createContext(null);jt.displayName="Location";var Ce=f.createContext({outlet:null,matches:[],isDataRoute:!1});Ce.displayName="Route";var Lr=f.createContext(null);Lr.displayName="RouteError";var Zn="REACT_ROUTER_ERROR",ui="REDIRECT",ci="ROUTE_ERROR_RESPONSE";function di(e){if(e.startsWith(`${Zn}:${ui}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function fi(e){if(e.startsWith(`${Zn}:${ci}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new je(t.status,t.statusText,t.data)}catch{}}function hi(e,{relative:t}={}){W(yt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=f.useContext(Ee),{hash:a,pathname:o,search:i}=vt(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:Te([r,o])),n.createHref({pathname:l,search:i,hash:a})}function yt(){return f.useContext(jt)!=null}function Le(){return W(yt(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(jt).location}var ea="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ta(e){f.useContext(Ee).static||f.useLayoutEffect(e)}function ra(){let{isDataRoute:e}=f.useContext(Ce);return e?Mi():mi()}function mi(){W(yt(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(Je),{basename:t,navigator:r}=f.useContext(Ee),{matches:n}=f.useContext(Ce),{pathname:a}=Le(),o=JSON.stringify(Er(n)),i=f.useRef(!1);return ta(()=>{i.current=!0}),f.useCallback((s,u={})=>{if(oe(i.current,ea),!i.current)return;if(typeof s=="number"){r.go(s);return}let h=Rr(s,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Te([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,o,a,e])}var pi=f.createContext(null);function yi(e){let t=f.useContext(Ce).outlet;return f.useMemo(()=>t&&f.createElement(pi.Provider,{value:e},t),[t,e])}function vi(){let{matches:e}=f.useContext(Ce),t=e[e.length-1];return t?t.params:{}}function vt(e,{relative:t}={}){let{matches:r}=f.useContext(Ce),{pathname:n}=Le(),a=JSON.stringify(Er(r));return f.useMemo(()=>Rr(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function gi(e,t,r,n,a){W(yt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=f.useContext(Ee),{matches:i}=f.useContext(Ce),l=i[i.length-1],s=l?l.params:{},u=l?l.pathname:"/",h=l?l.pathnameBase:"/",c=l&&l.route;{let S=c&&c.path||"";ia(u,!c||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) 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.
28
-
29
- Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let m=Le(),g;g=m;let R=g.pathname||"/",b=R;if(h!=="/"){let S=h.replace(/^\//,"").split("/");b="/"+R.replace(/^\//,"").split("/").slice(S.length).join("/")}let E=Ae(e,{pathname:b});return oe(c||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),oe(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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.`),Si(E&&E.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Te([h,o.encodeLocation?o.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:Te([h,o.encodeLocation?o.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,r,n,a)}function wi(){let e=oa(),t=Ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:o},"ErrorBoundary")," or"," ",f.createElement("code",{style:o},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:a},r):null,i)}var Ei=f.createElement(wi,null),na=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=fi(e.digest);r&&(e=r)}let t=e!==void 0?f.createElement(Ce.Provider,{value:this.props.routeContext},f.createElement(Lr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(Ri,{error:e},t):t}};na.contextType=qn;var tr=new WeakMap;function Ri({children:e,error:t}){let{basename:r}=f.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=di(t.digest);if(n){let a=tr.get(t);if(a)throw a;let o=kn(n.location,r);if($n&&!tr.get(t))if(o.isExternal||n.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw tr.set(t,i),i}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function bi({routeContext:e,match:t,children:r}){let n=f.useContext(Je);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Ce.Provider,{value:e},r)}function Si(e,t=[],r=null,n=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,i=r==null?void 0:r.errors;if(i!=null){let h=o.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);W(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let l=!1,s=-1;if(r)for(let h=0;h<o.length;h++){let c=o[h];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(s=h),c.route.id){let{loaderData:m,errors:g}=r,R=c.route.loader&&!m.hasOwnProperty(c.route.id)&&(!g||g[c.route.id]===void 0);if(c.route.lazy||R){l=!0,s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}let u=r&&n?(h,c)=>{var m,g;n(h,{location:r.location,params:((g=(m=r.matches)==null?void 0:m[0])==null?void 0:g.params)??{},unstable_pattern:pt(r.matches),errorInfo:c})}:void 0;return o.reduceRight((h,c,m)=>{let g,R=!1,b=null,E=null;r&&(g=i&&c.route.id?i[c.route.id]:void 0,b=c.route.errorElement||Ei,l&&(s<0&&m===0?(ia("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,E=null):s===m&&(R=!0,E=c.route.hydrateFallbackElement||null)));let L=t.concat(o.slice(0,m+1)),S=()=>{let D;return g?D=b:R?D=E:c.route.Component?D=f.createElement(c.route.Component,null):c.route.element?D=c.route.element:D=h,f.createElement(bi,{match:c,routeContext:{outlet:h,matches:L,isDataRoute:r!=null},children:D})};return r&&(c.route.ErrorBoundary||c.route.errorElement||m===0)?f.createElement(na,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:S(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:u}):S()},null)}function Pr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function aa(e){let t=f.useContext(Je);return W(t,Pr(e)),t}function Ge(e){let t=f.useContext(et);return W(t,Pr(e)),t}function xi(e){let t=f.useContext(Ce);return W(t,Pr(e)),t}function gt(e){let t=xi(e),r=t.matches[t.matches.length-1];return W(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ci(){return gt("useRouteId")}function Li(){return Ge("useNavigation").navigation}function hs(){let e=aa("useRevalidator"),t=Ge("useRevalidator"),r=f.useCallback(async()=>{await e.router.revalidate()},[e.router]);return f.useMemo(()=>({revalidate:r,state:t.revalidation}),[r,t.revalidation])}function Tr(){let{matches:e,loaderData:t}=Ge("useMatches");return f.useMemo(()=>e.map(r=>Dn(r,t)),[e,t])}function Pi(){let e=Ge("useLoaderData"),t=gt("useLoaderData");return e.loaderData[t]}function ms(e){return Ge("useRouteLoaderData").loaderData[e]}function Ti(){let e=Ge("useActionData"),t=gt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function oa(){var n;let e=f.useContext(Lr),t=Ge("useRouteError"),r=gt("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Mi(){let{router:e}=aa("useNavigate"),t=gt("useNavigate"),r=f.useRef(!1);return ta(()=>{r.current=!0}),f.useCallback(async(a,o={})=>{oe(r.current,ea),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var En={};function ia(e,t,r){!t&&!En[e]&&(En[e]=!0,oe(!1,r))}var Rn={};function dr(e,t){!e&&!Rn[t]&&(Rn[t]=!0,console.warn(t))}var _i="useOptimistic",bn=qa[_i],Di=()=>{};function Oi(e){return bn?bn(e):[e,Di]}function ps(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&oe(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:f.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&oe(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&oe(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var ys=["HydrateFallback","hydrateFallbackElement"],Ii=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function vs({router:e,flushSync:t,onError:r,unstable_useTransitions:n}){n=Qn()||n;let[o,i]=f.useState(e.state),[l,s]=Oi(o),[u,h]=f.useState(),[c,m]=f.useState({isTransitioning:!1}),[g,R]=f.useState(),[b,E]=f.useState(),[L,S]=f.useState(),D=f.useRef(new Map),A=f.useCallback((M,{deletedFetchers:F,newErrors:J,flushSync:K,viewTransitionOpts:ae})=>{J&&r&&Object.values(J).forEach(Q=>{var ue;return r(Q,{location:M.location,params:((ue=M.matches[0])==null?void 0:ue.params)??{},unstable_pattern:pt(M.matches)})}),M.fetchers.forEach((Q,ue)=>{Q.data!==void 0&&D.current.set(ue,Q.data)}),F.forEach(Q=>D.current.delete(Q)),dr(K===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let le=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(dr(ae==null||le,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!ae||!le){t&&K?t(()=>i(M)):n===!1?i(M):f.startTransition(()=>{n===!0&&s(Q=>Sn(Q,M)),i(M)});return}if(t&&K){t(()=>{b&&(g==null||g.resolve(),b.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})});let Q=e.window.document.startViewTransition(()=>{t(()=>i(M))});Q.finished.finally(()=>{t(()=>{R(void 0),E(void 0),h(void 0),m({isTransitioning:!1})})}),t(()=>E(Q));return}b?(g==null||g.resolve(),b.skipTransition(),S({state:M,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})):(h(M),m({isTransitioning:!0,flushSync:!1,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation}))},[e.window,t,b,g,n,s,r]);f.useLayoutEffect(()=>e.subscribe(A),[e,A]),f.useEffect(()=>{c.isTransitioning&&!c.flushSync&&R(new Ii)},[c]),f.useEffect(()=>{if(g&&u&&e.window){let M=u,F=g.promise,J=e.window.document.startViewTransition(async()=>{n===!1?i(M):f.startTransition(()=>{n===!0&&s(K=>Sn(K,M)),i(M)}),await F});J.finished.finally(()=>{R(void 0),E(void 0),h(void 0),m({isTransitioning:!1})}),E(J)}},[u,g,e.window,n,s]),f.useEffect(()=>{g&&u&&l.location.key===u.location.key&&g.resolve()},[g,b,l.location,u]),f.useEffect(()=>{!c.isTransitioning&&L&&(h(L.state),m({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),S(void 0))},[c.isTransitioning,L]);let P=f.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,F,J)=>e.navigate(M,{state:F,preventScrollReset:J==null?void 0:J.preventScrollReset}),replace:(M,F,J)=>e.navigate(M,{replace:!0,state:F,preventScrollReset:J==null?void 0:J.preventScrollReset})}),[e]),_=e.basename||"/",y=f.useMemo(()=>({router:e,navigator:P,static:!1,basename:_,onError:r}),[e,P,_,r]);return f.createElement(f.Fragment,null,f.createElement(Je.Provider,{value:y},f.createElement(et.Provider,{value:l},f.createElement(Cr.Provider,{value:D.current},f.createElement(xr.Provider,{value:c},f.createElement(Ni,{basename:_,location:l.location,navigationType:l.historyAction,navigator:P,unstable_useTransitions:n},f.createElement(Ai,{routes:e.routes,future:e.future,state:l,onError:r})))))),null)}function Sn(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var Ai=f.memo(Fi);function Fi({routes:e,future:t,state:r,onError:n}){return gi(e,void 0,r,n,t)}function gs(e){return yi(e.context)}function Ni({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:i}){W(!yt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=f.useMemo(()=>({basename:l,navigator:a,static:o,unstable_useTransitions:i,future:{}}),[l,a,o,i]);typeof r=="string"&&(r=ke(r));let{pathname:u="/",search:h="",hash:c="",state:m=null,key:g="default"}=r,R=f.useMemo(()=>{let b=be(u,l);return b==null?null:{location:{pathname:b,search:h,hash:c,state:m,key:g},navigationType:n}},[l,u,h,c,m,g,n]);return oe(R!=null,`<Router basename="${l}"> is not able to match the URL "${u}${h}${c}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:f.createElement(Ee.Provider,{value:s},f.createElement(jt.Provider,{children:t,value:R}))}function $i(){return{params:vi(),loaderData:Pi(),actionData:Ti(),matches:Tr()}}function ws(e){return function(){const r=$i();return f.createElement(e,r)}}var Ot="get",It="application/x-www-form-urlencoded";function Ut(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ki(e){return Ut(e)&&e.tagName.toLowerCase()==="button"}function ji(e){return Ut(e)&&e.tagName.toLowerCase()==="form"}function Ui(e){return Ut(e)&&e.tagName.toLowerCase()==="input"}function Hi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zi(e,t){return e.button===0&&(!t||t==="_self")&&!Hi(e)}function fr(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Bi(e,t){let r=fr(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var Pt=null;function Wi(){if(Pt===null)try{new FormData(document.createElement("form"),0),Pt=!1}catch{Pt=!0}return Pt}var Yi=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rr(e){return e!=null&&!Yi.has(e)?(oe(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${It}"`),null):e}function Vi(e,t){let r,n,a,o,i;if(ji(e)){let l=e.getAttribute("action");n=l?be(l,t):null,r=e.getAttribute("method")||Ot,a=rr(e.getAttribute("enctype"))||It,o=new FormData(e)}else if(ki(e)||Ui(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(n=s?be(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||Ot,a=rr(e.getAttribute("formenctype"))||rr(l.getAttribute("enctype"))||It,o=new FormData(l,e),!Wi()){let{name:u,type:h,value:c}=e;if(h==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,c)}}else{if(Ut(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ot,n=null,a=It,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}var Ji=-1,Gi=-2,Ki=-3,Xi=-4,qi=-5,Qi=-6,Zi=-7,el="B",tl="D",la="E",rl="M",nl="N",sa="P",al="R",ol="S",il="Y",ll="U",sl="Z",ua=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function ul(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(`
30
- `);t=o.pop()||"";for(const i of o)n.enqueue(i)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var nr=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function hr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return xn.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const a of e)r.push(a);return t.length=r.length,xn.call(this,n)}function xn(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const i=[[e,s=>{o=s}]];let l=[];for(;i.length>0;){const[s,u]=i.pop();switch(s){case Zi:u(void 0);continue;case qi:u(null);continue;case Gi:u(NaN);continue;case Qi:u(1/0);continue;case Ki:u(-1/0);continue;case Xi:u(-0);continue}if(t[s]){u(t[s]);continue}const h=r[s];if(!h||typeof h!="object"){t[s]=h,u(h);continue}if(Array.isArray(h))if(typeof h[0]=="string"){const[c,m,g]=h;switch(c){case tl:u(t[s]=new Date(m));continue;case ll:u(t[s]=new URL(m));continue;case el:u(t[s]=BigInt(m));continue;case al:u(t[s]=new RegExp(m,g));continue;case il:u(t[s]=Symbol.for(m));continue;case ol:const R=new Set;t[s]=R;for(let A=h.length-1;A>0;A--)i.push([h[A],P=>{R.add(P)}]);u(R);continue;case rl:const b=new Map;t[s]=b;for(let A=h.length-2;A>0;A-=2){const P=[];i.push([h[A+1],_=>{P[1]=_}]),i.push([h[A],_=>{P[0]=_}]),l.push(()=>{b.set(P[0],P[1])})}u(b);continue;case nl:const E=Object.create(null);t[s]=E;for(const A of Object.keys(m).reverse()){const P=[];i.push([m[A],_=>{P[1]=_}]),i.push([Number(A.slice(1)),_=>{P[0]=_}]),l.push(()=>{E[P[0]]=P[1]})}u(E);continue;case sa:if(t[m])u(t[s]=t[m]);else{const A=new ua;n[m]=A,u(t[s]=A.promise)}continue;case la:const[,L,S]=h;let D=S&&nr&&nr[S]?new nr[S](L):new Error(L);t[s]=D,u(D);continue;case sl:u(t[s]=t[m]);continue;default:if(Array.isArray(a)){const A=[],P=h.slice(1);for(let _=0;_<P.length;_++){const y=P[_];i.push([y,M=>{A[_]=M}])}l.push(()=>{for(const _ of a){const y=_(h[0],...A);if(y){u(t[s]=y.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const c=[];t[s]=c;for(let m=0;m<h.length;m++){const g=h[m];g!==Ji&&i.push([g,R=>{c[m]=R}])}u(c);continue}else{const c={};t[s]=c;for(const m of Object.keys(h).reverse()){const g=[];i.push([h[m],R=>{g[1]=R}]),i.push([Number(m.slice(1)),R=>{g[0]=R}]),l.push(()=>{c[g[0]]=g[1]})}u(c);continue}}for(;l.length>0;)l.pop()();return o}async function cl(e,t){const{plugins:r}=t??{},n=new ua,a=e.pipeThrough(ul()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await dl.call(o,a);let l=n.promise;return i.done?n.resolve():l=fl.call(o,a).then(n.resolve).catch(s=>{for(const u of Object.values(o.deferred))u.reject(s);n.reject(s)}),{done:l.then(()=>a.closed),value:i.value}}async function dl(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:hr.call(this,r)}}async function fl(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case sa:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=hr.call(this,l);o.resolve(s);break}case la:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=hr.call(this,l);o.reject(s);break}default:throw new SyntaxError}t=await e.read()}}async function hl(e){let t={signal:e.signal};if(e.method!=="GET"){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var ml={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},pl=/[&><\u2028\u2029]/g;function mr(e){return e.replace(pl,t=>ml[t])}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var pr=Symbol("SingleFetchRedirect"),ca=class extends Error{},yl=202,vl=new Set([100,101,204,205]);function Es(e,t,r,n,a,o){let i=gl(e,l=>{let s=t.routes[l.route.id];we(s,"Route not found in manifest");let u=r[l.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(u!=null&&u.shouldRevalidate)}},Cl,n,a,o);return async l=>l.runClientMiddleware(i)}function gl(e,t,r,n,a,o,i=()=>!0){return async l=>{let{request:s,matches:u,fetcherKey:h}=l,c=e();if(s.method!=="GET")return wl(l,r,a,o);let m=u.some(g=>{let{hasLoader:R,hasClientLoader:b}=t(g);return g.shouldCallHandler()&&R&&!b});return!n&&!m?El(l,t,r,a,o):h?Sl(l,r,a,o):Rl(l,c,t,r,n,a,o,i)}}async function wl(e,t,r,n){let a=e.matches.find(l=>l.shouldCallHandler());we(a,"No action match found");let o,i=await a.resolve(async l=>await l(async()=>{let{data:u,status:h}=await t(e,r,n,[a.route.id]);return o=h,mt(u,a.route.id)}));return kt(i.result)||Ve(i.result)||cr(i.result)?{[a.route.id]:i}:{[a.route.id]:{type:i.type,result:Co(i.result,o)}}}async function El(e,t,r,n,a){let o=e.matches.filter(l=>l.shouldCallHandler()),i={};return await Promise.all(o.map(l=>l.resolve(async s=>{try{let{hasClientLoader:u}=t(l),h=l.route.id,c=u?await s(async()=>{let{data:m}=await r(e,n,a,[h]);return mt(m,h)}):await s();i[l.route.id]={type:"data",result:c}}catch(u){i[l.route.id]={type:"error",result:u}}}))),i}async function Rl(e,t,r,n,a,o,i,l=()=>!0){let s=new Set,u=!1,h=e.matches.map(()=>Cn()),c=Cn(),m={},g=Promise.all(e.matches.map(async(b,E)=>b.resolve(async L=>{h[E].resolve();let S=b.route.id,{hasLoader:D,hasClientLoader:A,hasShouldRevalidate:P}=r(b),_=!b.shouldRevalidateArgs||b.shouldRevalidateArgs.actionStatus==null||b.shouldRevalidateArgs.actionStatus<400;if(!b.shouldCallHandler(_)){u||(u=b.shouldRevalidateArgs!=null&&D&&P===!0);return}if(l(b)&&A){D&&(u=!0);try{let M=await L(async()=>{let{data:F}=await n(e,o,i,[S]);return mt(F,S)});m[S]={type:"data",result:M}}catch(M){m[S]={type:"error",result:M}}return}D&&s.add(S);try{let M=await L(async()=>{let F=await c.promise;return mt(F,S)});m[S]={type:"data",result:M}}catch(M){m[S]={type:"error",result:M}}})));if(await Promise.all(h.map(b=>b.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let b=a&&u&&s.size>0?[...s.keys()]:void 0;try{let E=await n(e,o,i,b);c.resolve(E.data)}catch(E){c.reject(E)}}return await g,await bl(c.promise,e.matches,s,m),m}async function bl(e,t,r,n){var a;try{let o,i=await e;if("routes"in i){for(let l of t)if(l.route.id in i.routes){let s=i.routes[l.route.id];if("error"in s){o=s.error,((a=n[l.route.id])==null?void 0:a.result)==null&&(n[l.route.id]={type:"error",result:o});break}}}o!==void 0&&Array.from(r.values()).forEach(l=>{n[l].result instanceof ca&&(n[l].result=o)})}catch{}}async function Sl(e,t,r,n){let a=e.matches.find(l=>l.shouldCallHandler());we(a,"No fetcher match found");let o=a.route.id,i=await a.resolve(async l=>l(async()=>{let{data:s}=await t(e,r,n,[o]);return mt(s,o)}));return{[a.route.id]:i}}function xl(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}function da(e,t,r,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:a.pathname==="/"?a.pathname=`_root.${n}`:t&&be(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${n}`,a}async function Cl(e,t,r,n){let{request:a}=e,o=da(a.url,t,r,"data");a.method==="GET"&&(o=xl(o),n&&o.searchParams.set("_routes",n.join(",")));let i=await fetch(o,await hl(a));if(i.status>=400&&!i.headers.has("X-Remix-Response"))throw new je(i.status,i.statusText,await i.text());if(i.status===204&&i.headers.has("X-Remix-Redirect"))return{status:yl,data:{redirect:{redirect:i.headers.get("X-Remix-Redirect"),status:Number(i.headers.get("X-Remix-Status")||"302"),revalidate:i.headers.get("X-Remix-Revalidate")==="true",reload:i.headers.get("X-Remix-Reload-Document")==="true",replace:i.headers.get("X-Remix-Replace")==="true"}}};if(vl.has(i.status)){let l={};return n&&a.method!=="GET"&&(l[n[0]]={data:void 0}),{status:i.status,data:{routes:l}}}we(i.body,"No response body to decode");try{let l=await Ll(i.body,window),s;if(a.method==="GET"){let u=l.value;pr in u?s={redirect:u[pr]}:s={routes:u}}else{let u=l.value,h=n==null?void 0:n[0];we(h,"No routeId found for single fetch call decoding"),"redirect"in u?s={redirect:u}:s={routes:{[h]:u}}}return{status:i.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function Ll(e,t){return cl(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,o,i]=n,l=Error;a&&a in t&&typeof t[a]=="function"&&(l=t[a]);let s=new l(o);return s.stack=i,{value:s}}if(r==="ErrorResponse"){let[a,o,i]=n;return{value:new je(o,i,a)}}if(r==="SingleFetchRedirect")return{value:{[pr]:n[0]}};if(r==="SingleFetchClassInstance")return{value:n[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function mt(e,t){if("redirect"in e){let{redirect:n,revalidate:a,reload:o,replace:i,status:l}=e.redirect;throw Lo(n,{status:l,headers:{...a?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...i?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new ca(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function Cn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function fa(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Pl(e,t,r){let n=e.map(o=>{var s;let i=t[o.route.id],l=r.routes[o.route.id];return[l&&l.css?l.css.map(u=>({rel:"stylesheet",href:u})):[],((s=i==null?void 0:i.links)==null?void 0:s.call(i))||[]]}).flat(2),a=_r(e,r);return ya(n,a)}function ha(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Tl(e){if(!e.css)return;let t=ha(e);await Promise.all(t.map(pa))}async function ma(e,t){if(!e.css&&!t.links||!Il())return;let r=[];if(e.css&&r.push(...ha(e)),t.links&&r.push(...t.links()),r.length===0)return;let n=[];for(let a of r)!Mr(a)&&a.rel==="stylesheet"&&n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(pa))}async function pa(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");Object.assign(r,e);function n(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function Mr(e){return e!=null&&typeof e.page=="string"}function Ml(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function _l(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let i=await fa(o,r);return i.links?i.links():[]}return[]}));return ya(n.flat(1).filter(Ml).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Ln(e,t,r,n,a,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>{var h;return r[u].pathname!==s.pathname||((h=r[u].route.path)==null?void 0:h.endsWith("*"))&&r[u].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{var c;let h=n.routes[s.route.id];if(!h||!h.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let m=s.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((c=r[0])==null?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function _r(e,t,{includeHydrateFallback:r}={}){return Dl(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function Dl(e){return[...new Set(e)]}function Ol(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function ya(e,t){let r=new Set,n=new Set(t);return e.reduce((a,o)=>{if(t&&!Mr(o)&&o.as==="script"&&o.href&&n.has(o.href))return a;let l=JSON.stringify(Ol(o));return r.has(l)||(r.add(l),a.push({key:l,link:o})),a},[])}var Tt;function Il(){if(Tt!==void 0)return Tt;let e=document.createElement("link");return Tt=e.relList.supports("preload"),e=null,Tt}function Al(){return f.createElement(yr,{title:"Loading...",renderScripts:!0},f.createElement("script",{dangerouslySetInnerHTML:{__html:`
31
- console.log(
32
- "💿 Hey developer 👋. You can provide a way better UX than this " +
33
- "when your app is loading JS modules and/or running \`clientLoader\` " +
34
- "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
35
- "for more information."
36
- );
37
- `}}))}function va(e){let t={};return Object.values(e).forEach(r=>{if(r){let n=r.parentId||"";t[n]||(t[n]=[]),t[n].push(r)}}),t}function Fl(e,t,r){let n=ga(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Al:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>f.createElement(Ra,{error:oa()}):void 0;return e.id==="root"&&t.Layout?{...n?{element:f.createElement(t.Layout,null,f.createElement(n,null))}:{Component:n},...o?{errorElement:f.createElement(t.Layout,null,f.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:f.createElement(t.Layout,null,f.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function Rs(e,t,r,n,a,o){return Dr(t,r,n,a,o,"",va(t),e)}function Mt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let n=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(n),new je(400,"Bad Request",new Error(n),!0)}}function ar(e,t){let r=e==="clientAction"?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new je(405,"Method Not Allowed",new Error(n),!0)}function Dr(e,t,r,n,a,o="",i=va(e),l){return(i[o]||[]).map(s=>{var S,D,A;let u=t[s.id];function h(P){return we(typeof P=="function","No single fetch function available for route handler"),P()}function c(P){return s.hasLoader?h(P):Promise.resolve(null)}function m(P){if(!s.hasAction)throw ar("action",s.id);return h(P)}function g(P){import(P)}function R(P){P.clientActionModule&&g(P.clientActionModule),P.clientLoaderModule&&g(P.clientLoaderModule)}async function b(P){let _=t[s.id],y=_?ma(s,_):Promise.resolve();try{return P()}finally{await y}}let E={id:s.id,index:s.index,path:s.path};if(u){Object.assign(E,{...E,...Fl(s,u,a),middleware:u.clientMiddleware,handle:u.handle,shouldRevalidate:Pn(E.path,u,s,n,l)});let P=r&&r.loaderData&&s.id in r.loaderData,_=P?(S=r==null?void 0:r.loaderData)==null?void 0:S[s.id]:void 0,y=r&&r.errors&&s.id in r.errors,M=y?(D=r==null?void 0:r.errors)==null?void 0:D[s.id]:void 0,F=l==null&&(((A=u.clientLoader)==null?void 0:A.hydrate)===!0||!s.hasLoader);E.loader=async({request:J,params:K,context:ae,unstable_pattern:le},Q)=>{try{return await b(async()=>(we(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:J,params:K,context:ae,unstable_pattern:le,async serverLoader(){if(Mt("loader",s),F){if(P)return _;if(y)throw M}return c(Q)}}):c(Q)))}finally{F=!1}},E.loader.hydrate=kl(s.id,u.clientLoader,s.hasLoader,a),E.action=({request:J,params:K,context:ae,unstable_pattern:le},Q)=>b(async()=>{if(we(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(a)throw ar("clientAction",s.id);return m(Q)}return u.clientAction({request:J,params:K,context:ae,unstable_pattern:le,async serverAction(){return Mt("action",s),m(Q)}})})}else{s.hasClientLoader||(E.loader=(y,M)=>b(()=>c(M))),s.hasClientAction||(E.action=(y,M)=>b(()=>{if(a)throw ar("clientAction",s.id);return m(M)}));let P;async function _(){return P?await P:(P=(async()=>{(s.clientLoaderModule||s.clientActionModule)&&await new Promise(M=>setTimeout(M,0));let y=$l(s,t);return R(s),await y})(),await P)}E.lazy={loader:s.hasClientLoader?async()=>{let{clientLoader:y}=s.clientLoaderModule?await import(s.clientLoaderModule):await _();return we(y,"No `clientLoader` export found"),(M,F)=>y({...M,async serverLoader(){return Mt("loader",s),c(F)}})}:void 0,action:s.hasClientAction?async()=>{let y=s.clientActionModule?import(s.clientActionModule):_();R(s);let{clientAction:M}=await y;return we(M,"No `clientAction` export found"),(F,J)=>M({...F,async serverAction(){return Mt("action",s),m(J)}})}:void 0,middleware:s.hasClientMiddleware?async()=>{let{clientMiddleware:y}=s.clientMiddlewareModule?await import(s.clientMiddlewareModule):await _();return we(y,"No `clientMiddleware` export found"),y}:void 0,shouldRevalidate:async()=>{let y=await _();return Pn(E.path,y,s,n,l)},handle:async()=>(await _()).handle,Component:async()=>(await _()).Component,ErrorBoundary:s.hasErrorBoundary?async()=>(await _()).ErrorBoundary:void 0}}let L=Dr(e,t,r,n,a,s.id,i,l);return L.length>0&&(E.children=L),E})}function Pn(e,t,r,n,a){if(a)return Nl(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let o=e?An(e)[1].map(l=>l.paramName):[];const i=l=>o.some(s=>l.currentParams[s]!==l.nextParams[s]);if(t.shouldRevalidate){let l=t.shouldRevalidate;return s=>l({...s,defaultShouldRevalidate:i(s)})}else return l=>i(l)}return t.shouldRevalidate}function Nl(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function $l(e,t){let r=fa(e,t),n=Tl(e),a=await r;return await Promise.all([n,ma(e,a)]),{Component:ga(a),ErrorBoundary:a.ErrorBoundary,clientMiddleware:a.clientMiddleware,clientAction:a.clientAction,clientLoader:a.clientLoader,handle:a.handle,links:a.links,meta:a.meta,shouldRevalidate:a.shouldRevalidate}}function ga(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function kl(e,t,r,n){return n&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var At=new Set,jl=1e3,Nt=new Set,Ul=7680;function Or(e,t){return e.mode==="lazy"&&t===!0}function Hl({sri:e,...t},r){let n=new Set(r.state.matches.map(l=>l.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(l=>{let s=Ae(r.routes,l,r.basename);s&&s.forEach(u=>n.add(u.route.id))});let i=[...n].reduce((l,s)=>Object.assign(l,{[s]:t.routes[s]}),{});return{...t,routes:i,sri:e?!0:void 0}}function bs(e,t,r,n,a,o){if(Or(n,r))return async({path:i,patch:l,signal:s,fetcherKey:u})=>{Nt.has(i)||await wa([i],u?window.location.href:i,e,t,r,a,o,n.manifestPath,l,s)}}function Ss(e,t,r,n,a,o){f.useEffect(()=>{var h,c;if(!Or(a,n)||((c=(h=window.navigator)==null?void 0:h.connection)==null?void 0:c.saveData)===!0)return;function i(m){let g=m.tagName==="FORM"?m.getAttribute("action"):m.getAttribute("href");if(!g)return;let R=m.tagName==="A"?m.pathname:new URL(g,window.location.origin).pathname;Nt.has(R)||At.add(R)}async function l(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let m=Array.from(At.keys()).filter(g=>Nt.has(g)?(At.delete(g),!1):!0);if(m.length!==0)try{await wa(m,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(g){console.error("Failed to fetch manifest patches",g)}}let s=Wl(l,100);l();let u=new MutationObserver(()=>s());return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()},[n,o,t,r,e,a])}function zl(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var or="react-router-manifest-version";async function wa(e,t,r,n,a,o,i,l,s,u){const h=new URLSearchParams;h.set("paths",e.sort().join(",")),h.set("version",r.version);let c=new URL(zl(l,i),window.location.origin);if(c.search=h.toString(),c.toString().length>Ul){At.clear();return}let m;try{let E=await fetch(c,{signal:u});if(E.ok){if(E.status===204&&E.headers.has("X-Remix-Reload-Document")){if(!t){console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");return}try{if(sessionStorage.getItem(or)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(or,r.version)}catch{}window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(E.status>=400)throw new Error(await E.text())}else throw new Error(`${E.status} ${E.statusText}`);try{sessionStorage.removeItem(or)}catch{}m=await E.json()}catch(E){if(u!=null&&u.aborted)return;throw E}let g=new Set(Object.keys(r.routes)),R=Object.values(m).reduce((E,L)=>(L&&!g.has(L.id)&&(E[L.id]=L),E),{});Object.assign(r.routes,R),e.forEach(E=>Bl(E,Nt));let b=new Set;Object.values(R).forEach(E=>{E&&(!E.parentId||!R[E.parentId])&&b.add(E.parentId)}),b.forEach(E=>s(E||null,Dr(R,n,null,a,o,E)))}function Bl(e,t){if(t.size>=jl){let r=t.values().next().value;t.delete(r)}t.add(e)}function Wl(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function Ir(){let e=f.useContext(Je);return we(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ht(){let e=f.useContext(et);return we(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var zt=f.createContext(void 0);zt.displayName="FrameworkContext";function tt(){let e=f.useContext(zt);return we(e,"You must render this element inside a <HydratedRouter> element"),e}function Yl(e,t){let r=f.useContext(zt),[n,a]=f.useState(!1),[o,i]=f.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:h,onTouchStart:c}=t,m=f.useRef(null);f.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=L=>{L.forEach(S=>{i(S.isIntersecting)})},E=new IntersectionObserver(b,{threshold:.5});return m.current&&E.observe(m.current),()=>{E.disconnect()}}},[e]),f.useEffect(()=>{if(n){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[n]);let g=()=>{a(!0)},R=()=>{a(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:st(l,g),onBlur:st(s,R),onMouseEnter:st(u,g),onMouseLeave:st(h,R),onTouchStart:st(c,g)}]:[!1,m,{}]}function st(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Ar(e,t,r){if(r&&!$t)return[e[0]];if(t){let n=e.findIndex(a=>t[a.route.id]!==void 0);return e.slice(0,n+1)}return e}var Tn="data-react-router-critical-css";function xs({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:n,routeModules:a,criticalCss:o}=tt(),{errors:i,matches:l}=Ht(),s=Ar(l,i,r),u=f.useMemo(()=>Pl(s,a,n),[s,a,n]);return f.createElement(f.Fragment,null,typeof o=="string"?f.createElement("style",{[Tn]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o=="object"?f.createElement("link",{[Tn]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,u.map(({key:h,link:c})=>Mr(c)?f.createElement(Ea,{key:h,nonce:e,...c,crossOrigin:c.crossOrigin??t}):f.createElement("link",{key:h,nonce:e,...c,crossOrigin:c.crossOrigin??t})))}function Ea({page:e,...t}){let{router:r}=Ir(),n=f.useMemo(()=>Ae(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?f.createElement(Jl,{page:e,matches:n,...t}):null}function Vl(e){let{manifest:t,routeModules:r}=tt(),[n,a]=f.useState([]);return f.useEffect(()=>{let o=!1;return _l(e,t,r).then(i=>{o||a(i)}),()=>{o=!0}},[e,t,r]),n}function Jl({page:e,matches:t,...r}){let n=Le(),{future:a,manifest:o,routeModules:i}=tt(),{basename:l}=Ir(),{loaderData:s,matches:u}=Ht(),h=f.useMemo(()=>Ln(e,t,u,o,n,"data"),[e,t,u,o,n]),c=f.useMemo(()=>Ln(e,t,u,o,n,"assets"),[e,t,u,o,n]),m=f.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let b=new Set,E=!1;if(t.forEach(S=>{var A;let D=o.routes[S.route.id];!D||!D.hasLoader||(!h.some(P=>P.route.id===S.route.id)&&S.route.id in s&&((A=i[S.route.id])!=null&&A.shouldRevalidate)||D.hasClientLoader?E=!0:b.add(S.route.id))}),b.size===0)return[];let L=da(e,l,a.unstable_trailingSlashAwareDataRequests,"data");return E&&b.size>0&&L.searchParams.set("_routes",t.filter(S=>b.has(S.route.id)).map(S=>S.route.id).join(",")),[L.pathname+L.search]},[l,a.unstable_trailingSlashAwareDataRequests,s,n,o,h,t,e,i]),g=f.useMemo(()=>_r(c,o),[c,o]),R=Vl(c);return f.createElement(f.Fragment,null,m.map(b=>f.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),g.map(b=>f.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),R.map(({key:b,link:E})=>f.createElement("link",{key:b,nonce:r.nonce,...E,crossOrigin:E.crossOrigin??r.crossOrigin})))}function Cs(){let{isSpaMode:e,routeModules:t}=tt(),{errors:r,matches:n,loaderData:a}=Ht(),o=Le(),i=Ar(n,r,e),l=null;r&&(l=r[i[i.length-1].route.id]);let s=[],u=null,h=[];for(let c=0;c<i.length;c++){let m=i[c],g=m.route.id,R=a[g],b=m.params,E=t[g],L=[],S={id:g,data:R,loaderData:R,meta:[],params:m.params,pathname:m.pathname,handle:m.route.handle,error:l};if(h[c]=S,E!=null&&E.meta?L=typeof E.meta=="function"?E.meta({data:R,loaderData:R,params:b,location:o,matches:h,error:l}):Array.isArray(E.meta)?[...E.meta]:E.meta:u&&(L=[...u]),L=L||[],!Array.isArray(L))throw new Error("The route at "+m.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
38
-
39
- To reference the meta function API, see https://remix.run/route/meta`);S.meta=L,h[c]=S,s=[...L],u=s}return f.createElement(f.Fragment,null,s.flat().map(c=>{if(!c)return null;if("tagName"in c){let{tagName:m,...g}=c;if(!Gl(m))return console.warn(`A meta object uses an invalid tagName: ${m}. Expected either 'link' or 'meta'`),null;let R=m;return f.createElement(R,{key:JSON.stringify(g),...g})}if("title"in c)return f.createElement("title",{key:"title"},String(c.title));if("charset"in c&&(c.charSet??(c.charSet=c.charset),delete c.charset),"charSet"in c&&c.charSet!=null)return typeof c.charSet=="string"?f.createElement("meta",{key:"charSet",charSet:c.charSet}):null;if("script:ld+json"in c)try{let m=JSON.stringify(c["script:ld+json"]);return f.createElement("script",{key:`script:ld+json:${m}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:mr(m)}})}catch{return null}return f.createElement("meta",{key:JSON.stringify(c),...c})}))}function Gl(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var $t=!1;function Kl(){$t=!0}function Xl(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:i}=tt(),{router:l,static:s,staticContext:u}=Ir(),{matches:h}=Ht(),c=Qn(),m=Or(o,i);a&&(a.didRenderScripts=!0);let g=Ar(h,null,n);f.useEffect(()=>{Kl()},[]);let R=f.useMemo(()=>{var A;if(c)return null;let S=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",D=s?`${(A=t.hmr)!=null&&A.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${m?"":`import ${JSON.stringify(t.url)}`};
40
- ${g.map((P,_)=>{let y=`route${_}`,M=t.routes[P.route.id];we(M,`Route ${P.route.id} not found in manifest`);let{clientActionModule:F,clientLoaderModule:J,clientMiddlewareModule:K,hydrateFallbackModule:ae,module:le}=M,Q=[...F?[{module:F,varName:`${y}_clientAction`}]:[],...J?[{module:J,varName:`${y}_clientLoader`}]:[],...K?[{module:K,varName:`${y}_clientMiddleware`}]:[],...ae?[{module:ae,varName:`${y}_HydrateFallback`}]:[],{module:le,varName:`${y}_main`}];if(Q.length===1)return`import * as ${y} from ${JSON.stringify(le)};`;let ue=Q.map(ee=>`import * as ${ee.varName} from "${ee.module}";`).join(`
41
- `),X=`const ${y} = {${Q.map(ee=>`...${ee.varName}`).join(",")}};`;return[ue,X].join(`
42
- `)}).join(`
43
- `)}
44
- ${m?`window.__reactRouterManifest = ${JSON.stringify(Hl(t,l),null,2)};`:""}
45
- window.__reactRouterRouteModules = {${g.map((P,_)=>`${JSON.stringify(P.route.id)}:route${_}`).join(",")}};
46
-
47
- import(${JSON.stringify(t.entry.module)});`:" ";return f.createElement(f.Fragment,null,f.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:S},type:void 0}),f.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:D},type:"module",async:!0}))},[]),b=$t||c?[]:ql(t.entry.imports.concat(_r(g,t,{includeHydrateFallback:!0}))),E=typeof t.sri=="object"?t.sri:{};return dr(!c,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),$t||c?null:f.createElement(f.Fragment,null,typeof t.sri=="object"?f.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:E})}}):null,m?null:f.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:E[t.url],suppressHydrationWarning:!0}),f.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:E[t.entry.module],suppressHydrationWarning:!0}),b.map(L=>f.createElement("link",{key:L,rel:"modulepreload",href:L,crossOrigin:e.crossOrigin,integrity:E[L],suppressHydrationWarning:!0})),R)}function ql(e){return[...new Set(e)]}function Ql(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Ls=class extends f.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?f.createElement(Ra,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Ra({error:e,isOutsideRemixApp:t}){console.error(e);let r=f.createElement("script",{dangerouslySetInnerHTML:{__html:`
48
- console.log(
49
- "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
50
- );
51
- `}});if(Ve(e))return f.createElement(yr,{title:"Unhandled Thrown Response!"},f.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return f.createElement(yr,{title:"Application Error!",isOutsideRemixApp:t},f.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),f.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function yr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var o;let{routeModules:a}=tt();return(o=a.root)!=null&&o.Layout&&!r?n:f.createElement("html",{lang:"en"},f.createElement("head",null,f.createElement("meta",{charSet:"utf-8"}),f.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),f.createElement("title",null,e)),f.createElement("body",null,f.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?f.createElement(Xl,null):null)))}var Zl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Zl&&(window.__reactRouterVersion="7.13.0")}catch{}var ba=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sa=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:l,target:s,to:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R){let{basename:b,unstable_useTransitions:E}=f.useContext(Ee),L=typeof u=="string"&&ba.test(u),S=kn(u,b);u=S.to;let D=hi(u,{relative:a}),[A,P,_]=Yl(n,g),y=rs(u,{replace:i,state:l,target:s,preventScrollReset:h,relative:a,viewTransition:c,unstable_defaultShouldRevalidate:m,unstable_useTransitions:E});function M(J){t&&t(J),J.defaultPrevented||y(J)}let F=f.createElement("a",{...g,..._,href:S.absoluteURL||D,onClick:S.isExternal||o?t:M,ref:Ql(R,P),target:s,"data-discover":!L&&r==="render"?"true":void 0});return A&&!L?f.createElement(f.Fragment,null,F,f.createElement(Ea,{page:D})):F});Sa.displayName="Link";var es=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:l,children:s,...u},h){let c=vt(i,{relative:u.relative}),m=Le(),g=f.useContext(et),{navigator:R,basename:b}=f.useContext(Ee),E=g!=null&&ss(c)&&l===!0,L=R.encodeLocation?R.encodeLocation(c).pathname:c.pathname,S=m.pathname,D=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(S=S.toLowerCase(),D=D?D.toLowerCase():null,L=L.toLowerCase()),D&&b&&(D=be(D,b)||D);const A=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let P=S===L||!a&&S.startsWith(L)&&S.charAt(A)==="/",_=D!=null&&(D===L||!a&&D.startsWith(L)&&D.charAt(L.length)==="/"),y={isActive:P,isPending:_,isTransitioning:E},M=P?t:void 0,F;typeof n=="function"?F=n(y):F=[n,P?"active":null,_?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let J=typeof o=="function"?o(y):o;return f.createElement(Sa,{...u,"aria-current":M,className:F,ref:h,style:J,to:i,viewTransition:l},typeof s=="function"?s(y):s)});es.displayName="NavLink";var xa=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=Ot,action:l,onSubmit:s,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R)=>{let{unstable_useTransitions:b}=f.useContext(Ee),E=Pa(),L=os(l,{relative:u}),S=i.toLowerCase()==="get"?"get":"post",D=typeof l=="string"&&ba.test(l),A=P=>{if(s&&s(P),P.defaultPrevented)return;P.preventDefault();let _=P.nativeEvent.submitter,y=(_==null?void 0:_.getAttribute("formmethod"))||i,M=()=>E(_||P.currentTarget,{fetcherKey:t,method:y,navigate:r,replace:a,state:o,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m});b&&r!==!1?f.startTransition(()=>M()):M()};return f.createElement("form",{ref:R,method:S,action:L,onSubmit:n?s:A,...g,"data-discover":!D&&e==="render"?"true":void 0})});xa.displayName="Form";function ts({getKey:e,storageKey:t,...r}){let n=f.useContext(zt),{basename:a}=f.useContext(Ee),o=Le(),i=Tr();is({getKey:e,storageKey:t});let l=f.useMemo(()=>{if(!n||!e)return null;let u=gr(o,i,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let s=((u,h)=>{if(!window.history.state||!window.history.state.key){let c=Math.random().toString(32).slice(2);window.history.replaceState({key:c},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[h||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(u)}}).toString();return f.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${mr(JSON.stringify(t||vr))}, ${mr(JSON.stringify(l))})`}})}ts.displayName="ScrollRestoration";function Ca(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bt(e){let t=f.useContext(Je);return W(t,Ca(e)),t}function La(e){let t=f.useContext(et);return W(t,Ca(e)),t}function rs(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l,unstable_useTransitions:s}={}){let u=ra(),h=Le(),c=vt(e,{relative:o});return f.useCallback(m=>{if(zi(m,t)){m.preventDefault();let g=r!==void 0?r:Me(h)===Me(c),R=()=>u(e,{replace:g,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l});s?f.startTransition(()=>R()):R()}},[h,u,c,r,n,t,e,a,o,i,l,s])}function Ps(e){oe(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=f.useRef(fr(e)),r=f.useRef(!1),n=Le(),a=f.useMemo(()=>Bi(n.search,r.current?null:t.current),[n.search]),o=ra(),i=f.useCallback((l,s)=>{const u=fr(typeof l=="function"?l(new URLSearchParams(a)):l);r.current=!0,o("?"+u,s)},[o,a]);return[a,i]}var ns=0,as=()=>`__${String(++ns)}__`;function Pa(){let{router:e}=Bt("useSubmit"),{basename:t}=f.useContext(Ee),r=Ci(),n=e.fetch,a=e.navigate;return f.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:h,body:c}=Vi(o,t);if(i.navigate===!1){let m=i.fetcherKey||as();await n(m,r,i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await a(i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function os(e,{relative:t}={}){let{basename:r}=f.useContext(Ee),n=f.useContext(Ce);W(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...vt(e||".",{relative:t})},i=Le();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(h=>h==="")){l.delete("index"),s.filter(c=>c).forEach(c=>l.append("index",c));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Te([r,o.pathname])),Me(o)}function Ts({key:e}={}){var P;let{router:t}=Bt("useFetcher"),r=La("useFetcher"),n=f.useContext(Cr),a=f.useContext(Ce),o=(P=a.matches[a.matches.length-1])==null?void 0:P.route.id;W(n,"useFetcher must be used inside a FetchersContext"),W(a,"useFetcher must be used inside a RouteContext"),W(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=f.useId(),[l,s]=f.useState(e||i);e&&e!==l&&s(e);let{deleteFetcher:u,getFetcher:h,resetFetcher:c,fetch:m}=t;f.useEffect(()=>(h(l),()=>u(l)),[u,h,l]);let g=f.useCallback(async(_,y)=>{W(o,"No routeId available for fetcher.load()"),await m(l,o,_,y)},[l,o,m]),R=Pa(),b=f.useCallback(async(_,y)=>{await R(_,{...y,navigate:!1,fetcherKey:l})},[l,R]),E=f.useCallback(_=>c(l,_),[c,l]),L=f.useMemo(()=>{let _=f.forwardRef((y,M)=>f.createElement(xa,{...y,navigate:!1,fetcherKey:l,ref:M}));return _.displayName="fetcher.Form",_},[l]),S=r.fetchers.get(l)||zn,D=n.get(l);return f.useMemo(()=>({Form:L,submit:b,load:g,reset:E,...S,data:D}),[L,b,g,E,S,D])}var vr="react-router-scroll-positions",_t={};function gr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:be(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function is({getKey:e,storageKey:t}={}){let{router:r}=Bt("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=La("useScrollRestoration"),{basename:o}=f.useContext(Ee),i=Le(),l=Tr(),s=Li();f.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),ls(f.useCallback(()=>{if(s.state==="idle"){let u=gr(i,l,o,e);_t[u]=window.scrollY}try{sessionStorage.setItem(t||vr,JSON.stringify(_t))}catch(u){oe(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(f.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||vr);u&&(_t=JSON.parse(u))}catch{}},[t]),f.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(_t,()=>window.scrollY,e?(h,c)=>gr(h,c,o,e):void 0);return()=>u&&u()},[r,o,e]),f.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{oe(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function ls(e,t){let{capture:r}={};f.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function ss(e,{relative:t}={}){let r=f.useContext(xr);W(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Bt("useViewTransitionState"),a=vt(e,{relative:t});if(!r.isTransitioning)return!1;let o=be(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=be(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Ft(a.pathname,i)!=null||Ft(a.pathname,o)!=null}export{Rs as A,ps as B,ys as C,xs as D,je as E,zt as F,Xl as G,Ya as H,us as I,Sa as L,Cs as M,vl as N,gs as O,Xa as R,ts as S,ra as a,Ps as b,Ts as c,Le as d,Ti as e,hs as f,ms as g,Ka as h,vi as i,cs as j,Ve as k,W as l,Ae as m,Ss as n,Ls as o,vs as p,Ll as q,f as r,kl as s,Dr as t,Pi as u,fs as v,ws as w,bs as x,Es as y,ds as z};
@@ -1,21 +0,0 @@
1
- import{r as s}from"./chunk-JZWAC4HX-DB3aFuEO.js";/**
2
- * @license lucide-react v0.556.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const C=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=w(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
7
- * @license lucide-react v0.556.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */var h={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
12
- * @license lucide-react v0.556.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const g=s.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:u,...c},p)=>s.createElement("svg",{ref:p,...h,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",n),...!a&&!f(c)&&{"aria-hidden":"true"},...c},[...u.map(([m,d])=>s.createElement(m,d)),...Array.isArray(a)?a:[a]]));/**
17
- * @license lucide-react v0.556.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const b=(t,e)=>{const r=s.forwardRef(({className:o,...n},a)=>s.createElement(g,{ref:a,iconNode:e,className:l(`lucide-${C(i(t))}`,`lucide-${t}`,o),...n}));return r.displayName=i(t),r};export{b as c};
@@ -1 +0,0 @@
1
- import{w as t,c as r,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{S as i}from"./ScenarioViewer-BX2Ny2Qj.js";import{W as n}from"./InteractivePreview-yjIHlOGa.js";import"./useCustomSizes-BqgrAzs3.js";import"./LogViewer-kgBTLoJD.js";import"./SafeScreenshot-CwZrv-Ok.js";import"./useLastLogLine-DAFqfEDH.js";import"./InlineSpinner-EhOseatT.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-BzPgx-xO.js";import"./createLucideIcon-D1zB-pYc.js";import"./circle-check-igfMr5DY.js";import"./triangle-alert-CAD5b1o_.js";import"./copy-Coc4o_8c.js";import"./scenarioStatus-B_8jpV3e.js";const y=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],w=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#F8F7F6] flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("h1",{className:"text-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{w as default,y as meta};
@@ -1,6 +0,0 @@
1
- import{w as Y,u as q,a as G,b as J,r as l,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as O,S as P,I as $}from"./InlineSpinner-EhOseatT.js";import{u as Q}from"./useLastLogLine-DAFqfEDH.js";import{u as X,V as Z,S as ee}from"./useCustomSizes-BqgrAzs3.js";import{c as te}from"./cy-logo-cli-DcX-ZS3p.js";const b=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],de=Y(function(){const{entity:i,scenario:s,analysis:r,projectSlug:m}=q(),u=G();J();const[ne,w]=l.useState(null),[_,N]=l.useState(1440),[a,g]=l.useState({name:"Desktop",width:1440,height:900}),[z,p]=l.useState(!1),[f,B]=l.useState(null),{customSizes:S,addCustomSize:D}=X(m),x=l.useMemo(()=>[...b,...S],[S]),{interactiveServerUrl:y,isStarting:k,isLoading:C,showIframe:I,iframeKey:W,onIframeLoad:E}=O({analysisId:r==null?void 0:r.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:m,enabled:!0}),{lastLine:h}=Q(m,k||C),U=()=>{u(`/entity/${i.sha}`)},V=(t,n)=>{N(t);const o=x.find(M=>M.width===t&&M.height===n);w(o||null),g({name:(o==null?void 0:o.name)||"Custom",width:t,height:n})},L=t=>{w(t),N(t.width),g({name:t.name,width:t.width,height:t.height})},R=t=>{D(t,a.width,a.height??900),p(!1),g(n=>({...n,name:t}))},c=((r==null?void 0:r.scenarios)||[]).filter(t=>{var n;return!((n=t.metadata)!=null&&n.sameAsDefault)}),d=c.findIndex(t=>t.id===(s==null?void 0:s.id)),H=d+1,T=c.length,v=d>0,j=d<c.length-1,A=()=>{if(v){const t=c[d-1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},F=()=>{if(j){const t=c[d+1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},K=k||C||!I;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:te,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:i.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:A,disabled:!v,className:`${v?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[H,"/",T]}),e.jsx("button",{onClick:F,disabled:!j,className:`${j?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]})]}),e.jsx("button",{onClick:U,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close fullscreen",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${b[b.length-1].width}px`,width:"100%"},children:e.jsx(Z,{currentViewportWidth:_,currentPresetName:a.name,onDevicePresetClick:L,devicePresets:x,hideLabel:!0,onHoverChange:B,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(f==null?void 0:f.name)||a.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:a.name,onChange:t=>{const n=x.find(o=>o.name===t.target.value);n&&L(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[x.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),a.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:a.width,onChange:t=>{const n=parseInt(t.target.value,10);!isNaN(n)&&n>0&&V(n,a.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"×"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:a.height??900}),a.name==="Custom"&&e.jsx("button",{onClick:()=>p(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",style:{backgroundImage:`
2
- linear-gradient(45deg, #ebebeb 25%, transparent 25%),
3
- linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
4
- linear-gradient(45deg, transparent 75%, #ebebeb 75%),
5
- linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
6
- `,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:y?e.jsxs("div",{className:"relative bg-white w-full h-full",style:{maxWidth:`${a.width}px`,maxHeight:`${a.height}px`},children:[K&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),e.jsx("iframe",{src:y,className:"w-full h-full border-none",title:`Interactive preview: ${s==null?void 0:s.name}`,onLoad:E,style:{opacity:I?1:0}},W)]}):e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 w-[500px] h-[300px] bg-white rounded-lg p-8 shadow-sm",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),z&&e.jsx(ee,{width:a.width,height:a.height??900,onSave:R,onCancel:()=>p(!1)})]})});export{de as default};
@@ -1,6 +0,0 @@
1
- import{r as a,j as e,w as Z,u as ee,a as te,L as v}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{W as se,u as re,I as ae}from"./InteractivePreview-yjIHlOGa.js";import{u as ne}from"./InlineSpinner-EhOseatT.js";import{c as oe}from"./executionFlowCoverage-BWhdfn70.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-DAFqfEDH.js";function ie({executionFlows:t,selections:r,onChange:n,disabled:i=!1}){const x=a.useCallback(s=>r.some(o=>o.flowId===s),[r]),p=a.useCallback(s=>{x(s.id)?n(r.filter(o=>o.flowId!==s.id)):n([...r,{flowId:s.id,flowName:s.name}])},[r,n,x]);return t.length===0?e.jsx("div",{className:"text-sm text-gray-500 py-2",children:"No execution flows found."}):e.jsx("div",{className:"space-y-3",children:t.map(s=>{const o=x(s.id),I=s.usedInScenarios.length>0;return e.jsxs("div",{className:"border-b border-gray-100 pb-3 last:border-0 last:pb-0",children:[e.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:()=>p(s),disabled:i,className:"mt-0.5 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-mono text-sm font-medium text-gray-900",children:s.name}),!I&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-amber-100 text-amber-700 rounded",children:"uncovered"}),s.blocksOtherFlows&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-purple-100 text-purple-700 rounded",children:"blocking"}),s.impact==="high"&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-red-100 text-red-700 rounded",children:"high impact"})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 m-0",children:s.description})]})]}),o&&s.requiredValues.length>0&&e.jsxs("div",{className:"ml-6 mt-2 p-2 bg-gray-50 rounded text-xs",children:[e.jsx("span",{className:"text-gray-700 font-medium",children:"Required values:"}),e.jsx("ul",{className:"m-0 mt-1 pl-4 space-y-0.5",children:s.requiredValues.map((h,E)=>e.jsxs("li",{className:"text-gray-600",children:[e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.attributePath})," ",e.jsx("span",{className:"text-gray-400",children:h.comparison})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.value})]},E))})]})]},s.id)})})}const he=({data:t})=>[{title:t!=null&&t.entity?`Create Scenario - ${t.entity.name} - CodeYam`:"Create Scenario - CodeYam"},{name:"description",content:"Create a new scenario"}];function ce(){var W;const{analysis:t,defaultScenario:r,entity:n,entitySha:i,projectSlug:x}=ee(),p=te(),{iframeRef:s}=re(),[o,I]=a.useState(""),[h,E]=a.useState(400),[b,P]=a.useState(!1),[U,R]=a.useState(!1),[G,$]=a.useState(!1),[M,L]=a.useState(null),[F,l]=a.useState(null),[d,H]=a.useState([]),D=a.useMemo(()=>{var c;return!((c=t==null?void 0:t.metadata)!=null&&c.executionFlows)||!(t!=null&&t.scenarios)?[]:oe(t.metadata.executionFlows,t.scenarios).executionFlows},[t]),{interactiveServerUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V}=ne({analysisId:t==null?void 0:t.id,scenarioId:r==null?void 0:r.id,scenarioName:r==null?void 0:r.name,projectSlug:x,enabled:!0}),Y=a.useCallback(async()=>{var m,c,T,z;if(!o.trim()&&d.length===0){L("Please describe how you want to change the scenario or select execution flows");return}R(!0),L(null),l("Generating scenario with AI...");try{const u=await fetch("/api/generate-scenario-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:o,existingScenarios:t.scenarios,scenariosDataStructure:(m=t.metadata)==null?void 0:m.scenariosDataStructure,flowSelections:d.length>0?d:void 0})}),N=await u.json();if(!u.ok||!N.success)throw new Error(N.error||"Failed to generate scenario data");console.log("[CreateScenario] AI generated scenario:",N.data);const g=N.data;if(!g.name||!g.data)throw new Error("AI response missing required fields (name or data)");l("Saving new scenario..."),$(!0);const X={name:g.name,description:g.description||o,metadata:{data:g.data,interactiveExamplePath:(c=r.metadata)==null?void 0:c.interactiveExamplePath}},Q=[...t.scenarios||[],X],O=await fetch("/api/save-scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({analysis:t,scenarios:Q})}),C=await O.json();if(!O.ok||!C.success)throw new Error(C.error||"Failed to save scenario");console.log("[CreateScenario] Scenario saved:",C);const f=(z=(T=C.analysis)==null?void 0:T.scenarios)==null?void 0:z.find(k=>k.name===g.name);if(!(f!=null&&f.id)){console.warn("[CreateScenario] Could not find saved scenario ID, navigating to entity page"),l("Scenario created! Redirecting..."),setTimeout(()=>void p(`/entity/${i}`),1e3);return}if(y){l("Capturing screenshot...");const k=await fetch("/api/capture-screenshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverUrl:y,scenarioId:f.id,projectId:t.projectId,viewportWidth:1440})}),A=await k.json();!k.ok||!A.success?(console.error("[CreateScenario] Capture failed:",A),l("Scenario created! (Screenshot capture failed)")):l("Scenario created and captured!")}else l("Scenario created!");setTimeout(()=>{p(`/entity/${i}/scenarios/${f.id}`)},1e3)}catch(u){console.error("[CreateScenario] Error:",u),L(u instanceof Error?u.message:String(u)),l(null)}finally{R(!1),$(!1)}},[o,d,t,r,i,y,p]),j=U||G,K=a.useCallback(()=>{P(!0)},[]),w=a.useCallback(m=>{if(!b)return;const c=m.clientX;c>=250&&c<=600&&E(c)},[b]),S=a.useCallback(()=>{P(!1)},[]);return a.useEffect(()=>(b?(document.addEventListener("mousemove",w),document.addEventListener("mouseup",S)):(document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)}),[b,w,S]),e.jsxs("div",{className:"h-screen bg-white flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-end h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 pb-[14px]",children:[e.jsx("button",{onClick:()=>void p(`/entity/${i}`),className:"no-underline shrink-0 bg-transparent border-none cursor-pointer p-0 flex items-center",title:"Back",children:e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h1",{className:"text-base font-semibold text-black m-0 leading-[20px] shrink-0",children:n==null?void 0:n.name}),e.jsx("span",{className:"text-xs text-[#9e9e9e] font-mono font-normal whitespace-nowrap overflow-hidden text-ellipsis min-w-0",title:n==null?void 0:n.filePath,children:n==null?void 0:n.filePath})]}),e.jsxs("div",{className:"flex items-end gap-8 shrink-0",children:[e.jsx(v,{to:`/entity/${i}/scenarios`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-medium border-b-2",style:{color:"#005C75",borderColor:"#005C75"},children:e.jsxs("span",{className:"flex items-center gap-2",children:["Scenarios",e.jsx("span",{className:"inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full bg-[#cbf3fa] text-[#005c75]",children:((W=t==null?void 0:t.scenarios)==null?void 0:W.length)||0})]})}),e.jsx(v,{to:`/entity/${i}/related`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Related Entities"}),e.jsx(v,{to:`/entity/${i}/code`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Code"}),e.jsx(v,{to:`/entity/${i}/data`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Data Structure"}),e.jsx(v,{to:`/entity/${i}/history`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"History"})]})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0 relative",children:[e.jsxs("aside",{className:"bg-white border-r border-gray-200 overflow-y-auto shrink-0 p-6 flex flex-col",style:{width:`${h}px`},children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Default Scenario Preview"}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"The preview on the right shows the Default Scenario. Select execution flows and/or describe how you'd like to change it."})]}),D.length>0&&e.jsxs("details",{className:"mb-4 border border-gray-200 rounded-lg",children:[e.jsxs("summary",{className:"px-3 py-2 text-sm font-medium text-gray-700 cursor-pointer hover:bg-gray-50 rounded-lg",children:["Select Execution Flows"," ",d.length>0&&e.jsxs("span",{className:"text-blue-600",children:["(",d.length," selected)"]})]}),e.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-gray-100",children:e.jsx(ie,{executionFlows:D,selections:d,onChange:H,disabled:j})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"prompt",className:"block text-sm font-medium text-gray-700 mb-2",children:"Describe your scenario"}),e.jsx("textarea",{id:"prompt",value:o,onChange:m=>I(m.target.value),placeholder:"e.g., Show an empty state with no items...",className:"w-full h-32 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-sm resize-none",disabled:j})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:()=>void Y(),disabled:j||!o.trim()&&d.length===0,className:"w-full px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium cursor-pointer transition-colors hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:j?"Creating...":"Create Scenario"}),F&&e.jsx("div",{className:"text-xs text-blue-600 bg-blue-50 px-2 py-1.5 rounded",children:F}),M&&e.jsx("div",{className:"text-xs text-red-600 bg-red-50 px-2 py-1.5 rounded",children:M})]})]}),e.jsxs("div",{onMouseDown:K,style:{width:"20px",position:"absolute",top:0,left:`${h-10}px`,bottom:0,cursor:"col-resize",touchAction:"none",userSelect:"none",zIndex:100,pointerEvents:"auto"},children:[e.jsx("div",{style:{position:"absolute",left:"10px",top:0,bottom:0,width:"1px",background:b?"#005c75":"rgba(0,0,0,0.1)",transition:"background 0.15s ease"}}),e.jsx("div",{style:{position:"absolute",top:"50%",left:"10px",transform:"translate(-50%, -50%)",width:"8px",height:"40px",background:"#fff",border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",cursor:"col-resize"}})]}),e.jsx("main",{className:"flex-1 overflow-auto flex items-center justify-center min-w-0",style:{backgroundImage:`
2
- linear-gradient(45deg, #ebebeb 25%, transparent 25%),
3
- linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
4
- linear-gradient(45deg, transparent 75%, #ebebeb 75%),
5
- linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
6
- `,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:e.jsx(ae,{scenarioId:r.id||r.name,scenarioName:r.name,iframeUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V,projectSlug:x,defaultWidth:1440,defaultHeight:900})})]})]})}const ge=Z(function(){return e.jsx(se,{children:e.jsx(ce,{})})});export{ge as default,he as meta};
@@ -1 +0,0 @@
1
- import{j as l}from"./chunk-JZWAC4HX-DB3aFuEO.js";function C(e){switch(e){case"queued":return{text:"Queued",bgColor:"#cbf3fa",textColor:"#3098b4",icon:l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3098b4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12,6 12,12 16,14"})]})};case"analyzing":return{text:"Analyzing...",bgColor:"#ffdbf6",textColor:"#ff2ab5",icon:l.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 9 9",fill:"none",className:"animate-spin",children:[l.jsx("circle",{cx:"4.5",cy:"4.5",r:"3.5",stroke:"#FFF4FC",strokeWidth:"1",fill:"none"}),l.jsx("path",{d:"M4.5 1C2.57 1 1 2.57 1 4.5C1 5.6 1.5 6.58 2.28 7.23",stroke:"#FF2AB5",strokeWidth:"1",strokeLinecap:"round",fill:"none"})]})};case"up-to-date":return{text:"Up to date",bgColor:"#e8ffe6",textColor:"#00925d",icon:null};case"incomplete":return{text:"Incomplete",bgColor:"#fdf9c9",textColor:"#c69538",icon:null};case"out-of-date":return{text:"Out of date",bgColor:"#fdf9c9",textColor:"#c69538",icon:null};case"not-analyzed":return{text:"Not analyzed",bgColor:"#f9f9f9",textColor:"#646464",icon:null}}}function A(e){if(!e)return"Never";const o=new Date(e),c=new Date;if(o.getDate()===c.getDate()&&o.getMonth()===c.getMonth()&&o.getFullYear()===c.getFullYear()){const t=o.getHours(),f=o.getMinutes(),u=t>=12?"pm":"am",d=t%12||12,i=f.toString().padStart(2,"0");return`Today, ${d}:${i} ${u}`}return o.toLocaleString("en-US",{month:"numeric",day:"numeric",year:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0})}function b(e,o=[],c=!1){var h,g;if(o.some(n=>{var a,s;return!!((a=n.entityShas)!=null&&a.includes(e.sha)||(s=n.entities)!=null&&s.some(r=>r.sha===e.sha))}))return c?"analyzing":"queued";if(!e.analyses||e.analyses.length===0)return"not-analyzed";const t=e.analyses[0];if(!(((h=t.status)==null?void 0:h.scenarios)&&t.status.scenarios.length>0&&t.status.scenarios.some(n=>n.screenshotFinishedAt||n.finishedAt))||t.entitySha!==e.sha)return"not-analyzed";const u=t.createdAt?new Date(t.createdAt).getTime():0,d=(g=e.metadata)!=null&&g.editedAt?new Date(e.metadata.editedAt).getTime():0,i=t.scenarios||[],p=i.some(n=>{var a,s,r;return((s=(a=n.metadata)==null?void 0:a.screenshotPaths)==null?void 0:s[0])||((r=n.metadata)==null?void 0:r.executionResult)});return u>=d?i.length>0&&p?i.every(a=>{var s,r,m;return((r=(s=a.metadata)==null?void 0:s.screenshotPaths)==null?void 0:r[0])||((m=a.metadata)==null?void 0:m.executionResult)})?"up-to-date":"incomplete":i.length>0?"incomplete":"not-analyzed":"out-of-date"}export{C as a,A as f,b as g};
@@ -1 +0,0 @@
1
- import{b as ne,r as u,j as e,w as le,u as ce,f as de}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as me}from"./useReportContext-DZlYx2c4.js";import{C as pe,a as he,F as fe,b as xe,E as ue,S as ye,u as ge}from"./EntityItem-bwuHPyTa.js";import{g as T}from"./fileTableUtils-9sMMAiWJ.js";import{C as ae}from"./chevron-down-CG65viiV.js";import{S as ve}from"./search-DcAwD_Ln.js";import"./createLucideIcon-D1zB-pYc.js";import"./useToast-ihdMtlf6.js";import"./TruncatedFilePath-CDpEprKa.js";import"./SafeScreenshot-CwZrv-Ok.js";import"./LibraryFunctionPreview-Cq5o8jL4.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-CAD5b1o_.js";import"./EntityTypeIcon-BH0XDim7.js";import"./EntityTypeBadge-CvzqMxcu.js";function be({entities:Q,page:N,itemsPerPage:b=50,currentRun:L,filter:S,entityType:_,queueState:o,isEntityPending:U,pendingEntityKeys:w,onGenerateSimulation:k,onGenerateAllSimulations:D,totalFilesCount:H,totalEntitiesCount:J,uncommittedFilesCount:W,showOnlyUncommitted:j,onToggleUncommitted:V}){const[I,X]=ne(),[B,M]=u.useState(new Set),[A,y]=u.useState(""),[g,x]=u.useState(!1),[E,$]=u.useState("all"),[z,Y]=u.useState("desc"),P=_||"all",R=u.useMemo(()=>{let s=Q;return P!=="all"&&(s=s.filter(i=>i.entityType===P)),S==="analyzed"&&(s=s.filter(i=>i.analyses&&i.analyses.length>0)),s},[Q,P,S]),te=u.useMemo(()=>{const s=new Map,i=new Map,p=new Map;R.forEach(a=>{var r,c;const t=`${a.filePath}::${a.name}`,n=i.get(t);if(!n)i.set(t,a),p.set(t,[]);else{const d=((r=n.metadata)==null?void 0:r.editedAt)||n.createdAt||"",l=((c=a.metadata)==null?void 0:c.editedAt)||a.createdAt||"";let m=!1;if(l>d)m=!0;else if(l===d){const h=n.createdAt||"";m=(a.createdAt||"")>h}m?(p.get(t).push(n),i.set(t,a)):p.get(t).push(a)}}),i.forEach((a,t)=>{var r;if(!(a.analyses&&a.analyses.length>0)&&((r=a.metadata)!=null&&r.previousVersionWithAnalyses)){const d=(p.get(t)||[]).find(l=>{var m;return l.sha===((m=a.metadata)==null?void 0:m.previousVersionWithAnalyses)});d&&d.analyses&&d.analyses.length>0&&(a.analyses=d.analyses)}}),Array.from(i.values()).sort((a,t)=>{var c,d,l,m;const n=!((c=a.metadata)!=null&&c.notExported)&&!((d=a.metadata)!=null&&d.namedExport),r=!((l=t.metadata)!=null&&l.notExported)&&!((m=t.metadata)!=null&&m.namedExport);return n&&!r?-1:!n&&r?1:0}).forEach(a=>{var d,l,m,h,f;const t=a.filePath??"No File Path";s.has(t)||s.set(t,{filePath:t,entities:[],totalCount:0,uncommittedCount:0,lastUpdated:null,previewScreenshots:[],previewScreenshotErrors:[],previewLibraryScenarios:[],state:"up-to-date",simulationCount:0});const n=s.get(t);n.entities.push(a),n.totalCount++,(d=a.metadata)!=null&&d.isUncommitted&&n.uncommittedCount++;const r=((h=(m=(l=a.analyses)==null?void 0:l[0])==null?void 0:m.scenarios)==null?void 0:h.length)||0;n.simulationCount+=r;const c=((f=a.metadata)==null?void 0:f.editedAt)||a.updatedAt;c&&(!n.lastUpdated||new Date(c)>new Date(n.lastUpdated))&&(n.lastUpdated=c)});const q=(o==null?void 0:o.jobs)||[],ee=a=>{const t=`${a.filePath||""}::${a.name}`;return(w==null?void 0:w.includes(t))||!1};s.forEach(a=>{const t=a.entities.map(n=>ee(n)?"queued":T(n,q));t.includes("analyzing")||t.includes("queued")?a.state="analyzing":t.includes("incomplete")?a.state="incomplete":t.includes("out-of-date")?a.state="out-of-date":t.includes("not-analyzed")?a.state="not-analyzed":a.state="up-to-date"}),s.forEach(a=>{var t,n,r,c,d;for(const l of a.entities){if(a.previewScreenshots.length+a.previewLibraryScenarios.length>=3)break;const h=((n=(t=l.analyses)==null?void 0:t[0])==null?void 0:n.scenarios)||[];if(l.entityType==="library"){const f=h.find(v=>{var F,O;return((F=v.metadata)==null?void 0:F.executionResult)||((O=v.metadata)==null?void 0:O.error)});f&&a.previewLibraryScenarios.push({scenario:f,entitySha:l.sha})}else{const f=h.find(v=>{var F,O;return(O=(F=v.metadata)==null?void 0:F.screenshotPaths)==null?void 0:O[0]});if(f){const v=(c=(r=f.metadata)==null?void 0:r.screenshotPaths)==null?void 0:c[0],F=!!((d=f.metadata)!=null&&d.error);v&&!a.previewScreenshots.includes(v)&&(a.previewScreenshots.push(v),a.previewScreenshotErrors.push(F))}}}});const G=Array.from(s.values());return G.sort((a,t)=>{if(S==="analyzed"){const c=Math.max(...a.entities.filter(l=>{var m,h;return(h=(m=l.analyses)==null?void 0:m[0])==null?void 0:h.createdAt}).map(l=>new Date(l.analyses[0].createdAt).getTime()),0),d=Math.max(...t.entities.filter(l=>{var m,h;return(h=(m=l.analyses)==null?void 0:m[0])==null?void 0:h.createdAt}).map(l=>new Date(l.analyses[0].createdAt).getTime()),0);return z==="desc"?d-c:c-d}if(a.uncommittedCount>0&&t.uncommittedCount===0)return-1;if(a.uncommittedCount===0&&t.uncommittedCount>0)return 1;const n=a.lastUpdated?new Date(a.lastUpdated).getTime():0,r=t.lastUpdated?new Date(t.lastUpdated).getTime():0;return z==="desc"?r-n:n-r}),G},[R,S,z,o,w]),C=u.useMemo(()=>{let s=te;if(E!=="all"&&(s=s.filter(i=>i.state===E)),A.trim()){const i=A.toLowerCase();s=s.filter(p=>p.filePath.toLowerCase().includes(i))}return s},[te,A,E]),se=(N-1)*b,oe=se+b,Z=C.slice(se,oe),K=Math.ceil(C.length/b),re=s=>{M(i=>{const p=new Set(i);return p.has(s)?p.delete(s):p.add(s),p})},ie=()=>{Y(s=>s==="desc"?"asc":"desc")};return e.jsxs("div",{children:[e.jsxs("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-3",children:[e.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Filters"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative w-[130px]",children:[e.jsxs("select",{value:P,onChange:s=>{const i=s.target.value,p=new URLSearchParams(I);i==="all"?p.delete("entityType"):p.set("entityType",i),p.set("page","1"),X(p)},className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"visual",children:"Visual"}),e.jsx("option",{value:"library",children:"Library"})]}),e.jsx(ae,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"relative w-[130px]",children:[e.jsxs("select",{value:E,onChange:s=>$(s.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:[e.jsx("option",{value:"all",children:"All States"}),e.jsx("option",{value:"analyzing",children:"Analyzing..."}),e.jsx("option",{value:"up-to-date",children:"Up to date"}),e.jsx("option",{value:"incomplete",children:"Incomplete"}),e.jsx("option",{value:"out-of-date",children:"Out of date"}),e.jsx("option",{value:"not-analyzed",children:"Not analyzed"})]}),e.jsx(ae,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(ve,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"Search component",value:A,onChange:s=>y(s.target.value),className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-[10px] text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors"})]})]})]}),H!==void 0&&J!==void 0&&W!==void 0&&e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em"},children:[e.jsx("span",{style:{color:"#000000"},children:C.length})," ",C.length===1?"file":"files"]}),e.jsxs("div",{className:"relative group inline-flex items-center ml-1.5",children:[e.jsx("svg",{className:"w-3 h-3 text-gray-400 cursor-help",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("div",{className:"absolute left-0 top-full mt-2 hidden group-hover:block z-50 w-80",children:e.jsxs("div",{className:"bg-gray-900 text-white text-xs rounded-lg px-3 py-2 shadow-lg",children:["In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested.",e.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),e.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:[e.jsx("span",{style:{color:"#000000"},children:C.reduce((s,i)=>s+i.totalCount,0)})," ",C.reduce((s,i)=>s+i.totalCount,0)===1?"entity":"entities"]}),e.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),j?e.jsxs("button",{onClick:V,className:"flex items-center gap-2 text-[#005c75] underline hover:text-[#004a5e] transition-colors ml-2 font-mono uppercase cursor-pointer",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[C.filter(s=>s.uncommittedCount>0).length," ","uncommitted"," ",C.filter(s=>s.uncommittedCount>0).length===1?"file":"files",e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})]}):e.jsxs("button",{onClick:V,className:"text-[#005c75] underline hover:text-[#004a5e] transition-colors ml-2 font-mono uppercase",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[W," uncommitted"," ",W===1?"file":"files"]})]}),Z.length>0&&e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("button",{onClick:()=>{M(new Set(Z.map(s=>s.filePath))),x(!0)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[e.jsx(pe,{className:"w-3.5 h-3.5"}),"Expand All"]}),e.jsxs("button",{onClick:()=>{M(new Set),x(!1)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[e.jsx(he,{className:"w-3.5 h-3.5"}),"Collapse All"]})]})]})}),e.jsx(fe,{showActions:!0,sortOrder:z,onSortChange:ie}),e.jsx("div",{className:"flex flex-col gap-[3px]",children:Z.map(s=>{const i=B.has(s.filePath),q=s.entities.filter(t=>(t.entityType==="visual"||t.entityType==="library")&&(T(t,(o==null?void 0:o.jobs)||[])==="not-analyzed"||T(t,(o==null?void 0:o.jobs)||[])==="out-of-date"||T(t,(o==null?void 0:o.jobs)||[])==="incomplete")).length>0,ee=t=>{var n;return((n=L==null?void 0:L.currentEntityShas)==null?void 0:n.includes(t))||!1},G=t=>{var n;return U!=null&&U(t)?!0:((n=o==null?void 0:o.jobs)==null?void 0:n.some(r=>{var c;return(c=r.entityShas)==null?void 0:c.includes(t.sha)}))||!1},a=t=>{k==null||k(t)};return e.jsx(xe,{filePath:s.filePath,isExpanded:i,onToggle:()=>re(s.filePath),simulationPreviews:e.jsx(ye,{entities:s.entities,maxPreviews:1}),entityCount:s.totalCount,state:s.state,lastModified:s.lastUpdated,uncommittedCount:s.uncommittedCount,isUncommitted:s.uncommittedCount>0,actionButton:q?e.jsx("button",{onClick:t=>{t.stopPropagation();const n=s.entities.filter(r=>(r.entityType==="visual"||r.entityType==="library")&&(T(r,(o==null?void 0:o.jobs)||[])==="not-analyzed"||T(r,(o==null?void 0:o.jobs)||[])==="out-of-date"||T(r,(o==null?void 0:o.jobs)||[])==="incomplete"));D==null||D(n)},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors cursor-pointer px-[15px] py-0 h-[28px]",children:s.state==="out-of-date"?"Re-analyze":"Analyze"}):void 0,children:s.entities.sort((t,n)=>{var m,h,f,v;const r=!((m=t.metadata)!=null&&m.notExported)&&!((h=t.metadata)!=null&&h.namedExport),c=!((f=n.metadata)!=null&&f.notExported)&&!((v=n.metadata)!=null&&v.namedExport);if(r&&!c)return-1;if(!r&&c)return 1;const d=t.entityType==="visual"||t.entityType==="library",l=n.entityType==="visual"||n.entityType==="library";return d&&!l?-1:!d&&l?1:t.name.localeCompare(n.name)}).map(t=>e.jsx(ue,{entity:t,isActivelyAnalyzing:ee(t.sha),isQueued:G(t),onGenerateSimulation:a},t.sha))},s.filePath)})}),K>1&&e.jsxs("div",{className:"flex justify-center items-center gap-4 mt-6 p-4",children:[N>1&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(I),page:String(N-1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"← Previous"}),e.jsxs("span",{children:["Page ",N," of ",K]}),N<K&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(I),page:String(N+1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"Next →"})]})]})}const De=()=>[{title:"Files & Entities - CodeYam"},{name:"description",content:"Browse your codebase files and entities"}],We=le(function(){var B,M,A;const{entities:N,currentCommit:b,page:L,filter:S,entityType:_,queueState:o,error:U}=ce();de(),ne();const[w,k]=u.useState(!1);me({source:"files-page"});const{handleGenerateSimulation:D,handleGenerateAllSimulations:H,isEntityPending:J,pendingEntityKeys:W}=ge((M=(B=b==null?void 0:b.metadata)==null?void 0:B.currentRun)==null?void 0:M.currentEntityShas,o),j=N||[],V=u.useMemo(()=>{const y=new Set([]);for(const g of j)y.add(g.filePath??"No File Path");return Array.from(y)},[j]),I=u.useMemo(()=>{let y=j;return w&&(y=y.filter(g=>{var x;return(x=g.metadata)==null?void 0:x.isUncommitted})),y.sort((g,x)=>{var E,$,z,Y,P,R;return(E=g.metadata)!=null&&E.isUncommitted&&!(($=x.metadata)!=null&&$.isUncommitted)?-1:!((z=g.metadata)!=null&&z.isUncommitted)&&((Y=x.metadata)!=null&&Y.isUncommitted)?1:new Date(((P=x.metadata)==null?void 0:P.editedAt)||0).getTime()-new Date(((R=g.metadata)==null?void 0:R.editedAt)||0).getTime()})},[j,w]),X=u.useMemo(()=>{var g;const y=new Set([]);for(const x of j)(g=x.metadata)!=null&&g.isUncommitted&&y.add(x.filePath??"No File Path");return Array.from(y)},[j]);return U?e.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:e.jsxs("div",{className:"px-12 py-6 font-sans",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900",children:"Error"}),e.jsx("p",{className:"text-base text-gray-500",children:U})]})}):j.length===0?e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Files & Entities"}),e.jsx("p",{className:"text-[15px] text-gray-500",children:"This is a list of all the files in your app."})]}),e.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-12 text-center",children:e.jsxs("div",{className:"max-w-md mx-auto",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-3",children:"No entities found"}),e.jsxs("p",{className:"text-[15px] text-gray-600 mb-6",children:["Your project hasn't been analyzed yet. Run"," ",e.jsx("code",{className:"px-2 py-1 bg-gray-100 rounded text-sm font-mono",children:"codeyam analyze"})," ","to extract entities from your codebase."]}),e.jsx("p",{className:"text-sm text-gray-500",children:"Entities include React components, functions, and other analyzable code elements."})]})})]})}):e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Files & Entities"}),e.jsx("p",{className:"text-[15px] text-gray-500",children:"This is a list of all the files in your app."})]}),e.jsx(be,{entities:I,page:L,itemsPerPage:50,currentRun:(A=b==null?void 0:b.metadata)==null?void 0:A.currentRun,filter:S,entityType:_,queueState:o,isEntityPending:J,pendingEntityKeys:W,onGenerateSimulation:D,onGenerateAllSimulations:H,totalFilesCount:V.length,totalEntitiesCount:j.length,uncommittedFilesCount:X.length,showOnlyUncommitted:w,onToggleUncommitted:()=>k(!w)})]})})});export{We as default,De as meta};