@codeyam/codeyam-cli 0.1.0-staging.1 → 0.1.0-staging.28f73cf

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 (440) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +8 -7
  4. package/analyzer-template/packages/ai/index.ts +2 -1
  5. package/analyzer-template/packages/ai/package.json +2 -2
  6. package/analyzer-template/packages/ai/scripts/ai-test-matrix.mjs +424 -0
  7. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +24 -0
  8. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +6 -16
  9. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +197 -0
  10. package/analyzer-template/packages/ai/src/lib/astScopes/paths.ts +28 -2
  11. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +127 -4
  12. package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +1 -3
  13. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1821 -542
  14. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.ts +138 -0
  15. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +1 -1
  16. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +139 -0
  17. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/DebugTracer.ts +224 -0
  18. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/PathManager.ts +203 -0
  19. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/README.md +294 -0
  20. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +161 -0
  21. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.ts +235 -0
  22. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +14 -6
  23. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/selectBestValue.ts +70 -0
  24. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.ts +113 -0
  25. package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +36 -0
  26. package/analyzer-template/packages/ai/src/lib/generateChangesEntityDocumentation.ts +20 -2
  27. package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +51 -107
  28. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +56 -160
  29. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +79 -265
  30. package/analyzer-template/packages/ai/src/lib/generateEntityDocumentation.ts +16 -2
  31. package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +53 -176
  32. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +53 -154
  33. package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +84 -254
  34. package/analyzer-template/packages/ai/src/lib/generateStatementAnalysis.ts +48 -71
  35. package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +27 -6
  36. package/analyzer-template/packages/ai/src/lib/getLLMCallStats.ts +0 -14
  37. package/analyzer-template/packages/ai/src/lib/modelInfo.ts +15 -0
  38. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +42 -4
  39. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityDocumentationGenerator.ts +8 -33
  40. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +54 -62
  41. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +93 -109
  42. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityDocumentationGenerator.ts +8 -27
  43. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +33 -38
  44. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +30 -30
  45. package/analyzer-template/packages/ai/src/lib/types/index.ts +2 -0
  46. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +39 -0
  47. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +52 -6
  48. package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +2 -1
  49. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +238 -0
  50. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.ts +25 -0
  51. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/index.ts +2 -0
  52. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +8 -10
  53. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +6 -1
  54. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +8 -6
  55. package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +5 -13
  56. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +34 -15
  57. package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +17 -3
  58. package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +35 -16
  59. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +7 -1
  60. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +9 -1
  61. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +6 -1
  62. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +9 -1
  63. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +15 -7
  64. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts +23 -0
  65. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts.map +1 -0
  66. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js +30 -0
  67. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js.map +1 -0
  68. package/analyzer-template/packages/aws/package.json +5 -4
  69. package/analyzer-template/packages/aws/s3/index.ts +4 -0
  70. package/analyzer-template/packages/aws/src/lib/s3/getPresignedUrl.ts +62 -0
  71. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +28 -21
  72. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.ts +18 -11
  73. package/analyzer-template/packages/generate/src/lib/scenarioComponent.ts +6 -3
  74. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
  75. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +28 -21
  76. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
  77. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.d.ts.map +1 -1
  78. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js +18 -11
  79. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js.map +1 -1
  80. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.d.ts.map +1 -1
  81. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js +5 -3
  82. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js.map +1 -1
  83. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts +2 -0
  84. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts.map +1 -1
  85. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js +3 -0
  86. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js.map +1 -1
  87. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts +2 -0
  88. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts.map +1 -1
  89. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts +37 -0
  90. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -0
  91. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
  92. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
  93. package/analyzer-template/packages/github/dist/utils/index.d.ts +2 -0
  94. package/analyzer-template/packages/github/dist/utils/index.d.ts.map +1 -1
  95. package/analyzer-template/packages/github/dist/utils/index.js +2 -0
  96. package/analyzer-template/packages/github/dist/utils/index.js.map +1 -1
  97. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts +25 -0
  98. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
  99. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js +40 -0
  100. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js.map +1 -0
  101. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
  102. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js +5 -3
  103. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
  104. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
  105. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  106. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  107. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.d.ts.map +1 -1
  108. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js +2 -1
  109. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js.map +1 -1
  110. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
  111. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  112. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  113. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts +12 -0
  114. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts.map +1 -0
  115. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js +32 -0
  116. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js.map +1 -0
  117. package/analyzer-template/packages/supabase/src/lib/kysely/db.ts +6 -0
  118. package/analyzer-template/packages/supabase/src/lib/kysely/tableRelations.ts +3 -0
  119. package/analyzer-template/packages/supabase/src/lib/kysely/tables/debugReportsTable.ts +61 -0
  120. package/analyzer-template/packages/ui-components/src/scenario-editor/components/DataItemEditor.tsx +1 -1
  121. package/analyzer-template/packages/utils/dist/utils/index.d.ts +2 -0
  122. package/analyzer-template/packages/utils/dist/utils/index.d.ts.map +1 -1
  123. package/analyzer-template/packages/utils/dist/utils/index.js +2 -0
  124. package/analyzer-template/packages/utils/dist/utils/index.js.map +1 -1
  125. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts +25 -0
  126. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
  127. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js +40 -0
  128. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js.map +1 -0
  129. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
  130. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js +5 -3
  131. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
  132. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
  133. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  134. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  135. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.d.ts.map +1 -1
  136. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js +2 -1
  137. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js.map +1 -1
  138. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
  139. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  140. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  141. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts +12 -0
  142. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts.map +1 -0
  143. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js +32 -0
  144. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js.map +1 -0
  145. package/analyzer-template/packages/utils/index.ts +2 -0
  146. package/analyzer-template/packages/utils/src/lib/Semaphore.ts +42 -0
  147. package/analyzer-template/packages/utils/src/lib/frameworks/getNextRoutePath.ts +8 -3
  148. package/analyzer-template/packages/utils/src/lib/frameworks/getRemixRoutePath.ts +2 -1
  149. package/analyzer-template/packages/utils/src/lib/frameworks/nextRouteFileNameToRoute.ts +2 -1
  150. package/analyzer-template/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.ts +1 -0
  151. package/analyzer-template/packages/utils/src/lib/frameworks/sanitizeNextRouteSegments.ts +33 -0
  152. package/analyzer-template/project/constructMockCode.ts +170 -6
  153. package/analyzer-template/project/reconcileMockDataKeys.ts +13 -0
  154. package/analyzer-template/project/start.ts +1 -11
  155. package/analyzer-template/project/startScenarioCapture.ts +24 -0
  156. package/analyzer-template/project/trackGeneratedFiles.ts +41 -0
  157. package/analyzer-template/project/writeMockDataTsx.ts +125 -4
  158. package/analyzer-template/project/writeScenarioComponents.ts +199 -45
  159. package/analyzer-template/project/writeUniversalMocks.ts +72 -10
  160. package/background/src/lib/virtualized/project/constructMockCode.js +158 -7
  161. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  162. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +12 -0
  163. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  164. package/background/src/lib/virtualized/project/start.js +1 -8
  165. package/background/src/lib/virtualized/project/start.js.map +1 -1
  166. package/background/src/lib/virtualized/project/startScenarioCapture.js +18 -0
  167. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  168. package/background/src/lib/virtualized/project/trackGeneratedFiles.js +30 -0
  169. package/background/src/lib/virtualized/project/trackGeneratedFiles.js.map +1 -0
  170. package/background/src/lib/virtualized/project/writeMockDataTsx.js +95 -3
  171. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  172. package/background/src/lib/virtualized/project/writeScenarioComponents.js +144 -28
  173. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  174. package/background/src/lib/virtualized/project/writeUniversalMocks.js +59 -9
  175. package/background/src/lib/virtualized/project/writeUniversalMocks.js.map +1 -1
  176. package/codeyam-cli/scripts/apply-setup.js +288 -0
  177. package/codeyam-cli/scripts/apply-setup.js.map +1 -0
  178. package/codeyam-cli/scripts/extract-setup.js +130 -0
  179. package/codeyam-cli/scripts/extract-setup.js.map +1 -0
  180. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +238 -0
  181. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +1 -0
  182. package/codeyam-cli/src/cli.js +6 -0
  183. package/codeyam-cli/src/cli.js.map +1 -1
  184. package/codeyam-cli/src/codeyam-cli.js +0 -0
  185. package/codeyam-cli/src/commands/debug.js +221 -0
  186. package/codeyam-cli/src/commands/debug.js.map +1 -0
  187. package/codeyam-cli/src/commands/init.js +4 -23
  188. package/codeyam-cli/src/commands/init.js.map +1 -1
  189. package/codeyam-cli/src/commands/report.js +102 -0
  190. package/codeyam-cli/src/commands/report.js.map +1 -0
  191. package/codeyam-cli/src/commands/setup-sandbox.js +164 -0
  192. package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -0
  193. package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js +6 -6
  194. package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js.map +1 -1
  195. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +8 -0
  196. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  197. package/codeyam-cli/src/utils/analysisRunner.js +4 -3
  198. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  199. package/codeyam-cli/src/utils/analyzer.js +30 -0
  200. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  201. package/codeyam-cli/src/utils/backgroundServer.js +25 -5
  202. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  203. package/codeyam-cli/src/utils/cleanupAnalysisFiles.js +2 -2
  204. package/codeyam-cli/src/utils/cleanupAnalysisFiles.js.map +1 -1
  205. package/codeyam-cli/src/utils/fileWatcher.js +75 -5
  206. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  207. package/codeyam-cli/src/utils/generateReport.js +219 -0
  208. package/codeyam-cli/src/utils/generateReport.js.map +1 -0
  209. package/codeyam-cli/src/utils/install-skills.js +7 -0
  210. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  211. package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js +1 -0
  212. package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js.map +1 -1
  213. package/codeyam-cli/src/utils/queue/job.js +8 -3
  214. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  215. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +4 -0
  216. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  217. package/codeyam-cli/src/utils/webappDetection.js +2 -1
  218. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  219. package/codeyam-cli/src/webserver/app/lib/database.js +63 -2
  220. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  221. package/codeyam-cli/src/webserver/backgroundServer.js +15 -35
  222. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  223. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-D5ZHFomX.js +1 -0
  224. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-Dh-FldQK.js → InteractivePreview-XDSzQLOY.js} +3 -3
  225. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-BYVx9KFp.js +3 -0
  226. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-Dp6DC845.js → LogViewer-CRcT5fOZ.js} +1 -1
  227. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-BORLgi0X.js +1 -0
  228. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-Bual6h18.js +1 -0
  229. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bi-YUMa-.js +6 -0
  230. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-4D2vLLJz.js +5 -0
  231. package/codeyam-cli/src/webserver/build/client/assets/_index-BC200mfN.js +1 -0
  232. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CxvZPkCv.js +10 -0
  233. package/codeyam-cli/src/webserver/build/client/assets/api.generate-report-l0sNRNKZ.js +1 -0
  234. package/codeyam-cli/src/webserver/build/client/assets/{chart-column-B2I7jQx2.js → chart-column-B8fb6wnw.js} +1 -1
  235. package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-De6i8FUT.js +26 -0
  236. package/codeyam-cli/src/webserver/build/client/assets/{circle-alert-GwwOAbhw.js → circle-alert-IdsgAK39.js} +1 -1
  237. package/codeyam-cli/src/webserver/build/client/assets/circle-check-BACUUf75.js +1 -0
  238. package/codeyam-cli/src/webserver/build/client/assets/clock-vWeoCemX.js +1 -0
  239. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CS7XDrKv.js +1 -0
  240. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DIOEw_3i.js +1 -0
  241. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-1Z6D0fLM.js → entity._sha._-8Els_3Wb.js} +10 -10
  242. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-C3FZJx1w.js +1 -0
  243. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-YJz_igar.js +5 -0
  244. package/codeyam-cli/src/webserver/build/client/assets/entityStatus-BEqj2qBy.js +1 -0
  245. package/codeyam-cli/src/webserver/build/client/assets/{entityVersioning-DO2gCvXv.js → entityVersioning-Bk_YB1jM.js} +1 -1
  246. package/codeyam-cli/src/webserver/build/client/assets/entry.client-DiP0q291.js +5 -0
  247. package/codeyam-cli/src/webserver/build/client/assets/file-text-LM0mgxXE.js +1 -0
  248. package/codeyam-cli/src/webserver/build/client/assets/files-Dxh9CcaV.js +1 -0
  249. package/codeyam-cli/src/webserver/build/client/assets/git-BXmqrWCH.js +12 -0
  250. package/codeyam-cli/src/webserver/build/client/assets/globals-BGS74ED-.css +1 -0
  251. package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +5 -0
  252. package/codeyam-cli/src/webserver/build/client/assets/index-D-zYbzFZ.js +8 -0
  253. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-DN7Vr40D.js → loader-circle-BXPKbHEb.js} +1 -1
  254. package/codeyam-cli/src/webserver/build/client/assets/manifest-1af162d4.js +1 -0
  255. package/codeyam-cli/src/webserver/build/client/assets/root-DB7VgjCY.js +16 -0
  256. package/codeyam-cli/src/webserver/build/client/assets/{settings-MZc4XdmE.js → settings-5zF_GOcS.js} +1 -1
  257. package/codeyam-cli/src/webserver/build/client/assets/settings-Dc4MlMpK.js +1 -0
  258. package/codeyam-cli/src/webserver/build/client/assets/simulations-BQ-02-jB.js +1 -0
  259. package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-D7k-ArFa.js +1 -0
  260. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BBlyqxij.js → useLastLogLine-AlhS7g5F.js} +1 -1
  261. package/codeyam-cli/src/webserver/build/client/assets/useToast-Ddo4UQv7.js +1 -0
  262. package/codeyam-cli/src/webserver/build/client/assets/{zap-B4gsLUZQ.js → zap-_jw-9DCp.js} +1 -1
  263. package/codeyam-cli/src/webserver/build/server/assets/index-D4JpXSIO.js +1 -0
  264. package/codeyam-cli/src/webserver/build/server/assets/server-build-vwbN7n65.js +169 -0
  265. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  266. package/codeyam-cli/src/webserver/build-info.json +5 -5
  267. package/codeyam-cli/src/webserver/server.js +1 -1
  268. package/codeyam-cli/src/webserver/server.js.map +1 -1
  269. package/codeyam-cli/templates/codeyam-setup-skill.md +85 -94
  270. package/codeyam-cli/templates/debug-command.md +125 -0
  271. package/package.json +9 -11
  272. package/packages/ai/index.js +1 -2
  273. package/packages/ai/index.js.map +1 -1
  274. package/packages/ai/src/lib/analyzeScope.js +13 -0
  275. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  276. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +6 -15
  277. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  278. package/packages/ai/src/lib/astScopes/methodSemantics.js +134 -0
  279. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  280. package/packages/ai/src/lib/astScopes/paths.js +28 -3
  281. package/packages/ai/src/lib/astScopes/paths.js.map +1 -1
  282. package/packages/ai/src/lib/astScopes/processExpression.js +111 -3
  283. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  284. package/packages/ai/src/lib/checkAllAttributes.js +1 -3
  285. package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
  286. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1320 -396
  287. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  288. package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js +137 -1
  289. package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js.map +1 -1
  290. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +1 -1
  291. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  292. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +112 -0
  293. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -0
  294. package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js +176 -0
  295. package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js.map +1 -0
  296. package/packages/ai/src/lib/dataStructure/helpers/PathManager.js +178 -0
  297. package/packages/ai/src/lib/dataStructure/helpers/PathManager.js.map +1 -0
  298. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +138 -0
  299. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -0
  300. package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js +199 -0
  301. package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js.map +1 -0
  302. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +14 -6
  303. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  304. package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js +62 -0
  305. package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js.map +1 -0
  306. package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js +90 -0
  307. package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js.map +1 -0
  308. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +22 -0
  309. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
  310. package/packages/ai/src/lib/generateChangesEntityDocumentation.js +19 -1
  311. package/packages/ai/src/lib/generateChangesEntityDocumentation.js.map +1 -1
  312. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +51 -107
  313. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
  314. package/packages/ai/src/lib/generateChangesEntityScenarioData.js +55 -156
  315. package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
  316. package/packages/ai/src/lib/generateChangesEntityScenarios.js +79 -262
  317. package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
  318. package/packages/ai/src/lib/generateEntityDocumentation.js +15 -1
  319. package/packages/ai/src/lib/generateEntityDocumentation.js.map +1 -1
  320. package/packages/ai/src/lib/generateEntityKeyAttributes.js +53 -176
  321. package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +1 -1
  322. package/packages/ai/src/lib/generateEntityScenarioData.js +52 -152
  323. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  324. package/packages/ai/src/lib/generateEntityScenarios.js +88 -258
  325. package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
  326. package/packages/ai/src/lib/generateStatementAnalysis.js +46 -71
  327. package/packages/ai/src/lib/generateStatementAnalysis.js.map +1 -1
  328. package/packages/ai/src/lib/getConditionalUsagesFromCode.js +13 -8
  329. package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
  330. package/packages/ai/src/lib/getLLMCallStats.js +0 -14
  331. package/packages/ai/src/lib/getLLMCallStats.js.map +1 -1
  332. package/packages/ai/src/lib/modelInfo.js +15 -0
  333. package/packages/ai/src/lib/modelInfo.js.map +1 -1
  334. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +36 -3
  335. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  336. package/packages/ai/src/lib/promptGenerators/generateChangesEntityDocumentationGenerator.js +8 -33
  337. package/packages/ai/src/lib/promptGenerators/generateChangesEntityDocumentationGenerator.js.map +1 -1
  338. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js +35 -41
  339. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
  340. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +59 -72
  341. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
  342. package/packages/ai/src/lib/promptGenerators/generateEntityDocumentationGenerator.js +8 -27
  343. package/packages/ai/src/lib/promptGenerators/generateEntityDocumentationGenerator.js.map +1 -1
  344. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +24 -27
  345. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
  346. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +21 -22
  347. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
  348. package/packages/ai/src/lib/types/index.js +2 -0
  349. package/packages/ai/src/lib/types/index.js.map +1 -1
  350. package/packages/ai/src/lib/worker/SerializableDataStructure.js +7 -0
  351. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  352. package/packages/analyze/src/lib/FileAnalyzer.js +45 -5
  353. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  354. package/packages/analyze/src/lib/asts/nodes/index.js +2 -1
  355. package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
  356. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +191 -0
  357. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -0
  358. package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js +16 -0
  359. package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js.map +1 -0
  360. package/packages/analyze/src/lib/asts/sourceFiles/index.js +2 -0
  361. package/packages/analyze/src/lib/asts/sourceFiles/index.js.map +1 -1
  362. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +6 -8
  363. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  364. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +5 -1
  365. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  366. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +8 -2
  367. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  368. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +5 -8
  369. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
  370. package/packages/analyze/src/lib/files/analyzeChange.js +21 -9
  371. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  372. package/packages/analyze/src/lib/files/analyzeEntity.js +10 -4
  373. package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
  374. package/packages/analyze/src/lib/files/analyzeInitial.js +21 -9
  375. package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
  376. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +6 -1
  377. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  378. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +9 -1
  379. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +1 -1
  380. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +5 -1
  381. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
  382. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +9 -1
  383. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
  384. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +16 -7
  385. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  386. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +28 -21
  387. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
  388. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js +18 -11
  389. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js.map +1 -1
  390. package/packages/generate/src/lib/scenarioComponent.js +5 -3
  391. package/packages/generate/src/lib/scenarioComponent.js.map +1 -1
  392. package/packages/supabase/src/lib/kysely/db.js +3 -0
  393. package/packages/supabase/src/lib/kysely/db.js.map +1 -1
  394. package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
  395. package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
  396. package/packages/utils/index.js +2 -0
  397. package/packages/utils/index.js.map +1 -1
  398. package/packages/utils/src/lib/Semaphore.js +40 -0
  399. package/packages/utils/src/lib/Semaphore.js.map +1 -0
  400. package/packages/utils/src/lib/frameworks/getNextRoutePath.js +5 -3
  401. package/packages/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
  402. package/packages/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  403. package/packages/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  404. package/packages/utils/src/lib/frameworks/nextRouteFileNameToRoute.js +2 -1
  405. package/packages/utils/src/lib/frameworks/nextRouteFileNameToRoute.js.map +1 -1
  406. package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  407. package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  408. package/packages/utils/src/lib/frameworks/sanitizeNextRouteSegments.js +32 -0
  409. package/packages/utils/src/lib/frameworks/sanitizeNextRouteSegments.js.map +1 -0
  410. package/analyzer-template/packages/ai/src/lib/generateEntityDataMap.ts +0 -375
  411. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-GqWwt5wG.js +0 -1
  412. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-p0fuyqGQ.js +0 -3
  413. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-xwuhwsZH.js +0 -1
  414. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bl2IRh55.js +0 -1
  415. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-M2QuSHKC.js +0 -5
  416. package/codeyam-cli/src/webserver/build/client/assets/_index-CAVtep9Q.js +0 -1
  417. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CLmzsLsT.js +0 -10
  418. package/codeyam-cli/src/webserver/build/client/assets/components-CAx5ONX_.js +0 -40
  419. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CgyOwWip.js +0 -1
  420. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DGy3zrli.js +0 -1
  421. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-ChAdTrrU.js +0 -1
  422. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-D9L7267w.js +0 -5
  423. package/codeyam-cli/src/webserver/build/client/assets/entry.client-C6FRgjPr.js +0 -1
  424. package/codeyam-cli/src/webserver/build/client/assets/files-C3-cQjgv.js +0 -1
  425. package/codeyam-cli/src/webserver/build/client/assets/git-Dp4EB9nv.js +0 -12
  426. package/codeyam-cli/src/webserver/build/client/assets/globals-Da3jt49-.css +0 -1
  427. package/codeyam-cli/src/webserver/build/client/assets/manifest-172a4629.js +0 -1
  428. package/codeyam-cli/src/webserver/build/client/assets/root-COyVTsPq.js +0 -16
  429. package/codeyam-cli/src/webserver/build/client/assets/search-CvyP_1Lo.js +0 -1
  430. package/codeyam-cli/src/webserver/build/client/assets/settings-Hbf8b7J_.js +0 -1
  431. package/codeyam-cli/src/webserver/build/client/assets/simulations-BMBi0VzO.js +0 -1
  432. package/codeyam-cli/src/webserver/build/client/assets/useToast-C_VxoXTh.js +0 -1
  433. package/codeyam-cli/src/webserver/build/client/cy-logo-cli.svg +0 -13
  434. package/codeyam-cli/src/webserver/build/server/assets/index-eAULANMV.js +0 -1
  435. package/codeyam-cli/src/webserver/build/server/assets/server-build-lutv16q5.js +0 -161
  436. package/codeyam-cli/src/webserver/public/cy-logo-cli.svg +0 -13
  437. package/packages/ai/src/lib/generateEntityDataMap.js +0 -335
  438. package/packages/ai/src/lib/generateEntityDataMap.js.map +0 -1
  439. package/packages/ai/src/lib/promptGenerators/generateEntityDataMapGenerator.js +0 -17
  440. package/packages/ai/src/lib/promptGenerators/generateEntityDataMapGenerator.js.map +0 -1
