libre-webui 0.21.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +308 -328
- package/backend/dist/cli/migrateSqliteToPostgres.d.ts +2 -0
- package/backend/dist/cli/migrateSqliteToPostgres.d.ts.map +1 -0
- package/backend/dist/cli/migrateSqliteToPostgres.js +113 -0
- package/backend/dist/cli/migrateSqliteToPostgres.js.map +1 -0
- package/backend/dist/cli/recoveryBackup.d.ts +3 -0
- package/backend/dist/cli/recoveryBackup.d.ts.map +1 -0
- package/backend/dist/cli/recoveryBackup.js +251 -0
- package/backend/dist/cli/recoveryBackup.js.map +1 -0
- package/backend/dist/cli/recoveryInventory.d.ts +2 -0
- package/backend/dist/cli/recoveryInventory.d.ts.map +1 -0
- package/backend/dist/cli/recoveryInventory.js +109 -0
- package/backend/dist/cli/recoveryInventory.js.map +1 -0
- package/backend/dist/db.d.ts +27 -0
- package/backend/dist/db.d.ts.map +1 -1
- package/backend/dist/db.js +333 -16
- package/backend/dist/db.js.map +1 -1
- package/backend/dist/env.d.ts.map +1 -1
- package/backend/dist/env.js +12 -2
- package/backend/dist/env.js.map +1 -1
- package/backend/dist/index.d.ts.map +1 -1
- package/backend/dist/index.js +235 -47
- package/backend/dist/index.js.map +1 -1
- package/backend/dist/main.d.ts +2 -0
- package/backend/dist/main.d.ts.map +1 -0
- package/backend/dist/main.js +137 -0
- package/backend/dist/main.js.map +1 -0
- package/backend/dist/middleware/auth.d.ts.map +1 -1
- package/backend/dist/middleware/auth.js +7 -3
- package/backend/dist/middleware/auth.js.map +1 -1
- package/backend/dist/middleware/chatCancellationAdmission.d.ts +7 -0
- package/backend/dist/middleware/chatCancellationAdmission.d.ts.map +1 -0
- package/backend/dist/middleware/chatCancellationAdmission.js +17 -0
- package/backend/dist/middleware/chatCancellationAdmission.js.map +1 -0
- package/backend/dist/middleware/coordinatedRateLimit.d.ts +18 -0
- package/backend/dist/middleware/coordinatedRateLimit.d.ts.map +1 -0
- package/backend/dist/middleware/coordinatedRateLimit.js +52 -0
- package/backend/dist/middleware/coordinatedRateLimit.js.map +1 -0
- package/backend/dist/middleware/sharedRateLimit.d.ts +26 -0
- package/backend/dist/middleware/sharedRateLimit.d.ts.map +1 -0
- package/backend/dist/middleware/sharedRateLimit.js +99 -0
- package/backend/dist/middleware/sharedRateLimit.js.map +1 -0
- package/backend/dist/models/personaModel.d.ts +1 -26
- package/backend/dist/models/personaModel.d.ts.map +1 -1
- package/backend/dist/models/personaModel.js +54 -247
- package/backend/dist/models/personaModel.js.map +1 -1
- package/backend/dist/models/userModel.d.ts +23 -66
- package/backend/dist/models/userModel.d.ts.map +1 -1
- package/backend/dist/models/userModel.js +110 -187
- package/backend/dist/models/userModel.js.map +1 -1
- package/backend/dist/persistence/chatGenerationTypes.d.ts +24 -0
- package/backend/dist/persistence/chatGenerationTypes.d.ts.map +1 -0
- package/backend/dist/persistence/chatGenerationTypes.js +7 -0
- package/backend/dist/persistence/chatGenerationTypes.js.map +1 -0
- package/backend/dist/persistence/extensionTypes.d.ts +185 -0
- package/backend/dist/persistence/extensionTypes.d.ts.map +1 -0
- package/backend/dist/persistence/extensionTypes.js +13 -0
- package/backend/dist/persistence/extensionTypes.js.map +1 -0
- package/backend/dist/persistence/identityDeletionTypes.d.ts +16 -0
- package/backend/dist/persistence/identityDeletionTypes.d.ts.map +1 -0
- package/backend/dist/persistence/identityDeletionTypes.js +7 -0
- package/backend/dist/persistence/identityDeletionTypes.js.map +1 -0
- package/backend/dist/persistence/index.d.ts +48 -0
- package/backend/dist/persistence/index.d.ts.map +1 -0
- package/backend/dist/persistence/index.js +159 -0
- package/backend/dist/persistence/index.js.map +1 -0
- package/backend/dist/persistence/postgresConfig.d.ts +32 -0
- package/backend/dist/persistence/postgresConfig.d.ts.map +1 -0
- package/backend/dist/persistence/postgresConfig.js +91 -0
- package/backend/dist/persistence/postgresConfig.js.map +1 -0
- package/backend/dist/persistence/postgresCoreMigration.d.ts +8 -0
- package/backend/dist/persistence/postgresCoreMigration.d.ts.map +1 -0
- package/backend/dist/persistence/postgresCoreMigration.js +179 -0
- package/backend/dist/persistence/postgresCoreMigration.js.map +1 -0
- package/backend/dist/persistence/postgresDatabase.d.ts +40 -0
- package/backend/dist/persistence/postgresDatabase.d.ts.map +1 -0
- package/backend/dist/persistence/postgresDatabase.js +148 -0
- package/backend/dist/persistence/postgresDatabase.js.map +1 -0
- package/backend/dist/persistence/postgresExtensionMigration.d.ts +4 -0
- package/backend/dist/persistence/postgresExtensionMigration.d.ts.map +1 -0
- package/backend/dist/persistence/postgresExtensionMigration.js +143 -0
- package/backend/dist/persistence/postgresExtensionMigration.js.map +1 -0
- package/backend/dist/persistence/postgresExtensionRepositories.d.ts +6 -0
- package/backend/dist/persistence/postgresExtensionRepositories.d.ts.map +1 -0
- package/backend/dist/persistence/postgresExtensionRepositories.js +550 -0
- package/backend/dist/persistence/postgresExtensionRepositories.js.map +1 -0
- package/backend/dist/persistence/postgresImportState.d.ts +9 -0
- package/backend/dist/persistence/postgresImportState.d.ts.map +1 -0
- package/backend/dist/persistence/postgresImportState.js +64 -0
- package/backend/dist/persistence/postgresImportState.js.map +1 -0
- package/backend/dist/persistence/postgresMigrationRegistry.d.ts +4 -0
- package/backend/dist/persistence/postgresMigrationRegistry.d.ts.map +1 -0
- package/backend/dist/persistence/postgresMigrationRegistry.js +33 -0
- package/backend/dist/persistence/postgresMigrationRegistry.js.map +1 -0
- package/backend/dist/persistence/postgresMigrationTypes.d.ts +24 -0
- package/backend/dist/persistence/postgresMigrationTypes.d.ts.map +1 -0
- package/backend/dist/persistence/postgresMigrationTypes.js +7 -0
- package/backend/dist/persistence/postgresMigrationTypes.js.map +1 -0
- package/backend/dist/persistence/postgresMigrations.d.ts +15 -0
- package/backend/dist/persistence/postgresMigrations.d.ts.map +1 -0
- package/backend/dist/persistence/postgresMigrations.js +333 -0
- package/backend/dist/persistence/postgresMigrations.js.map +1 -0
- package/backend/dist/persistence/postgresPersistence.d.ts +17 -0
- package/backend/dist/persistence/postgresPersistence.d.ts.map +1 -0
- package/backend/dist/persistence/postgresPersistence.js +332 -0
- package/backend/dist/persistence/postgresPersistence.js.map +1 -0
- package/backend/dist/persistence/postgresPluginDefinitionMigration.d.ts +4 -0
- package/backend/dist/persistence/postgresPluginDefinitionMigration.d.ts.map +1 -0
- package/backend/dist/persistence/postgresPluginDefinitionMigration.js +40 -0
- package/backend/dist/persistence/postgresPluginDefinitionMigration.js.map +1 -0
- package/backend/dist/persistence/postgresResourceRepositories.d.ts +7 -0
- package/backend/dist/persistence/postgresResourceRepositories.d.ts.map +1 -0
- package/backend/dist/persistence/postgresResourceRepositories.js +776 -0
- package/backend/dist/persistence/postgresResourceRepositories.js.map +1 -0
- package/backend/dist/persistence/postgresSchemaInspector.d.ts +14 -0
- package/backend/dist/persistence/postgresSchemaInspector.d.ts.map +1 -0
- package/backend/dist/persistence/postgresSchemaInspector.js +817 -0
- package/backend/dist/persistence/postgresSchemaInspector.js.map +1 -0
- package/backend/dist/persistence/resourceTypes.d.ts +207 -0
- package/backend/dist/persistence/resourceTypes.d.ts.map +1 -0
- package/backend/dist/persistence/resourceTypes.js +38 -0
- package/backend/dist/persistence/resourceTypes.js.map +1 -0
- package/backend/dist/persistence/sqliteExtensionRepositories.d.ts +4 -0
- package/backend/dist/persistence/sqliteExtensionRepositories.d.ts.map +1 -0
- package/backend/dist/persistence/sqliteExtensionRepositories.js +494 -0
- package/backend/dist/persistence/sqliteExtensionRepositories.js.map +1 -0
- package/backend/dist/persistence/sqliteMigrations.d.ts +93 -0
- package/backend/dist/persistence/sqliteMigrations.d.ts.map +1 -0
- package/backend/dist/persistence/sqliteMigrations.js +2232 -0
- package/backend/dist/persistence/sqliteMigrations.js.map +1 -0
- package/backend/dist/persistence/sqlitePersistence.d.ts +23 -0
- package/backend/dist/persistence/sqlitePersistence.d.ts.map +1 -0
- package/backend/dist/persistence/sqlitePersistence.js +596 -0
- package/backend/dist/persistence/sqlitePersistence.js.map +1 -0
- package/backend/dist/persistence/sqliteResourceRepositories.d.ts +4 -0
- package/backend/dist/persistence/sqliteResourceRepositories.d.ts.map +1 -0
- package/backend/dist/persistence/sqliteResourceRepositories.js +663 -0
- package/backend/dist/persistence/sqliteResourceRepositories.js.map +1 -0
- package/backend/dist/persistence/sqliteSyncExecutor.d.ts +5 -0
- package/backend/dist/persistence/sqliteSyncExecutor.d.ts.map +1 -0
- package/backend/dist/persistence/sqliteSyncExecutor.js +19 -0
- package/backend/dist/persistence/sqliteSyncExecutor.js.map +1 -0
- package/backend/dist/persistence/sqliteToPostgresMigration.d.ts +80 -0
- package/backend/dist/persistence/sqliteToPostgresMigration.d.ts.map +1 -0
- package/backend/dist/persistence/sqliteToPostgresMigration.js +1543 -0
- package/backend/dist/persistence/sqliteToPostgresMigration.js.map +1 -0
- package/backend/dist/persistence/types.d.ts +131 -0
- package/backend/dist/persistence/types.d.ts.map +1 -0
- package/backend/dist/persistence/types.js +18 -0
- package/backend/dist/persistence/types.js.map +1 -0
- package/backend/dist/persistence/voiceProfileNameLookup.d.ts +9 -0
- package/backend/dist/persistence/voiceProfileNameLookup.d.ts.map +1 -0
- package/backend/dist/persistence/voiceProfileNameLookup.js +15 -0
- package/backend/dist/persistence/voiceProfileNameLookup.js.map +1 -0
- package/backend/dist/platform/coordination/index.d.ts +7 -0
- package/backend/dist/platform/coordination/index.d.ts.map +1 -0
- package/backend/dist/platform/coordination/index.js +24 -0
- package/backend/dist/platform/coordination/index.js.map +1 -0
- package/backend/dist/platform/coordination/localCoordinator.d.ts +49 -0
- package/backend/dist/platform/coordination/localCoordinator.d.ts.map +1 -0
- package/backend/dist/platform/coordination/localCoordinator.js +380 -0
- package/backend/dist/platform/coordination/localCoordinator.js.map +1 -0
- package/backend/dist/platform/coordination/redisCoordinator.d.ts +83 -0
- package/backend/dist/platform/coordination/redisCoordinator.d.ts.map +1 -0
- package/backend/dist/platform/coordination/redisCoordinator.js +726 -0
- package/backend/dist/platform/coordination/redisCoordinator.js.map +1 -0
- package/backend/dist/platform/coordination/service.d.ts +11 -0
- package/backend/dist/platform/coordination/service.d.ts.map +1 -0
- package/backend/dist/platform/coordination/service.js +55 -0
- package/backend/dist/platform/coordination/service.js.map +1 -0
- package/backend/dist/platform/coordination/sharedAdmission.d.ts +53 -0
- package/backend/dist/platform/coordination/sharedAdmission.d.ts.map +1 -0
- package/backend/dist/platform/coordination/sharedAdmission.js +194 -0
- package/backend/dist/platform/coordination/sharedAdmission.js.map +1 -0
- package/backend/dist/platform/coordination/types.d.ts +76 -0
- package/backend/dist/platform/coordination/types.d.ts.map +1 -0
- package/backend/dist/platform/coordination/types.js +32 -0
- package/backend/dist/platform/coordination/types.js.map +1 -0
- package/backend/dist/platform/events/durableEventGateway.d.ts +54 -0
- package/backend/dist/platform/events/durableEventGateway.d.ts.map +1 -0
- package/backend/dist/platform/events/durableEventGateway.js +262 -0
- package/backend/dist/platform/events/durableEventGateway.js.map +1 -0
- package/backend/dist/platform/events/index.d.ts +3 -0
- package/backend/dist/platform/events/index.d.ts.map +1 -0
- package/backend/dist/platform/events/index.js +8 -0
- package/backend/dist/platform/events/index.js.map +1 -0
- package/backend/dist/platform/events/service.d.ts +8 -0
- package/backend/dist/platform/events/service.d.ts.map +1 -0
- package/backend/dist/platform/events/service.js +25 -0
- package/backend/dist/platform/events/service.js.map +1 -0
- package/backend/dist/platform/jobs/chatGenerationEnqueuer.d.ts +3 -0
- package/backend/dist/platform/jobs/chatGenerationEnqueuer.d.ts.map +1 -0
- package/backend/dist/platform/jobs/chatGenerationEnqueuer.js +55 -0
- package/backend/dist/platform/jobs/chatGenerationEnqueuer.js.map +1 -0
- package/backend/dist/platform/jobs/documentIngestionEnqueuer.d.ts +3 -0
- package/backend/dist/platform/jobs/documentIngestionEnqueuer.d.ts.map +1 -0
- package/backend/dist/platform/jobs/documentIngestionEnqueuer.js +38 -0
- package/backend/dist/platform/jobs/documentIngestionEnqueuer.js.map +1 -0
- package/backend/dist/platform/jobs/domainJobContracts.d.ts +30 -0
- package/backend/dist/platform/jobs/domainJobContracts.d.ts.map +1 -0
- package/backend/dist/platform/jobs/domainJobContracts.js +53 -0
- package/backend/dist/platform/jobs/domainJobContracts.js.map +1 -0
- package/backend/dist/platform/jobs/domainJobHandlers.d.ts +11 -0
- package/backend/dist/platform/jobs/domainJobHandlers.d.ts.map +1 -0
- package/backend/dist/platform/jobs/domainJobHandlers.js +612 -0
- package/backend/dist/platform/jobs/domainJobHandlers.js.map +1 -0
- package/backend/dist/platform/jobs/durableEventIdentity.d.ts +8 -0
- package/backend/dist/platform/jobs/durableEventIdentity.d.ts.map +1 -0
- package/backend/dist/platform/jobs/durableEventIdentity.js +33 -0
- package/backend/dist/platform/jobs/durableEventIdentity.js.map +1 -0
- package/backend/dist/platform/jobs/durableJobRuntime.d.ts +57 -0
- package/backend/dist/platform/jobs/durableJobRuntime.d.ts.map +1 -0
- package/backend/dist/platform/jobs/durableJobRuntime.js +131 -0
- package/backend/dist/platform/jobs/durableJobRuntime.js.map +1 -0
- package/backend/dist/platform/jobs/durableJobRuntimeBackend.d.ts +28 -0
- package/backend/dist/platform/jobs/durableJobRuntimeBackend.d.ts.map +1 -0
- package/backend/dist/platform/jobs/durableJobRuntimeBackend.js +62 -0
- package/backend/dist/platform/jobs/durableJobRuntimeBackend.js.map +1 -0
- package/backend/dist/platform/jobs/durableJobService.d.ts +85 -0
- package/backend/dist/platform/jobs/durableJobService.d.ts.map +1 -0
- package/backend/dist/platform/jobs/durableJobService.js +726 -0
- package/backend/dist/platform/jobs/durableJobService.js.map +1 -0
- package/backend/dist/platform/jobs/durableJobTypes.d.ts +195 -0
- package/backend/dist/platform/jobs/durableJobTypes.d.ts.map +1 -0
- package/backend/dist/platform/jobs/durableJobTypes.js +72 -0
- package/backend/dist/platform/jobs/durableJobTypes.js.map +1 -0
- package/backend/dist/platform/jobs/embeddedDurableJobWorker.d.ts +87 -0
- package/backend/dist/platform/jobs/embeddedDurableJobWorker.d.ts.map +1 -0
- package/backend/dist/platform/jobs/embeddedDurableJobWorker.js +429 -0
- package/backend/dist/platform/jobs/embeddedDurableJobWorker.js.map +1 -0
- package/backend/dist/platform/jobs/identityDeletionEnqueuer.d.ts +3 -0
- package/backend/dist/platform/jobs/identityDeletionEnqueuer.d.ts.map +1 -0
- package/backend/dist/platform/jobs/identityDeletionEnqueuer.js +36 -0
- package/backend/dist/platform/jobs/identityDeletionEnqueuer.js.map +1 -0
- package/backend/dist/platform/jobs/index.d.ts +18 -0
- package/backend/dist/platform/jobs/index.d.ts.map +1 -0
- package/backend/dist/platform/jobs/index.js +34 -0
- package/backend/dist/platform/jobs/index.js.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableEventIdempotencyMigration.d.ts +4 -0
- package/backend/dist/platform/jobs/postgresDurableEventIdempotencyMigration.d.ts.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableEventIdempotencyMigration.js +25 -0
- package/backend/dist/platform/jobs/postgresDurableEventIdempotencyMigration.js.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableEventReplayIndexMigration.d.ts +4 -0
- package/backend/dist/platform/jobs/postgresDurableEventReplayIndexMigration.d.ts.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableEventReplayIndexMigration.js +23 -0
- package/backend/dist/platform/jobs/postgresDurableEventReplayIndexMigration.js.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableJobMigration.d.ts +11 -0
- package/backend/dist/platform/jobs/postgresDurableJobMigration.d.ts.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableJobMigration.js +106 -0
- package/backend/dist/platform/jobs/postgresDurableJobMigration.js.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableJobRepository.d.ts +88 -0
- package/backend/dist/platform/jobs/postgresDurableJobRepository.d.ts.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableJobRepository.js +1185 -0
- package/backend/dist/platform/jobs/postgresDurableJobRepository.js.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableJobService.d.ts +86 -0
- package/backend/dist/platform/jobs/postgresDurableJobService.d.ts.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableJobService.js +696 -0
- package/backend/dist/platform/jobs/postgresDurableJobService.js.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableJobWorker.d.ts +53 -0
- package/backend/dist/platform/jobs/postgresDurableJobWorker.d.ts.map +1 -0
- package/backend/dist/platform/jobs/postgresDurableJobWorker.js +393 -0
- package/backend/dist/platform/jobs/postgresDurableJobWorker.js.map +1 -0
- package/backend/dist/platform/jobs/resourceDeletionEnqueuer.d.ts +3 -0
- package/backend/dist/platform/jobs/resourceDeletionEnqueuer.d.ts.map +1 -0
- package/backend/dist/platform/jobs/resourceDeletionEnqueuer.js +43 -0
- package/backend/dist/platform/jobs/resourceDeletionEnqueuer.js.map +1 -0
- package/backend/dist/platform/jobs/sqliteDurableJobRepository.d.ts +166 -0
- package/backend/dist/platform/jobs/sqliteDurableJobRepository.d.ts.map +1 -0
- package/backend/dist/platform/jobs/sqliteDurableJobRepository.js +1008 -0
- package/backend/dist/platform/jobs/sqliteDurableJobRepository.js.map +1 -0
- package/backend/dist/platform/jobs/videoGenerationEnqueuer.d.ts +4 -0
- package/backend/dist/platform/jobs/videoGenerationEnqueuer.d.ts.map +1 -0
- package/backend/dist/platform/jobs/videoGenerationEnqueuer.js +46 -0
- package/backend/dist/platform/jobs/videoGenerationEnqueuer.js.map +1 -0
- package/backend/dist/platform/jobs/workExecutionEnqueuer.d.ts +3 -0
- package/backend/dist/platform/jobs/workExecutionEnqueuer.d.ts.map +1 -0
- package/backend/dist/platform/jobs/workExecutionEnqueuer.js +38 -0
- package/backend/dist/platform/jobs/workExecutionEnqueuer.js.map +1 -0
- package/backend/dist/platform/ollamaRuntimeConfig.d.ts +40 -0
- package/backend/dist/platform/ollamaRuntimeConfig.d.ts.map +1 -0
- package/backend/dist/platform/ollamaRuntimeConfig.js +72 -0
- package/backend/dist/platform/ollamaRuntimeConfig.js.map +1 -0
- package/backend/dist/platform/recovery/backupArchive.d.ts +120 -0
- package/backend/dist/platform/recovery/backupArchive.d.ts.map +1 -0
- package/backend/dist/platform/recovery/backupArchive.js +842 -0
- package/backend/dist/platform/recovery/backupArchive.js.map +1 -0
- package/backend/dist/platform/recovery/index.d.ts +3 -0
- package/backend/dist/platform/recovery/index.d.ts.map +1 -0
- package/backend/dist/platform/recovery/index.js +8 -0
- package/backend/dist/platform/recovery/index.js.map +1 -0
- package/backend/dist/platform/recovery/teamBackupArchive.d.ts +98 -0
- package/backend/dist/platform/recovery/teamBackupArchive.d.ts.map +1 -0
- package/backend/dist/platform/recovery/teamBackupArchive.js +1203 -0
- package/backend/dist/platform/recovery/teamBackupArchive.js.map +1 -0
- package/backend/dist/platform/runtimeConfig.d.ts +70 -0
- package/backend/dist/platform/runtimeConfig.d.ts.map +1 -0
- package/backend/dist/platform/runtimeConfig.js +205 -0
- package/backend/dist/platform/runtimeConfig.js.map +1 -0
- package/backend/dist/platform/storage/aesGcmKeyring.d.ts +26 -0
- package/backend/dist/platform/storage/aesGcmKeyring.d.ts.map +1 -0
- package/backend/dist/platform/storage/aesGcmKeyring.js +135 -0
- package/backend/dist/platform/storage/aesGcmKeyring.js.map +1 -0
- package/backend/dist/platform/storage/blobReferenceRepository.d.ts +36 -0
- package/backend/dist/platform/storage/blobReferenceRepository.d.ts.map +1 -0
- package/backend/dist/platform/storage/blobReferenceRepository.js +117 -0
- package/backend/dist/platform/storage/blobReferenceRepository.js.map +1 -0
- package/backend/dist/platform/storage/blobStore.d.ts +111 -0
- package/backend/dist/platform/storage/blobStore.d.ts.map +1 -0
- package/backend/dist/platform/storage/blobStore.js +46 -0
- package/backend/dist/platform/storage/blobStore.js.map +1 -0
- package/backend/dist/platform/storage/documentVectorIndex.d.ts +44 -0
- package/backend/dist/platform/storage/documentVectorIndex.d.ts.map +1 -0
- package/backend/dist/platform/storage/documentVectorIndex.js +110 -0
- package/backend/dist/platform/storage/documentVectorIndex.js.map +1 -0
- package/backend/dist/platform/storage/durableBlobQuotaPolicy.d.ts +82 -0
- package/backend/dist/platform/storage/durableBlobQuotaPolicy.d.ts.map +1 -0
- package/backend/dist/platform/storage/durableBlobQuotaPolicy.js +583 -0
- package/backend/dist/platform/storage/durableBlobQuotaPolicy.js.map +1 -0
- package/backend/dist/platform/storage/index.d.ts +19 -0
- package/backend/dist/platform/storage/index.d.ts.map +1 -0
- package/backend/dist/platform/storage/index.js +35 -0
- package/backend/dist/platform/storage/index.js.map +1 -0
- package/backend/dist/platform/storage/localEncryptedBlobStore.d.ts +120 -0
- package/backend/dist/platform/storage/localEncryptedBlobStore.d.ts.map +1 -0
- package/backend/dist/platform/storage/localEncryptedBlobStore.js +1205 -0
- package/backend/dist/platform/storage/localEncryptedBlobStore.js.map +1 -0
- package/backend/dist/platform/storage/personaMemoryIndexing.d.ts +12 -0
- package/backend/dist/platform/storage/personaMemoryIndexing.d.ts.map +1 -0
- package/backend/dist/platform/storage/personaMemoryIndexing.js +25 -0
- package/backend/dist/platform/storage/personaMemoryIndexing.js.map +1 -0
- package/backend/dist/platform/storage/pgVectorStore.d.ts +37 -0
- package/backend/dist/platform/storage/pgVectorStore.d.ts.map +1 -0
- package/backend/dist/platform/storage/pgVectorStore.js +493 -0
- package/backend/dist/platform/storage/pgVectorStore.js.map +1 -0
- package/backend/dist/platform/storage/platformDomainRepositories.d.ts +244 -0
- package/backend/dist/platform/storage/platformDomainRepositories.d.ts.map +1 -0
- package/backend/dist/platform/storage/platformDomainRepositories.js +7 -0
- package/backend/dist/platform/storage/platformDomainRepositories.js.map +1 -0
- package/backend/dist/platform/storage/platformStorageRuntime.d.ts +35 -0
- package/backend/dist/platform/storage/platformStorageRuntime.d.ts.map +1 -0
- package/backend/dist/platform/storage/platformStorageRuntime.js +299 -0
- package/backend/dist/platform/storage/platformStorageRuntime.js.map +1 -0
- package/backend/dist/platform/storage/postgresPlatformDomainRepositories.d.ts +4 -0
- package/backend/dist/platform/storage/postgresPlatformDomainRepositories.d.ts.map +1 -0
- package/backend/dist/platform/storage/postgresPlatformDomainRepositories.js +1017 -0
- package/backend/dist/platform/storage/postgresPlatformDomainRepositories.js.map +1 -0
- package/backend/dist/platform/storage/postgresResourceDeletionLifecycleMigration.d.ts +4 -0
- package/backend/dist/platform/storage/postgresResourceDeletionLifecycleMigration.d.ts.map +1 -0
- package/backend/dist/platform/storage/postgresResourceDeletionLifecycleMigration.js +40 -0
- package/backend/dist/platform/storage/postgresResourceDeletionLifecycleMigration.js.map +1 -0
- package/backend/dist/platform/storage/resourceContentCleanup.d.ts +29 -0
- package/backend/dist/platform/storage/resourceContentCleanup.d.ts.map +1 -0
- package/backend/dist/platform/storage/resourceContentCleanup.js +100 -0
- package/backend/dist/platform/storage/resourceContentCleanup.js.map +1 -0
- package/backend/dist/platform/storage/resourceDeletionLifecycle.d.ts +14 -0
- package/backend/dist/platform/storage/resourceDeletionLifecycle.d.ts.map +1 -0
- package/backend/dist/platform/storage/resourceDeletionLifecycle.js +31 -0
- package/backend/dist/platform/storage/resourceDeletionLifecycle.js.map +1 -0
- package/backend/dist/platform/storage/s3EncryptedBlobStore.d.ts +140 -0
- package/backend/dist/platform/storage/s3EncryptedBlobStore.d.ts.map +1 -0
- package/backend/dist/platform/storage/s3EncryptedBlobStore.js +1309 -0
- package/backend/dist/platform/storage/s3EncryptedBlobStore.js.map +1 -0
- package/backend/dist/platform/storage/sqliteEncryptedVectorStore.d.ts +71 -0
- package/backend/dist/platform/storage/sqliteEncryptedVectorStore.d.ts.map +1 -0
- package/backend/dist/platform/storage/sqliteEncryptedVectorStore.js +766 -0
- package/backend/dist/platform/storage/sqliteEncryptedVectorStore.js.map +1 -0
- package/backend/dist/platform/storage/sqlitePlatformDomainRepositories.d.ts +4 -0
- package/backend/dist/platform/storage/sqlitePlatformDomainRepositories.d.ts.map +1 -0
- package/backend/dist/platform/storage/sqlitePlatformDomainRepositories.js +1037 -0
- package/backend/dist/platform/storage/sqlitePlatformDomainRepositories.js.map +1 -0
- package/backend/dist/platform/storage/sqliteToTeamStorageMigration.d.ts +25 -0
- package/backend/dist/platform/storage/sqliteToTeamStorageMigration.d.ts.map +1 -0
- package/backend/dist/platform/storage/sqliteToTeamStorageMigration.js +1292 -0
- package/backend/dist/platform/storage/sqliteToTeamStorageMigration.js.map +1 -0
- package/backend/dist/platform/storage/storageFactory.d.ts +81 -0
- package/backend/dist/platform/storage/storageFactory.d.ts.map +1 -0
- package/backend/dist/platform/storage/storageFactory.js +518 -0
- package/backend/dist/platform/storage/storageFactory.js.map +1 -0
- package/backend/dist/platform/storage/storageSchemaContracts.d.ts +22 -0
- package/backend/dist/platform/storage/storageSchemaContracts.d.ts.map +1 -0
- package/backend/dist/platform/storage/storageSchemaContracts.js +299 -0
- package/backend/dist/platform/storage/storageSchemaContracts.js.map +1 -0
- package/backend/dist/platform/storage/vectorStore.d.ts +117 -0
- package/backend/dist/platform/storage/vectorStore.d.ts.map +1 -0
- package/backend/dist/platform/storage/vectorStore.js +40 -0
- package/backend/dist/platform/storage/vectorStore.js.map +1 -0
- package/backend/dist/platform/workPersistence/index.d.ts +9 -0
- package/backend/dist/platform/workPersistence/index.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/index.js +14 -0
- package/backend/dist/platform/workPersistence/index.js.map +1 -0
- package/backend/dist/platform/workPersistence/postgresWorkLifecycleMigration.d.ts +9 -0
- package/backend/dist/platform/workPersistence/postgresWorkLifecycleMigration.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/postgresWorkLifecycleMigration.js +47 -0
- package/backend/dist/platform/workPersistence/postgresWorkLifecycleMigration.js.map +1 -0
- package/backend/dist/platform/workPersistence/postgresWorkMessageContentMigration.d.ts +3 -0
- package/backend/dist/platform/workPersistence/postgresWorkMessageContentMigration.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/postgresWorkMessageContentMigration.js +28 -0
- package/backend/dist/platform/workPersistence/postgresWorkMessageContentMigration.js.map +1 -0
- package/backend/dist/platform/workPersistence/postgresWorkMigration.d.ts +3 -0
- package/backend/dist/platform/workPersistence/postgresWorkMigration.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/postgresWorkMigration.js +101 -0
- package/backend/dist/platform/workPersistence/postgresWorkMigration.js.map +1 -0
- package/backend/dist/platform/workPersistence/postgresWorkPersistence.d.ts +79 -0
- package/backend/dist/platform/workPersistence/postgresWorkPersistence.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/postgresWorkPersistence.js +521 -0
- package/backend/dist/platform/workPersistence/postgresWorkPersistence.js.map +1 -0
- package/backend/dist/platform/workPersistence/service.d.ts +6 -0
- package/backend/dist/platform/workPersistence/service.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/service.js +27 -0
- package/backend/dist/platform/workPersistence/service.js.map +1 -0
- package/backend/dist/platform/workPersistence/sqliteWorkPersistence.d.ts +77 -0
- package/backend/dist/platform/workPersistence/sqliteWorkPersistence.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/sqliteWorkPersistence.js +463 -0
- package/backend/dist/platform/workPersistence/sqliteWorkPersistence.js.map +1 -0
- package/backend/dist/platform/workPersistence/types.d.ts +159 -0
- package/backend/dist/platform/workPersistence/types.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/types.js +13 -0
- package/backend/dist/platform/workPersistence/types.js.map +1 -0
- package/backend/dist/platform/workPersistence/workExecutionTypes.d.ts +13 -0
- package/backend/dist/platform/workPersistence/workExecutionTypes.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/workExecutionTypes.js +7 -0
- package/backend/dist/platform/workPersistence/workExecutionTypes.js.map +1 -0
- package/backend/dist/platform/workPersistence/workMessageContentCodec.d.ts +8 -0
- package/backend/dist/platform/workPersistence/workMessageContentCodec.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/workMessageContentCodec.js +25 -0
- package/backend/dist/platform/workPersistence/workMessageContentCodec.js.map +1 -0
- package/backend/dist/platform/workPersistence/workTextSafety.d.ts +3 -0
- package/backend/dist/platform/workPersistence/workTextSafety.d.ts.map +1 -0
- package/backend/dist/platform/workPersistence/workTextSafety.js +8 -0
- package/backend/dist/platform/workPersistence/workTextSafety.js.map +1 -0
- package/backend/dist/routes/agentCli.js +1 -1
- package/backend/dist/routes/agentCli.js.map +1 -1
- package/backend/dist/routes/artifacts.d.ts.map +1 -1
- package/backend/dist/routes/artifacts.js +2 -1
- package/backend/dist/routes/artifacts.js.map +1 -1
- package/backend/dist/routes/auth.d.ts.map +1 -1
- package/backend/dist/routes/auth.js +64 -18
- package/backend/dist/routes/auth.js.map +1 -1
- package/backend/dist/routes/chat.d.ts.map +1 -1
- package/backend/dist/routes/chat.js +519 -85
- package/backend/dist/routes/chat.js.map +1 -1
- package/backend/dist/routes/documents.d.ts.map +1 -1
- package/backend/dist/routes/documents.js +136 -28
- package/backend/dist/routes/documents.js.map +1 -1
- package/backend/dist/routes/embeddings.d.ts.map +1 -1
- package/backend/dist/routes/embeddings.js +2 -1
- package/backend/dist/routes/embeddings.js.map +1 -1
- package/backend/dist/routes/health.d.ts +3 -0
- package/backend/dist/routes/health.d.ts.map +1 -0
- package/backend/dist/routes/health.js +52 -0
- package/backend/dist/routes/health.js.map +1 -0
- package/backend/dist/routes/huggingfaceHub.d.ts.map +1 -1
- package/backend/dist/routes/huggingfaceHub.js +2 -1
- package/backend/dist/routes/huggingfaceHub.js.map +1 -1
- package/backend/dist/routes/imageGen.d.ts.map +1 -1
- package/backend/dist/routes/imageGen.js +42 -10
- package/backend/dist/routes/imageGen.js.map +1 -1
- package/backend/dist/routes/jobs.d.ts +3 -0
- package/backend/dist/routes/jobs.d.ts.map +1 -0
- package/backend/dist/routes/jobs.js +117 -0
- package/backend/dist/routes/jobs.js.map +1 -0
- package/backend/dist/routes/libreClaw.d.ts.map +1 -1
- package/backend/dist/routes/libreClaw.js +10 -7
- package/backend/dist/routes/libreClaw.js.map +1 -1
- package/backend/dist/routes/media.d.ts.map +1 -1
- package/backend/dist/routes/media.js +523 -77
- package/backend/dist/routes/media.js.map +1 -1
- package/backend/dist/routes/notes.d.ts.map +1 -1
- package/backend/dist/routes/notes.js +21 -21
- package/backend/dist/routes/notes.js.map +1 -1
- package/backend/dist/routes/ollama.d.ts.map +1 -1
- package/backend/dist/routes/ollama.js +40 -12
- package/backend/dist/routes/ollama.js.map +1 -1
- package/backend/dist/routes/personas.d.ts.map +1 -1
- package/backend/dist/routes/personas.js +4 -2
- package/backend/dist/routes/personas.js.map +1 -1
- package/backend/dist/routes/plugins.d.ts.map +1 -1
- package/backend/dist/routes/plugins.js +79 -51
- package/backend/dist/routes/plugins.js.map +1 -1
- package/backend/dist/routes/preferences.d.ts.map +1 -1
- package/backend/dist/routes/preferences.js +290 -25
- package/backend/dist/routes/preferences.js.map +1 -1
- package/backend/dist/routes/search.d.ts.map +1 -1
- package/backend/dist/routes/search.js +23 -14
- package/backend/dist/routes/search.js.map +1 -1
- package/backend/dist/routes/stt.d.ts +9 -0
- package/backend/dist/routes/stt.d.ts.map +1 -0
- package/backend/dist/routes/stt.js +217 -0
- package/backend/dist/routes/stt.js.map +1 -0
- package/backend/dist/routes/systemDiagnostics.d.ts.map +1 -1
- package/backend/dist/routes/systemDiagnostics.js +2 -1
- package/backend/dist/routes/systemDiagnostics.js.map +1 -1
- package/backend/dist/routes/tts.d.ts.map +1 -1
- package/backend/dist/routes/tts.js +577 -28
- package/backend/dist/routes/tts.js.map +1 -1
- package/backend/dist/routes/users.d.ts.map +1 -1
- package/backend/dist/routes/users.js +16 -25
- package/backend/dist/routes/users.js.map +1 -1
- package/backend/dist/routes/work.d.ts.map +1 -1
- package/backend/dist/routes/work.js +167 -113
- package/backend/dist/routes/work.js.map +1 -1
- package/backend/dist/services/agentAccessService.d.ts +2 -2
- package/backend/dist/services/agentAccessService.d.ts.map +1 -1
- package/backend/dist/services/agentAccessService.js +5 -14
- package/backend/dist/services/agentAccessService.js.map +1 -1
- package/backend/dist/services/agentCliService.d.ts +3 -2
- package/backend/dist/services/agentCliService.d.ts.map +1 -1
- package/backend/dist/services/agentCliService.js +44 -16
- package/backend/dist/services/agentCliService.js.map +1 -1
- package/backend/dist/services/assistantCompletionService.d.ts +2 -1
- package/backend/dist/services/assistantCompletionService.d.ts.map +1 -1
- package/backend/dist/services/assistantCompletionService.js +7 -3
- package/backend/dist/services/assistantCompletionService.js.map +1 -1
- package/backend/dist/services/authService.d.ts +7 -2
- package/backend/dist/services/authService.d.ts.map +1 -1
- package/backend/dist/services/authService.js +23 -10
- package/backend/dist/services/authService.js.map +1 -1
- package/backend/dist/services/chatGenerationService.d.ts +5 -4
- package/backend/dist/services/chatGenerationService.d.ts.map +1 -1
- package/backend/dist/services/chatGenerationService.js +23 -17
- package/backend/dist/services/chatGenerationService.js.map +1 -1
- package/backend/dist/services/chatRequestService.d.ts +4 -3
- package/backend/dist/services/chatRequestService.d.ts.map +1 -1
- package/backend/dist/services/chatRequestService.js +3 -3
- package/backend/dist/services/chatRequestService.js.map +1 -1
- package/backend/dist/services/chatService.d.ts +66 -16
- package/backend/dist/services/chatService.d.ts.map +1 -1
- package/backend/dist/services/chatService.js +402 -111
- package/backend/dist/services/chatService.js.map +1 -1
- package/backend/dist/services/codexOAuthService.d.ts +2 -2
- package/backend/dist/services/codexOAuthService.d.ts.map +1 -1
- package/backend/dist/services/codexOAuthService.js +63 -7
- package/backend/dist/services/codexOAuthService.js.map +1 -1
- package/backend/dist/services/dataArchiveService.d.ts +88 -0
- package/backend/dist/services/dataArchiveService.d.ts.map +1 -0
- package/backend/dist/services/dataArchiveService.js +1027 -0
- package/backend/dist/services/dataArchiveService.js.map +1 -0
- package/backend/dist/services/documentService.d.ts +67 -14
- package/backend/dist/services/documentService.d.ts.map +1 -1
- package/backend/dist/services/documentService.js +938 -193
- package/backend/dist/services/documentService.js.map +1 -1
- package/backend/dist/services/durableChatCompletion.d.ts +16 -0
- package/backend/dist/services/durableChatCompletion.d.ts.map +1 -0
- package/backend/dist/services/durableChatCompletion.js +34 -0
- package/backend/dist/services/durableChatCompletion.js.map +1 -0
- package/backend/dist/services/durableChatGenerationService.d.ts +19 -0
- package/backend/dist/services/durableChatGenerationService.d.ts.map +1 -0
- package/backend/dist/services/durableChatGenerationService.js +341 -0
- package/backend/dist/services/durableChatGenerationService.js.map +1 -0
- package/backend/dist/services/embeddingService.d.ts +1 -1
- package/backend/dist/services/embeddingService.d.ts.map +1 -1
- package/backend/dist/services/embeddingService.js +16 -13
- package/backend/dist/services/embeddingService.js.map +1 -1
- package/backend/dist/services/encryptionService.d.ts +28 -1
- package/backend/dist/services/encryptionService.d.ts.map +1 -1
- package/backend/dist/services/encryptionService.js +131 -51
- package/backend/dist/services/encryptionService.js.map +1 -1
- package/backend/dist/services/followUpService.d.ts +1 -1
- package/backend/dist/services/followUpService.d.ts.map +1 -1
- package/backend/dist/services/followUpService.js +1 -1
- package/backend/dist/services/followUpService.js.map +1 -1
- package/backend/dist/services/galleryService.d.ts +38 -37
- package/backend/dist/services/galleryService.d.ts.map +1 -1
- package/backend/dist/services/galleryService.js +356 -251
- package/backend/dist/services/galleryService.js.map +1 -1
- package/backend/dist/services/healthService.d.ts +65 -0
- package/backend/dist/services/healthService.d.ts.map +1 -0
- package/backend/dist/services/healthService.js +379 -0
- package/backend/dist/services/healthService.js.map +1 -0
- package/backend/dist/services/legacyCiphertextIntegrity.d.ts +40 -0
- package/backend/dist/services/legacyCiphertextIntegrity.d.ts.map +1 -0
- package/backend/dist/services/legacyCiphertextIntegrity.js +406 -0
- package/backend/dist/services/legacyCiphertextIntegrity.js.map +1 -0
- package/backend/dist/services/mediaGenerationJobService.d.ts +27 -5
- package/backend/dist/services/mediaGenerationJobService.d.ts.map +1 -1
- package/backend/dist/services/mediaGenerationJobService.js +185 -55
- package/backend/dist/services/mediaGenerationJobService.js.map +1 -1
- package/backend/dist/services/memoryService.d.ts +7 -83
- package/backend/dist/services/memoryService.d.ts.map +1 -1
- package/backend/dist/services/memoryService.js +428 -573
- package/backend/dist/services/memoryService.js.map +1 -1
- package/backend/dist/services/memoryUtils.d.ts.map +1 -1
- package/backend/dist/services/memoryUtils.js +8 -1
- package/backend/dist/services/memoryUtils.js.map +1 -1
- package/backend/dist/services/modelAccessService.d.ts +3 -3
- package/backend/dist/services/modelAccessService.d.ts.map +1 -1
- package/backend/dist/services/modelAccessService.js +8 -16
- package/backend/dist/services/modelAccessService.js.map +1 -1
- package/backend/dist/services/mutationEngineService.d.ts +0 -7
- package/backend/dist/services/mutationEngineService.d.ts.map +1 -1
- package/backend/dist/services/mutationEngineService.js +7 -78
- package/backend/dist/services/mutationEngineService.js.map +1 -1
- package/backend/dist/services/ollamaService.d.ts +4 -4
- package/backend/dist/services/ollamaService.d.ts.map +1 -1
- package/backend/dist/services/ollamaService.js +97 -34
- package/backend/dist/services/ollamaService.js.map +1 -1
- package/backend/dist/services/personaService.d.ts.map +1 -1
- package/backend/dist/services/personaService.js +19 -54
- package/backend/dist/services/personaService.js.map +1 -1
- package/backend/dist/services/pluginActivationService.d.ts +6 -5
- package/backend/dist/services/pluginActivationService.d.ts.map +1 -1
- package/backend/dist/services/pluginActivationService.js +36 -76
- package/backend/dist/services/pluginActivationService.js.map +1 -1
- package/backend/dist/services/pluginAudioGenerationService.d.ts +11 -6
- package/backend/dist/services/pluginAudioGenerationService.d.ts.map +1 -1
- package/backend/dist/services/pluginAudioGenerationService.js +74 -16
- package/backend/dist/services/pluginAudioGenerationService.js.map +1 -1
- package/backend/dist/services/pluginCacheInvalidation.d.ts +38 -0
- package/backend/dist/services/pluginCacheInvalidation.d.ts.map +1 -0
- package/backend/dist/services/pluginCacheInvalidation.js +198 -0
- package/backend/dist/services/pluginCacheInvalidation.js.map +1 -0
- package/backend/dist/services/pluginCapabilityRegistryService.d.ts +3 -3
- package/backend/dist/services/pluginCapabilityRegistryService.d.ts.map +1 -1
- package/backend/dist/services/pluginCapabilityRegistryService.js +11 -7
- package/backend/dist/services/pluginCapabilityRegistryService.js.map +1 -1
- package/backend/dist/services/pluginCredentialsService.d.ts +9 -8
- package/backend/dist/services/pluginCredentialsService.d.ts.map +1 -1
- package/backend/dist/services/pluginCredentialsService.js +48 -89
- package/backend/dist/services/pluginCredentialsService.js.map +1 -1
- package/backend/dist/services/pluginEmbeddingService.d.ts +8 -7
- package/backend/dist/services/pluginEmbeddingService.d.ts.map +1 -1
- package/backend/dist/services/pluginEmbeddingService.js +13 -11
- package/backend/dist/services/pluginEmbeddingService.js.map +1 -1
- package/backend/dist/services/pluginImageGenerationService.d.ts +10 -8
- package/backend/dist/services/pluginImageGenerationService.d.ts.map +1 -1
- package/backend/dist/services/pluginImageGenerationService.js +119 -14
- package/backend/dist/services/pluginImageGenerationService.js.map +1 -1
- package/backend/dist/services/pluginSTTService.d.ts +47 -0
- package/backend/dist/services/pluginSTTService.d.ts.map +1 -0
- package/backend/dist/services/pluginSTTService.js +199 -0
- package/backend/dist/services/pluginSTTService.js.map +1 -0
- package/backend/dist/services/pluginService.d.ts +94 -40
- package/backend/dist/services/pluginService.d.ts.map +1 -1
- package/backend/dist/services/pluginService.js +799 -274
- package/backend/dist/services/pluginService.js.map +1 -1
- package/backend/dist/services/pluginTTSService.d.ts +26 -8
- package/backend/dist/services/pluginTTSService.d.ts.map +1 -1
- package/backend/dist/services/pluginTTSService.js +277 -25
- package/backend/dist/services/pluginTTSService.js.map +1 -1
- package/backend/dist/services/pluginUsageService.d.ts +4 -4
- package/backend/dist/services/pluginUsageService.d.ts.map +1 -1
- package/backend/dist/services/pluginUsageService.js +44 -93
- package/backend/dist/services/pluginUsageService.js.map +1 -1
- package/backend/dist/services/pluginVariablesService.d.ts +14 -7
- package/backend/dist/services/pluginVariablesService.d.ts.map +1 -1
- package/backend/dist/services/pluginVariablesService.js +116 -81
- package/backend/dist/services/pluginVariablesService.js.map +1 -1
- package/backend/dist/services/pluginVideoGenerationService.d.ts +19 -8
- package/backend/dist/services/pluginVideoGenerationService.d.ts.map +1 -1
- package/backend/dist/services/pluginVideoGenerationService.js +116 -20
- package/backend/dist/services/pluginVideoGenerationService.js.map +1 -1
- package/backend/dist/services/preferencesService.d.ts +31 -21
- package/backend/dist/services/preferencesService.d.ts.map +1 -1
- package/backend/dist/services/preferencesService.js +104 -102
- package/backend/dist/services/preferencesService.js.map +1 -1
- package/backend/dist/services/recoveryInventoryService.d.ts +244 -0
- package/backend/dist/services/recoveryInventoryService.d.ts.map +1 -0
- package/backend/dist/services/recoveryInventoryService.js +1436 -0
- package/backend/dist/services/recoveryInventoryService.js.map +1 -0
- package/backend/dist/services/simpleGitHubOAuth.js +3 -3
- package/backend/dist/services/simpleGitHubOAuth.js.map +1 -1
- package/backend/dist/services/simpleHuggingFaceOAuth.d.ts.map +1 -1
- package/backend/dist/services/simpleHuggingFaceOAuth.js +3 -3
- package/backend/dist/services/simpleHuggingFaceOAuth.js.map +1 -1
- package/backend/dist/services/systemDiagnosticsService.d.ts.map +1 -1
- package/backend/dist/services/systemDiagnosticsService.js +2 -2
- package/backend/dist/services/systemDiagnosticsService.js.map +1 -1
- package/backend/dist/services/systemSettingsService.d.ts +5 -0
- package/backend/dist/services/systemSettingsService.d.ts.map +1 -0
- package/backend/dist/services/systemSettingsService.js +24 -0
- package/backend/dist/services/systemSettingsService.js.map +1 -0
- package/backend/dist/services/titleGenerationService.d.ts +1 -1
- package/backend/dist/services/titleGenerationService.d.ts.map +1 -1
- package/backend/dist/services/titleGenerationService.js +15 -4
- package/backend/dist/services/titleGenerationService.js.map +1 -1
- package/backend/dist/services/voiceProfileService.d.ts +44 -0
- package/backend/dist/services/voiceProfileService.d.ts.map +1 -0
- package/backend/dist/services/voiceProfileService.js +195 -0
- package/backend/dist/services/voiceProfileService.js.map +1 -0
- package/backend/dist/services/webSearchService.d.ts +7 -7
- package/backend/dist/services/webSearchService.d.ts.map +1 -1
- package/backend/dist/services/webSearchService.js +40 -35
- package/backend/dist/services/webSearchService.js.map +1 -1
- package/backend/dist/services/websocketTicketService.d.ts +39 -0
- package/backend/dist/services/websocketTicketService.d.ts.map +1 -0
- package/backend/dist/services/websocketTicketService.js +183 -0
- package/backend/dist/services/websocketTicketService.js.map +1 -0
- package/backend/dist/services/workAccessService.d.ts +3 -3
- package/backend/dist/services/workAccessService.d.ts.map +1 -1
- package/backend/dist/services/workAccessService.js +8 -16
- package/backend/dist/services/workAccessService.js.map +1 -1
- package/backend/dist/services/workAdminService.d.ts +3 -3
- package/backend/dist/services/workAdminService.d.ts.map +1 -1
- package/backend/dist/services/workAdminService.js +4 -4
- package/backend/dist/services/workAdminService.js.map +1 -1
- package/backend/dist/services/workAgentService.d.ts +25 -1
- package/backend/dist/services/workAgentService.d.ts.map +1 -1
- package/backend/dist/services/workAgentService.js +294 -126
- package/backend/dist/services/workAgentService.js.map +1 -1
- package/backend/dist/services/workEventService.d.ts +15 -2
- package/backend/dist/services/workEventService.d.ts.map +1 -1
- package/backend/dist/services/workEventService.js +201 -3
- package/backend/dist/services/workEventService.js.map +1 -1
- package/backend/dist/services/workKubernetesDriver.d.ts +8 -7
- package/backend/dist/services/workKubernetesDriver.d.ts.map +1 -1
- package/backend/dist/services/workKubernetesDriver.js +65 -21
- package/backend/dist/services/workKubernetesDriver.js.map +1 -1
- package/backend/dist/services/workModelProviderService.d.ts +2 -2
- package/backend/dist/services/workModelProviderService.d.ts.map +1 -1
- package/backend/dist/services/workModelProviderService.js +38 -34
- package/backend/dist/services/workModelProviderService.js.map +1 -1
- package/backend/dist/services/workPolicyService.d.ts +7 -7
- package/backend/dist/services/workPolicyService.d.ts.map +1 -1
- package/backend/dist/services/workPolicyService.js +50 -51
- package/backend/dist/services/workPolicyService.js.map +1 -1
- package/backend/dist/services/workPreviewProxyService.d.ts +8 -8
- package/backend/dist/services/workPreviewProxyService.d.ts.map +1 -1
- package/backend/dist/services/workPreviewProxyService.js +47 -44
- package/backend/dist/services/workPreviewProxyService.js.map +1 -1
- package/backend/dist/services/workRuntimeDriver.d.ts +21 -18
- package/backend/dist/services/workRuntimeDriver.d.ts.map +1 -1
- package/backend/dist/services/workRuntimeDriver.js +69 -20
- package/backend/dist/services/workRuntimeDriver.js.map +1 -1
- package/backend/dist/services/workRuntimeService.d.ts +18 -13
- package/backend/dist/services/workRuntimeService.d.ts.map +1 -1
- package/backend/dist/services/workRuntimeService.js +438 -194
- package/backend/dist/services/workRuntimeService.js.map +1 -1
- package/backend/dist/services/workRuntimeShared.d.ts +2 -0
- package/backend/dist/services/workRuntimeShared.d.ts.map +1 -1
- package/backend/dist/services/workRuntimeShared.js.map +1 -1
- package/backend/dist/services/workTaskService.d.ts +42 -36
- package/backend/dist/services/workTaskService.d.ts.map +1 -1
- package/backend/dist/services/workTaskService.js +445 -350
- package/backend/dist/services/workTaskService.js.map +1 -1
- package/backend/dist/services/workTerminalService.d.ts +1 -1
- package/backend/dist/services/workTerminalService.d.ts.map +1 -1
- package/backend/dist/services/workTerminalService.js +33 -6
- package/backend/dist/services/workTerminalService.js.map +1 -1
- package/backend/dist/storage.d.ts +72 -40
- package/backend/dist/storage.d.ts.map +1 -1
- package/backend/dist/storage.js +312 -660
- package/backend/dist/storage.js.map +1 -1
- package/backend/dist/types/index.d.ts +28 -0
- package/backend/dist/types/index.d.ts.map +1 -1
- package/backend/dist/types/index.js.map +1 -1
- package/backend/dist/types/work.d.ts +7 -2
- package/backend/dist/types/work.d.ts.map +1 -1
- package/backend/dist/utils/chatCancellation.d.ts +48 -0
- package/backend/dist/utils/chatCancellation.d.ts.map +1 -0
- package/backend/dist/utils/chatCancellation.js +152 -0
- package/backend/dist/utils/chatCancellation.js.map +1 -0
- package/backend/dist/utils/chatDocumentContext.d.ts +1 -1
- package/backend/dist/utils/chatDocumentContext.d.ts.map +1 -1
- package/backend/dist/utils/chatDocumentContext.js +11 -5
- package/backend/dist/utils/chatDocumentContext.js.map +1 -1
- package/backend/dist/utils/chatStreamCoalescer.d.ts +15 -0
- package/backend/dist/utils/chatStreamCoalescer.d.ts.map +1 -0
- package/backend/dist/utils/chatStreamCoalescer.js +59 -0
- package/backend/dist/utils/chatStreamCoalescer.js.map +1 -0
- package/backend/dist/utils/dataDirectory.d.ts +49 -0
- package/backend/dist/utils/dataDirectory.d.ts.map +1 -0
- package/backend/dist/utils/dataDirectory.js +291 -0
- package/backend/dist/utils/dataDirectory.js.map +1 -0
- package/backend/dist/utils/generationUtils.d.ts.map +1 -1
- package/backend/dist/utils/generationUtils.js +18 -6
- package/backend/dist/utils/generationUtils.js.map +1 -1
- package/backend/dist/utils/jwt.d.ts.map +1 -1
- package/backend/dist/utils/jwt.js +2 -3
- package/backend/dist/utils/jwt.js.map +1 -1
- package/backend/dist/utils/ollamaModelDefaults.d.ts.map +1 -1
- package/backend/dist/utils/ollamaModelDefaults.js +2 -7
- package/backend/dist/utils/ollamaModelDefaults.js.map +1 -1
- package/backend/dist/utils/ollamaStreaming.d.ts +2 -1
- package/backend/dist/utils/ollamaStreaming.d.ts.map +1 -1
- package/backend/dist/utils/ollamaStreaming.js +49 -11
- package/backend/dist/utils/ollamaStreaming.js.map +1 -1
- package/backend/dist/utils/pluginConnectionVariables.d.ts.map +1 -1
- package/backend/dist/utils/pluginConnectionVariables.js +11 -3
- package/backend/dist/utils/pluginConnectionVariables.js.map +1 -1
- package/backend/dist/utils/pluginDefinitionTrust.d.ts.map +1 -1
- package/backend/dist/utils/pluginDefinitionTrust.js +4 -3
- package/backend/dist/utils/pluginDefinitionTrust.js.map +1 -1
- package/backend/dist/utils/pluginStreaming.d.ts +2 -1
- package/backend/dist/utils/pluginStreaming.d.ts.map +1 -1
- package/backend/dist/utils/pluginStreaming.js +5 -1
- package/backend/dist/utils/pluginStreaming.js.map +1 -1
- package/backend/dist/utils/pluginUpload.d.ts +1 -0
- package/backend/dist/utils/pluginUpload.d.ts.map +1 -1
- package/backend/dist/utils/pluginUpload.js +9 -2
- package/backend/dist/utils/pluginUpload.js.map +1 -1
- package/backend/dist/utils/pluginValidation.d.ts.map +1 -1
- package/backend/dist/utils/pluginValidation.js +29 -1
- package/backend/dist/utils/pluginValidation.js.map +1 -1
- package/backend/dist/utils/sttAudioUpload.d.ts +24 -0
- package/backend/dist/utils/sttAudioUpload.d.ts.map +1 -0
- package/backend/dist/utils/sttAudioUpload.js +500 -0
- package/backend/dist/utils/sttAudioUpload.js.map +1 -0
- package/backend/dist/utils/ttsVoiceCloneUpload.d.ts +34 -0
- package/backend/dist/utils/ttsVoiceCloneUpload.d.ts.map +1 -0
- package/backend/dist/utils/ttsVoiceCloneUpload.js +224 -0
- package/backend/dist/utils/ttsVoiceCloneUpload.js.map +1 -0
- package/backend/dist/utils/websocketMessages.d.ts +2 -1
- package/backend/dist/utils/websocketMessages.d.ts.map +1 -1
- package/backend/dist/utils/websocketMessages.js +16 -2
- package/backend/dist/utils/websocketMessages.js.map +1 -1
- package/backend/dist/websocketServer.d.ts +4 -1
- package/backend/dist/websocketServer.d.ts.map +1 -1
- package/backend/dist/websocketServer.js +290 -44
- package/backend/dist/websocketServer.js.map +1 -1
- package/backend/dist/workTerminalServer.d.ts +9 -0
- package/backend/dist/workTerminalServer.d.ts.map +1 -1
- package/backend/dist/workTerminalServer.js +221 -52
- package/backend/dist/workTerminalServer.js.map +1 -1
- package/backend/dist/worker.d.ts +2 -0
- package/backend/dist/worker.d.ts.map +1 -0
- package/backend/dist/worker.js +250 -0
- package/backend/dist/worker.js.map +1 -0
- package/backend/package.json +19 -9
- package/bin/cli.js +126 -99
- package/bin/runtime-paths.js +108 -0
- package/frontend/dist/artifact-runtime/.build-fingerprint +1 -1
- package/frontend/dist/artifact-runtime/framer-motion.js +5 -5
- package/frontend/dist/artifact-runtime/lucide-react.js +1 -1
- package/frontend/dist/assets/index-CUhEG7E2.js +33 -0
- package/frontend/dist/assets/index-kxtZQLV6.css +1 -0
- package/frontend/dist/assets/{markdown-math-ClQbWekD.css → markdown-math-ClTedVi7.css} +1 -1
- package/frontend/dist/index.html +36 -18
- package/frontend/dist/js/{ArtifactContainer-C_UdeK4k.js → ArtifactContainer-BTEDhBnv.js} +1 -1
- package/frontend/dist/js/{ArtifactDemoPage-D3AuvuR5.js → ArtifactDemoPage-B0gN3YTl.js} +1 -1
- package/frontend/dist/js/{ArtifactSandboxFrame-BiXl9iGD.js → ArtifactSandboxFrame-CLBXQkZs.js} +3 -3
- package/frontend/dist/js/{ArtifactSlideOutPanel-CvgS3sfQ.js → ArtifactSlideOutPanel-CfqHPFdE.js} +1 -1
- package/frontend/dist/js/{Button-DcBM7gdH.js → Button-BV44cTnj.js} +1 -1
- package/frontend/dist/js/ChatPage-DIkAXZWA.js +23 -0
- package/frontend/dist/js/{FirstTimeSetup-B9742i3H.js → FirstTimeSetup-B8phXGNA.js} +1 -1
- package/frontend/dist/js/GalleryPage-W4uI043I.js +1 -0
- package/frontend/dist/js/HomePage-DlxehbyO.js +1 -0
- package/frontend/dist/js/{LibreClawPage-Ds6pqEyk.js → LibreClawPage-CgD0_G_F.js} +1 -1
- package/frontend/dist/js/{ModelManagerModals-BBNg2fxs.js → ModelManagerModals-D7jIT3v1.js} +1 -1
- package/frontend/dist/js/{ModelSelector-CJfJYwxh.js → ModelSelector-BYxJU1UV.js} +1 -1
- package/frontend/dist/js/ModelsPage-C4XdCKP5.js +2 -0
- package/frontend/dist/js/NotesPage-CDECOl4V.js +1 -0
- package/frontend/dist/js/{OptimizedSyntaxHighlighter-CWYUn9Oe.js → OptimizedSyntaxHighlighter-XwqZEoTf.js} +1 -1
- package/frontend/dist/js/{PersonasPage-CbQVv9OM.js → PersonasPage-CjSLPrgS.js} +2 -2
- package/frontend/dist/js/PluginUsagePage-DJOXJuH4.js +1 -0
- package/frontend/dist/js/RichMessageContent-Debeh6bi.js +3 -0
- package/frontend/dist/js/SettingsModal-cUqAeYUP.js +1 -0
- package/frontend/dist/js/{SettingsToggle-Uz2jvV64.js → SettingsToggle-WTa0rgvY.js} +1 -1
- package/frontend/dist/js/{SystemPage-CIBDZTWB.js → SystemPage-DxPw0GS7.js} +1 -1
- package/frontend/dist/js/UserManagementPage-CEdYFe_Z.js +1 -0
- package/frontend/dist/js/WorkPage-DDVeuG_9.js +6 -0
- package/frontend/dist/js/api-IzobHGND.js +14 -0
- package/frontend/dist/js/appStore-DKwC2vgn.js +2 -0
- package/frontend/dist/js/ar-xTSvTq05.js +2 -0
- package/frontend/dist/js/authStore-OaTuapL7.js +4 -0
- package/frontend/dist/js/{babel-CmENXdZw.js → babel-D24oDI9y.js} +1 -1
- package/frontend/dist/js/bn-iYAsohEA.js +2 -0
- package/frontend/dist/js/chatStore-DXGUVLXD.js +3 -0
- package/frontend/dist/js/{config-CV8L89A5.js → config-DPEEuTAe.js} +1 -1
- package/frontend/dist/js/cs-YBHN88Hb.js +2 -0
- package/frontend/dist/js/da-D7qlLy_k.js +2 -0
- package/frontend/dist/js/de-DV671k2c.js +2 -0
- package/frontend/dist/js/es-kyBgzNq-.js +2 -0
- package/frontend/dist/js/{estree-Lx6fK8Ug.js → estree-ChwJsD2w.js} +1 -1
- package/frontend/dist/js/fr-Cw1vut7I.js +2 -0
- package/frontend/dist/js/hi-DWEFC024.js +2 -0
- package/frontend/dist/js/{html-Dx5reqmV.js → html-DFrVjciF.js} +1 -1
- package/frontend/dist/js/id-DlMHjjy0.js +2 -0
- package/frontend/dist/js/is-B9E_a7dG.js +2 -0
- package/frontend/dist/js/it-DawmVbLC.js +2 -0
- package/frontend/dist/js/ja-DmVvwY3W.js +2 -0
- package/frontend/dist/js/ko-DzOPpkVs.js +2 -0
- package/frontend/dist/js/{markdown-Bd5G8zQB.js → markdown-FLLx7b67.js} +1 -1
- package/frontend/dist/js/markdown-core-BmPPZiuD.js +31 -0
- package/frontend/dist/js/{markdown-math-B7FlYsmr.js → markdown-math-mH7AZ_mb.js} +6 -6
- package/frontend/dist/js/{messageCodeStyles-CUWSpffv.js → messageCodeStyles-CBkkZY4n.js} +1 -1
- package/frontend/dist/js/ms-DpsaOPht.js +2 -0
- package/frontend/dist/js/nl-B1d8W22n.js +2 -0
- package/frontend/dist/js/pl-nCncRVgt.js +2 -0
- package/frontend/dist/js/{postcss-B5WIGhAY.js → postcss-Bx9CTcIc.js} +1 -1
- package/frontend/dist/js/pt-DHw8fGuu.js +2 -0
- package/frontend/dist/js/{react-vendor-DPNXrO-8.js → react-vendor-C5yShNlM.js} +1 -1
- package/frontend/dist/js/{router-vendor-Ca9zqOqT.js → router-vendor-CbPDks39.js} +1 -1
- package/frontend/dist/js/ru-Derl_YP_.js +2 -0
- package/frontend/dist/js/{standalone-DLNXiOUi.js → standalone-i8-5bg5p.js} +1 -1
- package/frontend/dist/js/sv-pJAfBVo0.js +2 -0
- package/frontend/dist/js/{syntax-highlight-Ca9bHsaz.js → syntax-highlight-3EEX6CGL.js} +3 -3
- package/frontend/dist/js/th-C_7fIGnk.js +2 -0
- package/frontend/dist/js/tr-CPqsJvaP.js +2 -0
- package/frontend/dist/js/{typescript-YKxslwSt.js → typescript-CQ3x-Uni.js} +1 -1
- package/frontend/dist/js/{ui-Dw6jDKxN.js → ui-BHhR3Vok.js} +2 -2
- package/frontend/dist/js/ui-vendor-D3Ahl1x5.js +177 -0
- package/frontend/dist/js/uk-3o8P_kFi.js +2 -0
- package/frontend/dist/js/{useTranslation-t1quV8ce.js → useTranslation-C3ei3mJq.js} +1 -1
- package/frontend/dist/js/{utils-iKndEgla.js → utils-CuC1beTY.js} +1 -1
- package/frontend/dist/js/{utils-vendor-1zob7nK9.js → utils-vendor-BBa8OxtB.js} +1 -1
- package/frontend/dist/js/vi-Dv6N7OVD.js +2 -0
- package/frontend/dist/js/{workApi-LrQmhNxb.js → workApi-Czu69yWS.js} +2 -2
- package/frontend/dist/js/{yaml-QD4znPfZ.js → yaml-DioTxVLA.js} +1 -1
- package/frontend/dist/js/zh-qg5iqtPi.js +2 -0
- package/package.json +16 -5
- package/plugins/huggingface.json +12 -3
- package/plugins/llama-cpp.json +18 -6
- package/plugins/longcat-audiodit.json +114 -0
- package/plugins/openai.json +18 -0
- package/frontend/dist/assets/index-CN7wpzUO.js +0 -26
- package/frontend/dist/assets/index-Dqkx5o2y.css +0 -1
- package/frontend/dist/js/ChatPage-DBEi-FSO.js +0 -16
- package/frontend/dist/js/GalleryPage-BL0x_xl7.js +0 -1
- package/frontend/dist/js/HomePage-Ukn2Y-BG.js +0 -1
- package/frontend/dist/js/ModelsPage-CDPJM-LA.js +0 -2
- package/frontend/dist/js/NotesPage-DJ-_MSI1.js +0 -1
- package/frontend/dist/js/PluginUsagePage-D69rQvFl.js +0 -1
- package/frontend/dist/js/RichMessageContent-DfuCu6PB.js +0 -3
- package/frontend/dist/js/SettingsModal-D87lWSx4.js +0 -1
- package/frontend/dist/js/UserManagementPage-DzMnFKDG.js +0 -1
- package/frontend/dist/js/WorkPage-D84JNdjS.js +0 -6
- package/frontend/dist/js/api-DhmVEJr2.js +0 -14
- package/frontend/dist/js/appStore-BsqeY2tS.js +0 -2
- package/frontend/dist/js/ar-BgCHB9_9.js +0 -2
- package/frontend/dist/js/authStore-DanfaPdm.js +0 -4
- package/frontend/dist/js/bn-Cr8_opuR.js +0 -2
- package/frontend/dist/js/chatStore-C25ywAXQ.js +0 -3
- package/frontend/dist/js/cs-Bb9gXpfH.js +0 -2
- package/frontend/dist/js/da-JfdGHjAw.js +0 -2
- package/frontend/dist/js/de-CczkCOVx.js +0 -2
- package/frontend/dist/js/es-n_0cjhn7.js +0 -2
- package/frontend/dist/js/fr-Pno128cn.js +0 -2
- package/frontend/dist/js/hi-DBCdcL4p.js +0 -2
- package/frontend/dist/js/id-85QDk-wA.js +0 -2
- package/frontend/dist/js/is-9MuKmBft.js +0 -2
- package/frontend/dist/js/it-C5mz9I3H.js +0 -2
- package/frontend/dist/js/ja-Cu90QTBd.js +0 -2
- package/frontend/dist/js/ko-CSdgcMgq.js +0 -2
- package/frontend/dist/js/markdown-core-DHnR5Hw8.js +0 -16
- package/frontend/dist/js/ms-IQMi6HBU.js +0 -2
- package/frontend/dist/js/nl-BwpdTgvn.js +0 -2
- package/frontend/dist/js/pl-zq8ctKrQ.js +0 -2
- package/frontend/dist/js/pt-BIQu7dBu.js +0 -2
- package/frontend/dist/js/ru-BT5-Z0F9.js +0 -2
- package/frontend/dist/js/sv-B1_q6-Uj.js +0 -2
- package/frontend/dist/js/th-BiLLwq0A.js +0 -2
- package/frontend/dist/js/tr-NZbkkeKs.js +0 -2
- package/frontend/dist/js/ui-vendor-xUzKqAXI.js +0 -177
- package/frontend/dist/js/uk-CGu1pg-F.js +0 -2
- package/frontend/dist/js/vi-ClvH5JZg.js +0 -2
- package/frontend/dist/js/zh-Jgjy3uAG.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{f as t}from"./markdown-core-DHnR5Hw8.js";var n=e(t(),1);function r(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function i(e,t,n){r(e,t),t.set(e,n)}function a(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function o(e,t,n){return e.set(a(e,t),n),n}function s(e,t){return e.get(a(e,t))}var c=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,l=/^[\\/]{2}/;function u(e,t){return t+e.replace(/\\/g,`/`)}var d=`popstate`;function f(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function p(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return y(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:b(t)}return S(t,n,null,e)}function m(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=x(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),y(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:b(t))}function r(e,t){g(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return S(t,n,r,e)}function h(e,t){if(e===!1||e==null)throw Error(t)}function g(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function _(){return Math.random().toString(36).substring(2,10)}function v(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function y(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?x(t):t,state:n,key:t&&t.key||r||_(),mask:i}}function b({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function x(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function S(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:_.location,delta:t})}function m(e,t){s=`PUSH`;let r=f(e)?e:y(_.location,e,t);n&&n(r,e),l=u()+1;let d=v(r,l),p=_.createHref(r.mask||r);try{o.pushState(d,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:_.location,delta:1})}function h(e,t){s=`REPLACE`;let r=f(e)?e:y(_.location,e,t);n&&n(r,e),l=u();let i=v(r,l),d=_.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:_.location,delta:0})}function g(e){return C(i,e)}let _={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(d,p),c=e,()=>{i.removeEventListener(d,p),c=null}},createHref(e){return t(i,e)},createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return _}function C(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),h(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:b(t);return i=i.replace(/ $/,`%20`),!n&&l.test(i)&&(i=r+i),new URL(i,r)}function w(e){"@babel/helpers - typeof";return w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},w(e)}function T(e,t){if(w(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(w(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E(e){var t=T(e,`string`);return w(t)==`symbol`?t:t+``}function D(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O,k=(O=new WeakMap,class{constructor(e){if(i(this,O,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(s(O,this).has(e))return s(O,this).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){s(O,this).set(e,t)}}),A=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function j(e){return A.has(e)}var M=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function ee(e){return M.has(e)}function N(e){return e.index===!0}function P(e){let t={};return e.Component&&Object.assign(t,{element:n.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:n.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:n.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function te(e,t=P,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(h(e.index!==!0||!e.children,`Cannot specify children on an index route`),h(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),N(e)){let n={...e,id:s};return r[s]=F(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=F(n,t(n)),e.children&&(n.children=te(e.children,t,o,r,i)),n}})}function F(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ne(e,t,n=`/`){return re(e,t,n,!1)}function re(e,t,n,r,i){let a=H((typeof t==`string`?x(t):t).pathname||`/`,n);if(a==null)return null;let o=i??I(e),s=null,c=ve(a);for(let e=0;s==null&&e<o.length;++e)s=he(o[e],c,r);return s}function ie(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function I(e){let t=ae(e);return L(t),t}function ae(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;h(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=U([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(h(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ae(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:pe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=_e(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of oe(e.path))a(e,t,!0,n)}),t}function oe(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=oe(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function L(e){e.sort((e,t)=>e.score===t.score?me(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var se=/^:[\w-]+$/,ce=/^:[\w-]+/,le=3.5,ue=3,de=2,R=1,z=10,B=-2,fe=e=>e===`*`;function pe(e,t){let n=e.split(`/`),r=n.length;return n.some(fe)&&(r+=B),t&&(r+=de),n.filter(e=>!fe(e)).reduce((e,t)=>e+(se.test(t)?ue:ce.test(t)?le:t===``?R:z),r)}function me(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function he(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?V(u,l,s.matcher,s.compiledParams):ge(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ge({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:U([a,d.pathname]),pathnameBase:ke(U([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=U([a,d.pathnameBase]))}return o}function ge(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_e(e.path,e.caseSensitive,e.end);return V(e,t,n,r)}function V(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function _e(e,t=!1,n=!0){g(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 r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ve(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return g(!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 H(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function ye({basename:e,pathname:t}){return t===`/`?e:U([e,t])}var be=e=>c.test(e);function xe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?x(e):e,a;return n?(n=De(n),a=n.startsWith(`/`)?Se(n.substring(1),`/`):Se(n,t)):a=t,{pathname:a,search:Ae(r),hash:je(i)}}function Se(e,t){let n=Oe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ce(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function we(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Te(e){let t=we(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ee(e,t,n,r=!1){let i;typeof e==`string`?i=x(e):(i={...e},h(!i.pathname||!i.pathname.includes(`?`),Ce(`?`,`pathname`,`search`,i)),h(!i.pathname||!i.pathname.includes(`#`),Ce(`#`,`pathname`,`hash`,i)),h(!i.search||!i.search.includes(`#`),Ce(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=xe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var De=e=>e.replace(/[\\/]{2,}/g,`/`),U=e=>De(e.join(`/`)),Oe=e=>e.replace(/\/+$/,``),ke=e=>Oe(e).replace(/^\/*/,`/`),Ae=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,je=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Me=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],W=class{constructor(e,t,n,r=!1){D(this,`status`,void 0),D(this,`statusText`,void 0),D(this,`data`,void 0),D(this,`error`,void 0),D(this,`internal`,void 0),this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ne(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Pe(e){return U(e.map(e=>e.route.path).filter(Boolean))||`/`}function Fe(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?x(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var Ie=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Le(e,t){let n=e;if(typeof n!=`string`||!c.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ie)try{let e=new URL(window.location.href),r=l.test(n)?new URL(u(n,e.protocol)):new URL(n),a=H(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{g(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var G=Symbol(`Uninstrumented`),Re=new WeakMap;function ze(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>K(await q(n.lazy,void 0,()=>e(...t),J))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>K(await q(n[`lazy.middleware`],void 0,()=>t(...e),J))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>K(await q(n[`lazy.loader`],void 0,()=>t(...e),J))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>K(await q(n[`lazy.action`],void 0,()=>t(...e),J))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Ve(t.loader),i=async(...t)=>K(await q(n.loader,Ge(t[0]),()=>e(...t),J));e.hydrate===!0&&(i.hydrate=!0),He(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Ve(t.action),i=async(...t)=>K(await q(n.action,Ge(t[0]),()=>e(...t),J));He(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Ve(e),r=async(...e)=>K(await q(n.middleware,Ge(e[0]),()=>t(...e),J));return He(r,t),r})),r}function Be(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=Ve(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?b(i):`.`,...Ke(e,a??{})};return K(await q(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Ue(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:o})))};He(r,t),e.navigate=r}if(n.fetch.length>0){let t=Ve(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return K(await q(n.fetch,{href:o??`.`,fetcherKey:i,...Ke(e,s??{})},async()=>{let n=Ue(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:c})))};He(r,t),e.fetch=r}return e}function Ve(e){return e[G]??e}function He(e,t){e[G]=t}function Ue(e,t){return Re.set(e,t),()=>{Re.get(e)===t&&Re.delete(e)}}function We(e){let t=Re.get(e);return Re.delete(e),t}function K(e){if(e.type===`error`)throw e.value;return e.value}async function q(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=q(e,t,n,r,i,a-1),await s,h(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function J(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Ge(e){let{request:t,context:n,params:r}=e;return{...e,request:qe(t),params:{...r},context:Je(n)}}function Ke(e,t){return{currentUrl:b(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 qe(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Je(e){return{get:t=>e.get(t)}}var Ye,Xe,Y,Ze,Qe=[`POST`,`PUT`,`PATCH`,`DELETE`],$e=new Set(Qe),et=[`GET`,...Qe],tt=new Set(et),nt=new Set([301,302,303,307,308]),rt=new Set([307,308]),it={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},at={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},st=`remix-router-transitions`,ct=Symbol(`ResetLoaderData`),lt=(Ye=new WeakMap,Xe=new WeakMap,Y=new WeakMap,Ze=new WeakMap,class{constructor(e){i(this,Ye,void 0),i(this,Xe,void 0),i(this,Y,void 0),i(this,Ze,void 0),o(Ye,this,e),o(Xe,this,I(e))}get stableRoutes(){return s(Ye,this)}get activeRoutes(){return s(Y,this)??s(Ye,this)}get branches(){return s(Ze,this)??s(Xe,this)}get hasHMRRoutes(){return s(Y,this)!=null}setRoutes(e){o(Ye,this,e),o(Xe,this,I(e))}setHmrRoutes(e){o(Y,this,e),o(Ze,this,I(e))}commitHmrRoutes(){s(Y,this)&&(o(Ye,this,s(Y,this)),o(Xe,this,s(Ze,this)),o(Y,this,void 0),o(Ze,this,void 0))}});function ut(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;h(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...ze(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new lt(te(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Dt,u={...e.future},d=null,f=new Set,p=null,m=null,_=null,v=null,b=e.hydrationData!=null,S=re(s.activeRoutes,e.history.location,c,!1,s.branches),w=!1,T=null,E,D;if(S==null&&!e.patchRoutesOnNavigation){let t=X(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Xt(s.activeRoutes);E=!0,D=!E,S=n,T={[r.id]:t}}else if(S&&!e.hydrationData&&Xe(S,s.activeRoutes,e.history.location.pathname).active&&(S=null),!S){E=!1,D=!E,S=[];let t=Xe(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(w=!0,S=t.matches)}else if(S.some(e=>e.route.lazy))E=!1,D=!E;else if(!S.some(e=>ht(e.route)))E=!0,D=!E;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=S;if(n){let e=S.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}D=!1,E=!0,r.forEach(e=>{let r=gt(e.route,t,n);D=D||r.renderFallback,E=E&&!r.shouldLoad})}let O,A={historyAction:e.history.action,location:e.history.location,matches:S,initialized:E,renderFallback:D,navigation:it,restoreScrollPosition:e.hydrationData==null&&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},j=`POP`,M=null,ee=!1,N,P=!1,F=new Map,ne=null,I=!1,ae=!1,oe=new Set,L=new Map,se=0,ce=-1,le=new Map,ue=new Set,de=new Map,R=new Map,z=new Set,B=new Map,fe,pe=null;function me(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(fe){fe(),fe=void 0;return}g(B.size===0||r!=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 i=J({currentLocation:A.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{fe=e});e.history.go(r*-1),q(i,{state:`blocked`,location:n,proceed(){q(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(A.blockers);e.set(i,ot),V({blockers:e})}}),M?.resolve(),M=null;return}return xe(t,n)}),n){bn(t,F);let e=()=>xn(t,F);t.addEventListener(`pagehide`,e),ne=()=>t.removeEventListener(`pagehide`,e)}return A.initialized||xe(`POP`,A.location,{initialHydration:!0}),O}function he(){d&&d(),ne&&ne(),f.clear(),N&&N.abort(),A.fetchers.forEach((e,t)=>Ie(A.fetchers,t)),A.blockers.forEach((e,t)=>K(t))}function ge(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(A,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function V(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e})),A={...A,...e};let n=[],r=[];A.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!A.fetchers.has(e)&&!L.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(A,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ie(A.fetchers,e)),r.forEach(e=>A.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=A.actionData!=null&&A.navigation.formMethod!=null&&Q(A.navigation.formMethod)&&A.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?A.actionData:null;let o=n.loaderData?qt(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,c=A.blockers;c.size>0&&!I&&(c=new Map(c),c.forEach((e,t)=>c.set(t,ot)));let l=!I&&Ye(t,n.matches||A.matches),u=ee===!0||A.navigation.formMethod!=null&&Q(A.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),I||j===`POP`||(j===`PUSH`?e.history.push(t,t.state):j===`REPLACE`&&e.history.replace(t,t.state));let d;if(j===`POP`){let e=F.get(A.location.pathname);e&&e.has(t.pathname)?d={currentLocation:A.location,nextLocation:t}:F.has(t.pathname)&&(d={currentLocation:t,nextLocation:A.location})}else if(P){let e=F.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),F.set(A.location.pathname,e)),d={currentLocation:A.location,nextLocation:t}}V({...n,actionData:a,loaderData:o,historyAction:j,location:t,initialized:!0,renderFallback:!1,navigation:it,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),j=`POP`,ee=!1,P=!1,I=!1,ae=!1,M?.resolve(),M=null,pe?.resolve(),pe=null}async function ve(t,n){if(M?.resolve(),M=null,typeof t==`number`){M||(M=Sn());let n=M.promise;return e.history.go(t),n}let r=We(O),{path:i,submission:a,error:o}=pt(!1,ft(A.location,A.matches,c,t,n?.fromRouteId,n?.relative),n),s;n?.mask&&(s={pathname:``,search:``,hash:``,...typeof n.mask==`string`?x(n.mask):{...A.location.mask,...n.mask}});let l=A.location,u=y(l,i,n&&n.state,void 0,s);u={...u,...e.history.encodeLocation(u)};let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&Q(a.formMethod)&&a.formAction===A.location.pathname+A.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=J({currentLocation:l,nextLocation:u,historyAction:f});if(h){q(h,{state:`blocked`,location:u,proceed(){q(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),ve(t,n)},reset(){let e=new Map(A.blockers);e.set(h,ot),V({blockers:e})}});return}await xe(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function ye(){pe||(pe=Sn()),je(),V({revalidation:`loading`});let e=pe.promise;return A.navigation.state===`submitting`?e:A.navigation.state===`idle`?(xe(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),e):(xe(j||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:P===!0}),e)}async function xe(t,n,r){N&&N.abort(),N=null,j=t,I=(r&&r.startUninterruptedRevalidation)===!0,Je(A.location,A.matches),ee=(r&&r.preventScrollReset)===!0,P=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&A.matches&&A.matches.length>0&&!w?A.matches:re(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&A.initialized&&!ae&&$t(A.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){_e(n,{matches:a},{flushSync:o});return}let l=Xe(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),r?.instrumentationNavigateMetaReceiver){let t=pn(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Ge(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;N=new AbortController;let d=Ht(e.history,n,N.signal,r&&r.submission),f=e.getContext?await e.getContext():new k,p;if(r&&r.pendingError)p=[Yt(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let i=await Se(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Z(t)&&Ne(t.error)&&t.error.status===404){N=null,_e(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=hn(n,a,t,r.submission),o=!1,l.active=!1,d=Ht(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Ce(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(N=null,_e(n,{matches:h||a,...Jt(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Se(t,n,i,l,u,d,f,p,m={}){if(je(),V({navigation:gn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await Y(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Xt(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Yt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Ge(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=fn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:X(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await ke(t,n,Nt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(an(h)){let n;return n=m&&m.replace!=null?m.replace:Vt(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===A.location.pathname+A.location.search,await Oe(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Z(h)){let e=Yt(l,g.route.id);return(m&&m.replace)!==!0&&(j=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Ce(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||hn(n,i,l,p),x=p||m||mn(b),S=!I&&!g;if(d){if(S){let e=we(v);V({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Y(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Xt(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Yt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Ge(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=mt(t,u,a,o,e.history,A,i,x,n,g?[]:r,g===!0,ae,oe,z,de,ue,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(ce=++se,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(A.fetchers),t=Ve(e);return _e(n,{matches:i,loaderData:{},errors:v&&Z(v[1])?{[v[0]]:v[1].error}:null,...Jt(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=we(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Te(T)),V(e,{flushSync:_})}T.forEach(e=>{G(e.key),e.controller&&L.set(e.key,e.controller)});let E=()=>T.forEach(e=>G(e.key));N&&N.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Ae(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener(`abort`,E),T.forEach(e=>L.delete(e.key));let k=Zt(D);if(k)return await Oe(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=Zt(O),k)return ue.add(k.key),await Oe(t,k.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(A.fetchers),{loaderData:M,errors:ee}=Kt(A,i,D,v,T,O,j);g&&A.errors&&(ee={...A.errors,...ee});let P=Ve(j),te=He(ce,j),F=P||te||T.length>0;return{matches:i,loaderData:M,errors:ee,...F?{workingFetchers:j}:{}}}function we(e){if(e&&!Z(e[1]))return{[e[0]]:e[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Te(e){let t=new Map(A.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=_n(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ee(t,n,r,i){G(t);let a=(i&&i.flushSync)===!0,o=We(O),l=s.activeRoutes,u=ft(A.location,A.matches,c,r,n,i?.relative),d=re(l,u,c,!1,s.branches),f=Xe(d,l,u);if(f.active&&f.matches&&(d=f.matches),o&&o(pn(e.history,u,d)),!d){W(t,n,X(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=pt(!0,u,i);if(h){W(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new k,_=(i&&i.preventScrollReset)===!0;if(m&&Q(m.formMethod)){await De(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}de.set(t,{routeId:n,path:p}),await U(t,n,p,d,g,f.active,a,_,m)}async function De(t,n,i,l,u,d,f,p,m,g){je(),de.delete(t),Me(t,vn(m,A.fetchers.get(t)),{flushSync:f});let _=new AbortController,v=Ht(e.history,i,_.signal,m);if(d){let e=await Y(l,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{W(t,n,X(404,{pathname:i}),{flushSync:f});return}}let y=fn(l,i);if(!y.route.action&&!y.route.lazy){W(t,n,X(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}L.set(t,_);let b=se,x=Nt(a,o,v,i,l,y,r,u),S=await ke(v,i,x,u,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){L.get(t)===_&&L.delete(t);return}if(z.has(t)){if(an(C)||Z(C)){Me(t,yn(void 0));return}}else{if(an(C)){if(L.delete(t),ce>b){Me(t,yn(void 0));return}return ue.add(t),Me(t,_n(m)),Oe(v,C,!1,{fetcherSubmission:m,preventScrollReset:p})}if(Z(C)){W(t,n,C.error);return}}let w=A.navigation.location||A.location,T=Ht(e.history,w,_.signal),E=s.activeRoutes,D=A.navigation.state===`idle`?A.matches:re(E,A.navigation.location,c,!1,s.branches);h(D,`Didn't find any matches after fetcher action`);let O=++se;le.set(t,O);let{dsMatches:k,revalidatingFetchers:M}=mt(T,u,a,o,e.history,A,D,m,w,r,!1,ae,oe,z,de,ue,E,c,e.patchRoutesOnNavigation!=null,s.branches,[y.route.id,C],g),ee=_n(m,C.data),P=new Map(A.fetchers);P.set(t,ee),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=P.get(t),r=_n(void 0,n?n.data:void 0);P.set(t,r),G(t),e.controller&&L.set(t,e.controller)}),V({fetchers:P});let te=()=>M.forEach(e=>G(e.key));_.signal.addEventListener(`abort`,te);let{loaderResults:F,fetcherResults:ne}=await Ae(k,M,T,w,u);if(_.signal.aborted)return;_.signal.removeEventListener(`abort`,te),le.delete(t),L.delete(t),M.forEach(e=>L.delete(e.key));let ie=A.fetchers.has(t),I=e=>{if(!ie)return e;let n=new Map(e.fetchers);return n.set(t,yn(C.data)),{...e,fetchers:n}},R=Zt(F);if(R)return A=I(A),Oe(T,R.result,!1,{preventScrollReset:p});if(R=Zt(ne),R)return ue.add(R.key),A=I(A),Oe(T,R.result,!1,{preventScrollReset:p});let B=new Map(A.fetchers);ie&&B.set(t,yn(C.data));let{loaderData:fe,errors:pe}=Kt(A,D,F,void 0,M,ne,B);He(O,B),A.navigation.state===`loading`&&O>ce?(h(j,`Expected pending action`),N&&N.abort(),_e(A.navigation.location,{matches:D,loaderData:fe,errors:pe,fetchers:B})):(V({errors:pe,loaderData:qt(A.loaderData,fe,D,pe),fetchers:B}),ae=!1)}async function U(t,n,i,s,c,l,u,d,f){let p=A.fetchers.get(t);Me(t,_n(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Ht(e.history,i,m.signal);if(l){let e=await Y(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{W(t,n,X(404,{pathname:i}),{flushSync:u});return}}let g=fn(s,i);L.set(t,m);let _=se,v=await ke(h,i,Nt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(L.get(t)===m&&L.delete(t),!h.signal.aborted){if(z.has(t)){Me(t,yn(void 0));return}if(an(y))if(ce>_){Me(t,yn(void 0));return}else{ue.add(t),await Oe(h,y,!1,{preventScrollReset:d});return}if(Z(y)){W(t,n,y.error);return}Me(t,yn(y.data))}}async function Oe(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(M?.resolve(),M=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ae=!0);let d=i.response.headers.get(`Location`);h(d,`Expected a Location header on the redirect Response`),d=Vt(d,new URL(r.url),c,e.history);let f=y(A.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(be(d)){let n=C(t,d,!0);e=n.origin!==t.location.origin||H(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}N=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:g,formEncType:_}=A.navigation;!o&&!s&&m&&g&&_&&(o=mn(A.navigation));let v=o||s;rt.has(i.response.status)&&v&&Q(v.formMethod)?await xe(p,f,{submission:{...v,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?P:void 0}):await xe(p,f,{overrideNavigation:hn(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||ee,enableViewTransition:a?P:void 0})}async function ke(e,t,n,r,i){let a,o={};try{a=await Pt(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Q(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!A.loaderData.hasOwnProperty(e.route.id)&&(!A.errors||!A.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(rn(r)){let i=r.result;o[t]={type:`redirect`,response:Rt(i,e,t,n,c)}}else o[t]=await Lt(r);return o}async function Ae(e,t,n,r,i){let a=ke(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ke(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:X(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function je(){ae=!0,de.forEach((e,t)=>{L.has(t)&&oe.add(t),G(t)})}function Me(e,t,n={}){let r=new Map(A.fetchers);r.set(e,t),V({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function W(e,t,n,r={}){let i=Yt(A.matches,t),a=new Map(A.fetchers);Ie(a,e),V({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Pe(e){return R.set(e,(R.get(e)||0)+1),z.has(e)&&z.delete(e),A.fetchers.get(e)||at}function Fe(e,t){G(e,t?.reason),Me(e,yn(null))}function Ie(e,t){let n=A.fetchers.get(t);L.has(t)&&!(n&&n.state===`loading`&&le.has(t))&&G(t),de.delete(t),le.delete(t),ue.delete(t),z.delete(t),oe.delete(t),e.delete(t)}function Le(e){let t=(R.get(e)||0)-1;t<=0?(R.delete(e),z.add(e)):R.set(e,t),V({fetchers:new Map(A.fetchers)})}function G(e,t){let n=L.get(e);n&&(n.abort(t),L.delete(e))}function Re(e,t){for(let n of e){let e=t.get(n);h(e,`Expected fetcher: ${n}`);let r=yn(e.data);t.set(n,r)}}function Ve(e){let t=[],n=!1;for(let r of ue){let i=e.get(r);h(i,`Expected fetcher: ${r}`),i.state===`loading`&&(ue.delete(r),t.push(r),n=!0)}return Re(t,e),n}function He(e,t){let n=[];for(let[r,i]of le)if(i<e){let e=t.get(r);h(e,`Expected fetcher: ${r}`),e.state===`loading`&&(G(r),le.delete(r),n.push(r))}return Re(n,t),n.length>0}function Ue(e,t){let n=A.blockers.get(e)||ot;return B.get(e)!==t&&B.set(e,t),n}function K(e){A.blockers.delete(e),B.delete(e)}function q(e,t){let n=A.blockers.get(e)||ot;h(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(A.blockers);r.set(e,t),V({blockers:r})}function J({currentLocation:e,nextLocation:t,historyAction:n}){if(B.size===0)return;B.size>1&&g(!1,`A router only supports one blocker at a time`);let r=Array.from(B.entries()),[i,a]=r[r.length-1],o=A.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Ge(e){let t=X(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Xt(n);return{notFoundMatches:r,route:i,error:t}}function Ke(e,t,n){if(m=e,v=t,_=n||null,!b&&A.navigation===it){b=!0;let e=Ye(A.location,A.matches);e!=null&&V({restoreScrollPosition:e})}return()=>{m=null,v=null,_=null}}function qe(e,t){return _&&_(e,t.map(e=>ie(e,A.loaderData)))||e.key}function Je(e,t){if(m&&v){let n=qe(e,t);m[n]=v()}}function Ye(e,t){if(m){let n=qe(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Xe(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:re(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:re(n,r,c,!0,e)}}return{active:!1,matches:null}}async function Y(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||bt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=re(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=re(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Ze(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||(f=re(s.activeRoutes,n,c,!0,u)),!f||Ze(l,f))return{type:`success`,matches:null};l=f}}function Ze(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Qe(e){o={},s.setHmrRoutes(te(e,a,void 0,o))}function $e(e,t,n=!1){bt(e,t,s,o,a,n),s.hasHMRRoutes||V({})}return O={get basename(){return c},get future(){return u},get state(){return A},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:me,subscribe:ge,enableScrollRestoration:Ke,navigate:ve,fetch:Ee,revalidate:ye,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Pe,resetFetcher:Fe,deleteFetcher:Le,dispose:he,getBlocker:Ue,deleteBlocker:K,patchRoutes:$e,_internalFetchControllers:L,_internalSetRoutes:Qe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){V(e)}},e.instrumentations&&(O=Be(O,e.instrumentations.map(e=>e.router).filter(Boolean))),O}function dt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ft(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Ee(r||`.`,Te(o),H(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=dn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=ye({basename:n,pathname:c.pathname})),b(c)}function pt(e,t,n){if(!n||!dt(n))return{path:t};if(n.formMethod&&!un(n.formMethod))return{path:t,error:X(405,{method:n.formMethod})};let r=()=>({path:t,error:X(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Qt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Q(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}h(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Ut(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Ut(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Wt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Wt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Q(c.formMethod))return{path:t,submission:c};let l=x(t);return e&&l.search&&dn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:b(l),submission:c}}function mt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Z(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&Z(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=Pe(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!ht(s))f=!1;else if(u){let{shouldLoad:e}=gt(s,a.loaderData,a.errors);f=e}else _t(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Mt(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?vt(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return Mt(n,r,e,c,k,i,l,t,yt(i,m),m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=re(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=fn(b,e.path),C=new AbortController,w=Ht(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Nt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Nt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};yt(S,a)&&(T=Nt(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function ht(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function gt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ht(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function _t(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function vt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function yt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function bt(e,t,n,r,i,a){let o;if(e){let t=r[e];h(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>xt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=te(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=te([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function xt(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?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>xt(e,t)))??!1}var St=new WeakMap,Ct=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(h(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=St.get(i);o||(o={},St.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=j(e),n=i[e]!==void 0;if(t)g(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)g(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},wt=new WeakMap;function Tt(e,t,n,r,i){let a=n[e.id];if(h(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=wt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{h(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=ee(e),o=a[e]!==void 0;i?g(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?g(!o,`Route "${a.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.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return wt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Ct({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Et(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Dt(e){return e.matches.some(e=>e.route.middleware)?Ot(e,()=>Et(e)):Et(e)}function Ot(e,t){return kt(e,t,e=>{if(ln(e))throw e;return e},tn,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[Yt(r,a).route.id]:{type:`error`,result:t}}}}}async function kt(e,t,n,r,i){let{matches:a,...o}=e;return await At(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function At(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await At(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function jt(e,t,n,r,i){let a=Ct({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Tt(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Mt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=jt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?yt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?yt(a,{...l,defaultShouldRevalidate:e}):yt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?Ft({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Nt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Mt(e,t,n,r,Pe(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:jt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Pt(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Fe(t,n),pattern:Pe(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Ot(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Ft({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Fe(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw X(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw X(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function It(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 Lt(e){let{result:t,type:n}=e;if(sn(t)){let e;try{e=await It(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new W(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?on(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:en(t),statusCode:Ne(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Ne(t)?t.status:void 0}:on(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 Rt(e,t,n,r,i){let a=e.headers.get(`Location`);if(h(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!be(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ft(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var zt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Bt(e){try{return zt.includes(new URL(e).protocol)}catch{return!1}}function Vt(e,t,n,r){if(be(e)){let r=e,i=l.test(r)?new URL(u(r,t.protocol)):new URL(r);if(Bt(i.toString()))throw Error(`Invalid redirect location`);let a=H(i.pathname,n)!=null;if(i.origin===t.origin&&a)return De(i.pathname)+i.search+i.hash}try{if(Bt(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Ht(e,t,n,r){let i=e.createURL(Qt(t)).toString(),a={signal:n};if(r&&Q(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Ut(r.formData):r.formData}return new Request(i,a)}function Ut(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Wt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Gt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Z(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(h(!an(f),`Cannot handle redirect results in processLoaderData`),Z(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o=o||{},i)o[d]=t;else{let n=Yt(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=ct),c||(c=!0,s=Ne(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Kt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Gt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(h(s,`Did not find corresponding fetcher result`),Z(s)){let t=Yt(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(an(s))h(!1,`Unhandled fetcher revalidation redirect`);else{let e=yn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function qt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==ct).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Jt(e){return e?Z(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Yt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function Xt(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function X(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new W(e||500,o,Error(s),!0)}function Zt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(an(r))return{key:n,result:r}}}function Qt(e){return b({...typeof e==`string`?x(e):e,hash:``})}function $t(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function en(e){return new W(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function tn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&nn(t))}function nn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function rn(e){return sn(e.result)&&nt.has(e.result.status)}function Z(e){return e.type===`error`}function an(e){return(e&&e.type)===`redirect`}function on(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function sn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function cn(e){return nt.has(e)}function ln(e){return sn(e)&&cn(e.status)&&e.headers.has(`Location`)}function un(e){return tt.has(e.toUpperCase())}function Q(e){return $e.has(e.toUpperCase())}function dn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function fn(e,t){let n=typeof t==`string`?x(t).search:t.search;if(e[e.length-1].route.index&&dn(n||``))return e[e.length-1];let r=we(e);return r[r.length-1]}function pn(e,t,n){return{url:Fe(e.createURL(t),t),pattern:n?Pe(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function mn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function hn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function gn(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function _n(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 vn(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 yn(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 bn(e,t){try{let n=e.sessionStorage.getItem(st);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function xn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(st,JSON.stringify(n))}catch(e){g(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Sn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Cn=n.createContext(null);Cn.displayName=`DataRouter`;var wn=n.createContext(null);wn.displayName=`DataRouterState`;var Tn=n.createContext(!1);function En(){return n.useContext(Tn)}var Dn=n.createContext({isTransitioning:!1});Dn.displayName=`ViewTransition`;var On=n.createContext(new Map);On.displayName=`Fetchers`;var kn=n.createContext(null);kn.displayName=`Await`;var $=n.createContext(null);$.displayName=`Navigation`;var An=n.createContext(null);An.displayName=`Location`;var jn=n.createContext({outlet:null,matches:[],isDataRoute:!1});jn.displayName=`Route`;var Mn=n.createContext(null);Mn.displayName=`RouteError`;var Nn=`REACT_ROUTER_ERROR`,Pn=`REDIRECT`,Fn=`ROUTE_ERROR_RESPONSE`;function In(e){if(e.startsWith(`${Nn}:${Pn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ln(e){if(e.startsWith(`${Nn}:${Fn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new W(t.status,t.statusText,t.data)}catch{}}var Rn;function zn(e,{relative:t}={}){h(Bn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:r,navigator:i}=n.useContext($),{hash:a,pathname:o,search:s}=Kn(e,{relative:t}),c=o;return r!==`/`&&(c=o===`/`?r:U([r,o])),i.createHref({pathname:c,search:s,hash:a})}function Bn(){return n.useContext(An)!=null}function Vn(){return h(Bn(),`useLocation() may be used only in the context of a <Router> component.`),n.useContext(An).location}var Hn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Un(){let{isDataRoute:e}=n.useContext(jn);return e?dr():Wn()}function Wn(){h(Bn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=n.useContext(Cn),{basename:t,navigator:r}=n.useContext($),{matches:i}=n.useContext(jn),{pathname:a}=Vn(),o=JSON.stringify(Te(i)),s=n.useRef(!1);return n.useLayoutEffect(()=>{s.current=!0}),n.useCallback((n,i={})=>{if(g(s.current,Hn),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=Ee(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:U([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}n.createContext(null);function Gn(){let{matches:e}=n.useContext(jn);return e[e.length-1]?.params??{}}function Kn(e,{relative:t}={}){let{matches:r}=n.useContext(jn),{pathname:i}=Vn(),a=JSON.stringify(Te(r));return n.useMemo(()=>Ee(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function qn(e,t){return Jn(e,t)}function Jn(e,t,r){h(Bn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=n.useContext($),{matches:a}=n.useContext(jn),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=Vn(),u;if(t){let e=typeof t==`string`?x(t):t;h(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):ne(e,{pathname:f}),m=tr(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:U([c,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:U([c,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,r);return t&&m?n.createElement(An.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},m):m}function Yn(){let e=cr(),t=Ne(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return n.createElement(n.Fragment,null,n.createElement(`h2`,null,`Unexpected Application Error!`),n.createElement(`h3`,{style:{fontStyle:`italic`}},t),r?n.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},r):null,null)}var Xn=n.createElement(Yn,null),Zn=(Rn=class extends n.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?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ln(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:n.createElement(jn.Provider,{value:this.props.routeContext},n.createElement(Mn.Provider,{value:e,children:this.props.component}));return this.context?n.createElement($n,{error:e},t):t}},D(Rn,`contextType`,Tn),Rn),Qn=new WeakMap;function $n({children:e,error:t}){let{basename:r}=n.useContext($);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=In(t.digest);if(e){let i=Qn.get(t);if(i)throw i;let a=Le(e.location,r),o=a.absoluteURL||a.to;if(Bt(o))throw Error(`Invalid redirect location`);if(Ie&&!Qn.get(t))if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Qn.set(t,n),n}return n.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function er({routeContext:e,match:t,children:r}){let i=n.useContext(Cn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(jn.Provider,{value:e},r)}function tr(e,t=[],r){let i=r?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);h(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||n[t.route.id]===void 0);if(t.route.lazy||o){r.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=r?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Pe(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||Xn,s&&(c<0&&l===0?(pr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(er,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(r.route.ErrorBoundary||r.route.errorElement||l===0)?n.createElement(Zn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function nr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rr(e){let t=n.useContext(Cn);return h(t,nr(e)),t}function ir(e){let t=n.useContext(wn);return h(t,nr(e)),t}function ar(e){let t=n.useContext(jn);return h(t,nr(e)),t}function or(e){let t=ar(e),n=t.matches[t.matches.length-1];return h(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sr(){return or(`useRouteId`)}function cr(){let e=n.useContext(Mn),t=ir(`useRouteError`),r=or(`useRouteError`);return e===void 0?t.errors?.[r]:e}var lr=0;function ur(e){let{router:t,basename:r}=rr(`useBlocker`),i=ir(`useBlocker`),[a,o]=n.useState(``),s=n.useCallback(t=>{if(typeof e!=`function`)return!!e;if(r===`/`)return e(t);let{currentLocation:n,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...n,pathname:H(n.pathname,r)||n.pathname},nextLocation:{...i,pathname:H(i.pathname,r)||i.pathname},historyAction:a})},[r,e]);return n.useEffect(()=>{let e=String(++lr);return o(e),()=>t.deleteBlocker(e)},[t]),n.useEffect(()=>{a!==``&&t.getBlocker(a,s)},[t,a,s]),a&&i.blockers.has(a)?i.blockers.get(a):ot}function dr(){let{router:e}=rr(`useNavigate`),t=or(`useNavigate`),r=n.useRef(!1);return n.useLayoutEffect(()=>{r.current=!0}),n.useCallback(async(n,i={})=>{g(r.current,Hn),r.current&&(typeof n==`number`?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var fr={};function pr(e,t,n){!t&&!fr[e]&&(fr[e]=!0,g(!1,n))}var mr={};function hr(e,t){!e&&!mr[t]&&(mr[t]=!0,console.warn(t))}var gr=[`HydrateFallback`,`hydrateFallbackElement`],_r=class{constructor(){D(this,`status`,`pending`),D(this,`promise`,void 0),D(this,`resolve`,void 0),D(this,`reject`,void 0),this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function vr({router:e,flushSync:t,onError:r,useTransitions:i}){i=En()||i;let[a,o]=n.useState(e.state),[s,c]=(0,n.useOptimistic)(a),[l,u]=n.useState(),[d,f]=n.useState({isTransitioning:!1}),[p,m]=n.useState(),[h,g]=n.useState(),[_,v]=n.useState(),y=n.useRef(new Map),b=n.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&r&&Object.values(l).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:Pe(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),hr(d===!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 b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(hr(_==null||b,"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."),!_||!b){t&&d?t(()=>o(a)):i===!1?o(a):n.startTransition(()=>{i===!0&&c(e=>yr(e,a)),o(a)});return}if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,r]);n.useLayoutEffect(()=>e.subscribe(b),[e,b]),n.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new _r)},[d]),n.useEffect(()=>{if(p&&l&&e.window){let t=l,r=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):n.startTransition(()=>{i===!0&&c(e=>yr(e,t)),o(t)}),await r});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),n.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),n.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=n.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=n.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:r}),[e,x,S,r]);return n.createElement(n.Fragment,null,n.createElement(Cn.Provider,{value:C},n.createElement(wn.Provider,{value:s},n.createElement(On.Provider,{value:y.current},n.createElement(Dn.Provider,{value:d},n.createElement(wr,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,useTransitions:i},n.createElement(br,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function yr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var br=n.memo(xr);function xr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Jn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Sr({to:e,replace:t,state:r,relative:i}){h(Bn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=n.useContext($);g(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=n.useContext(jn),{pathname:s}=Vn(),c=Un(),l=Ee(e,Te(o),s,i===`path`),u=JSON.stringify(l);return n.useEffect(()=>{c(JSON.parse(u),{replace:t,state:r,relative:i})},[c,u,i,t,r]),null}function Cr(e){h(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function wr({basename:e=`/`,children:t=null,location:r,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){h(!Bn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=n.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof r==`string`&&(r=x(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:_}=r,v=n.useMemo(()=>{let e=H(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:_},navigationType:i}},[c,u,d,f,p,m,i,_]);return g(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:n.createElement($.Provider,{value:l},n.createElement(An.Provider,{children:t,value:v}))}function Tr({children:e,location:t}){return qn(Er(e),t)}n.Component;function Er(e,t=[]){let r=[];return n.Children.forEach(e,(e,i)=>{if(!n.isValidElement(e))return;let a=[...t,i];if(e.type===n.Fragment){r.push.apply(r,Er(e.props.children,a));return}h(e.type===Cr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let o=e.props;h(!o.index||!o.children,`An index route cannot have child routes.`);let s={id:o.id||a.join(`-`),caseSensitive:o.caseSensitive,element:o.element,Component:o.Component,index:o.index,path:o.path,middleware:o.middleware,loader:o.loader,action:o.action,hydrateFallbackElement:o.hydrateFallbackElement,HydrateFallback:o.HydrateFallback,errorElement:o.errorElement,ErrorBoundary:o.ErrorBoundary,shouldRevalidate:o.shouldRevalidate,handle:o.handle,lazy:o.lazy};o.children&&(s.children=Er(o.children,a)),r.push(s)}),r}var Dr=`application/x-www-form-urlencoded`;function Or(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function kr(e){return Or(e)&&e.tagName.toLowerCase()===`button`}function Ar(e){return Or(e)&&e.tagName.toLowerCase()===`form`}function jr(e){return Or(e)&&e.tagName.toLowerCase()===`input`}function Mr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Nr(e,t){return e.button===0&&(!t||t===`_self`)&&!Mr(e)}var Pr=null;function Fr(){if(Pr===null)try{new FormData(document.createElement(`form`),0),Pr=!1}catch{Pr=!0}return Pr}var Ir=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Lr(e){return e!=null&&!Ir.has(e)?(g(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dr}"`),null):e}function Rr(e,t){let n,r,i,a,o;if(Ar(e)){let o=e.getAttribute(`action`);r=o?H(o,t):null,n=e.getAttribute(`method`)||`get`,i=Lr(e.getAttribute(`enctype`))||Dr,a=new FormData(e)}else if(kr(e)||jr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?H(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Lr(e.getAttribute(`formenctype`))||Lr(o.getAttribute(`enctype`))||Dr,a=new FormData(o,e),!Fr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Or(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Dr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function zr(e,t){if(e===!1||e==null)throw Error(t)}function Br(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}var Vr=`modulepreload`,Hr=function(e){return`/`+e},Ur={},Wr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Hr(t,n),t=s(t),t in Ur)return;Ur[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Vr,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Gr(e,t){if(e.id in t)return t[e.id];try{let n=await Wr(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Kr(e){return e!=null&&typeof e.page==`string`}function qr(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 Jr(e,t,n){return $r((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Gr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(qr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Yr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Xr(e,t,{includeHydrateFallback:n}={}){return Zr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Zr(e){return[...new Set(e)]}function Qr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function $r(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Kr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Qr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ei(){let e=n.useContext(Cn);return zr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ti(){let e=n.useContext(wn);return zr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ni=n.createContext(void 0);ni.displayName=`FrameworkContext`;function ri(){let e=n.useContext(ni);return zr(e,`You must render this element inside a <HydratedRouter> element`),e}function ii(e,t){let r=n.useContext(ni),[i,a]=n.useState(!1),[o,s]=n.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=n.useRef(null);n.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return r?e===`intent`?[o,p,{onFocus:ai(c,m),onBlur:ai(l,h),onMouseEnter:ai(u,m),onMouseLeave:ai(d,h),onTouchStart:ai(f,m)}]:[o,p,{}]:[!1,p,{}]}function ai(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oi({page:e,...t}){let r=En(),{nonce:i}=ri(),{router:a}=ei(),o=n.useMemo(()=>ne(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),r?n.createElement(ci,{page:e,matches:o,...t}):n.createElement(li,{page:e,matches:o,...t})):null}function si(e){let{manifest:t,routeModules:r}=ri(),[i,a]=n.useState([]);return n.useEffect(()=>{let n=!1;return Jr(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),i}function ci({page:e,matches:t,...r}){let i=Vn(),a=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Br(e,`rsc`),r=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:a.push(e.route.id);return r&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,i,t]);return n.createElement(n.Fragment,null,a.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})))}function li({page:e,matches:t,...r}){let i=Vn(),{manifest:a,routeModules:o}=ri(),{loaderData:s,matches:c}=ti(),l=n.useMemo(()=>Yr(e,t,c,a,i,`data`),[e,t,c,a,i]),u=n.useMemo(()=>Yr(e,t,c,a,i,`assets`),[e,t,c,a,i]),d=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!l.some(t=>t.route.id===e.route.id)&&e.route.id in s&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let c=Br(e,`data`);return r&&n.size>0&&c.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[c.pathname+c.search]},[s,i,a,l,t,e,o]),f=n.useMemo(()=>Xr(u,a),[u,a]),p=si(u);return n.createElement(n.Fragment,null,d.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})),f.map(e=>n.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...r})),p.map(({key:e,link:t})=>n.createElement(`link`,{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function ui(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var di=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{di&&(window.__reactRouterVersion=`8.3.0`)}catch{}function fi(e,t){return ut({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:p({window:t?.window}),hydrationData:t?.hydrationData||mi(),routes:e,mapRouteProperties:P,hydrationRouteProperties:gr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function pi(e,t){return ut({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:m({window:t?.window}),hydrationData:t?.hydrationData||mi(),routes:e,mapRouteProperties:P,hydrationRouteProperties:gr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function mi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:hi(e.errors)}),e}function hi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new W(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Me.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var gi=n.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=n.useContext($),b=typeof d==`string`&&c.test(d),x=Le(d,_);d=x.to;let S=zn(d,{relative:i}),C=Vn(),w=null;if(s){let e=Ee(s,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:U([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=ii(r,h),O=xi(d,{replace:o,mask:s,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||a),j=n.createElement(`a`,{...h,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:ui(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?n.createElement(n.Fragment,null,j,n.createElement(oi,{page:S})):j});gi.displayName=`Link`;var _i=n.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:r=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Kn(o,{relative:l.relative}),f=Vn(),p=n.useContext(wn),{navigator:m,basename:h}=n.useContext($),g=p!=null&&Ei(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=H(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof r==`function`?r(C):[r,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return n.createElement(gi,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});_i.displayName=`NavLink`;var vi=n.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=`get`,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=n.useContext($),v=wi(),y=Ti(l,{relative:d}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&c.test(l);return n.createElement(`form`,{ref:g,method:b,action:y,onSubmit:i?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:c,navigate:r,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&r!==!1?n.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});vi.displayName=`Form`;function yi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bi(e){let t=n.useContext(Cn);return h(t,yi(e)),t}function xi(e,{target:t,replace:r,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Un(),f=Vn(),p=Kn(e,{relative:s});return n.useCallback(m=>{if(Nr(m,t)){m.preventDefault();let t=r===void 0?b(f)===b(p):r,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?n.startTransition(()=>h()):h()}},[f,d,p,r,i,a,t,e,o,s,c,l,u])}var Si=0,Ci=()=>`__${String(++Si)}__`;function wi(){let{router:e}=bi(`useSubmit`),{basename:t}=n.useContext($),r=sr(),i=e.fetch,a=e.navigate;return n.useCallback(async(e,n={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Rr(e,t);n.navigate===!1?await i(n.fetcherKey||Ci(),r,n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,flushSync:n.flushSync}):await a(n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[i,a,t,r])}function Ti(e,{relative:t}={}){let{basename:r}=n.useContext($),i=n.useContext(jn);h(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Kn(e||`.`,{relative:t})},s=Vn();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(o.pathname=o.pathname===`/`?r:U([r,o.pathname])),b(o)}function Ei(e,{relative:t}={}){let r=n.useContext(Dn);h(r!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=bi(`useViewTransitionState`),a=Kn(e,{relative:t});if(!r.isTransitioning)return!1;let o=H(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=H(r.nextLocation.pathname,i)||r.nextLocation.pathname;return ge(a.pathname,s)!=null||ge(a.pathname,o)!=null}export{i as _,Sr as a,Tr as c,Un as d,Gn as f,a as g,o as h,Wr as i,ur as l,s as m,fi as n,Cr as o,D as p,pi as r,vr as s,gi as t,Vn as u,r as v};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{m as t}from"./markdown-core-BmPPZiuD.js";var n=e(t(),1);function r(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function i(e,t,n){r(e,t),t.set(e,n)}function a(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function o(e,t,n){return e.set(a(e,t),n),n}function s(e,t){return e.get(a(e,t))}var c=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,l=/^[\\/]{2}/;function u(e,t){return t+e.replace(/\\/g,`/`)}var d=`popstate`;function f(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function p(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return y(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:b(t)}return S(t,n,null,e)}function m(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=x(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),y(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:b(t))}function r(e,t){g(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return S(t,n,r,e)}function h(e,t){if(e===!1||e==null)throw Error(t)}function g(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function _(){return Math.random().toString(36).substring(2,10)}function v(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function y(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?x(t):t,state:n,key:t&&t.key||r||_(),mask:i}}function b({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function x(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function S(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:_.location,delta:t})}function m(e,t){s=`PUSH`;let r=f(e)?e:y(_.location,e,t);n&&n(r,e),l=u()+1;let d=v(r,l),p=_.createHref(r.mask||r);try{o.pushState(d,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:_.location,delta:1})}function h(e,t){s=`REPLACE`;let r=f(e)?e:y(_.location,e,t);n&&n(r,e),l=u();let i=v(r,l),d=_.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:_.location,delta:0})}function g(e){return C(i,e)}let _={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(d,p),c=e,()=>{i.removeEventListener(d,p),c=null}},createHref(e){return t(i,e)},createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return _}function C(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),h(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:b(t);return i=i.replace(/ $/,`%20`),!n&&l.test(i)&&(i=r+i),new URL(i,r)}function w(e){"@babel/helpers - typeof";return w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},w(e)}function T(e,t){if(w(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(w(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E(e){var t=T(e,`string`);return w(t)==`symbol`?t:t+``}function D(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O,k=(O=new WeakMap,class{constructor(e){if(i(this,O,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(s(O,this).has(e))return s(O,this).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){s(O,this).set(e,t)}}),A=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function j(e){return A.has(e)}var M=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function ee(e){return M.has(e)}function N(e){return e.index===!0}function P(e){let t={};return e.Component&&Object.assign(t,{element:n.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:n.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:n.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function te(e,t=P,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(h(e.index!==!0||!e.children,`Cannot specify children on an index route`),h(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),N(e)){let n={...e,id:s};return r[s]=F(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=F(n,t(n)),e.children&&(n.children=te(e.children,t,o,r,i)),n}})}function F(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ne(e,t,n=`/`){return re(e,t,n,!1)}function re(e,t,n,r,i){let a=H((typeof t==`string`?x(t):t).pathname||`/`,n);if(a==null)return null;let o=i??I(e),s=null,c=ve(a);for(let e=0;s==null&&e<o.length;++e)s=he(o[e],c,r);return s}function ie(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function I(e){let t=ae(e);return L(t),t}function ae(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;h(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=U([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(h(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ae(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:pe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=_e(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of oe(e.path))a(e,t,!0,n)}),t}function oe(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=oe(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function L(e){e.sort((e,t)=>e.score===t.score?me(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var se=/^:[\w-]+$/,ce=/^:[\w-]+/,le=3.5,ue=3,de=2,R=1,z=10,B=-2,fe=e=>e===`*`;function pe(e,t){let n=e.split(`/`),r=n.length;return n.some(fe)&&(r+=B),t&&(r+=de),n.filter(e=>!fe(e)).reduce((e,t)=>e+(se.test(t)?ue:ce.test(t)?le:t===``?R:z),r)}function me(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function he(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?V(u,l,s.matcher,s.compiledParams):ge(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ge({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:U([a,d.pathname]),pathnameBase:ke(U([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=U([a,d.pathnameBase]))}return o}function ge(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_e(e.path,e.caseSensitive,e.end);return V(e,t,n,r)}function V(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function _e(e,t=!1,n=!0){g(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 r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ve(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return g(!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 H(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function ye({basename:e,pathname:t}){return t===`/`?e:U([e,t])}var be=e=>c.test(e);function xe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?x(e):e,a;return n?(n=De(n),a=n.startsWith(`/`)?Se(n.substring(1),`/`):Se(n,t)):a=t,{pathname:a,search:Ae(r),hash:je(i)}}function Se(e,t){let n=Oe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ce(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function we(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Te(e){let t=we(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ee(e,t,n,r=!1){let i;typeof e==`string`?i=x(e):(i={...e},h(!i.pathname||!i.pathname.includes(`?`),Ce(`?`,`pathname`,`search`,i)),h(!i.pathname||!i.pathname.includes(`#`),Ce(`#`,`pathname`,`hash`,i)),h(!i.search||!i.search.includes(`#`),Ce(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=xe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var De=e=>e.replace(/[\\/]{2,}/g,`/`),U=e=>De(e.join(`/`)),Oe=e=>e.replace(/\/+$/,``),ke=e=>Oe(e).replace(/^\/*/,`/`),Ae=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,je=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Me=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],W=class{constructor(e,t,n,r=!1){D(this,`status`,void 0),D(this,`statusText`,void 0),D(this,`data`,void 0),D(this,`error`,void 0),D(this,`internal`,void 0),this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ne(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Pe(e){return U(e.map(e=>e.route.path).filter(Boolean))||`/`}function Fe(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?x(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var Ie=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Le(e,t){let n=e;if(typeof n!=`string`||!c.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ie)try{let e=new URL(window.location.href),r=l.test(n)?new URL(u(n,e.protocol)):new URL(n),a=H(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{g(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var G=Symbol(`Uninstrumented`),Re=new WeakMap;function ze(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>K(await q(n.lazy,void 0,()=>e(...t),J))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>K(await q(n[`lazy.middleware`],void 0,()=>t(...e),J))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>K(await q(n[`lazy.loader`],void 0,()=>t(...e),J))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>K(await q(n[`lazy.action`],void 0,()=>t(...e),J))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Ve(t.loader),i=async(...t)=>K(await q(n.loader,Ge(t[0]),()=>e(...t),J));e.hydrate===!0&&(i.hydrate=!0),He(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Ve(t.action),i=async(...t)=>K(await q(n.action,Ge(t[0]),()=>e(...t),J));He(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Ve(e),r=async(...e)=>K(await q(n.middleware,Ge(e[0]),()=>t(...e),J));return He(r,t),r})),r}function Be(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=Ve(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?b(i):`.`,...Ke(e,a??{})};return K(await q(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Ue(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:o})))};He(r,t),e.navigate=r}if(n.fetch.length>0){let t=Ve(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return K(await q(n.fetch,{href:o??`.`,fetcherKey:i,...Ke(e,s??{})},async()=>{let n=Ue(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:c})))};He(r,t),e.fetch=r}return e}function Ve(e){return e[G]??e}function He(e,t){e[G]=t}function Ue(e,t){return Re.set(e,t),()=>{Re.get(e)===t&&Re.delete(e)}}function We(e){let t=Re.get(e);return Re.delete(e),t}function K(e){if(e.type===`error`)throw e.value;return e.value}async function q(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=q(e,t,n,r,i,a-1),await s,h(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function J(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Ge(e){let{request:t,context:n,params:r}=e;return{...e,request:qe(t),params:{...r},context:Je(n)}}function Ke(e,t){return{currentUrl:b(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 qe(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Je(e){return{get:t=>e.get(t)}}var Ye,Xe,Y,Ze,Qe=[`POST`,`PUT`,`PATCH`,`DELETE`],$e=new Set(Qe),et=[`GET`,...Qe],tt=new Set(et),nt=new Set([301,302,303,307,308]),rt=new Set([307,308]),it={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},at={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},st=`remix-router-transitions`,ct=Symbol(`ResetLoaderData`),lt=(Ye=new WeakMap,Xe=new WeakMap,Y=new WeakMap,Ze=new WeakMap,class{constructor(e){i(this,Ye,void 0),i(this,Xe,void 0),i(this,Y,void 0),i(this,Ze,void 0),o(Ye,this,e),o(Xe,this,I(e))}get stableRoutes(){return s(Ye,this)}get activeRoutes(){return s(Y,this)??s(Ye,this)}get branches(){return s(Ze,this)??s(Xe,this)}get hasHMRRoutes(){return s(Y,this)!=null}setRoutes(e){o(Ye,this,e),o(Xe,this,I(e))}setHmrRoutes(e){o(Y,this,e),o(Ze,this,I(e))}commitHmrRoutes(){s(Y,this)&&(o(Ye,this,s(Y,this)),o(Xe,this,s(Ze,this)),o(Y,this,void 0),o(Ze,this,void 0))}});function ut(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;h(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...ze(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new lt(te(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Dt,u={...e.future},d=null,f=new Set,p=null,m=null,_=null,v=null,b=e.hydrationData!=null,S=re(s.activeRoutes,e.history.location,c,!1,s.branches),w=!1,T=null,E,D;if(S==null&&!e.patchRoutesOnNavigation){let t=X(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Xt(s.activeRoutes);E=!0,D=!E,S=n,T={[r.id]:t}}else if(S&&!e.hydrationData&&Xe(S,s.activeRoutes,e.history.location.pathname).active&&(S=null),!S){E=!1,D=!E,S=[];let t=Xe(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(w=!0,S=t.matches)}else if(S.some(e=>e.route.lazy))E=!1,D=!E;else if(!S.some(e=>ht(e.route)))E=!0,D=!E;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=S;if(n){let e=S.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}D=!1,E=!0,r.forEach(e=>{let r=gt(e.route,t,n);D=D||r.renderFallback,E=E&&!r.shouldLoad})}let O,A={historyAction:e.history.action,location:e.history.location,matches:S,initialized:E,renderFallback:D,navigation:it,restoreScrollPosition:e.hydrationData==null&&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},j=`POP`,M=null,ee=!1,N,P=!1,F=new Map,ne=null,I=!1,ae=!1,oe=new Set,L=new Map,se=0,ce=-1,le=new Map,ue=new Set,de=new Map,R=new Map,z=new Set,B=new Map,fe,pe=null;function me(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(fe){fe(),fe=void 0;return}g(B.size===0||r!=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 i=J({currentLocation:A.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{fe=e});e.history.go(r*-1),q(i,{state:`blocked`,location:n,proceed(){q(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(A.blockers);e.set(i,ot),V({blockers:e})}}),M?.resolve(),M=null;return}return xe(t,n)}),n){bn(t,F);let e=()=>xn(t,F);t.addEventListener(`pagehide`,e),ne=()=>t.removeEventListener(`pagehide`,e)}return A.initialized||xe(`POP`,A.location,{initialHydration:!0}),O}function he(){d&&d(),ne&&ne(),f.clear(),N&&N.abort(),A.fetchers.forEach((e,t)=>Ie(A.fetchers,t)),A.blockers.forEach((e,t)=>K(t))}function ge(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(A,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function V(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e})),A={...A,...e};let n=[],r=[];A.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!A.fetchers.has(e)&&!L.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(A,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ie(A.fetchers,e)),r.forEach(e=>A.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=A.actionData!=null&&A.navigation.formMethod!=null&&Q(A.navigation.formMethod)&&A.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?A.actionData:null;let o=n.loaderData?qt(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,c=A.blockers;c.size>0&&!I&&(c=new Map(c),c.forEach((e,t)=>c.set(t,ot)));let l=!I&&Ye(t,n.matches||A.matches),u=ee===!0||A.navigation.formMethod!=null&&Q(A.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),I||j===`POP`||(j===`PUSH`?e.history.push(t,t.state):j===`REPLACE`&&e.history.replace(t,t.state));let d;if(j===`POP`){let e=F.get(A.location.pathname);e&&e.has(t.pathname)?d={currentLocation:A.location,nextLocation:t}:F.has(t.pathname)&&(d={currentLocation:t,nextLocation:A.location})}else if(P){let e=F.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),F.set(A.location.pathname,e)),d={currentLocation:A.location,nextLocation:t}}V({...n,actionData:a,loaderData:o,historyAction:j,location:t,initialized:!0,renderFallback:!1,navigation:it,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),j=`POP`,ee=!1,P=!1,I=!1,ae=!1,M?.resolve(),M=null,pe?.resolve(),pe=null}async function ve(t,n){if(M?.resolve(),M=null,typeof t==`number`){M||(M=Sn());let n=M.promise;return e.history.go(t),n}let r=We(O),{path:i,submission:a,error:o}=pt(!1,ft(A.location,A.matches,c,t,n?.fromRouteId,n?.relative),n),s;n?.mask&&(s={pathname:``,search:``,hash:``,...typeof n.mask==`string`?x(n.mask):{...A.location.mask,...n.mask}});let l=A.location,u=y(l,i,n&&n.state,void 0,s);u={...u,...e.history.encodeLocation(u)};let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&Q(a.formMethod)&&a.formAction===A.location.pathname+A.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=J({currentLocation:l,nextLocation:u,historyAction:f});if(h){q(h,{state:`blocked`,location:u,proceed(){q(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),ve(t,n)},reset(){let e=new Map(A.blockers);e.set(h,ot),V({blockers:e})}});return}await xe(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function ye(){pe||(pe=Sn()),je(),V({revalidation:`loading`});let e=pe.promise;return A.navigation.state===`submitting`?e:A.navigation.state===`idle`?(xe(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),e):(xe(j||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:P===!0}),e)}async function xe(t,n,r){N&&N.abort(),N=null,j=t,I=(r&&r.startUninterruptedRevalidation)===!0,Je(A.location,A.matches),ee=(r&&r.preventScrollReset)===!0,P=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&A.matches&&A.matches.length>0&&!w?A.matches:re(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&A.initialized&&!ae&&$t(A.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){_e(n,{matches:a},{flushSync:o});return}let l=Xe(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),r?.instrumentationNavigateMetaReceiver){let t=pn(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Ge(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;N=new AbortController;let d=Ht(e.history,n,N.signal,r&&r.submission),f=e.getContext?await e.getContext():new k,p;if(r&&r.pendingError)p=[Yt(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let i=await Se(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Z(t)&&Ne(t.error)&&t.error.status===404){N=null,_e(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=hn(n,a,t,r.submission),o=!1,l.active=!1,d=Ht(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Ce(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(N=null,_e(n,{matches:h||a,...Jt(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Se(t,n,i,l,u,d,f,p,m={}){if(je(),V({navigation:gn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await Y(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Xt(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Yt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Ge(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=fn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:X(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await ke(t,n,Nt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(an(h)){let n;return n=m&&m.replace!=null?m.replace:Vt(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===A.location.pathname+A.location.search,await Oe(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Z(h)){let e=Yt(l,g.route.id);return(m&&m.replace)!==!0&&(j=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Ce(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||hn(n,i,l,p),x=p||m||mn(b),S=!I&&!g;if(d){if(S){let e=we(v);V({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Y(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Xt(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Yt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Ge(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=mt(t,u,a,o,e.history,A,i,x,n,g?[]:r,g===!0,ae,oe,z,de,ue,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(ce=++se,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(A.fetchers),t=Ve(e);return _e(n,{matches:i,loaderData:{},errors:v&&Z(v[1])?{[v[0]]:v[1].error}:null,...Jt(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=we(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Te(T)),V(e,{flushSync:_})}T.forEach(e=>{G(e.key),e.controller&&L.set(e.key,e.controller)});let E=()=>T.forEach(e=>G(e.key));N&&N.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Ae(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener(`abort`,E),T.forEach(e=>L.delete(e.key));let k=Zt(D);if(k)return await Oe(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=Zt(O),k)return ue.add(k.key),await Oe(t,k.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(A.fetchers),{loaderData:M,errors:ee}=Kt(A,i,D,v,T,O,j);g&&A.errors&&(ee={...A.errors,...ee});let P=Ve(j),te=He(ce,j),F=P||te||T.length>0;return{matches:i,loaderData:M,errors:ee,...F?{workingFetchers:j}:{}}}function we(e){if(e&&!Z(e[1]))return{[e[0]]:e[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Te(e){let t=new Map(A.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=_n(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ee(t,n,r,i){G(t);let a=(i&&i.flushSync)===!0,o=We(O),l=s.activeRoutes,u=ft(A.location,A.matches,c,r,n,i?.relative),d=re(l,u,c,!1,s.branches),f=Xe(d,l,u);if(f.active&&f.matches&&(d=f.matches),o&&o(pn(e.history,u,d)),!d){W(t,n,X(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=pt(!0,u,i);if(h){W(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new k,_=(i&&i.preventScrollReset)===!0;if(m&&Q(m.formMethod)){await De(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}de.set(t,{routeId:n,path:p}),await U(t,n,p,d,g,f.active,a,_,m)}async function De(t,n,i,l,u,d,f,p,m,g){je(),de.delete(t),Me(t,vn(m,A.fetchers.get(t)),{flushSync:f});let _=new AbortController,v=Ht(e.history,i,_.signal,m);if(d){let e=await Y(l,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{W(t,n,X(404,{pathname:i}),{flushSync:f});return}}let y=fn(l,i);if(!y.route.action&&!y.route.lazy){W(t,n,X(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}L.set(t,_);let b=se,x=Nt(a,o,v,i,l,y,r,u),S=await ke(v,i,x,u,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){L.get(t)===_&&L.delete(t);return}if(z.has(t)){if(an(C)||Z(C)){Me(t,yn(void 0));return}}else{if(an(C)){if(L.delete(t),ce>b){Me(t,yn(void 0));return}return ue.add(t),Me(t,_n(m)),Oe(v,C,!1,{fetcherSubmission:m,preventScrollReset:p})}if(Z(C)){W(t,n,C.error);return}}let w=A.navigation.location||A.location,T=Ht(e.history,w,_.signal),E=s.activeRoutes,D=A.navigation.state===`idle`?A.matches:re(E,A.navigation.location,c,!1,s.branches);h(D,`Didn't find any matches after fetcher action`);let O=++se;le.set(t,O);let{dsMatches:k,revalidatingFetchers:M}=mt(T,u,a,o,e.history,A,D,m,w,r,!1,ae,oe,z,de,ue,E,c,e.patchRoutesOnNavigation!=null,s.branches,[y.route.id,C],g),ee=_n(m,C.data),P=new Map(A.fetchers);P.set(t,ee),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=P.get(t),r=_n(void 0,n?n.data:void 0);P.set(t,r),G(t),e.controller&&L.set(t,e.controller)}),V({fetchers:P});let te=()=>M.forEach(e=>G(e.key));_.signal.addEventListener(`abort`,te);let{loaderResults:F,fetcherResults:ne}=await Ae(k,M,T,w,u);if(_.signal.aborted)return;_.signal.removeEventListener(`abort`,te),le.delete(t),L.delete(t),M.forEach(e=>L.delete(e.key));let ie=A.fetchers.has(t),I=e=>{if(!ie)return e;let n=new Map(e.fetchers);return n.set(t,yn(C.data)),{...e,fetchers:n}},R=Zt(F);if(R)return A=I(A),Oe(T,R.result,!1,{preventScrollReset:p});if(R=Zt(ne),R)return ue.add(R.key),A=I(A),Oe(T,R.result,!1,{preventScrollReset:p});let B=new Map(A.fetchers);ie&&B.set(t,yn(C.data));let{loaderData:fe,errors:pe}=Kt(A,D,F,void 0,M,ne,B);He(O,B),A.navigation.state===`loading`&&O>ce?(h(j,`Expected pending action`),N&&N.abort(),_e(A.navigation.location,{matches:D,loaderData:fe,errors:pe,fetchers:B})):(V({errors:pe,loaderData:qt(A.loaderData,fe,D,pe),fetchers:B}),ae=!1)}async function U(t,n,i,s,c,l,u,d,f){let p=A.fetchers.get(t);Me(t,_n(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Ht(e.history,i,m.signal);if(l){let e=await Y(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{W(t,n,X(404,{pathname:i}),{flushSync:u});return}}let g=fn(s,i);L.set(t,m);let _=se,v=await ke(h,i,Nt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(L.get(t)===m&&L.delete(t),!h.signal.aborted){if(z.has(t)){Me(t,yn(void 0));return}if(an(y))if(ce>_){Me(t,yn(void 0));return}else{ue.add(t),await Oe(h,y,!1,{preventScrollReset:d});return}if(Z(y)){W(t,n,y.error);return}Me(t,yn(y.data))}}async function Oe(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(M?.resolve(),M=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ae=!0);let d=i.response.headers.get(`Location`);h(d,`Expected a Location header on the redirect Response`),d=Vt(d,new URL(r.url),c,e.history);let f=y(A.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(be(d)){let n=C(t,d,!0);e=n.origin!==t.location.origin||H(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}N=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:g,formEncType:_}=A.navigation;!o&&!s&&m&&g&&_&&(o=mn(A.navigation));let v=o||s;rt.has(i.response.status)&&v&&Q(v.formMethod)?await xe(p,f,{submission:{...v,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?P:void 0}):await xe(p,f,{overrideNavigation:hn(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||ee,enableViewTransition:a?P:void 0})}async function ke(e,t,n,r,i){let a,o={};try{a=await Pt(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Q(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!A.loaderData.hasOwnProperty(e.route.id)&&(!A.errors||!A.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(rn(r)){let i=r.result;o[t]={type:`redirect`,response:Rt(i,e,t,n,c)}}else o[t]=await Lt(r);return o}async function Ae(e,t,n,r,i){let a=ke(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ke(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:X(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function je(){ae=!0,de.forEach((e,t)=>{L.has(t)&&oe.add(t),G(t)})}function Me(e,t,n={}){let r=new Map(A.fetchers);r.set(e,t),V({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function W(e,t,n,r={}){let i=Yt(A.matches,t),a=new Map(A.fetchers);Ie(a,e),V({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Pe(e){return R.set(e,(R.get(e)||0)+1),z.has(e)&&z.delete(e),A.fetchers.get(e)||at}function Fe(e,t){G(e,t?.reason),Me(e,yn(null))}function Ie(e,t){let n=A.fetchers.get(t);L.has(t)&&!(n&&n.state===`loading`&&le.has(t))&&G(t),de.delete(t),le.delete(t),ue.delete(t),z.delete(t),oe.delete(t),e.delete(t)}function Le(e){let t=(R.get(e)||0)-1;t<=0?(R.delete(e),z.add(e)):R.set(e,t),V({fetchers:new Map(A.fetchers)})}function G(e,t){let n=L.get(e);n&&(n.abort(t),L.delete(e))}function Re(e,t){for(let n of e){let e=t.get(n);h(e,`Expected fetcher: ${n}`);let r=yn(e.data);t.set(n,r)}}function Ve(e){let t=[],n=!1;for(let r of ue){let i=e.get(r);h(i,`Expected fetcher: ${r}`),i.state===`loading`&&(ue.delete(r),t.push(r),n=!0)}return Re(t,e),n}function He(e,t){let n=[];for(let[r,i]of le)if(i<e){let e=t.get(r);h(e,`Expected fetcher: ${r}`),e.state===`loading`&&(G(r),le.delete(r),n.push(r))}return Re(n,t),n.length>0}function Ue(e,t){let n=A.blockers.get(e)||ot;return B.get(e)!==t&&B.set(e,t),n}function K(e){A.blockers.delete(e),B.delete(e)}function q(e,t){let n=A.blockers.get(e)||ot;h(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(A.blockers);r.set(e,t),V({blockers:r})}function J({currentLocation:e,nextLocation:t,historyAction:n}){if(B.size===0)return;B.size>1&&g(!1,`A router only supports one blocker at a time`);let r=Array.from(B.entries()),[i,a]=r[r.length-1],o=A.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Ge(e){let t=X(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Xt(n);return{notFoundMatches:r,route:i,error:t}}function Ke(e,t,n){if(m=e,v=t,_=n||null,!b&&A.navigation===it){b=!0;let e=Ye(A.location,A.matches);e!=null&&V({restoreScrollPosition:e})}return()=>{m=null,v=null,_=null}}function qe(e,t){return _&&_(e,t.map(e=>ie(e,A.loaderData)))||e.key}function Je(e,t){if(m&&v){let n=qe(e,t);m[n]=v()}}function Ye(e,t){if(m){let n=qe(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Xe(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:re(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:re(n,r,c,!0,e)}}return{active:!1,matches:null}}async function Y(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||bt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=re(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=re(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Ze(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||(f=re(s.activeRoutes,n,c,!0,u)),!f||Ze(l,f))return{type:`success`,matches:null};l=f}}function Ze(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Qe(e){o={},s.setHmrRoutes(te(e,a,void 0,o))}function $e(e,t,n=!1){bt(e,t,s,o,a,n),s.hasHMRRoutes||V({})}return O={get basename(){return c},get future(){return u},get state(){return A},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:me,subscribe:ge,enableScrollRestoration:Ke,navigate:ve,fetch:Ee,revalidate:ye,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Pe,resetFetcher:Fe,deleteFetcher:Le,dispose:he,getBlocker:Ue,deleteBlocker:K,patchRoutes:$e,_internalFetchControllers:L,_internalSetRoutes:Qe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){V(e)}},e.instrumentations&&(O=Be(O,e.instrumentations.map(e=>e.router).filter(Boolean))),O}function dt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ft(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Ee(r||`.`,Te(o),H(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=dn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=ye({basename:n,pathname:c.pathname})),b(c)}function pt(e,t,n){if(!n||!dt(n))return{path:t};if(n.formMethod&&!un(n.formMethod))return{path:t,error:X(405,{method:n.formMethod})};let r=()=>({path:t,error:X(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Qt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Q(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}h(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Ut(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Ut(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Wt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Wt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Q(c.formMethod))return{path:t,submission:c};let l=x(t);return e&&l.search&&dn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:b(l),submission:c}}function mt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Z(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&Z(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=Pe(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!ht(s))f=!1;else if(u){let{shouldLoad:e}=gt(s,a.loaderData,a.errors);f=e}else _t(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Mt(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?vt(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return Mt(n,r,e,c,k,i,l,t,yt(i,m),m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=re(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=fn(b,e.path),C=new AbortController,w=Ht(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Nt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Nt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};yt(S,a)&&(T=Nt(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function ht(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function gt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ht(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function _t(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function vt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function yt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function bt(e,t,n,r,i,a){let o;if(e){let t=r[e];h(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>xt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=te(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=te([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function xt(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?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>xt(e,t)))??!1}var St=new WeakMap,Ct=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(h(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=St.get(i);o||(o={},St.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=j(e),n=i[e]!==void 0;if(t)g(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)g(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},wt=new WeakMap;function Tt(e,t,n,r,i){let a=n[e.id];if(h(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=wt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{h(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=ee(e),o=a[e]!==void 0;i?g(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?g(!o,`Route "${a.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.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return wt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Ct({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Et(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Dt(e){return e.matches.some(e=>e.route.middleware)?Ot(e,()=>Et(e)):Et(e)}function Ot(e,t){return kt(e,t,e=>{if(ln(e))throw e;return e},tn,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[Yt(r,a).route.id]:{type:`error`,result:t}}}}}async function kt(e,t,n,r,i){let{matches:a,...o}=e;return await At(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function At(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await At(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function jt(e,t,n,r,i){let a=Ct({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Tt(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Mt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=jt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?yt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?yt(a,{...l,defaultShouldRevalidate:e}):yt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?Ft({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Nt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Mt(e,t,n,r,Pe(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:jt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Pt(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Fe(t,n),pattern:Pe(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Ot(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Ft({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Fe(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw X(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw X(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function It(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 Lt(e){let{result:t,type:n}=e;if(sn(t)){let e;try{e=await It(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new W(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?on(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:en(t),statusCode:Ne(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Ne(t)?t.status:void 0}:on(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 Rt(e,t,n,r,i){let a=e.headers.get(`Location`);if(h(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!be(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ft(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var zt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Bt(e){try{return zt.includes(new URL(e).protocol)}catch{return!1}}function Vt(e,t,n,r){if(be(e)){let r=e,i=l.test(r)?new URL(u(r,t.protocol)):new URL(r);if(Bt(i.toString()))throw Error(`Invalid redirect location`);let a=H(i.pathname,n)!=null;if(i.origin===t.origin&&a)return De(i.pathname)+i.search+i.hash}try{if(Bt(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Ht(e,t,n,r){let i=e.createURL(Qt(t)).toString(),a={signal:n};if(r&&Q(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Ut(r.formData):r.formData}return new Request(i,a)}function Ut(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Wt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Gt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Z(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(h(!an(f),`Cannot handle redirect results in processLoaderData`),Z(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o=o||{},i)o[d]=t;else{let n=Yt(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=ct),c||(c=!0,s=Ne(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Kt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Gt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(h(s,`Did not find corresponding fetcher result`),Z(s)){let t=Yt(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(an(s))h(!1,`Unhandled fetcher revalidation redirect`);else{let e=yn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function qt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==ct).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Jt(e){return e?Z(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Yt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function Xt(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function X(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new W(e||500,o,Error(s),!0)}function Zt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(an(r))return{key:n,result:r}}}function Qt(e){return b({...typeof e==`string`?x(e):e,hash:``})}function $t(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function en(e){return new W(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function tn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&nn(t))}function nn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function rn(e){return sn(e.result)&&nt.has(e.result.status)}function Z(e){return e.type===`error`}function an(e){return(e&&e.type)===`redirect`}function on(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function sn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function cn(e){return nt.has(e)}function ln(e){return sn(e)&&cn(e.status)&&e.headers.has(`Location`)}function un(e){return tt.has(e.toUpperCase())}function Q(e){return $e.has(e.toUpperCase())}function dn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function fn(e,t){let n=typeof t==`string`?x(t).search:t.search;if(e[e.length-1].route.index&&dn(n||``))return e[e.length-1];let r=we(e);return r[r.length-1]}function pn(e,t,n){return{url:Fe(e.createURL(t),t),pattern:n?Pe(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function mn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function hn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function gn(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function _n(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 vn(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 yn(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 bn(e,t){try{let n=e.sessionStorage.getItem(st);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function xn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(st,JSON.stringify(n))}catch(e){g(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Sn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Cn=n.createContext(null);Cn.displayName=`DataRouter`;var wn=n.createContext(null);wn.displayName=`DataRouterState`;var Tn=n.createContext(!1);function En(){return n.useContext(Tn)}var Dn=n.createContext({isTransitioning:!1});Dn.displayName=`ViewTransition`;var On=n.createContext(new Map);On.displayName=`Fetchers`;var kn=n.createContext(null);kn.displayName=`Await`;var $=n.createContext(null);$.displayName=`Navigation`;var An=n.createContext(null);An.displayName=`Location`;var jn=n.createContext({outlet:null,matches:[],isDataRoute:!1});jn.displayName=`Route`;var Mn=n.createContext(null);Mn.displayName=`RouteError`;var Nn=`REACT_ROUTER_ERROR`,Pn=`REDIRECT`,Fn=`ROUTE_ERROR_RESPONSE`;function In(e){if(e.startsWith(`${Nn}:${Pn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ln(e){if(e.startsWith(`${Nn}:${Fn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new W(t.status,t.statusText,t.data)}catch{}}var Rn;function zn(e,{relative:t}={}){h(Bn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:r,navigator:i}=n.useContext($),{hash:a,pathname:o,search:s}=Kn(e,{relative:t}),c=o;return r!==`/`&&(c=o===`/`?r:U([r,o])),i.createHref({pathname:c,search:s,hash:a})}function Bn(){return n.useContext(An)!=null}function Vn(){return h(Bn(),`useLocation() may be used only in the context of a <Router> component.`),n.useContext(An).location}var Hn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Un(){let{isDataRoute:e}=n.useContext(jn);return e?dr():Wn()}function Wn(){h(Bn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=n.useContext(Cn),{basename:t,navigator:r}=n.useContext($),{matches:i}=n.useContext(jn),{pathname:a}=Vn(),o=JSON.stringify(Te(i)),s=n.useRef(!1);return n.useLayoutEffect(()=>{s.current=!0}),n.useCallback((n,i={})=>{if(g(s.current,Hn),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=Ee(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:U([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}n.createContext(null);function Gn(){let{matches:e}=n.useContext(jn);return e[e.length-1]?.params??{}}function Kn(e,{relative:t}={}){let{matches:r}=n.useContext(jn),{pathname:i}=Vn(),a=JSON.stringify(Te(r));return n.useMemo(()=>Ee(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function qn(e,t){return Jn(e,t)}function Jn(e,t,r){h(Bn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=n.useContext($),{matches:a}=n.useContext(jn),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=Vn(),u;if(t){let e=typeof t==`string`?x(t):t;h(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):ne(e,{pathname:f}),m=tr(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:U([c,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:U([c,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,r);return t&&m?n.createElement(An.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},m):m}function Yn(){let e=cr(),t=Ne(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return n.createElement(n.Fragment,null,n.createElement(`h2`,null,`Unexpected Application Error!`),n.createElement(`h3`,{style:{fontStyle:`italic`}},t),r?n.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},r):null,null)}var Xn=n.createElement(Yn,null),Zn=(Rn=class extends n.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?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ln(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:n.createElement(jn.Provider,{value:this.props.routeContext},n.createElement(Mn.Provider,{value:e,children:this.props.component}));return this.context?n.createElement($n,{error:e},t):t}},D(Rn,`contextType`,Tn),Rn),Qn=new WeakMap;function $n({children:e,error:t}){let{basename:r}=n.useContext($);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=In(t.digest);if(e){let i=Qn.get(t);if(i)throw i;let a=Le(e.location,r),o=a.absoluteURL||a.to;if(Bt(o))throw Error(`Invalid redirect location`);if(Ie&&!Qn.get(t))if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Qn.set(t,n),n}return n.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function er({routeContext:e,match:t,children:r}){let i=n.useContext(Cn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(jn.Provider,{value:e},r)}function tr(e,t=[],r){let i=r?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);h(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||n[t.route.id]===void 0);if(t.route.lazy||o){r.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=r?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Pe(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||Xn,s&&(c<0&&l===0?(pr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(er,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(r.route.ErrorBoundary||r.route.errorElement||l===0)?n.createElement(Zn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function nr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rr(e){let t=n.useContext(Cn);return h(t,nr(e)),t}function ir(e){let t=n.useContext(wn);return h(t,nr(e)),t}function ar(e){let t=n.useContext(jn);return h(t,nr(e)),t}function or(e){let t=ar(e),n=t.matches[t.matches.length-1];return h(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sr(){return or(`useRouteId`)}function cr(){let e=n.useContext(Mn),t=ir(`useRouteError`),r=or(`useRouteError`);return e===void 0?t.errors?.[r]:e}var lr=0;function ur(e){let{router:t,basename:r}=rr(`useBlocker`),i=ir(`useBlocker`),[a,o]=n.useState(``),s=n.useCallback(t=>{if(typeof e!=`function`)return!!e;if(r===`/`)return e(t);let{currentLocation:n,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...n,pathname:H(n.pathname,r)||n.pathname},nextLocation:{...i,pathname:H(i.pathname,r)||i.pathname},historyAction:a})},[r,e]);return n.useEffect(()=>{let e=String(++lr);return o(e),()=>t.deleteBlocker(e)},[t]),n.useEffect(()=>{a!==``&&t.getBlocker(a,s)},[t,a,s]),a&&i.blockers.has(a)?i.blockers.get(a):ot}function dr(){let{router:e}=rr(`useNavigate`),t=or(`useNavigate`),r=n.useRef(!1);return n.useLayoutEffect(()=>{r.current=!0}),n.useCallback(async(n,i={})=>{g(r.current,Hn),r.current&&(typeof n==`number`?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var fr={};function pr(e,t,n){!t&&!fr[e]&&(fr[e]=!0,g(!1,n))}var mr={};function hr(e,t){!e&&!mr[t]&&(mr[t]=!0,console.warn(t))}var gr=[`HydrateFallback`,`hydrateFallbackElement`],_r=class{constructor(){D(this,`status`,`pending`),D(this,`promise`,void 0),D(this,`resolve`,void 0),D(this,`reject`,void 0),this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function vr({router:e,flushSync:t,onError:r,useTransitions:i}){i=En()||i;let[a,o]=n.useState(e.state),[s,c]=(0,n.useOptimistic)(a),[l,u]=n.useState(),[d,f]=n.useState({isTransitioning:!1}),[p,m]=n.useState(),[h,g]=n.useState(),[_,v]=n.useState(),y=n.useRef(new Map),b=n.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&r&&Object.values(l).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:Pe(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),hr(d===!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 b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(hr(_==null||b,"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."),!_||!b){t&&d?t(()=>o(a)):i===!1?o(a):n.startTransition(()=>{i===!0&&c(e=>yr(e,a)),o(a)});return}if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,r]);n.useLayoutEffect(()=>e.subscribe(b),[e,b]),n.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new _r)},[d]),n.useEffect(()=>{if(p&&l&&e.window){let t=l,r=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):n.startTransition(()=>{i===!0&&c(e=>yr(e,t)),o(t)}),await r});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),n.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),n.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=n.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=n.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:r}),[e,x,S,r]);return n.createElement(n.Fragment,null,n.createElement(Cn.Provider,{value:C},n.createElement(wn.Provider,{value:s},n.createElement(On.Provider,{value:y.current},n.createElement(Dn.Provider,{value:d},n.createElement(wr,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,useTransitions:i},n.createElement(br,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function yr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var br=n.memo(xr);function xr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Jn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Sr({to:e,replace:t,state:r,relative:i}){h(Bn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=n.useContext($);g(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=n.useContext(jn),{pathname:s}=Vn(),c=Un(),l=Ee(e,Te(o),s,i===`path`),u=JSON.stringify(l);return n.useEffect(()=>{c(JSON.parse(u),{replace:t,state:r,relative:i})},[c,u,i,t,r]),null}function Cr(e){h(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function wr({basename:e=`/`,children:t=null,location:r,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){h(!Bn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=n.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof r==`string`&&(r=x(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:_}=r,v=n.useMemo(()=>{let e=H(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:_},navigationType:i}},[c,u,d,f,p,m,i,_]);return g(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:n.createElement($.Provider,{value:l},n.createElement(An.Provider,{children:t,value:v}))}function Tr({children:e,location:t}){return qn(Er(e),t)}n.Component;function Er(e,t=[]){let r=[];return n.Children.forEach(e,(e,i)=>{if(!n.isValidElement(e))return;let a=[...t,i];if(e.type===n.Fragment){r.push.apply(r,Er(e.props.children,a));return}h(e.type===Cr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let o=e.props;h(!o.index||!o.children,`An index route cannot have child routes.`);let s={id:o.id||a.join(`-`),caseSensitive:o.caseSensitive,element:o.element,Component:o.Component,index:o.index,path:o.path,middleware:o.middleware,loader:o.loader,action:o.action,hydrateFallbackElement:o.hydrateFallbackElement,HydrateFallback:o.HydrateFallback,errorElement:o.errorElement,ErrorBoundary:o.ErrorBoundary,shouldRevalidate:o.shouldRevalidate,handle:o.handle,lazy:o.lazy};o.children&&(s.children=Er(o.children,a)),r.push(s)}),r}var Dr=`application/x-www-form-urlencoded`;function Or(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function kr(e){return Or(e)&&e.tagName.toLowerCase()===`button`}function Ar(e){return Or(e)&&e.tagName.toLowerCase()===`form`}function jr(e){return Or(e)&&e.tagName.toLowerCase()===`input`}function Mr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Nr(e,t){return e.button===0&&(!t||t===`_self`)&&!Mr(e)}var Pr=null;function Fr(){if(Pr===null)try{new FormData(document.createElement(`form`),0),Pr=!1}catch{Pr=!0}return Pr}var Ir=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Lr(e){return e!=null&&!Ir.has(e)?(g(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dr}"`),null):e}function Rr(e,t){let n,r,i,a,o;if(Ar(e)){let o=e.getAttribute(`action`);r=o?H(o,t):null,n=e.getAttribute(`method`)||`get`,i=Lr(e.getAttribute(`enctype`))||Dr,a=new FormData(e)}else if(kr(e)||jr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?H(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Lr(e.getAttribute(`formenctype`))||Lr(o.getAttribute(`enctype`))||Dr,a=new FormData(o,e),!Fr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Or(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Dr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function zr(e,t){if(e===!1||e==null)throw Error(t)}function Br(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}var Vr=`modulepreload`,Hr=function(e){return`/`+e},Ur={},Wr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Hr(t,n),t=s(t),t in Ur)return;Ur[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Vr,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Gr(e,t){if(e.id in t)return t[e.id];try{let n=await Wr(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Kr(e){return e!=null&&typeof e.page==`string`}function qr(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 Jr(e,t,n){return $r((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Gr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(qr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Yr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Xr(e,t,{includeHydrateFallback:n}={}){return Zr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Zr(e){return[...new Set(e)]}function Qr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function $r(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Kr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Qr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ei(){let e=n.useContext(Cn);return zr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ti(){let e=n.useContext(wn);return zr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ni=n.createContext(void 0);ni.displayName=`FrameworkContext`;function ri(){let e=n.useContext(ni);return zr(e,`You must render this element inside a <HydratedRouter> element`),e}function ii(e,t){let r=n.useContext(ni),[i,a]=n.useState(!1),[o,s]=n.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=n.useRef(null);n.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return r?e===`intent`?[o,p,{onFocus:ai(c,m),onBlur:ai(l,h),onMouseEnter:ai(u,m),onMouseLeave:ai(d,h),onTouchStart:ai(f,m)}]:[o,p,{}]:[!1,p,{}]}function ai(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oi({page:e,...t}){let r=En(),{nonce:i}=ri(),{router:a}=ei(),o=n.useMemo(()=>ne(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),r?n.createElement(ci,{page:e,matches:o,...t}):n.createElement(li,{page:e,matches:o,...t})):null}function si(e){let{manifest:t,routeModules:r}=ri(),[i,a]=n.useState([]);return n.useEffect(()=>{let n=!1;return Jr(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),i}function ci({page:e,matches:t,...r}){let i=Vn(),a=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Br(e,`rsc`),r=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:a.push(e.route.id);return r&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,i,t]);return n.createElement(n.Fragment,null,a.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})))}function li({page:e,matches:t,...r}){let i=Vn(),{manifest:a,routeModules:o}=ri(),{loaderData:s,matches:c}=ti(),l=n.useMemo(()=>Yr(e,t,c,a,i,`data`),[e,t,c,a,i]),u=n.useMemo(()=>Yr(e,t,c,a,i,`assets`),[e,t,c,a,i]),d=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!l.some(t=>t.route.id===e.route.id)&&e.route.id in s&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let c=Br(e,`data`);return r&&n.size>0&&c.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[c.pathname+c.search]},[s,i,a,l,t,e,o]),f=n.useMemo(()=>Xr(u,a),[u,a]),p=si(u);return n.createElement(n.Fragment,null,d.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})),f.map(e=>n.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...r})),p.map(({key:e,link:t})=>n.createElement(`link`,{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function ui(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var di=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{di&&(window.__reactRouterVersion=`8.3.0`)}catch{}function fi(e,t){return ut({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:p({window:t?.window}),hydrationData:t?.hydrationData||mi(),routes:e,mapRouteProperties:P,hydrationRouteProperties:gr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function pi(e,t){return ut({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:m({window:t?.window}),hydrationData:t?.hydrationData||mi(),routes:e,mapRouteProperties:P,hydrationRouteProperties:gr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function mi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:hi(e.errors)}),e}function hi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new W(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Me.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var gi=n.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=n.useContext($),b=typeof d==`string`&&c.test(d),x=Le(d,_);d=x.to;let S=zn(d,{relative:i}),C=Vn(),w=null;if(s){let e=Ee(s,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:U([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=ii(r,h),O=xi(d,{replace:o,mask:s,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||a),j=n.createElement(`a`,{...h,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:ui(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?n.createElement(n.Fragment,null,j,n.createElement(oi,{page:S})):j});gi.displayName=`Link`;var _i=n.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:r=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Kn(o,{relative:l.relative}),f=Vn(),p=n.useContext(wn),{navigator:m,basename:h}=n.useContext($),g=p!=null&&Ei(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=H(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof r==`function`?r(C):[r,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return n.createElement(gi,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});_i.displayName=`NavLink`;var vi=n.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=`get`,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=n.useContext($),v=wi(),y=Ti(l,{relative:d}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&c.test(l);return n.createElement(`form`,{ref:g,method:b,action:y,onSubmit:i?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:c,navigate:r,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&r!==!1?n.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});vi.displayName=`Form`;function yi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bi(e){let t=n.useContext(Cn);return h(t,yi(e)),t}function xi(e,{target:t,replace:r,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Un(),f=Vn(),p=Kn(e,{relative:s});return n.useCallback(m=>{if(Nr(m,t)){m.preventDefault();let t=r===void 0?b(f)===b(p):r,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?n.startTransition(()=>h()):h()}},[f,d,p,r,i,a,t,e,o,s,c,l,u])}var Si=0,Ci=()=>`__${String(++Si)}__`;function wi(){let{router:e}=bi(`useSubmit`),{basename:t}=n.useContext($),r=sr(),i=e.fetch,a=e.navigate;return n.useCallback(async(e,n={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Rr(e,t);n.navigate===!1?await i(n.fetcherKey||Ci(),r,n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,flushSync:n.flushSync}):await a(n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[i,a,t,r])}function Ti(e,{relative:t}={}){let{basename:r}=n.useContext($),i=n.useContext(jn);h(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Kn(e||`.`,{relative:t})},s=Vn();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(o.pathname=o.pathname===`/`?r:U([r,o.pathname])),b(o)}function Ei(e,{relative:t}={}){let r=n.useContext(Dn);h(r!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=bi(`useViewTransitionState`),a=Kn(e,{relative:t});if(!r.isTransitioning)return!1;let o=H(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=H(r.nextLocation.pathname,i)||r.nextLocation.pathname;return ge(a.pathname,s)!=null||ge(a.pathname,o)!=null}export{i as _,Sr as a,Tr as c,Un as d,Gn as f,a as g,o as h,Wr as i,ur as l,s as m,fi as n,Cr as o,D as p,pi as r,vr as s,gi as t,Vn as u,r as v};
|