@@ -0,0 +1 @@
1
+ import{w as J,u as K,b as ee,d as se,r as d,j as e,L as x}from"./chunk-WWGJGFF6-De6i8FUT.js";import{u as te}from"./useLastLogLine-AlhS7g5F.js";import{u as le}from"./useToast-Ddo4UQv7.js";import{L as ne}from"./LogViewer-CRcT5fOZ.js";import{I as b,C as V,E as ae}from"./EntityTypeIcon-D5ZHFomX.js";import{S as _}from"./SafeScreenshot-Bual6h18.js";import{c as re}from"./createLucideIcon-CS7XDrKv.js";import{C as ie}from"./circle-check-BACUUf75.js";import{S as oe}from"./settings-5zF_GOcS.js";import{Z as ce}from"./zap-_jw-9DCp.js";import{L as w}from"./loader-circle-BXPKbHEb.js";import"./file-text-LM0mgxXE.js";import"./chart-column-B8fb6wnw.js";const de=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],me=re("folder-open",de),Se=()=>[{title:"Dashboard - CodeYam"},{name:"description",content:"CodeYam project dashboard"}],Ee=J(function(){const{stats:j,uncommittedFiles:g,uncommittedEntitiesList:C,recentSimulations:h,visualEntitiesForSimulation:y,projectSlug:v,queueState:F,currentCommit:H}=K(),i=ee(),P=se(),{showToast:m}=le(),[W,I]=d.useState(new Set),[o,T]=d.useState(null),[R,A]=d.useState(!1),[L,k]=d.useState(!1),{lastLine:S,isCompleted:z,resetLogs:Z}=te(v,!!o),{simulatingEntity:f,scenarios:N,scenarioStatuses:U,allScenariosCaptured:E}=d.useMemo(()=>{const s={simulatingEntity:null,scenarios:[],scenarioStatuses:[],allScenariosCaptured:!1};if(!o)return s;const t=y?.find(r=>r.sha===o);if(!t)return s;const l=t.analyses?.[0],a=l?.scenarios||[],n=l?.status?.scenarios||[],u=n.filter(r=>r.screenshotFinishedAt).length,p=a.length>0&&u===a.length;return{simulatingEntity:t,scenarios:a,scenarioStatuses:n,allScenariosCaptured:p}},[o,y]);d.useEffect(()=>{(z||E)&&T(null)},[z,E]);const q=H?.metadata?.currentRun,$=new Set(q?.currentEntityShas||[]),M=new Set(F.jobs.flatMap(s=>s.entityShas||[])),B=new Set(F.currentlyExecuting?.entityShas||[]),D=C.filter(s=>s.entityType==="visual"||s.entityType==="library"),c=D.filter(s=>!$.has(s.sha)&&!M.has(s.sha)&&!B.has(s.sha)),Q=()=>{if(c.length===0){m("All entities are already queued or analyzing","info",3e3);return}console.log("Analyzing uncommitted entities not yet queued:",c.length),console.log("Entity SHAs:",c.map(s=>s.sha)),k(!0),m(`Starting analysis for ${c.length} entities...`,"info",3e3),i.submit({entityShas:c.map(s=>s.sha).join(",")},{method:"post",action:"/api/analyze"})};d.useEffect(()=>{if(i.state==="idle"&&i.data){const s=i.data;s.success?(console.log("[Analyze All] Success:",s.message),m(`Analysis started for ${s.entityCount} entities in ${s.fileCount} files. Watch the logs for progress.`,"success",6e3),k(!1)):s.error&&(console.error("[Analyze All] Error:",s.error),m(`Error: ${s.error}`,"error",8e3),k(!1))}},[i.state,i.data,m]);const Y=(s,t)=>{console.log("Simulating entity:",s);const l=y?.find(a=>a.sha===s);T(s),Z(),m(`Starting analysis for ${l?.name||"entity"}...`,"info",3e3),i.submit({entitySha:s,filePath:t},{method:"post",action:"/api/analyze"})},O=s=>{I(t=>{const l=new Set(t);return l.has(s)?l.delete(s):l.add(s),l})},G=d.useMemo(()=>{const s=new Map;return h.forEach(t=>{const l=t.entitySha;s.has(l)||s.set(l,[]),s.get(l).push(t)}),Array.from(s.entries()).map(([t,l])=>({entitySha:t,entityName:l[0].entityName,scenarios:l}))},[h]),X=[{label:"Total Entities",value:j.totalEntities,iconType:"folder",link:"/files",color:"#F59E0B"},{label:"Analyzed Entities",value:j.entitiesWithAnalyses,iconType:"check",link:"/simulations",color:"#10B981"},{label:"Visual Components",value:j.visualEntities,iconType:"image",link:"/files?entityType=visual",color:"#8B5CF6"},{label:"Library Functions",value:j.libraryEntities,iconType:"code-xml",link:"/files?entityType=library",color:"#0DBFE9"}];return e.jsx("div",{className:"bg-cygray-10 min-h-screen",children:e.jsxs("div",{className:"py-6 px-12",children:[e.jsxs("header",{className:"mb-8 flex justify-between items-center",children:[e.jsx("div",{children:e.jsx("h1",{className:"text-3xl font-bold text-gray-900 m-0 mb-2",children:"CodeYam"})}),P.state==="loading"&&e.jsx("div",{className:"text-blue-600 text-sm font-medium animate-pulse",children:"🔄 Updating..."})]}),e.jsx("div",{className:"flex items-center justify-between gap-3",children:X.map((s,t)=>e.jsx(x,{to:s.link,className:"flex-1 bg-white rounded-xl border border-gray-200 overflow-hidden flex transition-all hover:shadow-lg hover:-translate-y-0.5 no-underline",style:{borderLeft:`4px solid ${s.color}`},children:e.jsxs("div",{className:"px-6 py-4 flex flex-col gap-3 flex-1",children:[e.jsxs("div",{className:"flex md:justify-between md:items-start md:flex-row flex-col",children:[e.jsx("div",{className:"text-xs text-gray-700 font-medium",children:s.label}),e.jsx("div",{className:"text-xs font-medium transition-colors flex items-center gap-1 hidden md:flex",style:{color:s.color},children:"View All →"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"rounded-lg p-2 leading-none flex-shrink-0",style:{backgroundColor:`${s.color}15`},children:[s.iconType==="folder"&&e.jsx(me,{size:20,style:{color:s.color}}),s.iconType==="check"&&e.jsx(ie,{size:20,style:{color:s.color}}),s.iconType==="image"&&e.jsx(b,{size:20,style:{color:s.color}}),s.iconType==="gear"&&e.jsx(oe,{size:20,style:{color:s.color}}),s.iconType==="code-xml"&&e.jsx(V,{size:20,style:{color:s.color}})]}),e.jsx("div",{className:"text-2xl font-bold text-gray-900 leading-none",children:s.value})]}),e.jsx("div",{className:"text-xs font-medium transition-colors flex items-center gap-1 md:hidden",style:{color:s.color},children:"View All →"})]})]})},t))}),e.jsxs("div",{className:"mt-12 grid gap-8 items-start",style:{gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))"},children:[e.jsxs("section",{id:"uncommitted",className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsxs("div",{className:"flex justify-between items-start mb-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[22px] font-semibold text-gray-900 m-0 mb-1",children:"Uncommitted Changes"}),e.jsx("p",{className:"text-sm text-gray-500 m-0",children:g.length>0?`${g.length} file${g.length!==1?"s":""} with ${C.length} uncommitted entit${C.length!==1?"ies":"y"}`:"No uncommitted changes detected"})]}),D.length>0&&e.jsx("button",{onClick:Q,disabled:i.state!=="idle"||L||c.length===0,className:"px-5 py-2.5 text-white border-none rounded-lg text-sm font-semibold cursor-pointer transition-all hover:-translate-y-px disabled:bg-gray-400 disabled:cursor-not-allowed disabled:translate-y-0",style:{backgroundColor:"#005C75"},onMouseEnter:s=>s.currentTarget.style.backgroundColor="#004560",onMouseLeave:s=>s.currentTarget.style.backgroundColor="#005C75",children:i.state!=="idle"||L?"Starting analysis...":c.length===0?"All Queued":`Analyze All (${c.length})`})]}),g.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:g.map(([s,t])=>{const l=W.has(s),a=t.editedEntities||[];return e.jsxs("div",{className:"bg-white border border-gray-200 border-l-4 rounded-lg overflow-hidden",style:{borderLeftColor:"#306AFF"},children:[e.jsx("div",{className:"p-4 cursor-pointer select-none transition-colors hover:bg-gray-50",onClick:()=>O(s),role:"button",tabIndex:0,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-gray-500 text-xs w-4 shrink-0",children:l?"▼":"▶"}),e.jsxs("svg",{width:"16",height:"20",viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0",children:[e.jsxs("g",{clipPath:"url(#clip0_784_10666)",children:[e.jsx("path",{d:"M0 2.55857C0 1.14551 1.14551 0 2.55857 0H8.73194L12 3.3616V13.4414C12 14.8545 10.8545 16 9.44143 16H2.55857C1.14551 16 0 14.8545 0 13.4414V2.55857Z",fill:"#DDDDFE"}),e.jsx("path",{d:"M8.72656 3.3307H11.9906L8.72656 0V3.3307Z",fill:"#306AFF"}),e.jsx("line",{x1:"1.8125",y1:"5.94825",x2:"10.0235",y2:"5.94825",stroke:"#306AFF",strokeWidth:"1.27929"}),e.jsx("line",{x1:"1.8125",y1:"8.82715",x2:"6.01207",y2:"8.82715",stroke:"#306AFF",strokeWidth:"1.27929"}),e.jsx("line",{x1:"1.8125",y1:"11.7061",x2:"10.0235",y2:"11.7061",stroke:"#306AFF",strokeWidth:"1.27929"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_784_10666",children:e.jsx("rect",{width:"12",height:"16",fill:"white"})})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"font-normal text-gray-900 text-sm block truncate",children:s}),e.jsxs("span",{className:"text-xs text-gray-500",children:[a.length," entit",a.length!==1?"ies":"y"]})]})]})}),l&&e.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-3 flex flex-col gap-2",children:a.length>0?a.map(n=>{const u=$.has(n.sha),p=M.has(n.sha)||B.has(n.sha);return e.jsxs(x,{to:`/entity/${n.sha}`,className:"flex items-center gap-4 p-4 bg-white border border-gray-200 rounded-lg no-underline transition-all hover:shadow-md hover:-translate-y-0.5",style:{borderColor:"inherit"},onMouseEnter:r=>r.currentTarget.style.borderColor="#005C75",onMouseLeave:r=>r.currentTarget.style.borderColor="inherit",children:[e.jsxs("div",{className:"shrink-0 rounded-lg p-1.5 flex items-center justify-center",style:{backgroundColor:n.entityType==="visual"?"#8B5CF615":n.entityType==="library"?"#6366F1":"#EC4899"},children:[n.entityType==="visual"&&e.jsx(b,{size:16,style:{color:"#8B5CF6"}}),n.entityType==="library"&&e.jsx(V,{size:16,className:"text-white"}),n.entityType==="other"&&e.jsx(ce,{size:16,className:"text-white"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("div",{className:"font-semibold text-gray-900 text-sm",children:n.name}),n.entityType==="visual"&&e.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#8B5CF60D",color:"#8B5CF6"},children:"Visual"}),n.entityType==="library"&&e.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#0DBFE90D",color:"#0DBFE9"},children:"Library"}),n.entityType==="other"&&e.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#EC48990D",color:"#EC4899"},children:"Other"})]}),n.description&&e.jsx("div",{className:"text-sm text-gray-500 mt-1 overflow-hidden text-ellipsis whitespace-nowrap",children:n.description})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u&&e.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded text-xs text-pink-700 font-semibold flex items-center gap-1.5",children:[e.jsx(w,{size:14,className:"animate-spin"}),"Analyzing..."]}),!u&&p&&e.jsx("div",{className:"px-2 py-1 bg-purple-50 border border-purple-300 rounded text-xs text-purple-700 font-semibold",children:"⏳ Queued"}),!u&&!p&&e.jsx("button",{onClick:r=>{r.preventDefault(),r.stopPropagation(),m(`Starting analysis for ${n.name}...`,"info",3e3),i.submit({entityShas:n.sha},{method:"post",action:"/api/analyze"})},disabled:i.state!=="idle",className:"px-3 py-1.5 text-white border-none rounded text-xs font-medium cursor-pointer transition-all disabled:bg-gray-400 disabled:cursor-not-allowed",style:{backgroundColor:"#005C75"},onMouseEnter:r=>r.currentTarget.style.backgroundColor="#004560",onMouseLeave:r=>r.currentTarget.style.backgroundColor="#005C75",children:"Analyze"})]})]},n.sha)}):e.jsx("div",{className:"text-sm text-gray-500 italic p-2",children:"No entity changes detected in this file"})})]},s)})}):e.jsxs("div",{className:"py-12 px-6 text-center flex flex-col items-center bg-gray-50 rounded-lg min-h-[200px] justify-center",children:[e.jsxs("svg",{width:"52",height:"68",viewBox:"0 0 26 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"mb-4 opacity-40",children:[e.jsxs("g",{clipPath:"url(#clip0_784_10631)",children:[e.jsx("path",{d:"M0 2.55857C0 1.14551 1.14551 0 2.55857 0H18.9423L26.0318 7.14651V31.4562C26.0318 32.8693 24.8863 34.0148 23.4732 34.0148H2.55857C1.14551 34.0148 0 32.8693 0 31.4562V2.55857Z",fill:"#D9D9D9"}),e.jsx("path",{d:"M18.9453 7.08081H26.0261L18.9453 0V7.08081Z",fill:"#646464"}),e.jsx("line",{x1:"3.92188",y1:"13.3633",x2:"21.7341",y2:"13.3633",stroke:"#646464",strokeWidth:"1.27929"}),e.jsx("line",{x1:"3.92188",y1:"19.4863",x2:"13.0321",y2:"19.4863",stroke:"#646464",strokeWidth:"1.27929"}),e.jsx("line",{x1:"3.92188",y1:"25.6016",x2:"21.7341",y2:"25.6016",stroke:"#646464",strokeWidth:"1.27929"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_784_10631",children:e.jsx("rect",{width:"26",height:"34",fill:"white"})})})]}),e.jsx("p",{className:"text-sm font-medium text-gray-400 m-0 mb-2",children:"No Uncommitted Changes."})]})]}),e.jsxs("section",{className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsx("div",{className:"flex justify-between items-start mb-5",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-[22px] font-semibold text-gray-900 m-0 mb-1",children:"Recent Simulations"}),e.jsx("p",{className:"text-sm text-gray-500 m-0",children:h.length>0?`Latest ${h.length} captured screenshot${h.length!==1?"s":""}`:"No simulations captured yet"})]})}),h.length>0&&!o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-6 mb-5",children:G.map(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 rounded-lg p-1.5 flex items-center justify-center bg-purple-100",children:e.jsx(b,{size:16,style:{color:"#8B5CF6"}})}),e.jsx(x,{to:`/entity/${s.entitySha}`,className:"text-sm font-semibold text-gray-900 no-underline hover:text-gray-700 transition-colors",children:s.entityName})]}),e.jsx("div",{className:"grid grid-cols-4 gap-3",children:s.scenarios.map((t,l)=>e.jsx(x,{to:t.scenarioId?`/entity/${t.entitySha}/scenarios/${t.scenarioId}`:`/entity/${t.entitySha}`,className:"aspect-4/3 border border-gray-200 rounded-lg overflow-hidden bg-gray-50 transition-all flex items-center justify-center hover:scale-105",onMouseEnter:a=>{a.currentTarget.style.borderColor="#005C75",a.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.2)"},onMouseLeave:a=>{a.currentTarget.style.borderColor="#E5E7EB",a.currentTarget.style.boxShadow="none"},title:`${t.scenarioName}`,children:e.jsx(_,{screenshotPath:t.screenshotPath,alt:t.scenarioName,className:"max-w-full max-h-full object-contain object-center"})},l))})]},s.entitySha))}),e.jsx(x,{to:"/simulations",className:"block text-center p-3 rounded-lg no-underline font-semibold text-sm transition-all",style:{color:"#005C75",backgroundColor:"#F6F9FC"},onMouseEnter:s=>s.currentTarget.style.backgroundColor="#EEF4F8",onMouseLeave:s=>s.currentTarget.style.backgroundColor="#F6F9FC",children:"View All Recent Simulations →"})]}):o?e.jsxs("div",{className:"p-0 bg-white rounded-lg flex flex-col gap-0",children:[f&&e.jsx("div",{className:"p-4 rounded-t-lg",style:{backgroundColor:"#F0F5F8",borderBottom:"2px solid #005C75"},children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-[32px] leading-none",children:e.jsx(ae,{type:"visual"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-base font-bold mb-1",style:{color:"#005C75"},children:["Generating Simulations for ",f.name]}),e.jsx("div",{className:"text-[13px] text-gray-500 font-mono overflow-hidden text-ellipsis whitespace-nowrap",children:f.filePath})]})]})}),E?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-emerald-600 font-medium p-4 bg-emerald-50",children:[e.jsx("span",{className:"text-lg",children:"✅"}),e.jsxs("span",{children:["Complete (",N.length," scenario",N.length!==1?"s":"",")"]})]}):S?e.jsxs("div",{className:"flex items-center justify-between gap-1.5 text-sm font-medium p-4 bg-gray-50",style:{color:"#005C75"},children:[e.jsx(w,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-xs",title:S,children:S}),v&&e.jsx("button",{onClick:()=>A(!0),className:"px-2 py-1.5 bg-gray-500 text-white border-none rounded-md text-[13px] font-medium cursor-pointer transition-all whitespace-nowrap self-start hover:bg-gray-600 hover:-translate-y-px",title:"View analysis logs",children:"📋 Logs"})]}):i.state!=="idle"?e.jsxs("div",{className:"flex items-center justify-between gap-1.5 text-sm font-medium p-4 bg-gray-50",style:{color:"#005C75"},children:[e.jsx(w,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:"Initializing analysis..."})]}):e.jsxs("div",{className:"flex items-center justify-between gap-1.5 text-sm font-medium p-4 bg-gray-50",style:{color:"#005C75"},children:[e.jsx(w,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:"Starting analysis..."})]}),N.length>0&&e.jsx("div",{className:"flex gap-2 flex-wrap p-4 bg-white border-t border-gray-200",children:N.slice(0,8).map((s,t)=>{const l=s.metadata?.screenshotPaths?.[0],a=U.find(p=>p.name===s.name),n=a?.screenshotStartedAt&&!a?.screenshotFinishedAt;return l?e.jsx(x,{to:`/entity/${o}`,className:"w-20 h-15 border-2 border-gray-200 rounded overflow-hidden bg-gray-50 cursor-pointer transition-all flex items-center justify-center no-underline hover:border-blue-600 hover:scale-105 hover:shadow-md",children:e.jsx(_,{screenshotPath:l,alt:s.name,title:s.name,className:"max-w-full max-h-full object-contain object-center"})},t):e.jsx("div",{className:"w-20 h-15 border-2 border-dashed border-gray-300 rounded bg-gray-50 flex items-center justify-center text-2xl",title:`Capturing ${s.name}...`,children:e.jsx("span",{className:n?"animate-pulse":"text-gray-400",children:n?"⋯":"⏹️"})},t)})})]}):e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{className:"py-12 px-6 text-center bg-gray-50 rounded-lg w-full flex flex-col items-center justify-center min-h-[200px]",children:[e.jsx("div",{className:"mb-4 bg-[#efefef] rounded-lg p-3",children:e.jsx(b,{size:28,style:{color:"#999999"},strokeWidth:1.5})}),e.jsx("p",{className:"text-gray-700 m-0 font-semibold",children:"Start by analyzing your first component below."})]}),(y?.length??0)>0?e.jsx(e.Fragment,{children:e.jsx("div",{className:"flex flex-col gap-3 mt-6 w-full",children:(o&&f?[f]:y||[]).map(s=>e.jsx("div",{className:"flex flex-col gap-3",children:e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-white border border-gray-200 rounded-lg transition-colors",style:{borderLeft:"4px solid #8B5CF6"},onMouseEnter:t=>{t.currentTarget.style.backgroundColor="#F9FAFB"},onMouseLeave:t=>{t.currentTarget.style.backgroundColor="white"},children:[e.jsxs(x,{to:`/entity/${s.sha}`,className:"flex items-center gap-4 flex-1 min-w-0 no-underline",children:[e.jsx("div",{className:"shrink-0 rounded-lg p-1.5 flex items-center justify-center bg-purple-100",children:e.jsx(b,{size:16,style:{color:"#8B5CF6"}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-gray-900 text-sm mb-1",children:s.name}),e.jsx("div",{className:"text-xs text-gray-500 font-mono overflow-hidden text-ellipsis whitespace-nowrap",children:s.filePath})]})]}),e.jsx("button",{onClick:()=>Y(s.sha,s.filePath||""),disabled:i.state!=="idle"||o!==null,className:"px-4 py-2 text-white border-none rounded text-sm font-medium cursor-pointer transition-all whitespace-nowrap shrink-0 disabled:bg-gray-400 disabled:cursor-not-allowed disabled:translate-y-0",style:{backgroundColor:"#005C75"},onMouseEnter:t=>t.currentTarget.style.backgroundColor="#004560",onMouseLeave:t=>t.currentTarget.style.backgroundColor="#005C75",title:o?"Please wait for current analysis to complete":"Analyze this entity",children:"Analyze"})]})},s.sha))})}):e.jsx("p",{className:"text-base text-gray-600 m-0 mb-6 leading-relaxed mt-6",children:"Run analysis on your visual components to create simulations and capture screenshots"})]})]})]}),R&&v&&e.jsx(ne,{projectSlug:v,onClose:()=>A(!1)})]})})});export{Ee as default,Se as meta};
@@ -0,0 +1,10 @@
1
+ import{b as E,j as e,L as g,w as L,u as q,f as D,r as A,d as K}from"./chunk-WWGJGFF6-De6i8FUT.js";import{S as F}from"./settings-5zF_GOcS.js";import{F as C}from"./file-text-LM0mgxXE.js";import{L as _}from"./LogViewer-CRcT5fOZ.js";import{u as I}from"./useLastLogLine-AlhS7g5F.js";import{C as $,S as z}from"./ScenarioPreview-Bi-YUMa-.js";import{c as T}from"./createLucideIcon-CS7XDrKv.js";import{C as W}from"./chart-column-B8fb6wnw.js";import{C as B}from"./circle-alert-IdsgAK39.js";import"./SafeScreenshot-Bual6h18.js";import"./LibraryFunctionPreview-BYVx9KFp.js";const H=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],Q=T("cog",H);const J=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],V=T("list-todo",J);const O=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],M=T("pause",O);function R(i){const s=Date.now(),c=new Date(i).getTime(),r=s-c,l=Math.floor(r/6e4),t=Math.floor(l/60);return l<1?"just now":l<60?`${l}m ago`:t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`}function U({state:i,currentRun:s}){E();const c=s?.currentEntityShas&&s.currentEntityShas.length>0;return!i.currentlyExecuting&&(!i.jobs||i.jobs.length===0)?null:e.jsxs("div",{className:"bg-white border-2 rounded-xl shadow-lg p-5 mb-6",style:{borderColor:"#005C75"},children:[i.currentlyExecuting&&!c&&e.jsxs("div",{className:"mb-4 border-2 rounded-lg p-3",style:{backgroundColor:"#e8f1f5",borderColor:"#005C75"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(F,{size:20,className:"animate-spin",style:{color:"#005C75"}}),e.jsx("span",{className:"text-sm font-bold",style:{color:"#003d52"},children:"Starting analysis..."})]}),e.jsxs("p",{className:"text-xs mb-2",style:{color:"#004a5e"},children:["Booting analyzer for"," ",i.currentlyExecuting.entities?.length||i.currentlyExecuting.entityShas?.length||1," ",(i.currentlyExecuting.entities?.length||i.currentlyExecuting.entityShas?.length)===1?"entity":"entities"]}),i.currentlyExecuting.entities&&i.currentlyExecuting.entities.length>0&&e.jsxs("div",{className:"space-y-1 mt-2 max-h-[100px] overflow-y-auto bg-white rounded-md p-2 border",style:{borderColor:"#b3d9e6"},children:[i.currentlyExecuting.entities.slice(0,3).map(r=>e.jsxs(g,{to:`/entity/${r.sha}`,className:"flex items-center gap-1.5 text-xs hover:underline font-medium truncate",title:`${r.name} - ${r.filePath}`,style:{color:"#005C75"},onMouseEnter:l=>l.currentTarget.style.color="#003d52",onMouseLeave:l=>l.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:12,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[r.name,e.jsxs("span",{className:"text-gray-400 ml-1",children:["(",r.filePath,")"]})]})]},r.sha)),i.currentlyExecuting.entities.length>3&&e.jsxs("div",{className:"text-xs italic",style:{color:"#005C75"},children:["+",i.currentlyExecuting.entities.length-3," more entities"]})]}),e.jsx("p",{className:"text-xs mt-2",style:{color:"#005C75"},children:"This may take 2-3 minutes for environment setup"})]}),i.jobs.length>0&&e.jsxs("div",{className:"space-y-2",children:[i.jobs.slice(0,5).map((r,l)=>{r.entities?.length||r.entityShas?.length,r.filePaths?.length,r.entityNames?.[0];const t=r.entities&&r.entities.length>0;return e.jsx("div",{className:"flex items-start gap-3",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("span",{className:"text-sm font-semibold text-gray-700",children:["Job ",l+1]}),e.jsx("span",{className:"text-xs text-gray-400",children:"•"}),e.jsx("span",{className:"text-xs text-gray-500",children:R(r.queuedAt)})]}),t&&e.jsxs("div",{className:"space-y-1 mt-2 max-h-[120px] overflow-y-auto bg-white rounded-md p-2 border border-gray-200",children:[r.entities.slice(0,5).map(n=>e.jsxs(g,{to:`/entity/${n.sha}`,className:"flex items-center gap-1.5 text-xs hover:underline font-medium truncate",title:`${n.name} - ${n.filePath}`,style:{color:"#005C75"},onMouseEnter:u=>u.currentTarget.style.color="#003d52",onMouseLeave:u=>u.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:12,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[n.name,e.jsxs("span",{className:"text-gray-400 ml-1",children:["(",n.filePath,")"]})]})]},n.sha)),r.entities.length>5&&e.jsxs("div",{className:"text-xs text-gray-500 italic",children:["+",r.entities.length-5," more entities"]})]}),r.type==="recapture"&&r.scenarioId&&e.jsxs("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:["Scenario: ",r.scenarioId]})]})},r.id)}),i.jobs.length>5&&e.jsxs("div",{className:"text-xs text-gray-500 text-center py-2",children:["+",i.jobs.length-5," more jobs in queue"]})]})]})}function G({activeTab:i,hasCurrentActivity:s,queuedCount:c,historicCount:r}){const l=[{id:"current",label:"Current Activity",hasContent:s,count:null},{id:"queued",label:"Queued Activity",hasContent:c>0,count:c},{id:"historic",label:"Historic Activity",hasContent:r>0,count:r}];return e.jsx("div",{className:"border-b border-gray-200 mb-6",children:e.jsx("nav",{className:"flex gap-8",children:l.map(t=>{const n=i===t.id;return e.jsx(g,{to:t.id==="current"?"/activity":`/activity/${t.id}`,className:`
2
+ relative pb-4 px-2 text-sm font-medium transition-colors
3
+ ${n?"border-b-2":"text-gray-500 hover:text-gray-700"}
4
+ `,style:n?{color:"#005C75",borderColor:"#005C75"}:{},children:e.jsxs("span",{className:"flex items-center gap-2",children:[t.label,t.count!==null&&t.count>0&&e.jsx("span",{className:`
5
+ inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full
6
+ ${n?"":"bg-gray-200 text-gray-700"}
7
+ `,style:n?{backgroundColor:"#e8f1f5",color:"#005C75"}:{},children:t.count}),t.count===null&&t.hasContent&&e.jsx("span",{className:`
8
+ inline-block w-2 h-2 rounded-full
9
+ ${n?"":"bg-gray-400"}
10
+ `,style:n?{backgroundColor:"#005C75"}:{}})]})},t.id)})})})}function X(i){const s=new Date(i),r=Math.floor((new Date().getTime()-s.getTime())/1e3);if(r<60)return"just now";const l=Math.floor(r/60);if(l<60)return`${l}m ago`;const t=Math.floor(l/60);return t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`}function Y({currentlyExecuting:i,currentRun:s,state:c,projectSlug:r,commitSha:l,onShowLogs:t,recentCompletedRuns:n,totalCompletedRuns:u}){const[h,P]=A.useState({}),[p,j]=A.useState({isKilling:!1,current:0,total:0}),w=K(),k=!!i,y=i?.entities||[],x=!!s?.analysisCompletedAt,N=k,{lastLine:v}=I(r,N);return A.useEffect(()=>{if(!s)return;const a=[s.analyzerPid,s.capturePid].filter(o=>!!o);if(a.length===0)return;const m=async()=>{try{const d=await(await fetch(`/api/process-status?pids=${a.join(",")}`)).json();if(d.processes){const b={};d.processes.forEach(S=>{b[S.pid]={isRunning:S.isRunning,processName:S.processName}}),P(b)}}catch(o){console.error("Failed to fetch process statuses:",o)}};m();const f=setInterval(()=>{m()},5e3);return()=>clearInterval(f)},[s?.analyzerPid,s?.capturePid]),N?e.jsxs("div",{className:"bg-white rounded-xl shadow-lg p-6",style:{borderWidth:"2px",borderColor:"#005C75"},children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 bg-gray-100 rounded-full animate-spin",children:e.jsx(Q,{size:24,className:"text-gray-700"})}),e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:x?"Capture in Progress":"Analysis in Progress"})]}),e.jsx("button",{onClick:t,className:"px-4 py-2 text-white rounded-md text-sm font-semibold transition-colors",style:{backgroundColor:"#005C75"},onMouseEnter:a=>a.currentTarget.style.backgroundColor="#003d52",onMouseLeave:a=>a.currentTarget.style.backgroundColor="#005C75",children:"View Logs"})]}),x&&(s?.readyToBeCaptured??0)>0&&e.jsxs("div",{className:"rounded-md p-4 mb-4",style:{backgroundColor:"#f0f5f8",borderColor:"#b3d9e8",borderWidth:"1px"},children:[e.jsx("p",{className:"text-sm font-semibold mb-1",style:{color:"#00263d"},children:"Capture Progress:"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("p",{className:"text-sm",style:{color:"#004560"},children:[s?.capturesCompleted??0," of"," ",s?.readyToBeCaptured??0," entities captured"]}),e.jsx("div",{className:"flex-1 rounded-full h-2",style:{backgroundColor:"#b3d9e8"},children:e.jsx("div",{className:"h-2 rounded-full transition-all duration-300",style:{backgroundColor:"#005C75",width:`${(s?.capturesCompleted??0)/(s?.readyToBeCaptured??1)*100}%`}})})]})]}),y&&y.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsxs("p",{className:"text-sm font-semibold text-gray-700 mb-2",children:[x?"Capturing":"Analyzing"," ",y.length," ",y.length===1?"Entity":"Entities",":"]}),e.jsx("div",{className:"space-y-3",children:y.map(a=>{const m=a.analyses?.[0],f=m?.scenarios||[],o=m?.status;return e.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[e.jsxs(g,{to:`/entity/${a.sha}`,className:"flex items-center gap-1.5 text-sm hover:underline font-medium truncate mb-2",title:`${a.name} - ${a.filePath}`,style:{color:"#005C75"},onMouseEnter:d=>d.currentTarget.style.color="#003d52",onMouseLeave:d=>d.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:14,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[a.name,e.jsxs("span",{className:"text-gray-500 ml-2 text-xs",children:["(",a.filePath,")"]})]})]}),f.length>0&&e.jsx("div",{className:"flex gap-2 flex-wrap",children:f.slice(0,5).map((d,b)=>d.id?e.jsx(z,{scenario:d,entity:{sha:a.sha,entityType:a.entityType},analysisStatus:o,queueState:c,processIsRunning:N,size:"small"},b):null)})]},a.sha)})})]}),v&&e.jsxs("div",{className:"flex flex-col gap-2 mb-4",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-700",children:"Current Step:"}),e.jsx("p",{className:"text-sm text-gray-600 font-mono",children:v})]}),(s?.analyzerPid||s?.capturePid)&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-700",children:"Running Processes:"}),e.jsxs("div",{className:"flex items-center justify-between bg-gray-50 rounded-md p-3",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[s.analyzerPid&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-mono bg-gray-200 px-2 py-1 rounded",children:["Analyzer: ",s.analyzerPid]}),h[s.analyzerPid]&&e.jsx("span",{className:`text-xs px-2 py-1 rounded ${h[s.analyzerPid].isRunning?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}`,children:h[s.analyzerPid].isRunning?"Running":"Stopped"})]}),s.capturePid&&e.jsxs(e.Fragment,{children:[s.analyzerPid&&e.jsx("span",{className:"text-gray-400",children:"|"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-mono bg-gray-200 px-2 py-1 rounded",children:["Capture: ",s.capturePid]}),h[s.capturePid]&&e.jsx("span",{className:`text-xs px-2 py-1 rounded ${h[s.capturePid].isRunning?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}`,children:h[s.capturePid].isRunning?"Running":"Stopped"})]})]})]}),(h[s.analyzerPid]?.isRunning||h[s.capturePid]?.isRunning)&&e.jsxs("div",{className:"flex items-center gap-3",children:[p.isKilling&&e.jsxs("span",{className:"text-xs text-gray-600 font-medium",children:["Killing process ",p.current," of"," ",p.total,"..."]}),e.jsx("button",{onClick:()=>{const a=[s.analyzerPid,s.capturePid].filter(o=>!!o&&h[o]?.isRunning);if(a.length===0)return;const m=a.join(", ");if(!confirm(`Are you sure you want to kill all running processes (${m})?`))return;j({isKilling:!0,current:1,total:a.length}),(async()=>{for(let o=0;o<a.length;o++){const d=a[o];try{await fetch("/api/kill-process",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:d,commitSha:l||""})})}catch(b){console.error(`Failed to kill process ${d}:`,b)}o<a.length-1&&j({isKilling:!0,current:o+2,total:a.length})}j({isKilling:!1,current:0,total:0}),w.revalidate()})()},disabled:p.isKilling,className:"px-3 py-1 bg-red-600 text-white rounded-md text-xs font-semibold hover:bg-red-700 transition-colors whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed",children:p.isKilling?"Killing...":"Kill All Processes"})]})]})]})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gray-50 rounded-xl p-12 text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-2 bg-gray-200 rounded-lg",children:e.jsx(M,{size:20,className:"text-gray-600"})})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-2",children:"No Current Activity"}),e.jsxs("p",{className:"text-gray-500",children:["There are no analyses currently running. Trigger an analysis from the"," ",e.jsx(g,{to:"/git",className:"text-[#005C75] underline hover:text-[#004a5e]",children:"Git"})," ","or"," ",e.jsx(g,{to:"/files",className:"text-[#005C75] underline hover:text-[#004a5e]",children:"Files"})," ","page."]})]}),n&&n.length>0&&e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Recent Completed Analyses"}),e.jsx("div",{className:"space-y-3",children:n.map(a=>{const m=a.analysisCompletedAt||a.archivedAt||a.createdAt,f=a.entities&&a.entities.length>0;return e.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx($,{size:18,className:"text-green-600"}),e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"Completed"}),e.jsx("span",{className:"text-xs text-gray-400",children:"•"}),e.jsx("span",{className:"text-xs text-gray-500",children:m?X(m):"Unknown"})]}),f&&e.jsxs("div",{className:"ml-7 space-y-1",children:[a.entities.slice(0,3).map(o=>e.jsxs(g,{to:`/entity/${o.sha}`,className:"flex items-center gap-1.5 text-sm hover:underline truncate",title:`${o.name} - ${o.filePath}`,style:{color:"#005C75"},onMouseEnter:d=>d.currentTarget.style.color="#003d52",onMouseLeave:d=>d.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:14,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[o.name,e.jsxs("span",{className:"text-gray-400 ml-1 text-xs",children:["(",o.filePath,")"]})]})]},o.sha)),a.entities.length>3&&e.jsxs("div",{className:"text-xs text-gray-500 italic",children:["+",a.entities.length-3," more entities"]})]})]},a.id)})}),u>3&&e.jsx("div",{className:"mt-4 text-center",children:e.jsx(g,{to:"/activity/historic",className:"text-sm font-medium",style:{color:"#005C75"},onMouseEnter:a=>a.currentTarget.style.color="#003d52",onMouseLeave:a=>a.currentTarget.style.color="#005C75",children:"View All Historic Activity →"})})]})]})}function Z({queueJobs:i,state:s,currentRun:c}){return!i||i.length===0?e.jsxs("div",{className:"bg-gray-50 rounded-xl p-12 text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-3 bg-gray-200 rounded-lg",children:e.jsx(V,{size:20,className:"text-gray-600"})})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-2",children:"No Queued Jobs"}),e.jsx("p",{className:"text-gray-500",children:"Analysis jobs will appear here when they are queued but not yet started."})]}):e.jsx("div",{children:e.jsx(U,{state:s,currentRun:c})})}function ee({historicalRuns:i,totalHistoricalRuns:s,currentPage:c,totalPages:r,tab:l}){return s===0?e.jsxs("div",{className:"bg-gray-50 rounded-xl p-12 text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-3 bg-gray-200 rounded-lg",children:e.jsx(W,{size:20,className:"text-gray-600"})})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-2",children:"No Historic Activity"}),e.jsx("p",{className:"text-gray-500",children:"Completed analyses will appear here for historical reference."})]}):e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsx("div",{className:"space-y-3",children:i.map(t=>{const n=!!t.failedAt,u=t.readyToBeCaptured,h=t.capturesCompleted??0,P=u===void 0?!0:u===0||h>=u,p=!n&&!!t.analysisCompletedAt&&P,j=t.createdAt?new Date(t.createdAt):null,w=t.failedAt?new Date(t.failedAt):t.analysisCompletedAt?new Date(t.analysisCompletedAt):null,k=j&&w?(w.getTime()-j.getTime())/1e3:null,y=t.entities&&t.entities.length>0;return e.jsx("div",{className:`border rounded-lg p-4 ${n?"bg-red-50 border-red-200":p?"bg-green-50 border-green-200":"bg-gray-50 border-gray-200"}`,children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n?e.jsx(B,{size:20,className:"text-red-500"}):p?e.jsx($,{size:20,className:"text-green-500"}):e.jsx(M,{size:20,className:"text-gray-400"}),e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:n?"Failed":p?"Completed":"Incomplete"}),e.jsx("span",{className:"text-xs text-gray-400",children:"•"}),e.jsx("span",{className:"text-xs text-gray-500",children:t.archivedAt?new Date(t.archivedAt).toLocaleString():t.createdAt?new Date(t.createdAt).toLocaleString():"Unknown"})]}),y&&e.jsxs("div",{className:"ml-7 mt-2 space-y-2 max-h-[300px] overflow-y-auto bg-white rounded-md p-2 border border-gray-200",children:[t.entities.slice(0,5).map(x=>{const N=x.analyses?.[0],v=N?.scenarios||[];return e.jsxs("div",{className:"pb-2 border-b last:border-b-0 border-gray-100",children:[e.jsxs(g,{to:`/entity/${x.sha}`,className:"flex items-center gap-1.5 text-xs hover:underline font-medium truncate mb-1",title:`${x.name} - ${x.filePath}`,style:{color:"#005C75"},onMouseEnter:a=>a.currentTarget.style.color="#003d52",onMouseLeave:a=>a.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:12,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[x.name,e.jsxs("span",{className:"text-gray-400 ml-1",children:["(",x.filePath,")"]})]})]}),v.length>0&&e.jsx("div",{className:"flex gap-1.5 flex-wrap mt-1.5",children:v.slice(0,5).map((a,m)=>a.id?e.jsx(z,{scenario:a,entity:{sha:x.sha,entityType:x.entityType},analysisStatus:N?.status,queueState:void 0,processIsRunning:!1,size:"small"},m):null)})]},x.sha)}),t.entities.length>5&&e.jsxs("div",{className:"text-xs text-gray-500 italic pt-1",children:["+",t.entities.length-5," more entities"]})]}),t.failureReason&&e.jsx("p",{className:"text-xs text-red-600 mt-2 font-mono ml-7",children:t.failureReason})]}),k!==null&&e.jsxs("div",{className:"text-xs text-gray-500",children:[k.toFixed(1),"s"]})]})},t.id)})}),r>1&&e.jsxs("div",{className:"mt-6 flex items-center justify-between border-t border-gray-200 pt-4",children:[e.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",(c-1)*20+1," -"," ",Math.min(c*20,s)," of"," ",s," runs"]}),e.jsxs("div",{className:"flex gap-2",children:[c>1&&e.jsx(g,{to:`/activity/${l}?page=${c-1}`,className:"px-3 py-1 bg-gray-100 text-gray-700 rounded-md text-sm font-medium hover:bg-gray-200 transition-colors",children:"Previous"}),c<r&&e.jsx(g,{to:`/activity/${l}?page=${c+1}`,className:"px-3 py-1 bg-gray-100 text-gray-700 rounded-md text-sm font-medium hover:bg-gray-200 transition-colors",children:"Next"})]})]})]})}const me=L(function(){const s=q(),c=D(),[r,l]=A.useState(!1),t=c.tab||"current";return e.jsxs("div",{className:"px-36 py-12",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Activity"}),e.jsx("p",{className:"text-gray-600",children:"View queued, current, and historical analysis activity"})]}),e.jsx(G,{activeTab:t,hasCurrentActivity:s.hasCurrentActivity,queuedCount:s.queuedCount,historicCount:s.totalHistoricalRuns}),t==="current"&&e.jsx(Y,{currentlyExecuting:s.currentlyExecuting,currentRun:s.currentRun,state:s.state,projectSlug:s.projectSlug,commitSha:s.commitSha,onShowLogs:()=>l(!0),recentCompletedRuns:s.recentCompletedRuns,totalCompletedRuns:s.totalCompletedRuns}),t==="queued"&&e.jsx(Z,{queueJobs:s.queueJobs,state:s.state,currentRun:s.currentRun}),t==="historic"&&e.jsx(ee,{historicalRuns:s.historicalRuns,totalHistoricalRuns:s.totalHistoricalRuns,currentPage:s.currentPage,totalPages:s.totalPages,tab:t}),r&&s.projectSlug&&e.jsx(_,{projectSlug:s.projectSlug,onClose:()=>l(!1)})]})});export{me as default};
@@ -1 +1 @@
1
- import{c as t}from"./createLucideIcon-CgyOwWip.js";const a=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],o=t("chart-column",a);export{o as C};
1
+ import{c as t}from"./createLucideIcon-CS7XDrKv.js";const a=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],o=t("chart-column",a);export{o as C};
@@ -0,0 +1,26 @@
1
+ function Ia(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 ql=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Na(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ql(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var a=!1;try{a=this instanceof n}catch{}return a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),r}var Jt={exports:{}},at={},Kt={exports:{}},V={};var Wr;function $a(){if(Wr)return V;Wr=1;var e=Symbol.for("react.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.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),c=Symbol.iterator;function m(v){return v===null||typeof v!="object"?null:(v=c&&v[c]||v["@@iterator"],typeof v=="function"?v:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,L={};function R(v,P,j){this.props=v,this.context=P,this.refs=L,this.updater=j||g}R.prototype.isReactComponent={},R.prototype.setState=function(v,P){if(typeof v!="object"&&typeof v!="function"&&v!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,v,P,"setState")},R.prototype.forceUpdate=function(v){this.updater.enqueueForceUpdate(this,v,"forceUpdate")};function S(){}S.prototype=R.prototype;function b(v,P,j){this.props=v,this.context=P,this.refs=L,this.updater=j||g}var D=b.prototype=new S;D.constructor=b,E(D,R.prototype),D.isPureReactComponent=!0;var T=Array.isArray,M=Object.prototype.hasOwnProperty,O={current:null},p={key:!0,ref:!0,__self:!0,__source:!0};function H(v,P,j){var W,X={},Z=null,re=null;if(P!=null)for(W in P.ref!==void 0&&(re=P.ref),P.key!==void 0&&(Z=""+P.key),P)M.call(P,W)&&!p.hasOwnProperty(W)&&(X[W]=P[W]);var oe=arguments.length-2;if(oe===1)X.children=j;else if(1<oe){for(var ne=Array(oe),we=0;we<oe;we++)ne[we]=arguments[we+2];X.children=ne}if(v&&v.defaultProps)for(W in oe=v.defaultProps,oe)X[W]===void 0&&(X[W]=oe[W]);return{$$typeof:e,type:v,key:Z,ref:re,props:X,_owner:O.current}}function B(v,P){return{$$typeof:e,type:v.type,key:P,ref:v.ref,props:v.props,_owner:v._owner}}function Y(v){return typeof v=="object"&&v!==null&&v.$$typeof===e}function U(v){var P={"=":"=0",":":"=2"};return"$"+v.replace(/[=:]/g,function(j){return P[j]})}var de=/\/+/g;function ee(v,P){return typeof v=="object"&&v!==null&&v.key!=null?U(""+v.key):P.toString(36)}function G(v,P,j,W,X){var Z=typeof v;(Z==="undefined"||Z==="boolean")&&(v=null);var re=!1;if(v===null)re=!0;else switch(Z){case"string":case"number":re=!0;break;case"object":switch(v.$$typeof){case e:case t:re=!0}}if(re)return re=v,X=X(re),v=W===""?"."+ee(re,0):W,T(X)?(j="",v!=null&&(j=v.replace(de,"$&/")+"/"),G(X,P,j,"",function(we){return we})):X!=null&&(Y(X)&&(X=B(X,j+(!X.key||re&&re.key===X.key?"":(""+X.key).replace(de,"$&/")+"/")+v)),P.push(X)),1;if(re=0,W=W===""?".":W+":",T(v))for(var oe=0;oe<v.length;oe++){Z=v[oe];var ne=W+ee(Z,oe);re+=G(Z,P,j,ne,X)}else if(ne=m(v),typeof ne=="function")for(v=ne.call(v),oe=0;!(Z=v.next()).done;)Z=Z.value,ne=W+ee(Z,oe++),re+=G(Z,P,j,ne,X);else if(Z==="object")throw P=String(v),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return re}function te(v,P,j){if(v==null)return v;var W=[],X=0;return G(v,W,"","",function(Z){return P.call(j,Z,X++)}),W}function ue(v){if(v._status===-1){var P=v._result;P=P(),P.then(function(j){(v._status===0||v._status===-1)&&(v._status=1,v._result=j)},function(j){(v._status===0||v._status===-1)&&(v._status=2,v._result=j)}),v._status===-1&&(v._status=0,v._result=P)}if(v._status===1)return v._result.default;throw v._result}var q={current:null},Q={transition:null},ye={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:Q,ReactCurrentOwner:O};return V.Children={map:te,forEach:function(v,P,j){te(v,function(){P.apply(this,arguments)},j)},count:function(v){var P=0;return te(v,function(){P++}),P},toArray:function(v){return te(v,function(P){return P})||[]},only:function(v){if(!Y(v))throw Error("React.Children.only expected to receive a single React element child.");return v}},V.Component=R,V.Fragment=r,V.Profiler=a,V.PureComponent=b,V.StrictMode=n,V.Suspense=l,V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ye,V.cloneElement=function(v,P,j){if(v==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+v+".");var W=E({},v.props),X=v.key,Z=v.ref,re=v._owner;if(P!=null){if(P.ref!==void 0&&(Z=P.ref,re=O.current),P.key!==void 0&&(X=""+P.key),v.type&&v.type.defaultProps)var oe=v.type.defaultProps;for(ne in P)M.call(P,ne)&&!p.hasOwnProperty(ne)&&(W[ne]=P[ne]===void 0&&oe!==void 0?oe[ne]:P[ne])}var ne=arguments.length-2;if(ne===1)W.children=j;else if(1<ne){oe=Array(ne);for(var we=0;we<ne;we++)oe[we]=arguments[we+2];W.children=oe}return{$$typeof:e,type:v.type,key:X,ref:Z,props:W,_owner:re}},V.createContext=function(v){return v={$$typeof:i,_currentValue:v,_currentValue2:v,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},v.Provider={$$typeof:o,_context:v},v.Consumer=v},V.createElement=H,V.createFactory=function(v){var P=H.bind(null,v);return P.type=v,P},V.createRef=function(){return{current:null}},V.forwardRef=function(v){return{$$typeof:s,render:v}},V.isValidElement=Y,V.lazy=function(v){return{$$typeof:h,_payload:{_status:-1,_result:v},_init:ue}},V.memo=function(v,P){return{$$typeof:u,type:v,compare:P===void 0?null:P}},V.startTransition=function(v){var P=Q.transition;Q.transition={};try{v()}finally{Q.transition=P}},V.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},V.useCallback=function(v,P){return q.current.useCallback(v,P)},V.useContext=function(v){return q.current.useContext(v)},V.useDebugValue=function(){},V.useDeferredValue=function(v){return q.current.useDeferredValue(v)},V.useEffect=function(v,P){return q.current.useEffect(v,P)},V.useId=function(){return q.current.useId()},V.useImperativeHandle=function(v,P,j){return q.current.useImperativeHandle(v,P,j)},V.useInsertionEffect=function(v,P){return q.current.useInsertionEffect(v,P)},V.useLayoutEffect=function(v,P){return q.current.useLayoutEffect(v,P)},V.useMemo=function(v,P){return q.current.useMemo(v,P)},V.useReducer=function(v,P,j){return q.current.useReducer(v,P,j)},V.useRef=function(v){return q.current.useRef(v)},V.useState=function(v){return q.current.useState(v)},V.useSyncExternalStore=function(v,P,j){return q.current.useSyncExternalStore(v,P,j)},V.useTransition=function(){return q.current.useTransition()},V.version="18.2.0",V}var Vr;function Ln(){return Vr||(Vr=1,Kt.exports=$a()),Kt.exports}var Yr;function Aa(){if(Yr)return at;Yr=1;var e=Ln(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(s,l,u){var h,c={},m=null,g=null;u!==void 0&&(m=""+u),l.key!==void 0&&(m=""+l.key),l.ref!==void 0&&(g=l.ref);for(h in l)n.call(l,h)&&!o.hasOwnProperty(h)&&(c[h]=l[h]);if(s&&s.defaultProps)for(h in l=s.defaultProps,l)c[h]===void 0&&(c[h]=l[h]);return{$$typeof:t,type:s,key:m,ref:g,props:c,_owner:a.current}}return at.Fragment=r,at.jsx=i,at.jsxs=i,at}var Jr;function ja(){return Jr||(Jr=1,Jt.exports=Aa()),Jt.exports}var Zl=ja(),f=Ln();const Ua=Na(f),za=Ia({__proto__:null,default:Ua},[f]);var Pn=e=>{throw TypeError(e)},Ha=(e,t,r)=>t.has(e)||Pn("Cannot "+r),Gt=(e,t,r)=>(Ha(e,t,"read from private field"),r?r.call(e):t.get(e)),Ba=(e,t,r)=>t.has(e)?Pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Kr="popstate";function es(e={}){function t(n,a){let{pathname:o,search:i,hash:s}=n.location;return ct("",{pathname:o,search:i,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Me(a)}return Va(t,r,null,e)}function z(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function se(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Wa(){return Math.random().toString(36).substring(2,10)}function Gr(e,t){return{usr:e.state,key:e.key,idx:t}}function ct(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?$e(t):t,state:r,key:t&&t.key||n||Wa()}}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 $e(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 Va(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,s="POP",l=null,u=h();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function h(){return(i.state||{idx:null}).idx}function c(){s="POP";let R=h(),S=R==null?null:R-u;u=R,l&&l({action:s,location:L.location,delta:S})}function m(R,S){s="PUSH";let b=ct(L.location,R,S);u=h()+1;let D=Gr(b,u),T=L.createHref(b);try{i.pushState(D,"",T)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;a.location.assign(T)}o&&l&&l({action:s,location:L.location,delta:1})}function g(R,S){s="REPLACE";let b=ct(L.location,R,S);u=h();let D=Gr(b,u),T=L.createHref(b);i.replaceState(D,"",T),o&&l&&l({action:s,location:L.location,delta:0})}function E(R){return Cn(R)}let L={get action(){return s},get location(){return e(a,i)},listen(R){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(Kr,c),l=R,()=>{a.removeEventListener(Kr,c),l=null}},createHref(R){return t(a,R)},createURL:E,encodeLocation(R){let S=E(R);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:m,replace:g,go(R){return i.go(R)}};return L}function Cn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),z(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 st,Xr=class{constructor(e){if(Ba(this,st,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Gt(this,st).has(e))return Gt(this,st).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Gt(this,st).set(e,t)}};st=new WeakMap;var Ya=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ja(e){return Ya.has(e)}var Ka=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Ga(e){return Ka.has(e)}function Xa(e){return e.index===!0}function dt(e,t,r=[],n={},a=!1){return e.map((o,i)=>{let s=[...r,String(i)],l=typeof o.id=="string"?o.id:s.join("-");if(z(o.index!==!0||!o.children,"Cannot specify children on an index route"),z(a||!n[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),Xa(o)){let u={...o,id:l};return n[l]=qr(u,t(u)),u}else{let u={...o,id:l,children:void 0};return n[l]=qr(u,t(u)),o.children&&(u.children=dt(o.children,t,s,n,a)),u}})}function qr(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Fe(e,t,r="/"){return ut(e,t,r,!1)}function ut(e,t,r,n){let a=typeof t=="string"?$e(t):t,o=Re(a.pathname||"/",r);if(o==null)return null;let i=Dn(e);qa(i);let s=null;for(let l=0;s==null&&l<i.length;++l){let u=lo(o);s=io(i[l],u,n)}return s}function Mn(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 Dn(e,t=[],r=[],n="",a=!1){let o=(i,s,l=a,u)=>{let h={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(n)&&l)return;z(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=Ce([n,h.relativePath]),m=r.concat(h);i.children&&i.children.length>0&&(z(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Dn(i.children,t,m,c,l)),!(i.path==null&&!i.index)&&t.push({path:c,score:ao(c,i.index),routesMeta:m})};return e.forEach((i,s)=>{if(i.path===""||!i.path?.includes("?"))o(i,s);else for(let l of Tn(i.path))o(i,s,!0,l)}),t}function Tn(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=Tn(n.join("/")),s=[];return s.push(...i.map(l=>l===""?o:[o,l].join("/"))),a&&s.push(...i),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function qa(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:oo(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var Qa=/^:[\w-]+$/,Za=3,eo=2,to=1,ro=10,no=-2,Qr=e=>e==="*";function ao(e,t){let r=e.split("/"),n=r.length;return r.some(Qr)&&(n+=no),t&&(n+=eo),r.filter(a=>!Qr(a)).reduce((a,o)=>a+(Qa.test(o)?Za:o===""?to:ro),n)}function oo(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 io(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let s=0;s<n.length;++s){let l=n[s],u=s===n.length-1,h=o==="/"?t:t.slice(o.length)||"/",c=Ft({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},h),m=l.route;if(!c&&u&&r&&!n[n.length-1].route.index&&(c=Ft({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},h)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:Ce([o,c.pathname]),pathnameBase:fo(Ce([o,c.pathnameBase])),route:m}),c.pathnameBase!=="/"&&(o=Ce([o,c.pathnameBase]))}return i}function Ft(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=On(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce((u,{paramName:h,isOptional:c},m)=>{if(h==="*"){let E=s[m]||"";i=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const g=s[m];return c&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function On(e,t=!1,r=!0){se(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,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).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 lo(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return se(!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 Re(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 so({basename:e,pathname:t}){return t==="/"?e:Ce([e,t])}var uo=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$t=e=>uo.test(e);function co(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?$e(e):e,o;if(r)if($t(r))o=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),se(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${r}`)}r.startsWith("/")?o=Zr(r.substring(1),"/"):o=Zr(r,t)}else o=t;return{pathname:o,search:ho(n),hash:mo(a)}}function Zr(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 Xt(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 _n(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function pr(e){let t=_n(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function yr(e,t,r,n=!1){let a;typeof e=="string"?a=$e(e):(a={...e},z(!a.pathname||!a.pathname.includes("?"),Xt("?","pathname","search",a)),z(!a.pathname||!a.pathname.includes("#"),Xt("#","pathname","hash",a)),z(!a.search||!a.search.includes("#"),Xt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,s;if(i==null)s=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("/")}s=c>=0?t[c]:"/"}let l=co(a,s),u=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||h)&&(l.pathname+="/"),l}var Ce=e=>e.join("/").replace(/\/\/+/g,"/"),fo=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ho=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,mo=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,po=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function yo(e,t){return new po(e,typeof t=="number"?{status:t}:t)}var vo=(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})},Ve=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 We(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ht(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ne=Symbol("Uninstrumented");function go(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 s of i)o[s]&&r[s].push(o[s])}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let a=Xe(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],s=r[`lazy.${o}`];if(typeof i=="function"&&s.length>0){let l=Xe(s,i,()=>{});l&&(n.lazy=Object.assign(n.lazy||{},{[o]:l}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&r[a].length>0){let i=o[Ne]??o,s=Xe(r[a],i,(...l)=>en(l[0]));s&&(s[Ne]=i,n[a]=s)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(a=>{let o=a[Ne]??a,i=Xe(r.middleware,o,(...s)=>en(s[0]));return i?(i[Ne]=o,i):a})),n}function wo(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[Ne]??e.navigate,a=Xe(r.navigate,n,(...o)=>{let[i,s]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Me(i):".",...tn(e,s??{})}});a&&(a[Ne]=n,e.navigate=a)}if(r.fetch.length>0){let n=e.fetch[Ne]??e.fetch,a=Xe(r.fetch,n,(...o)=>{let[i,,s,l]=o;return{href:s??".",fetcherKey:i,...tn(e,l??{})}});a&&(a[Ne]=n,e.fetch=a)}return e}function Xe(e,t,r){return e.length===0?null:async(...n)=>{let a=await Fn(e,r(...n),()=>t(...n),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function Fn(e,t,r,n){let a=e[n],o;if(a){let i,s=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Fn(e,t,r,n-1),o=await i,z(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(s,t)}catch(l){console.error("An instrumentation function threw an error:",l)}i||await s(),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 en(e){let{request:t,context:r,params:n,unstable_pattern:a}=e;return{request:Eo(t),params:{...n},unstable_pattern:a,context:Ro(r)}}function tn(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 Eo(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ro(e){if(So(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var bo=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function So(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")===bo}var kn=["POST","PUT","PATCH","DELETE"],xo=new Set(kn),Lo=["GET",...kn],Po=new Set(Lo),Co=new Set([301,302,303,307,308]),Mo=new Set([307,308]),qt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},In={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Do=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Nn="remix-router-transitions",$n=Symbol("ResetLoaderData");function ts(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";z(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||Do,o=a;if(e.unstable_instrumentations){let d=e.unstable_instrumentations;o=y=>({...a(y),...go(d.map(w=>w.route).filter(Boolean),y)})}let i={},s=dt(e.routes,o,void 0,i),l,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let h=e.dataStrategy||ko,c={...e.future},m=null,g=new Set,E=null,L=null,R=null,S=e.hydrationData!=null,b=Fe(s,e.history.location,u),D=!1,T=null,M;if(b==null&&!e.patchRoutesOnNavigation){let d=Se(404,{pathname:e.history.location.pathname}),{matches:y,route:w}=St(s);M=!0,b=y,T={[w.id]:d}}else if(b&&!e.hydrationData&&gt(b,s,e.history.location.pathname).active&&(b=null),b)if(b.some(d=>d.route.lazy))M=!1;else if(!b.some(d=>vr(d.route)))M=!0;else{let d=e.hydrationData?e.hydrationData.loaderData:null,y=e.hydrationData?e.hydrationData.errors:null;if(y){let w=b.findIndex(x=>y[x.route.id]!==void 0);M=b.slice(0,w+1).every(x=>!ar(x.route,d,y))}else M=b.every(w=>!ar(w.route,d,y))}else{M=!1,b=[];let d=gt(null,s,e.history.location.pathname);d.active&&d.matches&&(D=!0,b=d.matches)}let O,p={historyAction:e.history.action,location:e.history.location,matches:b,initialized:M,navigation:qt,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||T,fetchers:new Map,blockers:new Map},H="POP",B=null,Y=!1,U,de=!1,ee=new Map,G=null,te=!1,ue=!1,q=new Set,Q=new Map,ye=0,v=-1,P=new Map,j=new Set,W=new Map,X=new Map,Z=new Set,re=new Map,oe,ne=null;function we(){if(m=e.history.listen(({action:d,location:y,delta:w})=>{if(oe){oe(),oe=void 0;return}se(re.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 x=jr({currentLocation:p.location,nextLocation:y,historyAction:d});if(x&&w!=null){let C=new Promise(F=>{oe=F});e.history.go(w*-1),vt(x,{state:"blocked",location:y,proceed(){vt(x,{state:"proceeding",proceed:void 0,reset:void 0,location:y}),C.then(()=>e.history.go(w))},reset(){let F=new Map(p.blockers);F.set(x,ot),me({blockers:F})}}),B?.resolve(),B=null;return}return Ae(d,y)}),r){Xo(t,ee);let d=()=>qo(t,ee);t.addEventListener("pagehide",d),G=()=>t.removeEventListener("pagehide",d)}return p.initialized||Ae("POP",p.location,{initialHydration:!0}),O}function ga(){m&&m(),G&&G(),g.clear(),U&&U.abort(),p.fetchers.forEach((d,y)=>Wt(y)),p.blockers.forEach((d,y)=>Ar(y))}function wa(d){return g.add(d),()=>g.delete(d)}function me(d,y={}){d.matches&&(d.matches=d.matches.map(C=>{let F=i[C.route.id],k=C.route;return k.element!==F.element||k.errorElement!==F.errorElement||k.hydrateFallbackElement!==F.hydrateFallbackElement?{...C,route:F}:C})),p={...p,...d};let w=[],x=[];p.fetchers.forEach((C,F)=>{C.state==="idle"&&(Z.has(F)?w.push(F):x.push(F))}),Z.forEach(C=>{!p.fetchers.has(C)&&!Q.has(C)&&w.push(C)}),[...g].forEach(C=>C(p,{deletedFetchers:w,newErrors:d.errors??null,viewTransitionOpts:y.viewTransitionOpts,flushSync:y.flushSync===!0})),w.forEach(C=>Wt(C)),x.forEach(C=>p.fetchers.delete(C))}function Je(d,y,{flushSync:w}={}){let x=p.actionData!=null&&p.navigation.formMethod!=null&&ve(p.navigation.formMethod)&&p.navigation.state==="loading"&&d.state?._isRedirect!==!0,C;y.actionData?Object.keys(y.actionData).length>0?C=y.actionData:C=null:x?C=p.actionData:C=null;let F=y.loaderData?fn(p.loaderData,y.loaderData,y.matches||[],y.errors):p.loaderData,k=p.blockers;k.size>0&&(k=new Map(k),k.forEach((N,$)=>k.set($,ot)));let _=te?!1:zr(d,y.matches||p.matches),I=Y===!0||p.navigation.formMethod!=null&&ve(p.navigation.formMethod)&&d.state?._isRedirect!==!0;l&&(s=l,l=void 0),te||H==="POP"||(H==="PUSH"?e.history.push(d,d.state):H==="REPLACE"&&e.history.replace(d,d.state));let A;if(H==="POP"){let N=ee.get(p.location.pathname);N&&N.has(d.pathname)?A={currentLocation:p.location,nextLocation:d}:ee.has(d.pathname)&&(A={currentLocation:d,nextLocation:p.location})}else if(de){let N=ee.get(p.location.pathname);N?N.add(d.pathname):(N=new Set([d.pathname]),ee.set(p.location.pathname,N)),A={currentLocation:p.location,nextLocation:d}}me({...y,actionData:C,loaderData:F,historyAction:H,location:d,initialized:!0,navigation:qt,revalidation:"idle",restoreScrollPosition:_,preventScrollReset:I,blockers:k},{viewTransitionOpts:A,flushSync:w===!0}),H="POP",Y=!1,de=!1,te=!1,ue=!1,B?.resolve(),B=null,ne?.resolve(),ne=null}async function Or(d,y){if(B?.resolve(),B=null,typeof d=="number"){B||(B=pn());let ae=B.promise;return e.history.go(d),ae}let w=nr(p.location,p.matches,u,d,y?.fromRouteId,y?.relative),{path:x,submission:C,error:F}=rn(!1,w,y),k=p.location,_=ct(p.location,x,y&&y.state);_={..._,...e.history.encodeLocation(_)};let I=y&&y.replace!=null?y.replace:void 0,A="PUSH";I===!0?A="REPLACE":I===!1||C!=null&&ve(C.formMethod)&&C.formAction===p.location.pathname+p.location.search&&(A="REPLACE");let N=y&&"preventScrollReset"in y?y.preventScrollReset===!0:void 0,$=(y&&y.flushSync)===!0,J=jr({currentLocation:k,nextLocation:_,historyAction:A});if(J){vt(J,{state:"blocked",location:_,proceed(){vt(J,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),Or(d,y)},reset(){let ae=new Map(p.blockers);ae.set(J,ot),me({blockers:ae})}});return}await Ae(A,_,{submission:C,pendingError:F,preventScrollReset:N,replace:y&&y.replace,enableViewTransition:y&&y.viewTransition,flushSync:$})}function Ea(){ne||(ne=pn()),Bt(),me({revalidation:"loading"});let d=ne.promise;return p.navigation.state==="submitting"?d:p.navigation.state==="idle"?(Ae(p.historyAction,p.location,{startUninterruptedRevalidation:!0}),d):(Ae(H||p.historyAction,p.navigation.location,{overrideNavigation:p.navigation,enableViewTransition:de===!0}),d)}async function Ae(d,y,w){U&&U.abort(),U=null,H=d,te=(w&&w.startUninterruptedRevalidation)===!0,Oa(p.location,p.matches),Y=(w&&w.preventScrollReset)===!0,de=(w&&w.enableViewTransition)===!0;let x=l||s,C=w&&w.overrideNavigation,F=w?.initialHydration&&p.matches&&p.matches.length>0&&!D?p.matches:Fe(x,y,u),k=(w&&w.flushSync)===!0;if(F&&p.initialized&&!ue&&Ho(p.location,y)&&!(w&&w.submission&&ve(w.submission.formMethod))){Je(y,{matches:F},{flushSync:k});return}let _=gt(F,x,y.pathname);if(_.active&&_.matches&&(F=_.matches),!F){let{error:he,notFoundMatches:ie,route:le}=Vt(y.pathname);Je(y,{matches:ie,loaderData:{},errors:{[le.id]:he}},{flushSync:k});return}U=new AbortController;let I=Ge(e.history,y,U.signal,w&&w.submission),A=e.getContext?await e.getContext():new Xr,N;if(w&&w.pendingError)N=[Ie(F).route.id,{type:"error",error:w.pendingError}];else if(w&&w.submission&&ve(w.submission.formMethod)){let he=await Ra(I,y,w.submission,F,A,_.active,w&&w.initialHydration===!0,{replace:w.replace,flushSync:k});if(he.shortCircuited)return;if(he.pendingActionResult){let[ie,le]=he.pendingActionResult;if(Ee(le)&&We(le.error)&&le.error.status===404){U=null,Je(y,{matches:he.matches,loaderData:{},errors:{[ie]:le.error}});return}}F=he.matches||F,N=he.pendingActionResult,C=Qt(y,w.submission),k=!1,_.active=!1,I=Ge(e.history,I.url,I.signal)}let{shortCircuited:$,matches:J,loaderData:ae,errors:fe}=await ba(I,y,F,A,_.active,C,w&&w.submission,w&&w.fetcherSubmission,w&&w.replace,w&&w.initialHydration===!0,k,N);$||(U=null,Je(y,{matches:J||F,...hn(N),loaderData:ae,errors:fe}))}async function Ra(d,y,w,x,C,F,k,_={}){Bt();let I=Ko(y,w);if(me({navigation:I},{flushSync:_.flushSync===!0}),F){let $=await wt(x,y.pathname,d.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){if($.partialMatches.length===0){let{matches:ae,route:fe}=St(s);return{matches:ae,pendingActionResult:[fe.id,{type:"error",error:$.error}]}}let J=Ie($.partialMatches).route.id;return{matches:$.partialMatches,pendingActionResult:[J,{type:"error",error:$.error}]}}else if($.matches)x=$.matches;else{let{notFoundMatches:J,error:ae,route:fe}=Vt(y.pathname);return{matches:J,pendingActionResult:[fe.id,{type:"error",error:ae}]}}}let A,N=Dt(x,y);if(!N.route.action&&!N.route.lazy)A={type:"error",error:Se(405,{method:d.method,pathname:y.pathname,routeId:N.route.id})};else{let $=qe(o,i,d,x,N,k?[]:n,C),J=await tt(d,$,C,null);if(A=J[N.route.id],!A){for(let ae of x)if(J[ae.route.id]){A=J[ae.route.id];break}}if(d.signal.aborted)return{shortCircuited:!0}}if(Be(A)){let $;return _&&_.replace!=null?$=_.replace:$=un(A.response.headers.get("Location"),new URL(d.url),u)===p.location.pathname+p.location.search,await je(d,A,!0,{submission:w,replace:$}),{shortCircuited:!0}}if(Ee(A)){let $=Ie(x,N.route.id);return(_&&_.replace)!==!0&&(H="PUSH"),{matches:x,pendingActionResult:[$.route.id,A,N.route.id]}}return{matches:x,pendingActionResult:[N.route.id,A]}}async function ba(d,y,w,x,C,F,k,_,I,A,N,$){let J=F||Qt(y,k),ae=k||_||mn(J),fe=!te&&!A;if(C){if(fe){let pe=_r($);me({navigation:J,...pe!==void 0?{actionData:pe}:{}},{flushSync:N})}let K=await wt(w,y.pathname,d.signal);if(K.type==="aborted")return{shortCircuited:!0};if(K.type==="error"){if(K.partialMatches.length===0){let{matches:Ke,route:He}=St(s);return{matches:Ke,loaderData:{},errors:{[He.id]:K.error}}}let pe=Ie(K.partialMatches).route.id;return{matches:K.partialMatches,loaderData:{},errors:{[pe]:K.error}}}else if(K.matches)w=K.matches;else{let{error:pe,notFoundMatches:Ke,route:He}=Vt(y.pathname);return{matches:Ke,loaderData:{},errors:{[He.id]:pe}}}}let he=l||s,{dsMatches:ie,revalidatingFetchers:le}=nn(d,x,o,i,e.history,p,w,ae,y,A?[]:n,A===!0,ue,q,Z,W,j,he,u,e.patchRoutesOnNavigation!=null,$);if(v=++ye,!e.dataStrategy&&!ie.some(K=>K.shouldLoad)&&!ie.some(K=>K.route.middleware&&K.route.middleware.length>0)&&le.length===0){let K=Nr();return Je(y,{matches:w,loaderData:{},errors:$&&Ee($[1])?{[$[0]]:$[1].error}:null,...hn($),...K?{fetchers:new Map(p.fetchers)}:{}},{flushSync:N}),{shortCircuited:!0}}if(fe){let K={};if(!C){K.navigation=J;let pe=_r($);pe!==void 0&&(K.actionData=pe)}le.length>0&&(K.fetchers=Sa(le)),me(K,{flushSync:N})}le.forEach(K=>{Oe(K.key),K.controller&&Q.set(K.key,K.controller)});let Ue=()=>le.forEach(K=>Oe(K.key));U&&U.signal.addEventListener("abort",Ue);let{loaderResults:rt,fetcherResults:ke}=await Fr(ie,le,d,x);if(d.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",Ue),le.forEach(K=>Q.delete(K.key));let Pe=xt(rt);if(Pe)return await je(d,Pe.result,!0,{replace:I}),{shortCircuited:!0};if(Pe=xt(ke),Pe)return j.add(Pe.key),await je(d,Pe.result,!0,{replace:I}),{shortCircuited:!0};let{loaderData:Yt,errors:nt}=dn(p,w,rt,$,le,ke);A&&p.errors&&(nt={...p.errors,...nt});let ze=Nr(),Et=$r(v),Rt=ze||Et||le.length>0;return{matches:w,loaderData:Yt,errors:nt,...Rt?{fetchers:new Map(p.fetchers)}:{}}}function _r(d){if(d&&!Ee(d[1]))return{[d[0]]:d[1].data};if(p.actionData)return Object.keys(p.actionData).length===0?null:p.actionData}function Sa(d){return d.forEach(y=>{let w=p.fetchers.get(y.key),x=it(void 0,w?w.data:void 0);p.fetchers.set(y.key,x)}),new Map(p.fetchers)}async function xa(d,y,w,x){Oe(d);let C=(x&&x.flushSync)===!0,F=l||s,k=nr(p.location,p.matches,u,w,y,x?.relative),_=Fe(F,k,u),I=gt(_,F,k);if(I.active&&I.matches&&(_=I.matches),!_){Te(d,y,Se(404,{pathname:k}),{flushSync:C});return}let{path:A,submission:N,error:$}=rn(!0,k,x);if($){Te(d,y,$,{flushSync:C});return}let J=e.getContext?await e.getContext():new Xr,ae=(x&&x.preventScrollReset)===!0;if(N&&ve(N.formMethod)){await La(d,y,A,_,J,I.active,C,ae,N);return}W.set(d,{routeId:y,path:A}),await Pa(d,y,A,_,J,I.active,C,ae,N)}async function La(d,y,w,x,C,F,k,_,I){Bt(),W.delete(d);let A=p.fetchers.get(d);De(d,Go(I,A),{flushSync:k});let N=new AbortController,$=Ge(e.history,w,N.signal,I);if(F){let ce=await wt(x,new URL($.url).pathname,$.signal,d);if(ce.type==="aborted")return;if(ce.type==="error"){Te(d,y,ce.error,{flushSync:k});return}else if(ce.matches)x=ce.matches;else{Te(d,y,Se(404,{pathname:w}),{flushSync:k});return}}let J=Dt(x,w);if(!J.route.action&&!J.route.lazy){let ce=Se(405,{method:I.formMethod,pathname:w,routeId:y});Te(d,y,ce,{flushSync:k});return}Q.set(d,N);let ae=ye,fe=qe(o,i,$,x,J,n,C),he=await tt($,fe,C,d),ie=he[J.route.id];if(!ie){for(let ce of fe)if(he[ce.route.id]){ie=he[ce.route.id];break}}if($.signal.aborted){Q.get(d)===N&&Q.delete(d);return}if(Z.has(d)){if(Be(ie)||Ee(ie)){De(d,_e(void 0));return}}else{if(Be(ie))if(Q.delete(d),v>ae){De(d,_e(void 0));return}else return j.add(d),De(d,it(I)),je($,ie,!1,{fetcherSubmission:I,preventScrollReset:_});if(Ee(ie)){Te(d,y,ie.error);return}}let le=p.navigation.location||p.location,Ue=Ge(e.history,le,N.signal),rt=l||s,ke=p.navigation.state!=="idle"?Fe(rt,p.navigation.location,u):p.matches;z(ke,"Didn't find any matches after fetcher action");let Pe=++ye;P.set(d,Pe);let Yt=it(I,ie.data);p.fetchers.set(d,Yt);let{dsMatches:nt,revalidatingFetchers:ze}=nn(Ue,C,o,i,e.history,p,ke,I,le,n,!1,ue,q,Z,W,j,rt,u,e.patchRoutesOnNavigation!=null,[J.route.id,ie]);ze.filter(ce=>ce.key!==d).forEach(ce=>{let bt=ce.key,Br=p.fetchers.get(bt),ka=it(void 0,Br?Br.data:void 0);p.fetchers.set(bt,ka),Oe(bt),ce.controller&&Q.set(bt,ce.controller)}),me({fetchers:new Map(p.fetchers)});let Et=()=>ze.forEach(ce=>Oe(ce.key));N.signal.addEventListener("abort",Et);let{loaderResults:Rt,fetcherResults:K}=await Fr(nt,ze,Ue,C);if(N.signal.aborted)return;if(N.signal.removeEventListener("abort",Et),P.delete(d),Q.delete(d),ze.forEach(ce=>Q.delete(ce.key)),p.fetchers.has(d)){let ce=_e(ie.data);p.fetchers.set(d,ce)}let pe=xt(Rt);if(pe)return je(Ue,pe.result,!1,{preventScrollReset:_});if(pe=xt(K),pe)return j.add(pe.key),je(Ue,pe.result,!1,{preventScrollReset:_});let{loaderData:Ke,errors:He}=dn(p,ke,Rt,void 0,ze,K);$r(Pe),p.navigation.state==="loading"&&Pe>v?(z(H,"Expected pending action"),U&&U.abort(),Je(p.navigation.location,{matches:ke,loaderData:Ke,errors:He,fetchers:new Map(p.fetchers)})):(me({errors:He,loaderData:fn(p.loaderData,Ke,ke,He),fetchers:new Map(p.fetchers)}),ue=!1)}async function Pa(d,y,w,x,C,F,k,_,I){let A=p.fetchers.get(d);De(d,it(I,A?A.data:void 0),{flushSync:k});let N=new AbortController,$=Ge(e.history,w,N.signal);if(F){let le=await wt(x,new URL($.url).pathname,$.signal,d);if(le.type==="aborted")return;if(le.type==="error"){Te(d,y,le.error,{flushSync:k});return}else if(le.matches)x=le.matches;else{Te(d,y,Se(404,{pathname:w}),{flushSync:k});return}}let J=Dt(x,w);Q.set(d,N);let ae=ye,fe=qe(o,i,$,x,J,n,C),ie=(await tt($,fe,C,d))[J.route.id];if(Q.get(d)===N&&Q.delete(d),!$.signal.aborted){if(Z.has(d)){De(d,_e(void 0));return}if(Be(ie))if(v>ae){De(d,_e(void 0));return}else{j.add(d),await je($,ie,!1,{preventScrollReset:_});return}if(Ee(ie)){Te(d,y,ie.error);return}De(d,_e(ie.data))}}async function je(d,y,w,{submission:x,fetcherSubmission:C,preventScrollReset:F,replace:k}={}){w||(B?.resolve(),B=null),y.response.headers.has("X-Remix-Revalidate")&&(ue=!0);let _=y.response.headers.get("Location");z(_,"Expected a Location header on the redirect Response"),_=un(_,new URL(d.url),u);let I=ct(p.location,_,{_isRedirect:!0});if(r){let fe=!1;if(y.response.headers.has("X-Remix-Reload-Document"))fe=!0;else if($t(_)){const he=Cn(_,!0);fe=he.origin!==t.location.origin||Re(he.pathname,u)==null}if(fe){k?t.location.replace(_):t.location.assign(_);return}}U=null;let A=k===!0||y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:N,formAction:$,formEncType:J}=p.navigation;!x&&!C&&N&&$&&J&&(x=mn(p.navigation));let ae=x||C;if(Mo.has(y.response.status)&&ae&&ve(ae.formMethod))await Ae(A,I,{submission:{...ae,formAction:_},preventScrollReset:F||Y,enableViewTransition:w?de:void 0});else{let fe=Qt(I,x);await Ae(A,I,{overrideNavigation:fe,fetcherSubmission:C,preventScrollReset:F||Y,enableViewTransition:w?de:void 0})}}async function tt(d,y,w,x){let C,F={};try{C=await No(h,d,y,x,w,!1)}catch(k){return y.filter(_=>_.shouldLoad).forEach(_=>{F[_.route.id]={type:"error",error:k}}),F}if(d.signal.aborted)return F;for(let[k,_]of Object.entries(C))if(Yo(_)){let I=_.result;F[k]={type:"redirect",response:Uo(I,d,k,y,u)}}else F[k]=await jo(_);return F}async function Fr(d,y,w,x){let C=tt(w,d,x,null),F=Promise.all(y.map(async I=>{if(I.matches&&I.match&&I.request&&I.controller){let N=(await tt(I.request,I.matches,x,I.key))[I.match.route.id];return{[I.key]:N}}else return Promise.resolve({[I.key]:{type:"error",error:Se(404,{pathname:I.path})}})})),k=await C,_=(await F).reduce((I,A)=>Object.assign(I,A),{});return{loaderResults:k,fetcherResults:_}}function Bt(){ue=!0,W.forEach((d,y)=>{Q.has(y)&&q.add(y),Oe(y)})}function De(d,y,w={}){p.fetchers.set(d,y),me({fetchers:new Map(p.fetchers)},{flushSync:(w&&w.flushSync)===!0})}function Te(d,y,w,x={}){let C=Ie(p.matches,y);Wt(d),me({errors:{[C.route.id]:w},fetchers:new Map(p.fetchers)},{flushSync:(x&&x.flushSync)===!0})}function kr(d){return X.set(d,(X.get(d)||0)+1),Z.has(d)&&Z.delete(d),p.fetchers.get(d)||In}function Ca(d,y){Oe(d,y?.reason),De(d,_e(null))}function Wt(d){let y=p.fetchers.get(d);Q.has(d)&&!(y&&y.state==="loading"&&P.has(d))&&Oe(d),W.delete(d),P.delete(d),j.delete(d),Z.delete(d),q.delete(d),p.fetchers.delete(d)}function Ma(d){let y=(X.get(d)||0)-1;y<=0?(X.delete(d),Z.add(d)):X.set(d,y),me({fetchers:new Map(p.fetchers)})}function Oe(d,y){let w=Q.get(d);w&&(w.abort(y),Q.delete(d))}function Ir(d){for(let y of d){let w=kr(y),x=_e(w.data);p.fetchers.set(y,x)}}function Nr(){let d=[],y=!1;for(let w of j){let x=p.fetchers.get(w);z(x,`Expected fetcher: ${w}`),x.state==="loading"&&(j.delete(w),d.push(w),y=!0)}return Ir(d),y}function $r(d){let y=[];for(let[w,x]of P)if(x<d){let C=p.fetchers.get(w);z(C,`Expected fetcher: ${w}`),C.state==="loading"&&(Oe(w),P.delete(w),y.push(w))}return Ir(y),y.length>0}function Da(d,y){let w=p.blockers.get(d)||ot;return re.get(d)!==y&&re.set(d,y),w}function Ar(d){p.blockers.delete(d),re.delete(d)}function vt(d,y){let w=p.blockers.get(d)||ot;z(w.state==="unblocked"&&y.state==="blocked"||w.state==="blocked"&&y.state==="blocked"||w.state==="blocked"&&y.state==="proceeding"||w.state==="blocked"&&y.state==="unblocked"||w.state==="proceeding"&&y.state==="unblocked",`Invalid blocker state transition: ${w.state} -> ${y.state}`);let x=new Map(p.blockers);x.set(d,y),me({blockers:x})}function jr({currentLocation:d,nextLocation:y,historyAction:w}){if(re.size===0)return;re.size>1&&se(!1,"A router only supports one blocker at a time");let x=Array.from(re.entries()),[C,F]=x[x.length-1],k=p.blockers.get(C);if(!(k&&k.state==="proceeding")&&F({currentLocation:d,nextLocation:y,historyAction:w}))return C}function Vt(d){let y=Se(404,{pathname:d}),w=l||s,{matches:x,route:C}=St(w);return{notFoundMatches:x,route:C,error:y}}function Ta(d,y,w){if(E=d,R=y,L=w||null,!S&&p.navigation===qt){S=!0;let x=zr(p.location,p.matches);x!=null&&me({restoreScrollPosition:x})}return()=>{E=null,R=null,L=null}}function Ur(d,y){return L&&L(d,y.map(x=>Mn(x,p.loaderData)))||d.key}function Oa(d,y){if(E&&R){let w=Ur(d,y);E[w]=R()}}function zr(d,y){if(E){let w=Ur(d,y),x=E[w];if(typeof x=="number")return x}return null}function gt(d,y,w){if(e.patchRoutesOnNavigation)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:ut(y,w,u,!0)}}else return{active:!0,matches:ut(y,w,u,!0)||[]};return{active:!1,matches:null}}async function wt(d,y,w,x){if(!e.patchRoutesOnNavigation)return{type:"success",matches:d};let C=d;for(;;){let F=l==null,k=l||s,_=i;try{await e.patchRoutesOnNavigation({signal:w,path:y,matches:C,fetcherKey:x,patch:(N,$)=>{w.aborted||an(N,$,k,_,o,!1)}})}catch(N){return{type:"error",error:N,partialMatches:C}}finally{F&&!w.aborted&&(s=[...s])}if(w.aborted)return{type:"aborted"};let I=Fe(k,y,u),A=null;if(I){if(Object.keys(I[0].params).length===0)return{type:"success",matches:I};if(A=ut(k,y,u,!0),!(A&&C.length<A.length&&Hr(C,A.slice(0,C.length))))return{type:"success",matches:I}}if(A||(A=ut(k,y,u,!0)),!A||Hr(C,A))return{type:"success",matches:null};C=A}}function Hr(d,y){return d.length===y.length&&d.every((w,x)=>w.route.id===y[x].route.id)}function _a(d){i={},l=dt(d,o,void 0,i)}function Fa(d,y,w=!1){let x=l==null;an(d,y,l||s,i,o,w),x&&(s=[...s],me({}))}return O={get basename(){return u},get future(){return c},get state(){return p},get routes(){return s},get window(){return t},initialize:we,subscribe:wa,enableScrollRestoration:Ta,navigate:Or,fetch:xa,revalidate:Ea,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:kr,resetFetcher:Ca,deleteFetcher:Ma,dispose:ga,getBlocker:Da,deleteBlocker:Ar,patchRoutes:Fa,_internalFetchControllers:Q,_internalSetRoutes:_a,_internalSetStateDoNotUseOrYouWillBreakYourApp(d){me(d)}},e.unstable_instrumentations&&(O=wo(O,e.unstable_instrumentations.map(d=>d.router).filter(Boolean))),O}function To(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function nr(e,t,r,n,a,o){let i,s;if(a){i=[];for(let u of t)if(i.push(u),u.route.id===a){s=u;break}}else i=t,s=t[t.length-1];let l=yr(n||".",pr(i),Re(e.pathname,r)||e.pathname,o==="path");if(n==null&&(l.search=e.search,l.hash=e.hash),(n==null||n===""||n===".")&&s){let u=wr(l.search);if(s.route.index&&!u)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let h=new URLSearchParams(l.search),c=h.getAll("index");h.delete("index"),c.filter(g=>g).forEach(g=>h.append("index",g));let m=h.toString();l.search=m?`?${m}`:""}}return r!=="/"&&(l.pathname=so({basename:r,pathname:l.pathname})),Me(l)}function rn(e,t,r){if(!r||!To(r))return{path:t};if(r.formMethod&&!Jo(r.formMethod))return{path:t,error:Se(405,{method:r.formMethod})};let n=()=>({path:t,error:Se(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Bn(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,E])=>`${m}${g}=${E}
2
+ `,""):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()}}}z(typeof FormData=="function","FormData is not available in this environment");let s,l;if(r.formData)s=ir(r.formData),l=r.formData;else if(r.body instanceof FormData)s=ir(r.body),l=r.body;else if(r.body instanceof URLSearchParams)s=r.body,l=cn(s);else if(r.body==null)s=new URLSearchParams,l=new FormData;else try{s=new URLSearchParams(r.body),l=cn(s)}catch{return n()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(ve(u.formMethod))return{path:t,submission:u};let h=$e(t);return e&&h.search&&wr(h.search)&&s.append("index",""),h.search=`?${s}`,{path:Me(h),submission:u}}function nn(e,t,r,n,a,o,i,s,l,u,h,c,m,g,E,L,R,S,b,D){let T=D?Ee(D[1])?D[1].error:D[1].data:void 0,M=a.createURL(o.location),O=a.createURL(l),p;if(h&&o.errors){let G=Object.keys(o.errors)[0];p=i.findIndex(te=>te.route.id===G)}else if(D&&Ee(D[1])){let G=D[0];p=i.findIndex(te=>te.route.id===G)-1}let H=D?D[1].statusCode:void 0,B=H&&H>=400,Y={currentUrl:M,currentParams:o.matches[0]?.params||{},nextUrl:O,nextParams:i[0].params,...s,actionResult:T,actionStatus:H},U=ht(i),de=i.map((G,te)=>{let{route:ue}=G,q=null;if(p!=null&&te>p?q=!1:ue.lazy?q=!0:vr(ue)?h?q=ar(ue,o.loaderData,o.errors):Oo(o.loaderData,o.matches[te],G)&&(q=!0):q=!1,q!==null)return or(r,n,e,U,G,u,t,q);let Q=B?!1:c||M.pathname+M.search===O.pathname+O.search||M.search!==O.search||_o(o.matches[te],G),ye={...Y,defaultShouldRevalidate:Q},v=kt(G,ye);return or(r,n,e,U,G,u,t,v,ye)}),ee=[];return E.forEach((G,te)=>{if(h||!i.some(W=>W.route.id===G.routeId)||g.has(te))return;let ue=o.fetchers.get(te),q=ue&&ue.state!=="idle"&&ue.data===void 0,Q=Fe(R,G.path,S);if(!Q){if(b&&q)return;ee.push({key:te,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(L.has(te))return;let ye=Dt(Q,G.path),v=new AbortController,P=Ge(a,G.path,v.signal),j=null;if(m.has(te))m.delete(te),j=qe(r,n,P,Q,ye,u,t);else if(q)c&&(j=qe(r,n,P,Q,ye,u,t));else{let W={...Y,defaultShouldRevalidate:B?!1:c};kt(ye,W)&&(j=qe(r,n,P,Q,ye,u,t,W))}j&&ee.push({key:te,routeId:G.routeId,path:G.path,matches:j,match:ye,request:P,controller:v})}),{dsMatches:de,revalidatingFetchers:ee}}function vr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ar(e,t,r){if(e.lazy)return!0;if(!vr(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 Oo(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function _o(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function kt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function an(e,t,r,n,a,o){let i;if(e){let u=n[e];z(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r;let s=[],l=[];if(t.forEach(u=>{let h=i.find(c=>An(u,c));h?l.push({existingRoute:h,newRoute:u}):s.push(u)}),s.length>0){let u=dt(s,a,[e||"_","patch",String(i?.length||"0")],n);i.push(...u)}if(o&&l.length>0)for(let u=0;u<l.length;u++){let{existingRoute:h,newRoute:c}=l[u],m=h,[g]=dt([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 An(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)=>t.children?.some(a=>An(r,a))):!1}var on=new WeakMap,jn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(z(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let i=on.get(a);i||(i={},on.set(a,i));let s=i[e];if(s)return s;let l=(async()=>{let u=Ja(e),c=a[e]!==void 0&&e!=="hasErrorBoundary";if(u)se(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)se(!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]=l,l},ln=new WeakMap;function Fo(e,t,r,n,a){let o=r[e.id];if(z(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let h=ln.get(o);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let c=(async()=>{z(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),g={};for(let E in m){let L=m[E];if(L===void 0)continue;let R=Ga(E),b=o[E]!==void 0&&E!=="hasErrorBoundary";R?se(!R,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):b?se(!b,`Route "${o.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):g[E]=L}Object.assign(o,g),Object.assign(o,{...n(o),lazy:void 0})})();return ln.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),s=[],l;for(let h of i){if(a&&a.includes(h))continue;let c=jn({key:h,route:e,manifest:r,mapRouteProperties:n});c&&(s.push(c),h===t&&(l=c))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),l?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:l}}async function sn(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 ko(e){return e.matches.some(t=>t.route.middleware)?Un(e,()=>sn(e)):sn(e)}function Un(e,t){return Io(e,t,n=>n,Wo,r);function r(n,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:n}}));{let{matches:i}=e,s=Math.min(Math.max(i.findIndex(u=>u.route.id===a),0),Math.max(i.findIndex(u=>u.shouldCallHandler()),0)),l=Ie(i,i[s].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:n}})}}}async function Io(e,t,r,n,a){let{matches:o,request:i,params:s,context:l,unstable_pattern:u}=e,h=o.flatMap(m=>m.route.middleware?m.route.middleware.map(g=>[m.route.id,g]):[]);return await zn({request:i,params:s,context:l,unstable_pattern:u},h,t,r,n,a)}async function zn(e,t,r,n,a,o,i=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let l=t[i];if(!l)return await r();let[u,h]=l,c,m=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await zn(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),E=g!=null?n(g):void 0;return a(E)?E:c?E??c.value:(c={value:await m()},c.value)}catch(g){return await o(g,u,c)}}function Hn(e,t,r,n,a){let o=jn({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=Fo(n.route,ve(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function or(e,t,r,n,a,o,i,s,l=null){let u=!1,h=Hn(e,t,r,a,o);return{...a,_lazyPromises:h,shouldLoad:s,shouldRevalidateArgs:l,shouldCallHandler(c){return u=!0,l?typeof c=="boolean"?kt(a,{...l,defaultShouldRevalidate:c}):kt(a,l):s},resolve(c){let{lazy:m,loader:g,middleware:E}=a.route,L=u||s||c&&!ve(r.method)&&(m||g),R=E&&E.length>0&&!g&&!m;return L&&(ve(r.method)||!R)?$o({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:c,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function qe(e,t,r,n,a,o,i,s=null){return n.map(l=>l.route.id!==a.route.id?{...l,shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:Hn(e,t,r,l,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:or(e,t,r,ht(n),l,o,i,!0,s))}async function No(e,t,r,n,a,o){r.some(u=>u._lazyPromises?.middleware)&&await Promise.all(r.map(u=>u._lazyPromises?.middleware));let i={request:t,unstable_pattern:ht(r),params:r[0].params,context:a,matches:r},l=await e({...i,fetcherKey:n,runClientMiddleware:u=>{let h=i;return Un(h,()=>u({...h,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(u=>[u._lazyPromises?.handler,u._lazyPromises?.route]))}catch{}return l}async function $o({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let s,l,u=ve(e.method),h=u?"action":"loader",c=m=>{let g,E=new Promise((S,b)=>g=b);l=()=>g(),e.signal.addEventListener("abort",l);let L=S=>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},...S!==void 0?[S]:[]),R=(async()=>{try{return{type:"data",result:await(o?o(b=>L(b)):L())}}catch(S){return{type:"error",result:S}}})();return Promise.race([R,E])};try{let m=u?r.route.action:r.route.loader;if(n||a)if(m){let g,[E]=await Promise.all([c(m).catch(L=>{g=L}),n,a]);if(g!==void 0)throw g;s=E}else{await n;let g=u?r.route.action:r.route.loader;if(g)[s]=await Promise.all([c(g),a]);else if(h==="action"){let E=new URL(e.url),L=E.pathname+E.search;throw Se(405,{method:e.method,pathname:L,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(m)s=await c(m);else{let g=new URL(e.url),E=g.pathname+g.search;throw Se(404,{pathname:E})}}catch(m){return{type:"error",result:m}}finally{l&&e.signal.removeEventListener("abort",l)}return s}async function Ao(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){let{result:t,type:r}=e;if(gr(t)){let n;try{n=await Ao(t)}catch(a){return{type:"error",error:a}}return r==="error"?{type:"error",error:new Ve(t.status,t.statusText,n),statusCode:t.status,headers:t.headers}:{type:"data",data:n,statusCode:t.status,headers:t.headers}}return r==="error"?lr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:Bo(t),statusCode:We(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:We(t)?t.status:void 0}:lr(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Uo(e,t,r,n,a){let o=e.headers.get("Location");if(z(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!$t(o)){let i=n.slice(0,n.findIndex(s=>s.route.id===r)+1);o=nr(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function un(e,t,r){if($t(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=Re(a.pathname,r)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Ge(e,t,r,n){let a=e.createURL(Bn(t)).toString(),o={signal:r};if(n&&ve(n.formMethod)){let{formMethod:i,formEncType:s}=n;o.method=i.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(n.json)):s==="text/plain"?o.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?o.body=ir(n.formData):o.body=n.formData}return new Request(a,o)}function ir(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function cn(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function zo(e,t,r,n=!1,a=!1){let o={},i=null,s,l=!1,u={},h=r&&Ee(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(z(!Be(g),"Cannot handle redirect results in processLoaderData"),Ee(g)){let E=g.error;if(h!==void 0&&(E=h,h=void 0),i=i||{},a)i[m]=E;else{let L=Ie(e,m);i[L.route.id]==null&&(i[L.route.id]=E)}n||(o[m]=$n),l||(l=!0,s=We(g.error)?g.error.status:500),g.headers&&(u[m]=g.headers)}else o[m]=g.data,g.statusCode&&g.statusCode!==200&&!l&&(s=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:s||200,loaderHeaders:u}}function dn(e,t,r,n,a,o){let{loaderData:i,errors:s}=zo(t,r,n);return a.filter(l=>!l.matches||l.matches.some(u=>u.shouldLoad)).forEach(l=>{let{key:u,match:h,controller:c}=l;if(c&&c.signal.aborted)return;let m=o[u];if(z(m,"Did not find corresponding fetcher result"),Ee(m)){let g=Ie(e.matches,h?.route.id);s&&s[g.route.id]||(s={...s,[g.route.id]:m.error}),e.fetchers.delete(u)}else if(Be(m))z(!1,"Unhandled fetcher revalidation redirect");else{let g=_e(m.data);e.fetchers.set(u,g)}}),{loaderData:i,errors:s}}function fn(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==$n).reduce((o,[i,s])=>(o[i]=s,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 hn(e){return e?Ee(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ie(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 St(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 Se(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(i="Bad Request",n&&t&&r?s=`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"&&(s="Unable to encode submission body")):e===403?(i="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",s=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",n&&t&&r?s=`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&&(s=`Invalid request method "${n.toUpperCase()}"`)),new Ve(e||500,i,new Error(s),!0)}function xt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Be(a))return{key:n,result:a}}}function Bn(e){let t=typeof e=="string"?$e(e):e;return Me({...t,hash:""})}function Ho(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Bo(e){return new Ve(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function Wo(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Vo(r))}function Vo(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Yo(e){return gr(e.result)&&Co.has(e.result.status)}function Ee(e){return e.type==="error"}function Be(e){return(e&&e.type)==="redirect"}function lr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function gr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Jo(e){return Po.has(e.toUpperCase())}function ve(e){return xo.has(e.toUpperCase())}function wr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Dt(e,t){let r=typeof t=="string"?$e(t).search:t.search;if(e[e.length-1].route.index&&wr(r||""))return e[e.length-1];let n=_n(e);return n[n.length-1]}function mn(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 Qt(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 Ko(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 it(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 Go(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 _e(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 Xo(e,t){try{let r=e.sessionStorage.getItem(Nn);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 qo(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Nn,JSON.stringify(r))}catch(n){se(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function pn(){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 Ye=f.createContext(null);Ye.displayName="DataRouter";var Qe=f.createContext(null);Qe.displayName="DataRouterState";var Qo=f.createContext(!1);function Zo(){return f.useContext(Qo)}var Er=f.createContext({isTransitioning:!1});Er.displayName="ViewTransition";var Rr=f.createContext(new Map);Rr.displayName="Fetchers";var ei=f.createContext(null);ei.displayName="Await";var be=f.createContext(null);be.displayName="Navigation";var At=f.createContext(null);At.displayName="Location";var xe=f.createContext({outlet:null,matches:[],isDataRoute:!1});xe.displayName="Route";var br=f.createContext(null);br.displayName="RouteError";function ti(e,{relative:t}={}){z(mt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=f.useContext(be),{hash:a,pathname:o,search:i}=pt(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:Ce([r,o])),n.createHref({pathname:s,search:i,hash:a})}function mt(){return f.useContext(At)!=null}function Le(){return z(mt(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(At).location}var Wn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Vn(e){f.useContext(be).static||f.useLayoutEffect(e)}function Yn(){let{isDataRoute:e}=f.useContext(xe);return e?vi():ri()}function ri(){z(mt(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(Ye),{basename:t,navigator:r}=f.useContext(be),{matches:n}=f.useContext(xe),{pathname:a}=Le(),o=JSON.stringify(pr(n)),i=f.useRef(!1);return Vn(()=>{i.current=!0}),f.useCallback((l,u={})=>{if(se(i.current,Wn),!i.current)return;if(typeof l=="number"){r.go(l);return}let h=yr(l,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Ce([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,o,a,e])}var ni=f.createContext(null);function ai(e){let t=f.useContext(xe).outlet;return f.useMemo(()=>t&&f.createElement(ni.Provider,{value:e},t),[t,e])}function oi(){let{matches:e}=f.useContext(xe),t=e[e.length-1];return t?t.params:{}}function pt(e,{relative:t}={}){let{matches:r}=f.useContext(xe),{pathname:n}=Le(),a=JSON.stringify(pr(r));return f.useMemo(()=>yr(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function ii(e,t,r,n,a){z(mt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=f.useContext(be),{matches:i}=f.useContext(xe),s=i[i.length-1],l=s?s.params:{},u=s?s.pathname:"/",h=s?s.pathnameBase:"/",c=s&&s.route;{let b=c&&c.path||"";Gn(u,!c||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${b}">) 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.
3
+
4
+ Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let m=Le(),g;g=m;let E=g.pathname||"/",L=E;if(h!=="/"){let b=h.replace(/^\//,"").split("/");L="/"+E.replace(/^\//,"").split("/").slice(b.length).join("/")}let R=Fe(e,{pathname:L});return se(c||R!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),se(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.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.`),di(R&&R.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Ce([h,o.encodeLocation?o.encodeLocation(b.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?h:Ce([h,o.encodeLocation?o.encodeLocation(b.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),i,r,n,a)}function li(){let e=Kn(),t=We(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 si=f.createElement(li,null),ui=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(){return this.state.error!==void 0?f.createElement(xe.Provider,{value:this.props.routeContext},f.createElement(br.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ci({routeContext:e,match:t,children:r}){let n=f.useContext(Ye);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(xe.Provider,{value:e},r)}function di(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?.errors;if(i!=null){let h=o.findIndex(c=>c.route.id&&i?.[c.route.id]!==void 0);z(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 s=!1,l=-1;if(r)for(let h=0;h<o.length;h++){let c=o[h];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=h),c.route.id){let{loaderData:m,errors:g}=r,E=c.route.loader&&!m.hasOwnProperty(c.route.id)&&(!g||g[c.route.id]===void 0);if(c.route.lazy||E){s=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}let u=r&&n?(h,c)=>{n(h,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:ht(r.matches),errorInfo:c})}:void 0;return o.reduceRight((h,c,m)=>{let g,E=!1,L=null,R=null;r&&(g=i&&c.route.id?i[c.route.id]:void 0,L=c.route.errorElement||si,s&&(l<0&&m===0?(Gn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,R=null):l===m&&(E=!0,R=c.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,m+1)),b=()=>{let D;return g?D=L:E?D=R:c.route.Component?D=f.createElement(c.route.Component,null):c.route.element?D=c.route.element:D=h,f.createElement(ci,{match:c,routeContext:{outlet:h,matches:S,isDataRoute:r!=null},children:D})};return r&&(c.route.ErrorBoundary||c.route.errorElement||m===0)?f.createElement(ui,{location:r.location,revalidation:r.revalidation,component:L,error:g,children:b(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:u}):b()},null)}function Sr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Jn(e){let t=f.useContext(Ye);return z(t,Sr(e)),t}function Ze(e){let t=f.useContext(Qe);return z(t,Sr(e)),t}function fi(e){let t=f.useContext(xe);return z(t,Sr(e)),t}function yt(e){let t=fi(e),r=t.matches[t.matches.length-1];return z(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function hi(){return yt("useRouteId")}function mi(){return Ze("useNavigation").navigation}function rs(){let e=Jn("useRevalidator"),t=Ze("useRevalidator"),r=f.useCallback(async()=>{await e.router.revalidate()},[e.router]);return f.useMemo(()=>({revalidate:r,state:t.revalidation}),[r,t.revalidation])}function xr(){let{matches:e,loaderData:t}=Ze("useMatches");return f.useMemo(()=>e.map(r=>Mn(r,t)),[e,t])}function pi(){let e=Ze("useLoaderData"),t=yt("useLoaderData");return e.loaderData[t]}function yi(){let e=Ze("useActionData"),t=yt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Kn(){let e=f.useContext(br),t=Ze("useRouteError"),r=yt("useRouteError");return e!==void 0?e:t.errors?.[r]}function vi(){let{router:e}=Jn("useNavigate"),t=yt("useNavigate"),r=f.useRef(!1);return Vn(()=>{r.current=!0}),f.useCallback(async(a,o={})=>{se(r.current,Wn),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var yn={};function Gn(e,t,r){!t&&!yn[e]&&(yn[e]=!0,se(!1,r))}var vn={};function sr(e,t){!e&&!vn[t]&&(vn[t]=!0,console.warn(t))}var gi="useOptimistic",gn=za[gi],wi=()=>{};function Ei(e){return gn?gn(e):[e,wi]}function ns(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&se(!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&&se(!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&&se(!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 as=["HydrateFallback","hydrateFallbackElement"],Ri=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 os({router:e,flushSync:t,unstable_onError:r,unstable_useTransitions:n}){let[a,o]=f.useState(e.state),[i,s]=Ei(a),[l,u]=f.useState(),[h,c]=f.useState({isTransitioning:!1}),[m,g]=f.useState(),[E,L]=f.useState(),[R,S]=f.useState(),b=f.useRef(new Map),D=f.useCallback((p,{deletedFetchers:H,newErrors:B,flushSync:Y,viewTransitionOpts:U})=>{B&&r&&Object.values(B).forEach(ee=>r(ee,{location:p.location,params:p.matches[0]?.params??{},unstable_pattern:ht(p.matches)})),p.fetchers.forEach((ee,G)=>{ee.data!==void 0&&b.current.set(G,ee.data)}),H.forEach(ee=>b.current.delete(ee)),sr(Y===!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 de=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(sr(U==null||de,"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."),!U||!de){t&&Y?t(()=>o(p)):n===!1?o(p):f.startTransition(()=>{n===!0&&s(ee=>wn(ee,p)),o(p)});return}if(t&&Y){t(()=>{E&&(m?.resolve(),E.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let ee=e.window.document.startViewTransition(()=>{t(()=>o(p))});ee.finished.finally(()=>{t(()=>{g(void 0),L(void 0),u(void 0),c({isTransitioning:!1})})}),t(()=>L(ee));return}E?(m?.resolve(),E.skipTransition(),S({state:p,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(u(p),c({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[e.window,t,E,m,n,s,r]);f.useLayoutEffect(()=>e.subscribe(D),[e,D]),f.useEffect(()=>{h.isTransitioning&&!h.flushSync&&g(new Ri)},[h]),f.useEffect(()=>{if(m&&l&&e.window){let p=l,H=m.promise,B=e.window.document.startViewTransition(async()=>{n===!1?o(p):f.startTransition(()=>{n===!0&&s(Y=>wn(Y,p)),o(p)}),await H});B.finished.finally(()=>{g(void 0),L(void 0),u(void 0),c({isTransitioning:!1})}),L(B)}},[l,m,e.window,n,s]),f.useEffect(()=>{m&&l&&i.location.key===l.location.key&&m.resolve()},[m,E,i.location,l]),f.useEffect(()=>{!h.isTransitioning&&R&&(u(R.state),c({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),S(void 0))},[h.isTransitioning,R]);let T=f.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:p=>e.navigate(p),push:(p,H,B)=>e.navigate(p,{state:H,preventScrollReset:B?.preventScrollReset}),replace:(p,H,B)=>e.navigate(p,{replace:!0,state:H,preventScrollReset:B?.preventScrollReset})}),[e]),M=e.basename||"/",O=f.useMemo(()=>({router:e,navigator:T,static:!1,basename:M,unstable_onError:r}),[e,T,M,r]);return f.createElement(f.Fragment,null,f.createElement(Ye.Provider,{value:O},f.createElement(Qe.Provider,{value:i},f.createElement(Rr.Provider,{value:b.current},f.createElement(Er.Provider,{value:h},f.createElement(xi,{basename:M,location:i.location,navigationType:i.historyAction,navigator:T,unstable_useTransitions:n===!0},f.createElement(bi,{routes:e.routes,future:e.future,state:i,unstable_onError:r})))))),null)}function wn(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 bi=f.memo(Si);function Si({routes:e,future:t,state:r,unstable_onError:n}){return ii(e,void 0,r,n,t)}function is(e){return ai(e.context)}function xi({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:i}){z(!mt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=f.useMemo(()=>({basename:s,navigator:a,static:o,unstable_useTransitions:i,future:{}}),[s,a,o,i]);typeof r=="string"&&(r=$e(r));let{pathname:u="/",search:h="",hash:c="",state:m=null,key:g="default"}=r,E=f.useMemo(()=>{let L=Re(u,s);return L==null?null:{location:{pathname:L,search:h,hash:c,state:m,key:g},navigationType:n}},[s,u,h,c,m,g,n]);return se(E!=null,`<Router basename="${s}"> 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.`),E==null?null:f.createElement(be.Provider,{value:l},f.createElement(At.Provider,{children:t,value:E}))}function Li(){return{params:oi(),loaderData:pi(),actionData:yi(),matches:xr()}}function ls(e){return function(){const r=Li();return f.createElement(e,r)}}var Tt="get",Ot="application/x-www-form-urlencoded";function jt(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Pi(e){return jt(e)&&e.tagName.toLowerCase()==="button"}function Ci(e){return jt(e)&&e.tagName.toLowerCase()==="form"}function Mi(e){return jt(e)&&e.tagName.toLowerCase()==="input"}function Di(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ti(e,t){return e.button===0&&(!t||t==="_self")&&!Di(e)}function ur(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 Oi(e,t){let r=ur(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var Lt=null;function _i(){if(Lt===null)try{new FormData(document.createElement("form"),0),Lt=!1}catch{Lt=!0}return Lt}var Fi=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zt(e){return e!=null&&!Fi.has(e)?(se(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ot}"`),null):e}function ki(e,t){let r,n,a,o,i;if(Ci(e)){let s=e.getAttribute("action");n=s?Re(s,t):null,r=e.getAttribute("method")||Tt,a=Zt(e.getAttribute("enctype"))||Ot,o=new FormData(e)}else if(Pi(e)||Mi(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(n=l?Re(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Tt,a=Zt(e.getAttribute("formenctype"))||Zt(s.getAttribute("enctype"))||Ot,o=new FormData(s,e),!_i()){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(jt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Tt,n=null,a=Ot,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}var Ii=-1,Ni=-2,$i=-3,Ai=-4,ji=-5,Ui=-6,zi=-7,Hi="B",Bi="D",Xn="E",Wi="M",Vi="N",qn="P",Yi="R",Ji="S",Ki="Y",Gi="U",Xi="Z",Qn=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function qi(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(`
5
+ `);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 er=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function cr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return En.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,En.call(this,n)}function En(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const i=[[e,l=>{o=l}]];let s=[];for(;i.length>0;){const[l,u]=i.pop();switch(l){case zi:u(void 0);continue;case ji:u(null);continue;case Ni:u(NaN);continue;case Ui:u(1/0);continue;case $i:u(-1/0);continue;case Ai:u(-0);continue}if(t[l]){u(t[l]);continue}const h=r[l];if(!h||typeof h!="object"){t[l]=h,u(h);continue}if(Array.isArray(h))if(typeof h[0]=="string"){const[c,m,g]=h;switch(c){case Bi:u(t[l]=new Date(m));continue;case Gi:u(t[l]=new URL(m));continue;case Hi:u(t[l]=BigInt(m));continue;case Yi:u(t[l]=new RegExp(m,g));continue;case Ki:u(t[l]=Symbol.for(m));continue;case Ji:const E=new Set;t[l]=E;for(let T=h.length-1;T>0;T--)i.push([h[T],M=>{E.add(M)}]);u(E);continue;case Wi:const L=new Map;t[l]=L;for(let T=h.length-2;T>0;T-=2){const M=[];i.push([h[T+1],O=>{M[1]=O}]),i.push([h[T],O=>{M[0]=O}]),s.push(()=>{L.set(M[0],M[1])})}u(L);continue;case Vi:const R=Object.create(null);t[l]=R;for(const T of Object.keys(m).reverse()){const M=[];i.push([m[T],O=>{M[1]=O}]),i.push([Number(T.slice(1)),O=>{M[0]=O}]),s.push(()=>{R[M[0]]=M[1]})}u(R);continue;case qn:if(t[m])u(t[l]=t[m]);else{const T=new Qn;n[m]=T,u(t[l]=T.promise)}continue;case Xn:const[,S,b]=h;let D=b&&er&&er[b]?new er[b](S):new Error(S);t[l]=D,u(D);continue;case Xi:u(t[l]=t[m]);continue;default:if(Array.isArray(a)){const T=[],M=h.slice(1);for(let O=0;O<M.length;O++){const p=M[O];i.push([p,H=>{T[O]=H}])}s.push(()=>{for(const O of a){const p=O(h[0],...T);if(p){u(t[l]=p.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const c=[];t[l]=c;for(let m=0;m<h.length;m++){const g=h[m];g!==Ii&&i.push([g,E=>{c[m]=E}])}u(c);continue}else{const c={};t[l]=c;for(const m of Object.keys(h).reverse()){const g=[];i.push([h[m],E=>{g[1]=E}]),i.push([Number(m.slice(1)),E=>{g[0]=E}]),s.push(()=>{c[g[0]]=g[1]})}u(c);continue}}for(;s.length>0;)s.pop()();return o}async function Qi(e,t){const{plugins:r}=t??{},n=new Qn,a=e.pipeThrough(qi()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await Zi.call(o,a);let s=n.promise;return i.done?n.resolve():s=el.call(o,a).then(n.resolve).catch(l=>{for(const u of Object.values(o.deferred))u.reject(l);n.reject(l)}),{done:s.then(()=>a.closed),value:i.value}}async function Zi(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:cr.call(this,r)}}async function el(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case qn:{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 s;try{s=JSON.parse(i)}catch{throw new SyntaxError}const l=cr.call(this,s);o.resolve(l);break}case Xn:{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 s;try{s=JSON.parse(i)}catch{throw new SyntaxError}const l=cr.call(this,s);o.reject(l);break}default:throw new SyntaxError}t=await e.read()}}async function tl(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 rl={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},nl=/[&><\u2028\u2029]/g;function al(e){return e.replace(nl,t=>rl[t])}function ge(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var dr=Symbol("SingleFetchRedirect"),Zn=class extends Error{},ol=202,il=new Set([100,101,204,205]);function ss(e,t,r,n,a){let o=ll(e,i=>{let s=t.routes[i.route.id];ge(s,"Route not found in manifest");let l=r[i.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!l?.shouldRevalidate}},ml,n,a);return async i=>i.runClientMiddleware(o)}function ll(e,t,r,n,a,o=()=>!0){return async i=>{let{request:s,matches:l,fetcherKey:u}=i,h=e();if(s.method!=="GET")return sl(i,r,a);let c=l.some(m=>{let{hasLoader:g,hasClientLoader:E}=t(m);return m.shouldCallHandler()&&g&&!E});return!n&&!c?ul(i,t,r,a):u?fl(i,r,a):cl(i,h,t,r,n,a,o)}}async function sl(e,t,r){let n=e.matches.find(i=>i.shouldCallHandler());ge(n,"No action match found");let a,o=await n.resolve(async i=>await i(async()=>{let{data:l,status:u}=await t(e,r,[n.route.id]);return a=u,ft(l,n.route.id)}));return gr(o.result)||We(o.result)||lr(o.result)?{[n.route.id]:o}:{[n.route.id]:{type:o.type,result:yo(o.result,a)}}}async function ul(e,t,r,n){let a=e.matches.filter(i=>i.shouldCallHandler()),o={};return await Promise.all(a.map(i=>i.resolve(async s=>{try{let{hasClientLoader:l}=t(i),u=i.route.id,h=l?await s(async()=>{let{data:c}=await r(e,n,[u]);return ft(c,u)}):await s();o[i.route.id]={type:"data",result:h}}catch(l){o[i.route.id]={type:"error",result:l}}}))),o}async function cl(e,t,r,n,a,o,i=()=>!0){let s=new Set,l=!1,u=e.matches.map(()=>Rn()),h=Rn(),c={},m=Promise.all(e.matches.map(async(E,L)=>E.resolve(async R=>{u[L].resolve();let S=E.route.id,{hasLoader:b,hasClientLoader:D,hasShouldRevalidate:T}=r(E),M=!E.shouldRevalidateArgs||E.shouldRevalidateArgs.actionStatus==null||E.shouldRevalidateArgs.actionStatus<400;if(!E.shouldCallHandler(M)){l||(l=E.shouldRevalidateArgs!=null&&b&&T===!0);return}if(i(E)&&D){b&&(l=!0);try{let p=await R(async()=>{let{data:H}=await n(e,o,[S]);return ft(H,S)});c[S]={type:"data",result:p}}catch(p){c[S]={type:"error",result:p}}return}b&&s.add(S);try{let p=await R(async()=>{let H=await h.promise;return ft(H,S)});c[S]={type:"data",result:p}}catch(p){c[S]={type:"error",result:p}}})));if(await Promise.all(u.map(E=>E.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)h.resolve({routes:{}});else{let E=a&&l&&s.size>0?[...s.keys()]:void 0;try{let L=await n(e,o,E);h.resolve(L.data)}catch(L){h.reject(L)}}return await m,await dl(h.promise,e.matches,s,c),c}async function dl(e,t,r,n){try{let a,o=await e;if("routes"in o){for(let i of t)if(i.route.id in o.routes){let s=o.routes[i.route.id];if("error"in s){a=s.error,n[i.route.id]?.result==null&&(n[i.route.id]={type:"error",result:a});break}}}a!==void 0&&Array.from(r.values()).forEach(i=>{n[i].result instanceof Zn&&(n[i].result=a)})}catch{}}async function fl(e,t,r){let n=e.matches.find(i=>i.shouldCallHandler());ge(n,"No fetcher match found");let a=n.route.id,o=await n.resolve(async i=>i(async()=>{let{data:s}=await t(e,r,[a]);return ft(s,a)}));return{[n.route.id]:o}}function hl(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 ea(e,t,r){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname=`_root.${r}`:t&&Re(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function ml(e,t,r){let{request:n}=e,a=ea(n.url,t,"data");n.method==="GET"&&(a=hl(a),r&&a.searchParams.set("_routes",r.join(",")));let o=await fetch(a,await tl(n));if(o.status>=400&&!o.headers.has("X-Remix-Response"))throw new Ve(o.status,o.statusText,await o.text());if(o.status===204&&o.headers.has("X-Remix-Redirect"))return{status:ol,data:{redirect:{redirect:o.headers.get("X-Remix-Redirect"),status:Number(o.headers.get("X-Remix-Status")||"302"),revalidate:o.headers.get("X-Remix-Revalidate")==="true",reload:o.headers.get("X-Remix-Reload-Document")==="true",replace:o.headers.get("X-Remix-Replace")==="true"}}};if(il.has(o.status)){let i={};return r&&n.method!=="GET"&&(i[r[0]]={data:void 0}),{status:o.status,data:{routes:i}}}ge(o.body,"No response body to decode");try{let i=await pl(o.body,window),s;if(n.method==="GET"){let l=i.value;dr in l?s={redirect:l[dr]}:s={routes:l}}else{let l=i.value,u=r?.[0];ge(u,"No routeId found for single fetch call decoding"),"redirect"in l?s={redirect:l}:s={routes:{[u]:l}}}return{status:o.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function pl(e,t){return Qi(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,o,i]=n,s=Error;a&&a in t&&typeof t[a]=="function"&&(s=t[a]);let l=new s(o);return l.stack=i,{value:l}}if(r==="ErrorResponse"){let[a,o,i]=n;return{value:new Ve(o,i,a)}}if(r==="SingleFetchRedirect")return{value:{[dr]:n[0]}};if(r==="SingleFetchClassInstance")return{value:n[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function ft(e,t){if("redirect"in e){let{redirect:n,revalidate:a,reload:o,replace:i,status:s}=e.redirect;throw vo(n,{status:s,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 Zn(`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 Rn(){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 ta(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 yl(e,t,r){let n=e.map(o=>{let i=t[o.route.id],s=r.routes[o.route.id];return[s&&s.css?s.css.map(l=>({rel:"stylesheet",href:l})):[],i?.links?.()||[]]}).flat(2),a=Pr(e,r);return oa(n,a)}function ra(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function vl(e){if(!e.css)return;let t=ra(e);await Promise.all(t.map(aa))}async function na(e,t){if(!e.css&&!t.links||!bl())return;let r=[];if(e.css&&r.push(...ra(e)),t.links&&r.push(...t.links()),r.length===0)return;let n=[];for(let a of r)!Lr(a)&&a.rel==="stylesheet"&&n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(aa))}async function aa(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 Lr(e){return e!=null&&typeof e.page=="string"}function gl(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 wl(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let i=await ta(o,r);return i.links?i.links():[]}return[]}));return oa(n.flat(1).filter(gl).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function bn(e,t,r,n,a,o){let i=(l,u)=>r[u]?l.route.id!==r[u].route.id:!0,s=(l,u)=>r[u].pathname!==l.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==l.params["*"];return o==="assets"?t.filter((l,u)=>i(l,u)||s(l,u)):o==="data"?t.filter((l,u)=>{let h=n.routes[l.route.id];if(!h||!h.hasLoader)return!1;if(i(l,u)||s(l,u))return!0;if(l.route.shouldRevalidate){let c=l.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof c=="boolean")return c}return!0}):[]}function Pr(e,t,{includeHydrateFallback:r}={}){return El(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 El(e){return[...new Set(e)]}function Rl(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function oa(e,t){let r=new Set,n=new Set(t);return e.reduce((a,o)=>{if(t&&!Lr(o)&&o.as==="script"&&o.href&&n.has(o.href))return a;let s=JSON.stringify(Rl(o));return r.has(s)||(r.add(s),a.push({key:s,link:o})),a},[])}var Pt;function bl(){if(Pt!==void 0)return Pt;let e=document.createElement("link");return Pt=e.relList.supports("preload"),e=null,Pt}function Sl(){return f.createElement(fr,{title:"Loading...",renderScripts:!0},f.createElement("script",{dangerouslySetInnerHTML:{__html:`
6
+ console.log(
7
+ "💿 Hey developer 👋. You can provide a way better UX than this " +
8
+ "when your app is loading JS modules and/or running \`clientLoader\` " +
9
+ "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
10
+ "for more information."
11
+ );
12
+ `}}))}function ia(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 xl(e,t,r){let n=la(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Sl:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>f.createElement(ca,{error:Kn()}):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 us(e,t,r,n,a,o){return Cr(t,r,n,a,o,"",ia(t),e)}function Ct(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 Ve(400,"Bad Request",new Error(n),!0)}}function tr(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 Ve(405,"Method Not Allowed",new Error(n),!0)}function Cr(e,t,r,n,a,o="",i=ia(e),s){return(i[o]||[]).map(l=>{let u=t[l.id];function h(b){return ge(typeof b=="function","No single fetch function available for route handler"),b()}function c(b){return l.hasLoader?h(b):Promise.resolve(null)}function m(b){if(!l.hasAction)throw tr("action",l.id);return h(b)}function g(b){import(b)}function E(b){b.clientActionModule&&g(b.clientActionModule),b.clientLoaderModule&&g(b.clientLoaderModule)}async function L(b){let D=t[l.id],T=D?na(l,D):Promise.resolve();try{return b()}finally{await T}}let R={id:l.id,index:l.index,path:l.path};if(u){Object.assign(R,{...R,...xl(l,u,a),middleware:u.clientMiddleware,handle:u.handle,shouldRevalidate:Sn(R.path,u,l,n,s)});let b=r&&r.loaderData&&l.id in r.loaderData,D=b?r?.loaderData?.[l.id]:void 0,T=r&&r.errors&&l.id in r.errors,M=T?r?.errors?.[l.id]:void 0,O=s==null&&(u.clientLoader?.hydrate===!0||!l.hasLoader);R.loader=async({request:p,params:H,context:B,unstable_pattern:Y},U)=>{try{return await L(async()=>(ge(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:p,params:H,context:B,unstable_pattern:Y,async serverLoader(){if(Ct("loader",l),O){if(b)return D;if(T)throw M}return c(U)}}):c(U)))}finally{O=!1}},R.loader.hydrate=Cl(l.id,u.clientLoader,l.hasLoader,a),R.action=({request:p,params:H,context:B,unstable_pattern:Y},U)=>L(async()=>{if(ge(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(a)throw tr("clientAction",l.id);return m(U)}return u.clientAction({request:p,params:H,context:B,unstable_pattern:Y,async serverAction(){return Ct("action",l),m(U)}})})}else{l.hasClientLoader||(R.loader=(T,M)=>L(()=>c(M))),l.hasClientAction||(R.action=(T,M)=>L(()=>{if(a)throw tr("clientAction",l.id);return m(M)}));let b;async function D(){return b?await b:(b=(async()=>{(l.clientLoaderModule||l.clientActionModule)&&await new Promise(M=>setTimeout(M,0));let T=Pl(l,t);return E(l),await T})(),await b)}R.lazy={loader:l.hasClientLoader?async()=>{let{clientLoader:T}=l.clientLoaderModule?await import(l.clientLoaderModule):await D();return ge(T,"No `clientLoader` export found"),(M,O)=>T({...M,async serverLoader(){return Ct("loader",l),c(O)}})}:void 0,action:l.hasClientAction?async()=>{let T=l.clientActionModule?import(l.clientActionModule):D();E(l);let{clientAction:M}=await T;return ge(M,"No `clientAction` export found"),(O,p)=>M({...O,async serverAction(){return Ct("action",l),m(p)}})}:void 0,middleware:l.hasClientMiddleware?async()=>{let{clientMiddleware:T}=l.clientMiddlewareModule?await import(l.clientMiddlewareModule):await D();return ge(T,"No `clientMiddleware` export found"),T}:void 0,shouldRevalidate:async()=>{let T=await D();return Sn(R.path,T,l,n,s)},handle:async()=>(await D()).handle,Component:async()=>(await D()).Component,ErrorBoundary:l.hasErrorBoundary?async()=>(await D()).ErrorBoundary:void 0}}let S=Cr(e,t,r,n,a,l.id,i,s);return S.length>0&&(R.children=S),R})}function Sn(e,t,r,n,a){if(a)return Ll(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let o=e?On(e)[1].map(s=>s.paramName):[];const i=s=>o.some(l=>s.currentParams[l]!==s.nextParams[l]);if(t.shouldRevalidate){let s=t.shouldRevalidate;return l=>s({...l,defaultShouldRevalidate:i(l)})}else return s=>i(s)}return t.shouldRevalidate}function Ll(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function Pl(e,t){let r=ta(e,t),n=vl(e),a=await r;return await Promise.all([n,na(e,a)]),{Component:la(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 la(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Cl(e,t,r,n){return n&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var _t=new Set,Ml=1e3,It=new Set,Dl=7680;function Mr(e,t){return e.mode==="lazy"&&t===!0}function Tl({sri:e,...t},r){let n=new Set(r.state.matches.map(s=>s.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(s=>{let l=Fe(r.routes,s,r.basename);l&&l.forEach(u=>n.add(u.route.id))});let i=[...n].reduce((s,l)=>Object.assign(s,{[l]:t.routes[l]}),{});return{...t,routes:i,sri:e?!0:void 0}}function cs(e,t,r,n,a,o){if(Mr(n,r))return async({path:i,patch:s,signal:l,fetcherKey:u})=>{It.has(i)||await sa([i],u?window.location.href:i,e,t,r,a,o,n.manifestPath,s,l)}}function ds(e,t,r,n,a,o){f.useEffect(()=>{if(!Mr(a,n)||window.navigator?.connection?.saveData===!0)return;function i(h){let c=h.tagName==="FORM"?h.getAttribute("action"):h.getAttribute("href");if(!c)return;let m=h.tagName==="A"?h.pathname:new URL(c,window.location.origin).pathname;It.has(m)||_t.add(m)}async function s(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let h=Array.from(_t.keys()).filter(c=>It.has(c)?(_t.delete(c),!1):!0);if(h.length!==0)try{await sa(h,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(c){console.error("Failed to fetch manifest patches",c)}}let l=Fl(s,100);s();let u=new MutationObserver(()=>l());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 Ol(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var rr="react-router-manifest-version";async function sa(e,t,r,n,a,o,i,s,l,u){const h=new URLSearchParams;h.set("paths",e.sort().join(",")),h.set("version",r.version);let c=new URL(Ol(s,i),window.location.origin);if(c.search=h.toString(),c.toString().length>Dl){_t.clear();return}let m;try{let R=await fetch(c,{signal:u});if(R.ok){if(R.status===204&&R.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(rr)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(rr,r.version)}catch{}window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(R.status>=400)throw new Error(await R.text())}else throw new Error(`${R.status} ${R.statusText}`);try{sessionStorage.removeItem(rr)}catch{}m=await R.json()}catch(R){if(u?.aborted)return;throw R}let g=new Set(Object.keys(r.routes)),E=Object.values(m).reduce((R,S)=>(S&&!g.has(S.id)&&(R[S.id]=S),R),{});Object.assign(r.routes,E),e.forEach(R=>_l(R,It));let L=new Set;Object.values(E).forEach(R=>{R&&(!R.parentId||!E[R.parentId])&&L.add(R.parentId)}),L.forEach(R=>l(R||null,Cr(E,n,null,a,o,R)))}function _l(e,t){if(t.size>=Ml){let r=t.values().next().value;t.delete(r)}t.add(e)}function Fl(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function Dr(){let e=f.useContext(Ye);return ge(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ut(){let e=f.useContext(Qe);return ge(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var zt=f.createContext(void 0);zt.displayName="FrameworkContext";function et(){let e=f.useContext(zt);return ge(e,"You must render this element inside a <HydratedRouter> element"),e}function kl(e,t){let r=f.useContext(zt),[n,a]=f.useState(!1),[o,i]=f.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:h,onTouchStart:c}=t,m=f.useRef(null);f.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let L=S=>{S.forEach(b=>{i(b.isIntersecting)})},R=new IntersectionObserver(L,{threshold:.5});return m.current&&R.observe(m.current),()=>{R.disconnect()}}},[e]),f.useEffect(()=>{if(n){let L=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(L)}}},[n]);let g=()=>{a(!0)},E=()=>{a(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:lt(s,g),onBlur:lt(l,E),onMouseEnter:lt(u,g),onMouseLeave:lt(h,E),onTouchStart:lt(c,g)}]:[!1,m,{}]}function lt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Tr(e,t,r){if(r&&!Nt)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 xn="data-react-router-critical-css";function fs({nonce:e}){let{isSpaMode:t,manifest:r,routeModules:n,criticalCss:a}=et(),{errors:o,matches:i}=Ut(),s=Tr(i,o,t),l=f.useMemo(()=>yl(s,n,r),[s,n,r]);return f.createElement(f.Fragment,null,typeof a=="string"?f.createElement("style",{[xn]:"",dangerouslySetInnerHTML:{__html:a}}):null,typeof a=="object"?f.createElement("link",{[xn]:"",rel:"stylesheet",href:a.href,nonce:e}):null,l.map(({key:u,link:h})=>Lr(h)?f.createElement(ua,{key:u,nonce:e,...h}):f.createElement("link",{key:u,nonce:e,...h})))}function ua({page:e,...t}){let{router:r}=Dr(),n=f.useMemo(()=>Fe(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?f.createElement(Nl,{page:e,matches:n,...t}):null}function Il(e){let{manifest:t,routeModules:r}=et(),[n,a]=f.useState([]);return f.useEffect(()=>{let o=!1;return wl(e,t,r).then(i=>{o||a(i)}),()=>{o=!0}},[e,t,r]),n}function Nl({page:e,matches:t,...r}){let n=Le(),{manifest:a,routeModules:o}=et(),{basename:i}=Dr(),{loaderData:s,matches:l}=Ut(),u=f.useMemo(()=>bn(e,t,l,a,n,"data"),[e,t,l,a,n]),h=f.useMemo(()=>bn(e,t,l,a,n,"assets"),[e,t,l,a,n]),c=f.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let E=new Set,L=!1;if(t.forEach(S=>{let b=a.routes[S.route.id];!b||!b.hasLoader||(!u.some(D=>D.route.id===S.route.id)&&S.route.id in s&&o[S.route.id]?.shouldRevalidate||b.hasClientLoader?L=!0:E.add(S.route.id))}),E.size===0)return[];let R=ea(e,i,"data");return L&&E.size>0&&R.searchParams.set("_routes",t.filter(S=>E.has(S.route.id)).map(S=>S.route.id).join(",")),[R.pathname+R.search]},[i,s,n,a,u,t,e,o]),m=f.useMemo(()=>Pr(h,a),[h,a]),g=Il(h);return f.createElement(f.Fragment,null,c.map(E=>f.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),m.map(E=>f.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),g.map(({key:E,link:L})=>f.createElement("link",{key:E,nonce:r.nonce,...L})))}function hs(){let{isSpaMode:e,routeModules:t}=et(),{errors:r,matches:n,loaderData:a}=Ut(),o=Le(),i=Tr(n,r,e),s=null;r&&(s=r[i[i.length-1].route.id]);let l=[],u=null,h=[];for(let c=0;c<i.length;c++){let m=i[c],g=m.route.id,E=a[g],L=m.params,R=t[g],S=[],b={id:g,data:E,loaderData:E,meta:[],params:m.params,pathname:m.pathname,handle:m.route.handle,error:s};if(h[c]=b,R?.meta?S=typeof R.meta=="function"?R.meta({data:E,loaderData:E,params:L,location:o,matches:h,error:s}):Array.isArray(R.meta)?[...R.meta]:R.meta:u&&(S=[...u]),S=S||[],!Array.isArray(S))throw new Error("The route at "+m.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
13
+
14
+ To reference the meta function API, see https://remix.run/route/meta`);b.meta=S,h[c]=b,l=[...S],u=l}return f.createElement(f.Fragment,null,l.flat().map(c=>{if(!c)return null;if("tagName"in c){let{tagName:m,...g}=c;if(!$l(m))return console.warn(`A meta object uses an invalid tagName: ${m}. Expected either 'link' or 'meta'`),null;let E=m;return f.createElement(E,{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:al(m)}})}catch{return null}return f.createElement("meta",{key:JSON.stringify(c),...c})}))}function $l(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Nt=!1;function Al(){Nt=!0}function jl(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:i}=et(),{router:s,static:l,staticContext:u}=Dr(),{matches:h}=Ut(),c=Zo(),m=Mr(o,i);a&&(a.didRenderScripts=!0);let g=Tr(h,null,n);f.useEffect(()=>{Al()},[]);let E=f.useMemo(()=>{if(c)return null;let b=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",D=l?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${m?"":`import ${JSON.stringify(t.url)}`};
15
+ ${g.map((T,M)=>{let O=`route${M}`,p=t.routes[T.route.id];ge(p,`Route ${T.route.id} not found in manifest`);let{clientActionModule:H,clientLoaderModule:B,clientMiddlewareModule:Y,hydrateFallbackModule:U,module:de}=p,ee=[...H?[{module:H,varName:`${O}_clientAction`}]:[],...B?[{module:B,varName:`${O}_clientLoader`}]:[],...Y?[{module:Y,varName:`${O}_clientMiddleware`}]:[],...U?[{module:U,varName:`${O}_HydrateFallback`}]:[],{module:de,varName:`${O}_main`}];if(ee.length===1)return`import * as ${O} from ${JSON.stringify(de)};`;let G=ee.map(ue=>`import * as ${ue.varName} from "${ue.module}";`).join(`
16
+ `),te=`const ${O} = {${ee.map(ue=>`...${ue.varName}`).join(",")}};`;return[G,te].join(`
17
+ `)}).join(`
18
+ `)}
19
+ ${m?`window.__reactRouterManifest = ${JSON.stringify(Tl(t,s),null,2)};`:""}
20
+ window.__reactRouterRouteModules = {${g.map((T,M)=>`${JSON.stringify(T.route.id)}:route${M}`).join(",")}};
21
+
22
+ import(${JSON.stringify(t.entry.module)});`:" ";return f.createElement(f.Fragment,null,f.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:b},type:void 0}),f.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:D},type:"module",async:!0}))},[]),L=Nt||c?[]:Ul(t.entry.imports.concat(Pr(g,t,{includeHydrateFallback:!0}))),R=typeof t.sri=="object"?t.sri:{};return sr(!c,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Nt||c?null:f.createElement(f.Fragment,null,typeof t.sri=="object"?f.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:R})}}):null,m?null:f.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:R[t.url],suppressHydrationWarning:!0}),f.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:R[t.entry.module],suppressHydrationWarning:!0}),L.map(S=>f.createElement("link",{key:S,rel:"modulepreload",href:S,crossOrigin:e.crossOrigin,integrity:R[S],suppressHydrationWarning:!0})),E)}function Ul(e){return[...new Set(e)]}function zl(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var ms=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(ca,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function ca({error:e,isOutsideRemixApp:t}){console.error(e);let r=f.createElement("script",{dangerouslySetInnerHTML:{__html:`
23
+ console.log(
24
+ "💿 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."
25
+ );
26
+ `}});if(We(e))return f.createElement(fr,{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(fr,{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 fr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:a}=et();return a.root?.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(jl,null):null)))}var da=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{da&&(window.__reactRouterVersion="7.10.1")}catch{}var fa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ha=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:s,target:l,to:u,preventScrollReset:h,viewTransition:c,...m},g){let{basename:E,unstable_useTransitions:L}=f.useContext(be),R=typeof u=="string"&&fa.test(u),S,b=!1;if(typeof u=="string"&&R&&(S=u,da))try{let Y=new URL(window.location.href),U=u.startsWith("//")?new URL(Y.protocol+u):new URL(u),de=Re(U.pathname,E);U.origin===Y.origin&&de!=null?u=de+U.search+U.hash:b=!0}catch{se(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let D=ti(u,{relative:a}),[T,M,O]=kl(n,m),p=Wl(u,{replace:i,state:s,target:l,preventScrollReset:h,relative:a,viewTransition:c,unstable_useTransitions:L});function H(Y){t&&t(Y),Y.defaultPrevented||p(Y)}let B=f.createElement("a",{...m,...O,href:S||D,onClick:b||o?t:H,ref:zl(g,M),target:l,"data-discover":!R&&r==="render"?"true":void 0});return T&&!R?f.createElement(f.Fragment,null,B,f.createElement(ua,{page:D})):B});ha.displayName="Link";var Hl=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:s,children:l,...u},h){let c=pt(i,{relative:u.relative}),m=Le(),g=f.useContext(Qe),{navigator:E,basename:L}=f.useContext(be),R=g!=null&&Xl(c)&&s===!0,S=E.encodeLocation?E.encodeLocation(c).pathname:c.pathname,b=m.pathname,D=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(b=b.toLowerCase(),D=D?D.toLowerCase():null,S=S.toLowerCase()),D&&L&&(D=Re(D,L)||D);const T=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let M=b===S||!a&&b.startsWith(S)&&b.charAt(T)==="/",O=D!=null&&(D===S||!a&&D.startsWith(S)&&D.charAt(S.length)==="/"),p={isActive:M,isPending:O,isTransitioning:R},H=M?t:void 0,B;typeof n=="function"?B=n(p):B=[n,M?"active":null,O?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let Y=typeof o=="function"?o(p):o;return f.createElement(ha,{...u,"aria-current":H,className:B,ref:h,style:Y,to:i,viewTransition:s},typeof l=="function"?l(p):l)});Hl.displayName="NavLink";var ma=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=Tt,action:s,onSubmit:l,relative:u,preventScrollReset:h,viewTransition:c,...m},g)=>{let{unstable_useTransitions:E}=f.useContext(be),L=va(),R=Jl(s,{relative:u}),S=i.toLowerCase()==="get"?"get":"post",b=typeof s=="string"&&fa.test(s),D=T=>{if(l&&l(T),T.defaultPrevented)return;T.preventDefault();let M=T.nativeEvent.submitter,O=M?.getAttribute("formmethod")||i,p=()=>L(M||T.currentTarget,{fetcherKey:t,method:O,navigate:r,replace:a,state:o,relative:u,preventScrollReset:h,viewTransition:c});E&&r!==!1?f.startTransition(()=>p()):p()};return f.createElement("form",{ref:g,method:S,action:R,onSubmit:n?l:D,...m,"data-discover":!b&&e==="render"?"true":void 0})});ma.displayName="Form";function Bl({getKey:e,storageKey:t,...r}){let n=f.useContext(zt),{basename:a}=f.useContext(be),o=Le(),i=xr();Kl({getKey:e,storageKey:t});let s=f.useMemo(()=>{if(!n||!e)return null;let u=mr(o,i,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let l=((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:`(${l})(${JSON.stringify(t||hr)}, ${JSON.stringify(s)})`}})}Bl.displayName="ScrollRestoration";function pa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ht(e){let t=f.useContext(Ye);return z(t,pa(e)),t}function ya(e){let t=f.useContext(Qe);return z(t,pa(e)),t}function Wl(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_useTransitions:s}={}){let l=Yn(),u=Le(),h=pt(e,{relative:o});return f.useCallback(c=>{if(Ti(c,t)){c.preventDefault();let m=r!==void 0?r:Me(u)===Me(h),g=()=>l(e,{replace:m,state:n,preventScrollReset:a,relative:o,viewTransition:i});s?f.startTransition(()=>g()):g()}},[u,l,h,r,n,t,e,a,o,i,s])}function ps(e){se(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(ur(e)),r=f.useRef(!1),n=Le(),a=f.useMemo(()=>Oi(n.search,r.current?null:t.current),[n.search]),o=Yn(),i=f.useCallback((s,l)=>{const u=ur(typeof s=="function"?s(new URLSearchParams(a)):s);r.current=!0,o("?"+u,l)},[o,a]);return[a,i]}var Vl=0,Yl=()=>`__${String(++Vl)}__`;function va(){let{router:e}=Ht("useSubmit"),{basename:t}=f.useContext(be),r=hi(),n=e.fetch,a=e.navigate;return f.useCallback(async(o,i={})=>{let{action:s,method:l,encType:u,formData:h,body:c}=ki(o,t);if(i.navigate===!1){let m=i.fetcherKey||Yl();await n(m,r,i.action||s,{preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||l,formEncType:i.encType||u,flushSync:i.flushSync})}else await a(i.action||s,{preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||l,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function Jl(e,{relative:t}={}){let{basename:r}=f.useContext(be),n=f.useContext(xe);z(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...pt(e||".",{relative:t})},i=Le();if(e==null){o.search=i.search;let s=new URLSearchParams(o.search),l=s.getAll("index");if(l.some(h=>h==="")){s.delete("index"),l.filter(c=>c).forEach(c=>s.append("index",c));let h=s.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:Ce([r,o.pathname])),Me(o)}function ys({key:e}={}){let{router:t}=Ht("useFetcher"),r=ya("useFetcher"),n=f.useContext(Rr),a=f.useContext(xe),o=a.matches[a.matches.length-1]?.route.id;z(n,"useFetcher must be used inside a FetchersContext"),z(a,"useFetcher must be used inside a RouteContext"),z(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=f.useId(),[s,l]=f.useState(e||i);e&&e!==s&&l(e);let{deleteFetcher:u,getFetcher:h,resetFetcher:c,fetch:m}=t;f.useEffect(()=>(h(s),()=>u(s)),[u,h,s]);let g=f.useCallback(async(M,O)=>{z(o,"No routeId available for fetcher.load()"),await m(s,o,M,O)},[s,o,m]),E=va(),L=f.useCallback(async(M,O)=>{await E(M,{...O,navigate:!1,fetcherKey:s})},[s,E]),R=f.useCallback(M=>c(s,M),[c,s]),S=f.useMemo(()=>{let M=f.forwardRef((O,p)=>f.createElement(ma,{...O,navigate:!1,fetcherKey:s,ref:p}));return M.displayName="fetcher.Form",M},[s]),b=r.fetchers.get(s)||In,D=n.get(s);return f.useMemo(()=>({Form:S,submit:L,load:g,reset:R,...b,data:D}),[S,L,g,R,b,D])}var hr="react-router-scroll-positions",Mt={};function mr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:Re(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function Kl({getKey:e,storageKey:t}={}){let{router:r}=Ht("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=ya("useScrollRestoration"),{basename:o}=f.useContext(be),i=Le(),s=xr(),l=mi();f.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Gl(f.useCallback(()=>{if(l.state==="idle"){let u=mr(i,s,o,e);Mt[u]=window.scrollY}try{sessionStorage.setItem(t||hr,JSON.stringify(Mt))}catch(u){se(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[l.state,e,o,i,s,t])),typeof document<"u"&&(f.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||hr);u&&(Mt=JSON.parse(u))}catch{}},[t]),f.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(Mt,()=>window.scrollY,e?(h,c)=>mr(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{se(!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 Gl(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 Xl(e,{relative:t}={}){let r=f.useContext(Er);z(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ht("useViewTransitionState"),a=pt(e,{relative:t});if(!r.isTransitioning)return!1;let o=Re(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=Re(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Ft(a.pathname,i)!=null||Ft(a.pathname,o)!=null}export{Ln as A,Le as B,fs as C,jl as D,Ve as E,zt as F,Ql as G,ja as H,Na as I,ql as J,ha as L,hs as M,il as N,is as O,Ua as R,Bl as S,Yn as a,ys as b,yi as c,rs as d,ps as e,oi as f,z as g,ds as h,We as i,Zl as j,ms as k,os as l,Fe as m,pl as n,Cr as o,ts as p,cs as q,f as r,Cl as s,ss as t,pi as u,es as v,ls as w,us as x,ns as y,as as z};
@@ -1 +1 @@
1
- import{c as e}from"./createLucideIcon-CgyOwWip.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=e("circle-alert",c);export{y as C};
1
+ import{c as e}from"./createLucideIcon-CS7XDrKv.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=e("circle-alert",c);export{y as C};
@@ -0,0 +1 @@
1
+ import{c}from"./createLucideIcon-CS7XDrKv.js";const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],r=c("circle-check",e);export{r as C};
@@ -0,0 +1 @@
1
+ import{c}from"./createLucideIcon-CS7XDrKv.js";const o=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],r=c("clock",o);export{r as C};
@@ -0,0 +1 @@
1
+ import{r as s}from"./chunk-WWGJGFF6-De6i8FUT.js";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};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"};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]]));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};
@@ -0,0 +1 @@
1
+ import{w as t,b as r,j as e}from"./chunk-WWGJGFF6-De6i8FUT.js";import{S as i}from"./ScenarioViewer-4D2vLLJz.js";import{W as n}from"./InteractivePreview-XDSzQLOY.js";import"./LogViewer-CRcT5fOZ.js";import"./SafeScreenshot-Bual6h18.js";import"./useLastLogLine-AlhS7g5F.js";import"./ReportIssueModal-BORLgi0X.js";import"./settings-5zF_GOcS.js";import"./createLucideIcon-CS7XDrKv.js";import"./circle-check-BACUUf75.js";import"./triangle-alert-D7k-ArFa.js";import"./index-D-zYbzFZ.js";const v=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],g=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-[#f9f9f9] 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{g as default,v as meta};