@openmrs/esm-app-shell 10.0.1-pre.5199 → 10.0.1-pre.5227
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/.turbo/turbo-build.log +4 -4
- package/dist/05851ecc07146490.js +1 -0
- package/dist/05851ecc07146490.js.map +1 -0
- package/dist/0be72cc6428e6925.js +1 -0
- package/dist/0be72cc6428e6925.js.map +1 -0
- package/dist/{5536ca8de39cb7d8.js → 13957ff0f140c6ff.js} +1 -1
- package/dist/13957ff0f140c6ff.js.map +1 -0
- package/dist/14b6c76f4b6cb59d.js +1 -0
- package/dist/14b6c76f4b6cb59d.js.map +1 -0
- package/dist/1a594994b175a085.js +1 -0
- package/dist/{457cd6ddd88887ec.js.map → 1a594994b175a085.js.map} +1 -1
- package/dist/24d4af05d310e7cd.js +1 -0
- package/dist/{790ebb7f7c3a944e.js.map → 24d4af05d310e7cd.js.map} +1 -1
- package/dist/342998ef12151fda.js +1 -0
- package/dist/342998ef12151fda.js.map +1 -0
- package/dist/371800b8adf2ecbc.js +1 -0
- package/dist/371800b8adf2ecbc.js.map +1 -0
- package/dist/3914d75d45c36ebc.js +1 -0
- package/dist/{98b428008990f466.js.map → 3914d75d45c36ebc.js.map} +1 -1
- package/dist/3affb37bd7c5e13d.js +1 -0
- package/dist/3affb37bd7c5e13d.js.map +1 -0
- package/dist/4230cf0319465310.js +1 -0
- package/dist/4230cf0319465310.js.map +1 -0
- package/dist/49f144128bf06965.js +1 -0
- package/dist/49f144128bf06965.js.map +1 -0
- package/dist/58e843241736198e.js +1 -0
- package/dist/58e843241736198e.js.map +1 -0
- package/dist/5a39f84add6ddbce.js +1 -0
- package/dist/5a39f84add6ddbce.js.map +1 -0
- package/dist/5a91f11a67af8e19.js +1 -0
- package/dist/{2977d80d1391b826.js.map → 5a91f11a67af8e19.js.map} +1 -1
- package/dist/5ad8cc3f3a1eee5c.js +1 -0
- package/dist/5ad8cc3f3a1eee5c.js.map +1 -0
- package/dist/5c858aea5fcb8617.js +1 -0
- package/dist/{998d1c557f85ca03.js.map → 5c858aea5fcb8617.js.map} +1 -1
- package/dist/6032d0e3b2927788.js +1 -0
- package/dist/{97165ec17daf35fc.js.map → 6032d0e3b2927788.js.map} +1 -1
- package/dist/692e798381349d20.js +1 -0
- package/dist/692e798381349d20.js.map +1 -0
- package/dist/6b4e9dbce0abc737.js +1 -0
- package/dist/6b4e9dbce0abc737.js.map +1 -0
- package/dist/6c121fe3fb94e78d.js +1 -0
- package/dist/6c121fe3fb94e78d.js.map +1 -0
- package/dist/6e09ab3cf3cb8a39.js +1 -0
- package/dist/6e09ab3cf3cb8a39.js.map +1 -0
- package/dist/6ec186481378b3f6.js +1 -0
- package/dist/6ec186481378b3f6.js.map +1 -0
- package/dist/713d2b74f56e0f3d.js +1 -0
- package/dist/713d2b74f56e0f3d.js.map +1 -0
- package/dist/7166614620fcd51c.js +1 -0
- package/dist/7166614620fcd51c.js.map +1 -0
- package/dist/73def4ffd08c637a.js +1 -0
- package/dist/73def4ffd08c637a.js.map +1 -0
- package/dist/7cc333a9b440d342.js +1 -0
- package/dist/7cc333a9b440d342.js.map +1 -0
- package/dist/82f6525970cbec1b.js +1 -0
- package/dist/{e173aa5eee85c641.js.map → 82f6525970cbec1b.js.map} +1 -1
- package/dist/95147fec497d02d2.js +1 -0
- package/dist/95147fec497d02d2.js.map +1 -0
- package/dist/9d19e5cc67c3e4f2.js +1 -0
- package/dist/9d19e5cc67c3e4f2.js.map +1 -0
- package/dist/9f9ef1f0f13ed258.js +1 -0
- package/dist/{da0f4000ff8a6308.js.map → 9f9ef1f0f13ed258.js.map} +1 -1
- package/dist/a21ba6a0329dacc3.js +1 -0
- package/dist/{3486eca0da3b88d1.js.map → a21ba6a0329dacc3.js.map} +1 -1
- package/dist/bd6b6ffba0831b4b.js +1 -0
- package/dist/bd6b6ffba0831b4b.js.map +1 -0
- package/dist/c37d944188b49944.js +1 -0
- package/dist/c37d944188b49944.js.map +1 -0
- package/dist/c4641db3088669e3.js +1 -0
- package/dist/c4641db3088669e3.js.map +1 -0
- package/dist/c4a815138ff694d3.js +1 -0
- package/dist/c4a815138ff694d3.js.map +1 -0
- package/dist/ca7025abbd4510ef.js +1 -0
- package/dist/ca7025abbd4510ef.js.map +1 -0
- package/dist/cb26daa4643ef6a9.js +1 -0
- package/dist/cb26daa4643ef6a9.js.map +1 -0
- package/dist/cea7b5aab075cfae.js +1 -0
- package/dist/{b006959f43e23fb8.js.map → cea7b5aab075cfae.js.map} +1 -1
- package/dist/d3d0fd00f6f27706.js +1 -0
- package/dist/d3d0fd00f6f27706.js.map +1 -0
- package/dist/d53d3a5adc27b3dc.js +1 -0
- package/dist/d53d3a5adc27b3dc.js.map +1 -0
- package/dist/d6a4c854751187c4.js +1 -0
- package/dist/d6a4c854751187c4.js.map +1 -0
- package/dist/d93d574a0a0a5ad1.js +1 -0
- package/dist/{6caaada0dd55e590.js.map → d93d574a0a0a5ad1.js.map} +1 -1
- package/dist/e0d211634c10fe6a.js +1 -0
- package/dist/e0d211634c10fe6a.js.map +1 -0
- package/dist/e372d79ed33118ff.js +1 -0
- package/dist/e372d79ed33118ff.js.map +1 -0
- package/dist/e80e5a1b612d1e8b.js +1 -0
- package/dist/{0cf6d2fca5bd467d.js.map → e80e5a1b612d1e8b.js.map} +1 -1
- package/dist/ea8b50f3e86d0c16.js +1 -0
- package/dist/ea8b50f3e86d0c16.js.map +1 -0
- package/dist/eb4945827da1cb41.js +1 -0
- package/dist/eb4945827da1cb41.js.map +1 -0
- package/dist/f531f465b3f30aa4.js +1 -0
- package/dist/f531f465b3f30aa4.js.map +1 -0
- package/dist/fd43dec286bd966c.js +1 -0
- package/dist/fd43dec286bd966c.js.map +1 -0
- package/dist/fda233679a0da75e.js +1 -0
- package/dist/fda233679a0da75e.js.map +1 -0
- package/dist/index.html +1 -1
- package/dist/openmrs.8ca63e38321edeff.js +7 -0
- package/dist/openmrs.8ca63e38321edeff.js.map +1 -0
- package/lib/openmrs.js +499 -20
- package/package.json +6 -3
- package/rspack.config.js +15 -2
- package/src/federation-runtime.test.ts +54 -0
- package/src/federation-runtime.ts +42 -0
- package/src/index.ts +5 -0
- package/turbo.json +33 -0
- package/dist/0cf6d2fca5bd467d.js +0 -1
- package/dist/0db3b903f784a131.js +0 -1
- package/dist/0db3b903f784a131.js.map +0 -1
- package/dist/140de372a2d1acb4.js +0 -1
- package/dist/140de372a2d1acb4.js.map +0 -1
- package/dist/29004411600d2e11.js +0 -1
- package/dist/29004411600d2e11.js.map +0 -1
- package/dist/2977d80d1391b826.js +0 -1
- package/dist/2edd97ba16bad94d.js +0 -1
- package/dist/2edd97ba16bad94d.js.map +0 -1
- package/dist/2f45a3ddfd50c943.js +0 -1
- package/dist/2f45a3ddfd50c943.js.map +0 -1
- package/dist/3486eca0da3b88d1.js +0 -1
- package/dist/3589f169e541e5a0.js +0 -1
- package/dist/3589f169e541e5a0.js.map +0 -1
- package/dist/368c44457fdd04cf.js +0 -1
- package/dist/368c44457fdd04cf.js.map +0 -1
- package/dist/3b65aba1b215cece.js +0 -1
- package/dist/3b65aba1b215cece.js.map +0 -1
- package/dist/457cd6ddd88887ec.js +0 -1
- package/dist/5536ca8de39cb7d8.js.map +0 -1
- package/dist/597d2113aef375f6.js +0 -1
- package/dist/597d2113aef375f6.js.map +0 -1
- package/dist/64f7917f1a8f8fb4.js +0 -1
- package/dist/64f7917f1a8f8fb4.js.map +0 -1
- package/dist/6610375530e10884.js +0 -1
- package/dist/6610375530e10884.js.map +0 -1
- package/dist/6caaada0dd55e590.js +0 -1
- package/dist/732bf759b17b5732.js +0 -1
- package/dist/732bf759b17b5732.js.map +0 -1
- package/dist/74d457f3dd2eb85f.js +0 -1
- package/dist/74d457f3dd2eb85f.js.map +0 -1
- package/dist/7760be96d3727fe2.js +0 -1
- package/dist/7760be96d3727fe2.js.map +0 -1
- package/dist/790ebb7f7c3a944e.js +0 -1
- package/dist/7e17d8151ef1ad94.js +0 -1
- package/dist/7e17d8151ef1ad94.js.map +0 -1
- package/dist/8d9b20644952b178.js +0 -1
- package/dist/8d9b20644952b178.js.map +0 -1
- package/dist/8ed0cc8227531777.js +0 -1
- package/dist/8ed0cc8227531777.js.map +0 -1
- package/dist/8ee4946c8757f032.js +0 -1
- package/dist/8ee4946c8757f032.js.map +0 -1
- package/dist/97165ec17daf35fc.js +0 -1
- package/dist/98b428008990f466.js +0 -1
- package/dist/998d1c557f85ca03.js +0 -1
- package/dist/aa19cc3bbe94d915.js +0 -1
- package/dist/aa19cc3bbe94d915.js.map +0 -1
- package/dist/b006959f43e23fb8.js +0 -1
- package/dist/b0a211dba76847c5.js +0 -1
- package/dist/b0a211dba76847c5.js.map +0 -1
- package/dist/b726991c35e41429.js +0 -1
- package/dist/b726991c35e41429.js.map +0 -1
- package/dist/b9123922ca01a42d.js +0 -1
- package/dist/b9123922ca01a42d.js.map +0 -1
- package/dist/bbe6b27a195b4177.js +0 -1
- package/dist/bbe6b27a195b4177.js.map +0 -1
- package/dist/bc1bf5960ca6f5c2.js +0 -1
- package/dist/bc1bf5960ca6f5c2.js.map +0 -1
- package/dist/bca5f162fad8eca9.js +0 -1
- package/dist/bca5f162fad8eca9.js.map +0 -1
- package/dist/bd91ed290a71e9cd.js +0 -1
- package/dist/bd91ed290a71e9cd.js.map +0 -1
- package/dist/c0d7c9cbe921b6e6.js +0 -1
- package/dist/c0d7c9cbe921b6e6.js.map +0 -1
- package/dist/c1f5ae377b833cf9.js +0 -1
- package/dist/c1f5ae377b833cf9.js.map +0 -1
- package/dist/c23d889af7916acd.js +0 -1
- package/dist/c23d889af7916acd.js.map +0 -1
- package/dist/c62d22bb7b3da2b8.js +0 -1
- package/dist/c62d22bb7b3da2b8.js.map +0 -1
- package/dist/c8c144b11053330d.js +0 -1
- package/dist/c8c144b11053330d.js.map +0 -1
- package/dist/c9da4b3d6e2dd2e7.js +0 -1
- package/dist/c9da4b3d6e2dd2e7.js.map +0 -1
- package/dist/ca13dd2bc48ab091.js +0 -1
- package/dist/ca13dd2bc48ab091.js.map +0 -1
- package/dist/da0f4000ff8a6308.js +0 -1
- package/dist/dc8bae4b1fc21ce6.js +0 -1
- package/dist/dc8bae4b1fc21ce6.js.map +0 -1
- package/dist/dde52f342e5fc083.js +0 -1
- package/dist/dde52f342e5fc083.js.map +0 -1
- package/dist/e113b11e79cf6e27.js +0 -1
- package/dist/e113b11e79cf6e27.js.map +0 -1
- package/dist/e173aa5eee85c641.js +0 -1
- package/dist/e70de7f0da3e9681.js +0 -1
- package/dist/e70de7f0da3e9681.js.map +0 -1
- package/dist/f5e94073baff3906.js +0 -1
- package/dist/f5e94073baff3906.js.map +0 -1
- package/dist/openmrs.6166de66af6e7d89.js +0 -5
- package/dist/openmrs.6166de66af6e7d89.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-app-shell",
|
|
3
|
-
"version": "10.0.1-pre.
|
|
3
|
+
"version": "10.0.1-pre.5227",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"main": "dist/openmrs.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,8 +35,11 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@carbon/react": "^1.92.1",
|
|
37
37
|
"@internationalized/date": "^3.8.0",
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
38
|
+
"@module-federation/enhanced": "2.8.1",
|
|
39
|
+
"@module-federation/error-codes": "2.8.1",
|
|
40
|
+
"@module-federation/sdk": "2.8.1",
|
|
41
|
+
"@openmrs/esm-framework": "10.0.1-pre.5227",
|
|
42
|
+
"@openmrs/esm-styleguide": "10.0.1-pre.5227",
|
|
40
43
|
"@rspack/cli": "1.7.9",
|
|
41
44
|
"@rspack/core": "1.7.9",
|
|
42
45
|
"dayjs": "^1.11.13",
|
package/rspack.config.js
CHANGED
|
@@ -2,9 +2,9 @@ const {
|
|
|
2
2
|
CssExtractRspackPlugin,
|
|
3
3
|
CopyRspackPlugin,
|
|
4
4
|
DefinePlugin,
|
|
5
|
-
container,
|
|
6
5
|
util: { createHash },
|
|
7
6
|
} = require('@rspack/core');
|
|
7
|
+
const { ModuleFederationPlugin } = require('@module-federation/enhanced/rspack');
|
|
8
8
|
const CleanWebpackPlugin = require('clean-webpack-plugin').CleanWebpackPlugin;
|
|
9
9
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
10
10
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
@@ -22,7 +22,6 @@ const frameworkVersion = require('@openmrs/esm-framework/package.json').version;
|
|
|
22
22
|
const timestamp = getTimestamp();
|
|
23
23
|
const production = 'production';
|
|
24
24
|
const allowedSuffixes = ['-app', '-widgets'];
|
|
25
|
-
const { ModuleFederationPlugin } = container;
|
|
26
25
|
|
|
27
26
|
const openmrsAddCookie = process.env.OMRS_ADD_COOKIE;
|
|
28
27
|
const openmrsApiUrl = removeTrailingSlash(process.env.OMRS_API_URL || '/openmrs');
|
|
@@ -462,6 +461,20 @@ module.exports = (env, argv = []) => {
|
|
|
462
461
|
}),
|
|
463
462
|
new ModuleFederationPlugin({
|
|
464
463
|
name,
|
|
464
|
+
// The app shell is the only build that ships `@module-federation/runtime-core`:
|
|
465
|
+
// `provideExternalRuntime` publishes it as `_FEDERATION_RUNTIME_CORE` for remotes to read, and
|
|
466
|
+
// Module Federation only allows it on a build with no `exposes`. `src/federation-runtime.ts`
|
|
467
|
+
// publishes the runtime's stateless helpers alongside it.
|
|
468
|
+
experiments: {
|
|
469
|
+
provideExternalRuntime: true,
|
|
470
|
+
// Every app shares this build's `runtime-core`, so anything pruned here is pruned for all of
|
|
471
|
+
// them. `target` is safe on those terms — nothing in a distribution runs the runtime in Node,
|
|
472
|
+
// and it saves ~5 kB gzipped. `disableSnapshot` is deliberately not set: it would leave every
|
|
473
|
+
// app's federation instance with an empty plugin array, and it saved 16 gzipped bytes.
|
|
474
|
+
optimization: { target: 'web' },
|
|
475
|
+
},
|
|
476
|
+
manifest: false,
|
|
477
|
+
dts: false,
|
|
465
478
|
shared: sharedDependencies.reduce((obj, depName) => {
|
|
466
479
|
// This just attempts to align the requiredVersion with what we usually have in peerDependencies
|
|
467
480
|
let version = dependencies[depName];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// The names published here are read by remote entries built separately from the app shell, so nothing
|
|
2
|
+
// else in this build would notice a rename or the call in `index.ts` being dropped.
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { resolve } from 'node:path';
|
|
5
|
+
import { describe, expect, it } from 'vitest';
|
|
6
|
+
|
|
7
|
+
const shellRoot = resolve(__dirname, '..');
|
|
8
|
+
|
|
9
|
+
describe('the Module Federation runtime the app shell publishes for remotes', () => {
|
|
10
|
+
it('publishes the runtime helpers under the names remote entries read', async () => {
|
|
11
|
+
expect(globalThis._OPENMRS_FEDERATION_SDK).toBeUndefined();
|
|
12
|
+
expect(globalThis._OPENMRS_FEDERATION_ERROR_CODES).toBeUndefined();
|
|
13
|
+
|
|
14
|
+
const { publishFederationRuntime } = await import('./federation-runtime');
|
|
15
|
+
publishFederationRuntime();
|
|
16
|
+
|
|
17
|
+
// Indexed by string so a rename in the module can't rename the assertion along with it.
|
|
18
|
+
expect(Object.keys(globalThis['_OPENMRS_FEDERATION_SDK'] ?? {}).length).toBeGreaterThan(0);
|
|
19
|
+
expect(Object.keys(globalThis['_OPENMRS_FEDERATION_ERROR_CODES'] ?? {}).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('is configured to publish the runtime that remote entries expect', () => {
|
|
23
|
+
// Dropping `provideExternalRuntime` — or giving the app shell `exposes`, which makes Module Federation
|
|
24
|
+
// reject it — breaks every app in the distribution.
|
|
25
|
+
const originalCwd = process.cwd();
|
|
26
|
+
process.chdir(shellRoot);
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
30
|
+
const config = require(resolve(shellRoot, 'rspack.config.js'))({}, { mode: 'production' });
|
|
31
|
+
const federationOptions = config.plugins.find(
|
|
32
|
+
(plugin: { constructor?: { name?: string } }) => plugin?.constructor?.name === 'ModuleFederationPlugin',
|
|
33
|
+
)?._options;
|
|
34
|
+
|
|
35
|
+
expect(federationOptions?.experiments?.provideExternalRuntime).toBe(true);
|
|
36
|
+
expect(federationOptions?.exposes).toBeUndefined();
|
|
37
|
+
} finally {
|
|
38
|
+
process.chdir(originalCwd);
|
|
39
|
+
}
|
|
40
|
+
}, 60_000);
|
|
41
|
+
|
|
42
|
+
it('is called by the app shell entry, before anything that can load a remote', () => {
|
|
43
|
+
const statements = readFileSync(resolve(__dirname, 'index.ts'), 'utf8')
|
|
44
|
+
.split('\n')
|
|
45
|
+
.map((line) => line.trim())
|
|
46
|
+
.filter((line) => line.length > 0 && !line.startsWith('//') && !line.startsWith('*') && !line.startsWith('/*'));
|
|
47
|
+
|
|
48
|
+
// Remotes are only loaded from code reached via `initializeSpa`, so anywhere ahead of the first
|
|
49
|
+
// function declaration is early enough.
|
|
50
|
+
const callIndex = statements.indexOf('publishFederationRuntime();');
|
|
51
|
+
expect(callIndex).toBeGreaterThan(-1);
|
|
52
|
+
expect(callIndex).toBeLessThan(statements.findIndex((line) => line.startsWith('function ')));
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remote entries built by `@openmrs/rspack-config` or `@openmrs/webpack-config` read the Module
|
|
3
|
+
* Federation runtime from globals instead of embedding a copy each, so the app shell has to publish it.
|
|
4
|
+
*
|
|
5
|
+
* `@module-federation/runtime-core` is published by Module Federation itself, via the runtime plugin
|
|
6
|
+
* that `experiments.provideExternalRuntime` injects. Because it is this build's copy, its compiled-in
|
|
7
|
+
* build identifier and `experiments.optimization` settings are the ones every app's federation instance
|
|
8
|
+
* ends up with. The two helpers below are published here because that doesn't cover them; they hold no
|
|
9
|
+
* cross-build state. `@module-federation/runtime` and `webpack-bundler-runtime` are deliberately not
|
|
10
|
+
* published — they cache a federation instance at module scope, so a remote using the app shell's copy
|
|
11
|
+
* dies with RUNTIME-010.
|
|
12
|
+
*/
|
|
13
|
+
import * as errorCodes from '@module-federation/error-codes';
|
|
14
|
+
import * as sdk from '@module-federation/sdk';
|
|
15
|
+
|
|
16
|
+
declare global {
|
|
17
|
+
// `var` is what declares a property on `globalThis`; `let`/`const` do not.
|
|
18
|
+
|
|
19
|
+
var _OPENMRS_FEDERATION_ERROR_CODES: typeof errorCodes;
|
|
20
|
+
|
|
21
|
+
var _OPENMRS_FEDERATION_SDK: typeof sdk;
|
|
22
|
+
|
|
23
|
+
var _FEDERATION_RUNTIME_CORE: unknown;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A function rather than a module side effect so the call can't be tree-shaken away if the app shell
|
|
28
|
+
* ever declares `sideEffects: false`.
|
|
29
|
+
*/
|
|
30
|
+
export function publishFederationRuntime() {
|
|
31
|
+
globalThis._OPENMRS_FEDERATION_ERROR_CODES = errorCodes;
|
|
32
|
+
globalThis._OPENMRS_FEDERATION_SDK = sdk;
|
|
33
|
+
|
|
34
|
+
// Reporting this here means a mis-built app shell says so itself, rather than every app in the
|
|
35
|
+
// distribution claiming the app shell is too old.
|
|
36
|
+
if (typeof globalThis._FEDERATION_RUNTIME_CORE === 'undefined') {
|
|
37
|
+
console.error(
|
|
38
|
+
'The app shell did not publish the Module Federation runtime, so no frontend module will be able ' +
|
|
39
|
+
'to start. This is a bug in the app shell build (see `experiments.provideExternalRuntime`).',
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { publishFederationRuntime } from './federation-runtime';
|
|
1
2
|
import type { SpaConfig } from '@openmrs/esm-framework/src/internal';
|
|
2
3
|
|
|
4
|
+
// Before anything else: every frontend module reads the Module Federation runtime from the globals
|
|
5
|
+
// this publishes, and modules are only ever loaded from code reached via `initializeSpa` below.
|
|
6
|
+
publishFederationRuntime();
|
|
7
|
+
|
|
3
8
|
function _createSpaBase(baseUrl: string) {
|
|
4
9
|
return () => baseUrl;
|
|
5
10
|
}
|
package/turbo.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["//"],
|
|
3
|
+
"tasks": {
|
|
4
|
+
"test": {
|
|
5
|
+
"inputs": [
|
|
6
|
+
"src/**",
|
|
7
|
+
"__mocks__/**",
|
|
8
|
+
"mock.ts",
|
|
9
|
+
"mock-jest.ts",
|
|
10
|
+
"mock-jest.tsx",
|
|
11
|
+
"vitest.config.ts",
|
|
12
|
+
"setup-tests.ts",
|
|
13
|
+
"rspack.config.js",
|
|
14
|
+
"dependencies.json",
|
|
15
|
+
"tools/**"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"coverage": {
|
|
19
|
+
"inputs": [
|
|
20
|
+
"src/**",
|
|
21
|
+
"__mocks__/**",
|
|
22
|
+
"mock.ts",
|
|
23
|
+
"mock-jest.ts",
|
|
24
|
+
"mock-jest.tsx",
|
|
25
|
+
"vitest.config.ts",
|
|
26
|
+
"setup-tests.ts",
|
|
27
|
+
"rspack.config.js",
|
|
28
|
+
"dependencies.json",
|
|
29
|
+
"tools/**"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/dist/0cf6d2fca5bd467d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_openmrs_esm_app_shell=self.webpackChunk_openmrs_esm_app_shell||[]).push([["2434"],{3433(e,t,r){r.r(t),r.d(t,{useFetchers:()=>r6,unstable_HistoryRouter:()=>r$,useLoaderData:()=>t0,ScrollRestoration:()=>rG,Route:()=>ro,MemoryRouter:()=>rr,useMatches:()=>tZ,redirect:()=>ew,useOutletContext:()=>tM,createRoutesFromElements:()=>rh,useLinkClickHandler:()=>r0,useRouteError:()=>t3,generatePath:()=>et,replace:()=>eE,useHref:()=>tC,useParams:()=>tF,UNSAFE_ViewTransitionContext:()=>rO,useRoutes:()=>tN,useSubmit:()=>r4,UNSAFE_NavigationContext:()=>tR,Navigate:()=>rn,UNSAFE_ErrorResponseImpl:()=>eR,UNSAFE_FetchersContext:()=>rM,useAsyncError:()=>t7,createRoutesFromChildren:()=>rh,unstable_usePrompt:()=>nr,useFetcher:()=>r5,useBlocker:()=>t6,createHashRouter:()=>rT,UNSAFE_useRouteId:()=>tX,useMatch:()=>tA,useNavigation:()=>tG,HashRouter:()=>rK,useFormAction:()=>r7,useResolvedPath:()=>tI,defer:()=>eg,Router:()=>ri,Routes:()=>ru,useActionData:()=>t2,useRouteLoaderData:()=>t1,Await:()=>rs,matchPath:()=>er,UNSAFE_DataRouterContext:()=>tw,BrowserRouter:()=>rW,NavigationType:()=>l,Form:()=>rX,UNSAFE_RouteContext:()=>tk,createSearchParams:()=>rx,RouterProvider:()=>rz,UNSAFE_LocationContext:()=>tx,parsePath:()=>V,Outlet:()=>ra,createMemoryRouter:()=>rm,UNSAFE_useScrollRestoration:()=>ne,useNavigate:()=>tj,matchRoutes:()=>X,createPath:()=>$,resolvePath:()=>ei,useInRouterContext:()=>tD,useOutlet:()=>tU,useAsyncValue:()=>t4,useViewTransitionState:()=>nn,Link:()=>rq,AbortedDeferredError:()=>ey,renderMatches:()=>rv,NavLink:()=>rY,UNSAFE_DataRouterStateContext:()=>tS,json:()=>em,useSearchParams:()=>r1,redirectDocument:()=>eS,useBeforeUnload:()=>nt,useLocation:()=>tL,createBrowserRouter:()=>rA,isRouteErrorResponse:()=>ex,useNavigationType:()=>t_,useRevalidator:()=>tQ});var n,a,o,i,u,s,c,l,f,d,h,v=r(6925),p=r(2065);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y(e){if(Array.isArray(e))return e}function b(e,t,r,n,a,o,i){try{var u=e[o](i),s=u.value}catch(e){r(e);return}u.done?t(s):Promise.resolve(s).then(n,a)}function g(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){b(o,n,a,i,u,"next",e)}function u(e){b(o,n,a,i,u,"throw",e)}i(void 0)})}}function w(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function S(e,t,r){return(S=j()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&C(a,r.prototype),a}).apply(null,arguments)}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function k(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function P(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function D(e,t){return y(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,u=!1;try{for(a=a.call(e);!(i=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){u=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(u)throw n}}return o}}(e,t)||A(e,t)||P()}function L(e){return function(e){if(Array.isArray(e))return m(e)}(e)||k(e)||A(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function A(e,t){if(e){if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}}function T(e){var t="function"==typeof Map?new Map:void 0;return(T=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return S(e,arguments,R(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),C(r,e)})(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function O(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:s(0)}),u(i,"throw",{value:s(1)}),u(i,"return",{value:s(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function s(u){return function(s){var c=[u,s];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function M(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function U(){return(U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}(n=l||(l={})).Pop="POP",n.Push="PUSH",n.Replace="REPLACE";var F="popstate";function I(e){void 0===e&&(e={});var t,r=e.initialEntries,n=e.initialIndex,a=e.v5Compat,o=void 0!==a&&a;t=(void 0===r?["/"]:r).map(function(e,t){return f(e,"string"==typeof e?null:e.state,0===t?"default":void 0)});var i=c(null==n?t.length-1:n),u=l.Pop,s=null;function c(e){return Math.min(Math.max(e,0),t.length-1)}function f(e,r,n){void 0===r&&(r=null);var a=K(t?t[i].pathname:"/",e,r,n);return H("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function d(e){return"string"==typeof e?e:$(e)}return{get index(){return i},get action(){return u},get location(){return t[i]},createHref:d,createURL:function(e){return new URL(d(e),"http://localhost")},encodeLocation:function(e){var t="string"==typeof e?V(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push:function(e,r){u=l.Push;var n=f(e,r);i+=1,t.splice(i,t.length,n),o&&s&&s({action:u,location:n,delta:1})},replace:function(e,r){u=l.Replace;var n=f(e,r);t[i]=n,o&&s&&s({action:u,location:n,delta:0})},go:function(e){u=l.Pop;var r=c(i+e),n=t[r];i=r,s&&s({action:u,location:n,delta:e})},listen:function(e){return s=e,function(){s=null}}}}function N(e){return void 0===e&&(e={}),J(function(e,t){var r=e.location;return K("",{pathname:r.pathname,search:r.search,hash:r.hash},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:$(t)},null,e)}function B(e){return void 0===e&&(e={}),J(function(e,t){var r=V(e.location.hash.substr(1)),n=r.pathname,a=void 0===n?"/":n,o=r.search,i=r.hash;return a.startsWith("/")||a.startsWith(".")||(a="/"+a),K("",{pathname:a,search:void 0===o?"":o,hash:void 0===i?"":i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){var r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){var a=e.location.href,o=a.indexOf("#");n=-1===o?a:a.slice(0,o)}return n+"#"+("string"==typeof t?t:$(t))},function(e,t){H("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},e)}function z(e,t){if(!1===e||null==e)throw Error(t)}function H(e,t){if(!e){"u">typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function W(e,t){return{usr:e.state,key:e.key,idx:t}}function K(e,t,r,n){return void 0===r&&(r=null),U({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?V(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function $(e){var t=e.pathname,r=void 0===t?"/":t,n=e.search,a=void 0===n?"":n,o=e.hash,i=void 0===o?"":o;return a&&"?"!==a&&(r+="?"===a.charAt(0)?a:"?"+a),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}function V(e){var t={};if(e){var r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));var n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function J(e,t,r,n){void 0===n&&(n={});var a=n.window,o=void 0===a?document.defaultView:a,i=n.v5Compat,u=void 0!==i&&i,s=o.history,c=l.Pop,f=null,d=h();function h(){return(s.state||{idx:null}).idx}function v(){c=l.Pop;var e=h(),t=null==e?null:e-d;d=e,f&&f({action:c,location:m.location,delta:t})}function p(e){var t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:$(e);return z(t,"No window.location.(origin|href) available to create URL for href: "+(r=r.replace(/ $/,"%20"))),new URL(r,t)}null==d&&(d=0,s.replaceState(U({},s.state,{idx:d}),""));var m={get action(){return c},get location(){return e(o,s)},listen:function(e){if(f)throw Error("A history only accepts one active listener");return o.addEventListener(F,v),f=e,function(){o.removeEventListener(F,v),f=null}},createHref:function(e){return t(o,e)},createURL:p,encodeLocation:function(e){var t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c=l.Push;var n=K(m.location,e,t);r&&r(n,e);var a=W(n,d=h()+1),i=m.createHref(n);try{s.pushState(a,"",i)}catch(e){if(x(e,DOMException)&&"DataCloneError"===e.name)throw e;o.location.assign(i)}u&&f&&f({action:c,location:m.location,delta:1})},replace:function(e,t){c=l.Replace;var n=K(m.location,e,t);r&&r(n,e);var a=W(n,d=h()),o=m.createHref(n);s.replaceState(a,"",o),u&&f&&f({action:c,location:m.location,delta:0})},go:function(e){return s.go(e)}};return m}(a=f||(f={})).data="data",a.deferred="deferred",a.redirect="redirect",a.error="error";var q=new Set(["lazy","caseSensitive","path","id","index","children"]);function Y(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(function(e,a){var o=L(r).concat([String(a)]),i="string"==typeof e.id?e.id:o.join("-");if(z(!0!==e.index||!e.children,"Cannot specify children on an index route"),z(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),!0===e.index){var u=U({},e,t(e),{id:i});return n[i]=u,u}var s=U({},e,t(e),{id:i,children:void 0});return n[i]=s,e.children&&(s.children=Y(e.children,t,o,n)),s})}function X(e,t,r){return void 0===r&&(r="/"),G(e,t,r,!1)}function G(e,t,r,n){var a=ea(("string"==typeof t?V(t):t).pathname||"/",r);if(null==a)return null;var o=function e(t,r,n,a){void 0===r&&(r=[]),void 0===n&&(n=[]),void 0===a&&(a="");var o=function(t,o,i){var u,s,c,l,f={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:o,route:t};f.relativePath.startsWith("/")&&(z(f.relativePath.startsWith(a),'Absolute route path "'+f.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),f.relativePath=f.relativePath.slice(a.length));var d=ed([a,f.relativePath]),h=n.concat(f);t.children&&t.children.length>0&&(z(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+d+'".'),e(t.children,r,h,d)),(null!=t.path||t.index)&&r.push({path:d,score:(u=d,s=t.index,l=(c=u.split("/")).length,c.some(ee)&&(l+=-2),s&&(l+=2),c.filter(function(e){return!ee(e)}).reduce(function(e,t){return e+(Z.test(t)?3:""===t?1:10)},l)),routesMeta:h})};return t.forEach(function(e,t){var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?")){var n=!0,a=!1,i=void 0;try{for(var u,s=(function e(t){var r=t.split("/");if(0===r.length)return[];var n=y(r)||k(r)||A(r)||P(),a=n[0],o=n.slice(1),i=a.endsWith("?"),u=a.replace(/\?$/,"");if(0===o.length)return i?[u,""]:[u];var s=e(o.join("/")),c=[];return c.push.apply(c,L(s.map(function(e){return""===e?u:[u,e].join("/")}))),i&&c.push.apply(c,L(s)),c.map(function(e){return t.startsWith("/")&&""===e?"/":e})})(e.path)[Symbol.iterator]();!(n=(u=s.next()).done);n=!0){var c=u.value;o(e,t,c)}}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}}else o(e,t)}),r}(e);o.sort(function(e,t){var r,n;return e.score!==t.score?t.score-e.score:(r=e.routesMeta.map(function(e){return e.childrenIndex}),n=t.routesMeta.map(function(e){return e.childrenIndex}),r.length===n.length&&r.slice(0,-1).every(function(e,t){return e===n[t]})?r[r.length-1]-n[n.length-1]:0)});for(var i=null,u=0;null==i&&u<o.length;++u){var s=en(a);i=function(e,t,r){void 0===r&&(r=!1);for(var n=e.routesMeta,a={},o="/",i=[],u=0;u<n.length;++u){var s=n[u],c=u===n.length-1,l="/"===o?t:t.slice(o.length)||"/",f=er({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!f&&c&&r&&!n[n.length-1].route.index&&(f=er({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!f)return null;Object.assign(a,f.params),i.push({params:a,pathname:ed([o,f.pathname]),pathnameBase:eh(ed([o,f.pathnameBase])),route:d}),"/"!==f.pathnameBase&&(o=ed([o,f.pathnameBase]))}return i}(o[u],s,n)}return i}function Q(e,t){var r=e.route,n=e.pathname,a=e.params;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}var Z=/^:[\w-]+$/,ee=function(e){return"*"===e};function et(e,t){void 0===t&&(t={});var r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(H(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));var n=r.startsWith("/")?"/":"",a=function(e){return null==e?"":"string"==typeof e?e:String(e)};return n+r.split(/\/+/).map(function(e,r,n){if(r===n.length-1&&"*"===e)return a(t["*"]);var o=e.match(/^:([\w-]+)(\??)$/);if(o){var i=D(o,3),u=i[1],s=i[2],c=t[u];return z("?"===s||null!=c,'Missing ":'+u+'" param'),a(c)}return e.replace(/\?$/g,"")}).filter(function(e){return!!e}).join("/")}function er(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});var r,n,a,o,i,u=D((r=e.path,n=e.caseSensitive,a=e.end,void 0===n&&(n=!1),void 0===a&&(a=!0),H("*"===r||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),o=[],i="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,function(e,t,r){return o.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"}),r.endsWith("*")?(o.push({paramName:"*"}),i+="*"===r||"/*"===r?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==r&&"/"!==r&&(i+="(?:(?=\\/|$))"),[new RegExp(i,n?void 0:"i"),o]),2),s=u[0],c=u[1],l=t.match(s);if(!l)return null;var f=l[0],d=f.replace(/(.)\/+$/,"$1"),h=l.slice(1);return{params:c.reduce(function(e,t,r){var n=t.paramName,a=t.isOptional;if("*"===n){var o=h[r]||"";d=f.slice(0,f.length-o.length).replace(/(.)\/+$/,"$1")}var i=h[r];return a&&!i?e[n]=void 0:e[n]=(i||"").replace(/%2F/g,"/"),e},{}),pathname:f,pathnameBase:d,pattern:e}}function en(e){try{return e.split("/").map(function(e){return decodeURIComponent(e).replace(/\//g,"%2F")}).join("/")}catch(t){return H(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function ea(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;var r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}var eo=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ei(e,t){void 0===t&&(t="/");var r,n,a="string"==typeof e?V(e):e,o=a.pathname,i=a.search,u=a.hash;return o?(r=o,eo.test(r))?n=o:(o.includes("//")&&H(!1,"Pathnames cannot have embedded double slashes - normalizing "+o+" -> "+(o=o.replace(/\/\/+/g,"/"))),n=o.startsWith("/")?eu(o.substring(1),"/"):eu(o,t)):n=t,{pathname:n,search:ev(void 0===i?"":i),hash:ep(void 0===u?"":u)}}function eu(e,t){var r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(function(e){".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function es(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field [")+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function ec(e){return e.filter(function(e,t){return 0===t||e.route.path&&e.route.path.length>0})}function el(e,t){var r=ec(e);return t?r.map(function(e,t){return t===r.length-1?e.pathname:e.pathnameBase}):r.map(function(e){return e.pathnameBase})}function ef(e,t,r,n){void 0===n&&(n=!1),"string"==typeof e?a=V(e):(z(!(a=U({},e)).pathname||!a.pathname.includes("?"),es("?","pathname","search",a)),z(!a.pathname||!a.pathname.includes("#"),es("#","pathname","hash",a)),z(!a.search||!a.search.includes("#"),es("#","search","hash",a)));var a,o,i=""===e||""===a.pathname,u=i?"/":a.pathname;if(null==u)o=r;else{var s=t.length-1;if(!n&&u.startsWith("..")){for(var c=u.split("/");".."===c[0];)c.shift(),s-=1;a.pathname=c.join("/")}o=s>=0?t[s]:"/"}var l=ei(a,o),f=u&&"/"!==u&&u.endsWith("/"),d=(i||"."===u)&&r.endsWith("/");return!l.pathname.endsWith("/")&&(f||d)&&(l.pathname+="/"),l}var ed=function(e){return e.join("/").replace(/\/\/+/g,"/")},eh=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},ev=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},ep=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},em=function(e,t){void 0===t&&(t={});var r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),U({},r,{headers:n}))},ey=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,r;return w(this,t),e=t,r=arguments,e=R(e),function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,j()?Reflect.construct(e,r||[],R(this).constructor):e.apply(this,r))}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&C(t,e),t}(T(Error)),eb=function(){var e;function t(e,r){var n,a=this;w(this,t),this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],z(e&&(void 0===e?"undefined":_(e))==="object"&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(function(e,t){return n=t}),this.controller=new AbortController;var o=function(){return n(new ey("Deferred data aborted"))};this.unlistenAbortSignal=function(){return a.controller.signal.removeEventListener("abort",o)},this.controller.signal.addEventListener("abort",o),this.data=Object.entries(e).reduce(function(e,t){var r=D(t,2),n=r[0],o=r[1];return Object.assign(e,E({},n,a.trackPromise(n,o)))},{}),this.done&&this.unlistenAbortSignal(),this.init=r}return e=[{key:"trackPromise",value:function(e,t){var r=this;if(!x(t,Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);var n=Promise.race([t,this.abortPromise]).then(function(t){return r.onSettle(n,e,void 0,t)},function(t){return r.onSettle(n,e,t)});return n.catch(function(){}),Object.defineProperty(n,"_tracked",{get:function(){return!0}}),n}},{key:"onSettle",value:function(e,t,r,n){if(this.controller.signal.aborted&&x(r,ey))return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:function(){return r}}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){var a=Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:function(){return a}}),this.emit(!1,t),Promise.reject(a)}return void 0===n?(Object.defineProperty(e,"_error",{get:function(){return r}}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:function(){return n}}),this.emit(!1,t),n)}},{key:"emit",value:function(e,t){this.subscribers.forEach(function(r){return r(e,t)})}},{key:"subscribe",value:function(e){var t=this;return this.subscribers.add(e),function(){return t.subscribers.delete(e)}}},{key:"cancel",value:function(){var e=this;this.controller.abort(),this.pendingKeysSet.forEach(function(t,r){return e.pendingKeysSet.delete(r)}),this.emit(!0)}},{key:"resolveData",value:function(e){return g(function(){var t,r,n;return O(this,function(a){switch(a.label){case 0:if(t=this,r=!1,this.done)return[3,2];return n=function(){return t.cancel()},e.addEventListener("abort",n),[4,new Promise(function(r){t.subscribe(function(a){e.removeEventListener("abort",n),(a||t.done)&&r(a)})})];case 1:r=a.sent(),a.label=2;case 2:return[2,r]}})}).call(this)}},{key:"done",get:function(){return 0===this.pendingKeysSet.size}},{key:"unwrappedData",get:function(){return z(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(function(e,t){var r=D(t,2);return Object.assign(e,E({},r[0],function(e){if(!(x(e,Promise)&&!0===e._tracked))return e;if(e._error)throw e._error;return e._data}(r[1])))},{})}},{key:"pendingKeys",get:function(){return Array.from(this.pendingKeysSet)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),eg=function(e,t){return void 0===t&&(t={}),new eb(e,"number"==typeof t?{status:t}:t)},ew=function(e,t){void 0===t&&(t=302);var r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);var n=new Headers(r.headers);return n.set("Location",e),new Response(null,U({},r,{headers:n}))},eS=function(e,t){var r=ew(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},eE=function(e,t){var r=ew(e,t);return r.headers.set("X-Remix-Replace","true"),r},eR=function e(t,r,n,a){w(this,e),void 0===a&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,x(n,Error)?(this.data=n.toString(),this.error=n):this.data=n};function ex(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var ek=["post","put","patch","delete"],eP=new Set(ek),eC=new Set(["get"].concat(L(ek))),eD=new Set([301,302,303,307,308]),eL=new Set([307,308]),e_={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},eA={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},eT={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ej=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eO=function(e){return{hasErrorBoundary:!!e.hasErrorBoundary}},eM="remix-router-transitions";function eU(e){var t,r,n,a,o,i=e.window?e.window:"u">typeof window?window:void 0,u=void 0!==i&&void 0!==i.document&&void 0!==i.document.createElement,s=!u;if(z(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){var c=e.detectErrorBoundary;t=function(e){return{hasErrorBoundary:c(e)}}}else t=eO;var d={},h=Y(e.routes,t,void 0,d),v=e.basename||"/",p=e.dataStrategy||e$,m=e.patchRoutesOnNavigation,y=U({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),b=null,w=new Set,S=null,R=null,k=null,P=null!=e.hydrationData,C=X(h,e.history.location,v),A=!1,T=null;if(null==C&&!m){var j=e1(404,{pathname:e.history.location.pathname}),F=e0(h),I=F.matches,N=F.route;C=I,T=E({},N.id,j)}if(C&&!e.hydrationData&&ty(C,h,e.history.location.pathname).active&&(C=null),C)if(C.some(function(e){return e.route.lazy}))n=!1;else if(C.some(function(e){return e.route.loader}))if(y.v7_partialHydration){var B=e.hydrationData?e.hydrationData.loaderData:null,W=e.hydrationData?e.hydrationData.errors:null;if(W){var $=C.findIndex(function(e){return void 0!==W[e.route.id]});n=C.slice(0,$+1).every(function(e){return!ez(e.route,B,W)})}else n=C.every(function(e){return!ez(e.route,B,W)})}else n=null!=e.hydrationData;else n=!0;else if(n=!1,C=[],y.v7_partialHydration){var V=ty(null,h,e.history.location.pathname);V.active&&V.matches&&(A=!0,C=V.matches)}var J={historyAction:e.history.action,location:e.history.location,matches:C,initialized:n,navigation:e_,restoreScrollPosition:null==e.hydrationData&&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},Z=l.Pop,ee=!1,et=!1,er=new Map,en=null,eo=!1,ei=!1,eu=[],es=new Set,ec=new Map,el=0,ef=-1,ed=new Map,eh=new Set,ev=new Map,ep=new Map,em=new Set,ey=new Map,eb=new Map,eg=void 0;function ew(e,t){void 0===t&&(t={}),J=U({},J,e);var r=[],n=[];y.v7_fetcherPersist&&J.fetchers.forEach(function(e,t){"idle"===e.state&&(em.has(t)?n.push(t):r.push(t))}),em.forEach(function(e){J.fetchers.has(e)||ec.has(e)||n.push(e)}),L(w).forEach(function(e){return e(J,{deletedFetchers:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})}),y.v7_fetcherPersist?(r.forEach(function(e){return J.fetchers.delete(e)}),n.forEach(function(e){return e3(e)})):n.forEach(function(e){return em.delete(e)})}function eS(t,n,a){var o,i,u,s,c=(void 0===a?{}:a).flushSync,f=null!=J.actionData&&null!=J.navigation.formMethod&&e9(J.navigation.formMethod)&&"loading"===J.navigation.state&&(null==(o=t.state)?void 0:o._isRedirect)!==!0;u=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:f?J.actionData:null;var d=n.loaderData?eG(J.loaderData,n.loaderData,n.matches||[],n.errors):J.loaderData,v=J.blockers;v.size>0&&(v=new Map(v)).forEach(function(e,t){return v.set(t,eT)});var p=!0===ee||null!=J.navigation.formMethod&&e9(J.navigation.formMethod)&&(null==(i=t.state)?void 0:i._isRedirect)!==!0;if(r&&(h=r,r=void 0),eo||Z===l.Pop||(Z===l.Push?e.history.push(t,t.state):Z===l.Replace&&e.history.replace(t,t.state)),Z===l.Pop){var m=er.get(J.location.pathname);m&&m.has(t.pathname)?s={currentLocation:J.location,nextLocation:t}:er.has(t.pathname)&&(s={currentLocation:t,nextLocation:J.location})}else if(et){var y=er.get(J.location.pathname);y?y.add(t.pathname):(y=new Set([t.pathname]),er.set(J.location.pathname,y)),s={currentLocation:J.location,nextLocation:t}}ew(U({},n,{actionData:u,loaderData:d,historyAction:Z,location:t,initialized:!0,navigation:e_,revalidation:"idle",restoreScrollPosition:tm(t,n.matches||J.matches),preventScrollReset:p,blockers:v}),{viewTransitionOpts:s,flushSync:!0===c}),Z=l.Pop,ee=!1,et=!1,eo=!1,ei=!1,eu=[]}function eE(t,n,a){return g(function(){var i,u,s,c,d,p,m,b,w,R,x,P,C,L,_,T,j,M;return O(this,function(F){var I,N,B,z,H,W,K,$,V,q,Y,G,Q,er,en,ea,ed,ep,eb,eg,eE;switch(F.label){case 0:if(o&&o.abort(),o=null,Z=t,eo=!0===(a&&a.startUninterruptedRevalidation),I=J.location,N=J.matches,S&&k&&(S[tp(I,N)]=k()),ee=!0===(a&&a.preventScrollReset),et=!0===(a&&a.enableViewTransition),i=r||h,u=a&&a.overrideNavigation,s=null!=a&&a.initialHydration&&J.matches&&J.matches.length>0&&!A?J.matches:X(i,n,v),c=!0===(a&&a.flushSync),s&&J.initialized&&!ei&&(B=J.location,z=n,B.pathname===z.pathname&&B.search===z.search&&(""===B.hash?""!==z.hash:B.hash===z.hash||""!==z.hash||!1))&&!(a&&a.submission&&e9(a.submission.formMethod)))return eS(n,{matches:s},{flushSync:c}),[2];if((d=ty(s,i,n.pathname)).active&&d.matches&&(s=d.matches),!s)return m=(p=th(n.pathname)).error,eS(n,{matches:p.notFoundMatches,loaderData:{},errors:E({},p.route.id,m)},{flushSync:c}),[2];if(o=new AbortController,b=eJ(e.history,n,o.signal,a&&a.submission),!(a&&a.pendingError))return[3,1];return w=[eZ(s).route.id,{type:f.error,error:a.pendingError}],[3,3];case 1:if(!(a&&a.submission&&e9(a.submission.formMethod)))return[3,3];return[4,(H=b,W=n,K=a.submission,$=s,V=d.active,q={replace:a.replace,flushSync:c},g(function(){var t,r,n,a,o,i,u,s,c;return O(this,function(d){switch(d.label){case 0:var h;if(void 0===q&&(q={}),eN(),ew({navigation:{state:"submitting",location:W,formMethod:(h=K).formMethod,formAction:h.formAction,formEncType:h.formEncType,formData:h.formData,json:h.json,text:h.text}},{flushSync:!0===q.flushSync}),!V)return[3,2];return[4,tb($,W.pathname,H.signal)];case 1:if("aborted"===(t=d.sent()).type)return[2,{shortCircuited:!0}];if("error"===t.type)return r=eZ(t.partialMatches).route.id,[2,{matches:t.partialMatches,pendingActionResult:[r,{type:f.error,error:t.error}]}];if(!t.matches)return a=(n=th(W.pathname)).notFoundMatches,o=n.error,[2,{matches:a,pendingActionResult:[n.route.id,{type:f.error,error:o}]}];$=t.matches;d.label=2;case 2:if(!(!(u=tr($,W)).route.action&&!u.route.lazy))return[3,3];return i={type:f.error,error:e1(405,{method:H.method,pathname:W.pathname,routeId:u.route.id})},[3,5];case 3:return[4,eC("action",J,H,[u],$,null)];case 4:if(i=d.sent()[u.route.id],H.signal.aborted)return[2,{shortCircuited:!0}];d.label=5;case 5:if(!e5(i))return[3,7];return s=q&&null!=q.replace?q.replace:eV(i.response.headers.get("Location"),new URL(H.url),v,e.history)===J.location.pathname+J.location.search,[4,eP(H,i,!0,{submission:K,replace:s})];case 6:return d.sent(),[2,{shortCircuited:!0}];case 7:if(e4(i))throw e1(400,{type:"defer-action"});if(e7(i))return c=eZ($,u.route.id),!0!==(q&&q.replace)&&(Z=l.Push),[2,{matches:$,pendingActionResult:[c.route.id,i]}];return[2,{matches:$,pendingActionResult:[u.route.id,i]}]}})})())];case 2:if((R=F.sent()).shortCircuited)return[2];if(R.pendingActionResult&&(P=(x=D(R.pendingActionResult,2))[0],e7(C=x[1])&&ex(C.error)&&404===C.error.status))return o=null,eS(n,{matches:R.matches,loaderData:{},errors:E({},P,C.error)}),[2];s=R.matches||s,w=R.pendingActionResult,u=ta(n,a.submission),c=!1,d.active=!1,b=eJ(e.history,b.url,b.signal),F.label=3;case 3:return[4,(Y=b,G=n,Q=s,er=d.active,en=u,ea=a&&a.submission,ed=a&&a.fetcherSubmission,ep=a&&a.replace,eb=a&&!0===a.initialHydration,eg=c,eE=w,g(function(){var t,n,a,i,u,s,c,l,f,d,p,m,b,g,w,S,R,x,k,P,C,L,_,A,T,j;return O(this,function(O){switch(O.label){case 0:if(t=en||ta(G,ea),n=ea||ed||tn(t),a=!eo&&(!y.v7_partialHydration||!eb),!er)return[3,2];return a&&(i=ek(eE),ew(U({navigation:t},void 0!==i?{actionData:i}:{}),{flushSync:eg})),[4,tb(Q,G.pathname,Y.signal)];case 1:if("aborted"===(u=O.sent()).type)return[2,{shortCircuited:!0}];if("error"===u.type)return s=eZ(u.partialMatches).route.id,[2,{matches:u.partialMatches,loaderData:{},errors:E({},s,u.error)}];if(!u.matches)return l=(c=th(G.pathname)).error,[2,{matches:c.notFoundMatches,loaderData:{},errors:E({},c.route.id,l)}];Q=u.matches;O.label=2;case 2:if(f=r||h,p=(d=D(eB(e.history,J,Q,n,G,y.v7_partialHydration&&!0===eb,y.v7_skipActionErrorRevalidation,ei,eu,es,em,ev,eh,f,v,eE),2))[0],m=d[1],tv(function(e){return!(Q&&Q.some(function(t){return t.route.id===e}))||p&&p.some(function(t){return t.route.id===e})}),ef=++el,0===p.length&&0===m.length)return b=ts(),eS(G,U({matches:Q,loaderData:{},errors:eE&&e7(eE[1])?E({},eE[0],eE[1].error):null},eQ(eE),b?{fetchers:new Map(J.fetchers)}:{}),{flushSync:eg}),[2,{shortCircuited:!0}];return a&&(g={},er||(g.navigation=t,void 0!==(w=ek(eE))&&(g.actionData=w)),m.length>0&&(m.forEach(function(e){var t=J.fetchers.get(e.key),r=to(void 0,t?t.data:void 0);J.fetchers.set(e.key,r)}),g.fetchers=new Map(J.fetchers)),ew(g,{flushSync:eg})),m.forEach(function(e){tt(e.key),e.controller&&ec.set(e.key,e.controller)}),S=function(){return m.forEach(function(e){return tt(e.key)})},o&&o.signal.addEventListener("abort",S),[4,eU(J,Q,p,m,Y)];case 3:if(x=(R=O.sent()).loaderResults,k=R.fetcherResults,Y.signal.aborted)return[2,{shortCircuited:!0}];if(o&&o.signal.removeEventListener("abort",S),m.forEach(function(e){return ec.delete(e.key)}),!(P=e2(x)))return[3,5];return[4,eP(Y,P.result,!0,{replace:ep})];case 4:case 6:return O.sent(),[2,{shortCircuited:!0}];case 5:if(!(P=e2(k)))return[3,7];return eh.add(P.key),[4,eP(Y,P.result,!0,{replace:ep})];case 7:return L=(C=eX(J,Q,x,eE,m,k,ey)).loaderData,_=C.errors,ey.forEach(function(e,t){e.subscribe(function(r){(r||e.done)&&ey.delete(t)})}),y.v7_partialHydration&&eb&&J.errors&&(_=U({},J.errors,_)),A=ts(),T=tc(ef),j=A||T||m.length>0,[2,U({matches:Q,loaderData:L,errors:_},j?{fetchers:new Map(J.fetchers)}:{})]}})})())];case 4:if(_=(L=F.sent()).shortCircuited,T=L.matches,j=L.loaderData,M=L.errors,_)return[2];return o=null,eS(n,U({matches:T||s},eQ(w),{loaderData:j,errors:M})),[2]}})})()}function ek(e){if(e&&!e7(e[1]))return E({},e[0],e[1].data);if(J.actionData)if(0===Object.keys(J.actionData).length)return null;else return J.actionData}function eP(t,r,n,a){return g(function(){var s,c,f,d,h,p,m,y,b,g,w,S,E,R,x,k;return O(this,function(P){switch(P.label){case 0:if(c=(s=void 0===a?{}:a).submission,f=s.fetcherSubmission,d=s.preventScrollReset,h=s.replace,r.response.headers.has("X-Remix-Revalidate")&&(ei=!0),z(p=r.response.headers.get("Location"),"Expected a Location header on the redirect Response"),p=eV(p,new URL(t.url),v,e.history),m=K(J.location,p,{_isRedirect:!0}),u&&(y=!1,r.response.headers.has("X-Remix-Reload-Document")?y=!0:ej.test(p)&&(y=(b=e.history.createURL(p)).origin!==i.location.origin||null==ea(b.pathname,v)),y))return h?i.location.replace(p):i.location.assign(p),[2];if(o=null,g=!0===h||r.response.headers.has("X-Remix-Replace")?l.Replace:l.Push,S=(w=J.navigation).formMethod,E=w.formAction,R=w.formEncType,!c&&!f&&S&&E&&R&&(c=tn(J.navigation)),x=c||f,!(eL.has(r.response.status)&&x&&e9(x.formMethod)))return[3,2];return[4,eE(g,m,{submission:U({},x,{formAction:p}),preventScrollReset:d||ee,enableViewTransition:n?et:void 0})];case 1:return P.sent(),[3,4];case 2:return k=ta(m,c),[4,eE(g,m,{overrideNavigation:k,fetcherSubmission:f,preventScrollReset:d||ee,enableViewTransition:n?et:void 0})];case 3:P.sent(),P.label=4;case 4:return[2]}})})()}function eC(e,r,n,a,o,i){return g(function(){var r,u,s,c,l,h,m,b,w,S,E,R,k;return O(this,function(P){var C,A,T,j,M,F,I,N,B,W;switch(P.label){case 0:u={},P.label=1;case 1:return P.trys.push([1,3,,4]),[4,(C=p,A=e,T=n,j=a,M=o,F=i,I=d,N=t,g(function(){var e,t;return O(this,function(r){switch(r.label){case 0:return e=M.map(function(e){var t;return e.route.lazy?(t=e.route,g(function(){var e,r,n,a;return O(this,function(o){switch(o.label){case 0:if(!t.lazy)return[2];return[4,t.lazy()];case 1:if(e=o.sent(),!t.lazy)return[2];for(var i in z(r=I[t.id],"No route found in manifest"),n={},e)H(!(a=void 0!==r[i]&&"hasErrorBoundary"!==i),'Route "'+r.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+i+'" will be ignored.'),a||q.has(i)||(n[i]=e[i]);return Object.assign(r,n),Object.assign(r,U({},N(r),{lazy:void 0})),[2]}})})()):void 0}),[4,C({matches:M.map(function(t,r){var n=e[r],a=j.some(function(e){return e.route.id===t.route.id});return U({},t,{shouldLoad:a,resolve:function(e){return g(function(){return O(this,function(r){var o,i,u,s,c,l;return e&&"GET"===T.method&&(t.route.lazy||t.route.loader)&&(a=!0),[2,a?(o=A,i=T,u=t,s=n,c=e,l=void 0,g(function(){var e,t,r,n,a,d,h,v,p,m;return O(this,function(y){switch(y.label){case 0:r=function(e){var r,n=new Promise(function(e,t){return r=t});t=function(){return r()},i.signal.addEventListener("abort",t);var a=function(t){return"function"!=typeof e?Promise.reject(Error("You cannot call the handler for a route which defines a boolean "+('"'+o+'" [routeId: ')+u.route.id+"]")):e.apply(void 0,[{request:i,params:u.params,context:l}].concat(L(void 0!==t?[t]:[])))};return Promise.race([g(function(){return O(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,c?c(function(e){return a(e)}):a()];case 1:return[2,{type:"data",result:e.sent()}];case 2:return[2,{type:"error",result:e.sent()}];case 3:return[2]}})})(),n])},y.label=1;case 1:if(y.trys.push([1,12,13,14]),n=u.route[o],!s)return[3,8];if(!n)return[3,3];return[4,Promise.all([r(n).catch(function(e){a=e}),s])];case 2:if(d=D.apply(void 0,[y.sent(),1])[0],void 0!==a)throw a;return e=d,[3,7];case 3:return[4,s];case 4:if(y.sent(),!(n=u.route[o]))return[3,6];return[4,r(n)];case 5:return e=y.sent(),[3,7];case 6:if("action"!==o)return[2,{type:f.data,result:void 0}];throw v=(h=new URL(i.url)).pathname+h.search,e1(405,{method:i.method,pathname:v,routeId:u.route.id});case 7:return[3,11];case 8:if(n)return[3,9];throw e1(404,{pathname:(p=new URL(i.url)).pathname+p.search});case 9:return[4,r(n)];case 10:e=y.sent(),y.label=11;case 11:return z(void 0!==e.result,"You defined "+("action"===o?"an action":"a loader")+" for route "+('"'+u.route.id+"\" but didn't return anything from your `")+o+"` function. Please return a value or `null`."),[3,14];case 12:return m=y.sent(),[2,{type:f.error,result:m}];case 13:return t&&i.signal.removeEventListener("abort",t),[7];case 14:return[2,e]}})})()):Promise.resolve({type:f.data,result:void 0})]})})()}})}),request:T,params:M[0].params,fetcherKey:F,context:void 0})];case 1:t=r.sent(),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,Promise.all(e)];case 3:case 4:return r.sent(),[3,5];case 5:return[2,t]}})})())];case 2:return r=P.sent(),[3,4];case 3:return s=P.sent(),a.forEach(function(e){u[e.route.id]={type:f.error,error:s}}),[2,u];case 4:c=!0,l=!1,h=void 0,P.label=5;case 5:P.trys.push([5,11,12,13]),m=Object.entries(r)[Symbol.iterator](),P.label=6;case 6:if(c=(b=m.next()).done)return[3,10];if(S=(w=D(b.value,2))[0],!(e8((B=E=w[1]).result)&&eD.has(B.result.status)))return[3,7];return R=E.result,u[S]={type:f.redirect,response:function(e,t,r,n,a,o){var i=e.headers.get("Location");if(z(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!ej.test(i)){var u=n.slice(0,n.findIndex(function(e){return e.route.id===r})+1);i=eF(new URL(t.url),u,a,!0,i,o),e.headers.set("Location",i)}return e}(R,n,S,o,v,y.v7_relativeSplatPath)},[3,9];case 7:return[4,(W=E,g(function(){var e,t,r,n,a,o,i,u,s,c,l,d,h;return O(this,function(v){switch(v.label){case 0:if(e=W.result,t=W.type,!e8(e))return[3,10];v.label=1;case 1:if(v.trys.push([1,8,,9]),!((n=e.headers.get("Content-Type"))&&/\bapplication\/json\b/.test(n)))return[3,5];if(null!=e.body)return[3,2];return r=null,[3,4];case 2:return[4,e.json()];case 3:r=v.sent(),v.label=4;case 4:return[3,7];case 5:return[4,e.text()];case 6:r=v.sent(),v.label=7;case 7:return[3,9];case 8:return a=v.sent(),[2,{type:f.error,error:a}];case 9:if(t===f.error)return[2,{type:f.error,error:new eR(e.status,e.statusText,r),statusCode:e.status,headers:e.headers}];return[2,{type:f.data,data:r,statusCode:e.status,headers:e.headers}];case 10:var p;if(t===f.error){if(e6(e)){if(x(e.data,Error))return[2,{type:f.error,error:e.data,statusCode:null==(u=e.init)?void 0:u.status,headers:null!=(s=e.init)&&s.headers?new Headers(e.init.headers):void 0}];return[2,{type:f.error,error:new eR((null==(o=e.init)?void 0:o.status)||500,void 0,e.data),statusCode:ex(e)?e.status:void 0,headers:null!=(i=e.init)&&i.headers?new Headers(e.init.headers):void 0}]}return[2,{type:f.error,error:e,statusCode:ex(e)?e.status:void 0}]}if((p=e)&&(void 0===p?"undefined":_(p))==="object"&&"object"===_(p.data)&&"function"==typeof p.subscribe&&"function"==typeof p.cancel&&"function"==typeof p.resolveData)return[2,{type:f.deferred,deferredData:e,statusCode:null==(c=e.init)?void 0:c.status,headers:(null==(l=e.init)?void 0:l.headers)&&new Headers(e.init.headers)}];if(e6(e))return[2,{type:f.data,data:e.data,statusCode:null==(d=e.init)?void 0:d.status,headers:null!=(h=e.init)&&h.headers?new Headers(e.init.headers):void 0}];return[2,{type:f.data,data:e}]}})})())];case 8:u[S]=P.sent(),P.label=9;case 9:return c=!0,[3,6];case 10:return[3,13];case 11:return k=P.sent(),l=!0,h=k,[3,13];case 12:try{c||null==m.return||m.return()}finally{if(l)throw h}return[7];case 13:return[2,u]}})})()}function eU(t,r,n,a,o){return g(function(){var i,u,s,c,l;return O(this,function(d){switch(d.label){case 0:return i=t.matches,u=eC("loader",t,o,n,r,null),s=Promise.all(a.map(function(r){return g(function(){var n;return O(this,function(a){switch(a.label){case 0:if(!(r.matches&&r.match&&r.controller))return[3,2];return[4,eC("loader",t,eJ(e.history,r.path,r.controller.signal),[r.match],r.matches,r.key)];case 1:return n=a.sent()[r.match.route.id],[2,E({},r.key,n)];case 2:return[2,Promise.resolve(E({},r.key,{type:f.error,error:e1(404,{pathname:r.path})}))];case 3:return[2]}})})()})),[4,u];case 1:return c=d.sent(),[4,s];case 2:var h,v,p,m,y,b,w,S;return l=d.sent().reduce(function(e,t){return Object.assign(e,t)},{}),[4,Promise.all([(h=r,v=c,p=o.signal,m=i,y=t.loaderData,g(function(){var e,t,r;return O(this,function(n){switch(n.label){case 0:e=function(e){var r,n,a,o,i,u;return O(this,function(s){switch(s.label){case 0:if(n=(r=D(t[e],2))[0],a=r[1],!(o=h.find(function(e){return(null==e?void 0:e.route.id)===n})))return[2,"continue"];if(u=null!=(i=m.find(function(e){return e.route.id===o.route.id}))&&!eH(i,o)&&(y&&y[o.route.id])!==void 0,!(e4(a)&&u))return[3,2];return[4,te(a,p,!1).then(function(e){e&&(v[n]=e)})];case 1:s.sent(),s.label=2;case 2:return[2]}})},t=Object.entries(v),r=0,n.label=1;case 1:if(!(r<t.length))return[3,4];return[5,M(e(r))];case 2:n.sent(),n.label=3;case 3:return r++,[3,1];case 4:return[2]}})})()),(b=r,w=l,S=a,g(function(){var e,t;return O(this,function(r){switch(r.label){case 0:e=function(e){var t,r,n,a,o;return O(this,function(i){switch(i.label){case 0:if(r=(t=S[e]).key,n=t.routeId,a=t.controller,o=w[r],!b.find(function(e){return(null==e?void 0:e.route.id)===n}))return[2,"continue"];if(!e4(o))return[3,2];return z(a,"Expected an AbortController for revalidating fetcher deferred result"),[4,te(o,a.signal,!0).then(function(e){e&&(w[r]=e)})];case 1:i.sent(),i.label=2;case 2:return[2]}})},t=0,r.label=1;case 1:if(!(t<S.length))return[3,4];return[5,M(e(t))];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}})})())])];case 3:return d.sent(),[2,{loaderResults:c,fetcherResults:l}]}})})()}function eN(){var e;ei=!0,(e=eu).push.apply(e,L(tv())),ev.forEach(function(e,t){ec.has(t)&&es.add(t),tt(t)})}function eW(e,t,r){void 0===r&&(r={}),J.fetchers.set(e,t),ew({fetchers:new Map(J.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function eq(e,t,r,n){void 0===n&&(n={});var a=eZ(J.matches,t);e3(e),ew({errors:E({},a.route.id,r),fetchers:new Map(J.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function eY(e){return ep.set(e,(ep.get(e)||0)+1),em.has(e)&&em.delete(e),J.fetchers.get(e)||eA}function e3(e){var t=J.fetchers.get(e);ec.has(e)&&!(t&&"loading"===t.state&&ed.has(e))&&tt(e),ev.delete(e),ed.delete(e),eh.delete(e),y.v7_fetcherPersist&&em.delete(e),es.delete(e),J.fetchers.delete(e)}function tt(e){var t=ec.get(e);t&&(t.abort(),ec.delete(e))}function tu(e){var t=!0,r=!1,n=void 0;try{for(var a,o=e[Symbol.iterator]();!(t=(a=o.next()).done);t=!0){var i=a.value,u=eY(i),s=ti(u.data);J.fetchers.set(i,s)}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}function ts(){var e=[],t=!1,r=!0,n=!1,a=void 0;try{for(var o,i=eh[Symbol.iterator]();!(r=(o=i.next()).done);r=!0){var u=o.value,s=J.fetchers.get(u);z(s,"Expected fetcher: "+u),"loading"===s.state&&(eh.delete(u),e.push(u),t=!0)}}catch(e){n=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw a}}return tu(e),t}function tc(e){var t=[],r=!0,n=!1,a=void 0;try{for(var o,i=ed[Symbol.iterator]();!(r=(o=i.next()).done);r=!0){var u=D(o.value,2),s=u[0];if(u[1]<e){var c=J.fetchers.get(s);z(c,"Expected fetcher: "+s),"loading"===c.state&&(tt(s),ed.delete(s),t.push(s))}}}catch(e){n=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw a}}return tu(t),t.length>0}function tl(e){J.blockers.delete(e),eb.delete(e)}function tf(e,t){var r=J.blockers.get(e)||eT;z("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);var n=new Map(J.blockers);n.set(e,t),ew({blockers:n})}function td(e){var t=e.currentLocation,r=e.nextLocation,n=e.historyAction;if(0!==eb.size){eb.size>1&&H(!1,"A router only supports one blocker at a time");var a=Array.from(eb.entries()),o=D(a[a.length-1],2),i=o[0],u=o[1],s=J.blockers.get(i);if((!s||"proceeding"!==s.state)&&u({currentLocation:t,nextLocation:r,historyAction:n}))return i}}function th(e){var t=e1(404,{pathname:e}),n=e0(r||h),a=n.matches,o=n.route;return tv(),{notFoundMatches:a,route:o,error:t}}function tv(e){var t=[];return ey.forEach(function(r,n){(!e||e(n))&&(r.cancel(),t.push(n),ey.delete(n))}),t}function tp(e,t){return R&&R(e,t.map(function(e){return Q(e,J.loaderData)}))||e.key}function tm(e,t){if(S){var r=S[tp(e,t)];if("number"==typeof r)return r}return null}function ty(e,t,r){if(m){if(!e)return{active:!0,matches:G(t,r,v,!0)||[]};else if(Object.keys(e[0].params).length>0)return{active:!0,matches:G(t,r,v,!0)}}return{active:!1,matches:null}}function tb(e,n,a,o){return g(function(){var i,u,s;return O(this,function(c){switch(c.label){case 0:if(i=function(){var e,i,s,c,l;return O(this,function(f){switch(f.label){case 0:e=null==r,i=r||h,s=d,f.label=1;case 1:return f.trys.push([1,3,4,5]),[4,m({signal:a,path:n,matches:u,fetcherKey:o,patch:function(e,r){a.aborted||eK(e,r,i,s,t)}})];case 2:return f.sent(),[3,5];case 3:return[2,{v:{type:"error",error:f.sent(),partialMatches:u}}];case 4:return e&&!a.aborted&&(h=L(h)),[7];case 5:if(a.aborted)return[2,{v:{type:"aborted"}}];if(c=X(i,n,v))return[2,{v:{type:"success",matches:c}}];if(!(l=G(i,n,v,!0))||u.length===l.length&&u.every(function(e,t){return e.route.id===l[t].route.id}))return[2,{v:{type:"success",matches:null}}];return u=l,[2]}})},!m)return[2,{type:"success",matches:e}];u=e,c.label=1;case 1:return[5,M(i())];case 2:if("object"===_(s=c.sent()))return[2,s.v];return[3,1];case 3:return[2]}})})()}return a={get basename(){return v},get future(){return y},get state(){return J},get routes(){return h},get window(){return i},initialize:function(){if(b=e.history.listen(function(t){var r=t.action,n=t.location,a=t.delta;if(eg){eg(),eg=void 0;return}H(0===eb.size||null!=a,"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.");var o=td({currentLocation:J.location,nextLocation:n,historyAction:r});if(o&&null!=a){var i=new Promise(function(e){eg=e});e.history.go(-1*a),tf(o,{state:"blocked",location:n,proceed:function(){tf(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),i.then(function(){return e.history.go(a)})},reset:function(){var e=new Map(J.blockers);e.set(o,eT),ew({blockers:e})}});return}return eE(r,n)}),u){!function(e,t){try{var r=e.sessionStorage.getItem(eM);if(r){var n=JSON.parse(r),a=!0,o=!1,i=void 0;try{for(var u,s=Object.entries(n||{})[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=D(u.value,2),l=c[0],f=c[1];f&&Array.isArray(f)&&t.set(l,new Set(f||[]))}}catch(e){o=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(o)throw i}}}}catch(e){}}(i,er);var t=function(){return function(e,t){if(t.size>0){var r={},n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var s=D(i.value,2),c=s[0],l=s[1];r[c]=L(l)}}catch(e){a=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}try{e.sessionStorage.setItem(eM,JSON.stringify(r))}catch(e){H(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(i,er)};i.addEventListener("pagehide",t),en=function(){return i.removeEventListener("pagehide",t)}}return J.initialized||eE(l.Pop,J.location,{initialHydration:!0}),a},subscribe:function(e){return w.add(e),function(){return w.delete(e)}},enableScrollRestoration:function(e,t,r){if(S=e,k=t,R=r||null,!P&&J.navigation===e_){P=!0;var n=tm(J.location,J.matches);null!=n&&ew({restoreScrollPosition:n})}return function(){S=null,k=null,R=null}},navigate:function t(r,n){return g(function(){var a,o,i,u,s,c,f,d,h,p,m,b;return O(this,function(g){switch(g.label){case 0:if("number"==typeof r)return e.history.go(r),[2];if(a=eF(J.location,J.matches,v,y.v7_prependBasename,r,y.v7_relativeSplatPath,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),i=(o=eI(y.v7_normalizeFormMethod,!1,a,n)).path,u=o.submission,s=o.error,c=J.location,f=K(J.location,i,n&&n.state),f=U({},f,e.history.encodeLocation(f)),d=n&&null!=n.replace?n.replace:void 0,h=l.Push,!0===d?h=l.Replace:!1===d||null!=u&&e9(u.formMethod)&&u.formAction===J.location.pathname+J.location.search&&(h=l.Replace),p=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,m=!0===(n&&n.flushSync),b=td({currentLocation:c,nextLocation:f,historyAction:h}))return tf(b,{state:"blocked",location:f,proceed:function(){tf(b,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),t(r,n)},reset:function(){var e=new Map(J.blockers);e.set(b,eT),ew({blockers:e})}}),[2];return[4,eE(h,f,{submission:u,pendingError:s,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m})];case 1:return[2,g.sent()]}})})()},fetch:function(t,n,a,i){if(s)throw Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");tt(t);var u,c,l,f,d,p,m,b,w,S,E,R,x,k,P,C,L,_,A=!0===(i&&i.flushSync),T=r||h,j=eF(J.location,J.matches,v,y.v7_prependBasename,a,y.v7_relativeSplatPath,n,null==i?void 0:i.relative),M=X(T,j,v),U=ty(M,T,j);if(U.active&&U.matches&&(M=U.matches),!M)return void eq(t,n,e1(404,{pathname:j}),{flushSync:A});var F=eI(y.v7_normalizeFormMethod,!0,j,i),I=F.path,N=F.submission,B=F.error;if(B)return void eq(t,n,B,{flushSync:A});var H=tr(M,I),W=!0===(i&&i.preventScrollReset);N&&e9(N.formMethod)?(u=t,c=n,l=I,f=H,d=M,p=U.active,m=A,b=W,w=N,g(function(){var t,n,a,i,s,g,S,E,R,x,k,P,C,L,_,A,T,j,M,U,F,I,N,B;function H(e){if(!e.route.action&&!e.route.lazy){var t=e1(405,{method:w.formMethod,pathname:l,routeId:c});return eq(u,c,t,{flushSync:m}),!0}return!1}return O(this,function(O){switch(O.label){case 0:var W,K;if(eN(),ev.delete(u),!p&&H(f))return[2];if(t=J.fetchers.get(u),eW(u,(W=w,K=t,{state:"submitting",formMethod:W.formMethod,formAction:W.formAction,formEncType:W.formEncType,formData:W.formData,json:W.json,text:W.text,data:K?K.data:void 0}),{flushSync:m}),n=new AbortController,a=eJ(e.history,l,n.signal,w),!p)return[3,2];return[4,tb(d,new URL(a.url).pathname,a.signal,u)];case 1:if("aborted"===(i=O.sent()).type)return[2];if("error"===i.type)return eq(u,c,i.error,{flushSync:m}),[2];if(!i.matches)return eq(u,c,e1(404,{pathname:l}),{flushSync:m}),[2];else if(H(f=tr(d=i.matches,l)))return[2];O.label=2;case 2:return ec.set(u,n),s=el,[4,eC("action",J,a,[f],d,u)];case 3:if(g=O.sent()[f.route.id],a.signal.aborted)return ec.get(u)===n&&ec.delete(u),[2];if(y.v7_fetcherPersist&&em.has(u)){if(e5(g)||e7(g))return eW(u,ti(void 0)),[2]}else{if(e5(g)){if(ec.delete(u),ef>s)return eW(u,ti(void 0)),[2];return eh.add(u),eW(u,to(w)),[2,eP(a,g,!1,{fetcherSubmission:w,preventScrollReset:b})]}if(e7(g))return eq(u,c,g.error),[2]}if(e4(g))throw e1(400,{type:"defer-action"});return S=J.navigation.location||J.location,E=eJ(e.history,S,n.signal),R=r||h,z(x="idle"!==J.navigation.state?X(R,J.navigation.location,v):J.matches,"Didn't find any matches after fetcher action"),k=++el,ed.set(u,k),P=to(w,g.data),J.fetchers.set(u,P),L=(C=D(eB(e.history,J,x,w,S,!1,y.v7_skipActionErrorRevalidation,ei,eu,es,em,ev,eh,R,v,[f.route.id,g]),2))[0],(_=C[1]).filter(function(e){return e.key!==u}).forEach(function(e){var t=e.key,r=J.fetchers.get(t),n=to(void 0,r?r.data:void 0);J.fetchers.set(t,n),tt(t),e.controller&&ec.set(t,e.controller)}),ew({fetchers:new Map(J.fetchers)}),A=function(){return _.forEach(function(e){return tt(e.key)})},n.signal.addEventListener("abort",A),[4,eU(J,x,L,_,E)];case 4:if(j=(T=O.sent()).loaderResults,M=T.fetcherResults,n.signal.aborted)return[2];if(n.signal.removeEventListener("abort",A),ed.delete(u),ec.delete(u),_.forEach(function(e){return ec.delete(e.key)}),U=e2(j))return[2,eP(E,U.result,!1,{preventScrollReset:b})];if(U=e2(M))return eh.add(U.key),[2,eP(E,U.result,!1,{preventScrollReset:b})];return I=(F=eX(J,x,j,void 0,_,M,ey)).loaderData,N=F.errors,J.fetchers.has(u)&&(B=ti(g.data),J.fetchers.set(u,B)),tc(k),"loading"===J.navigation.state&&k>ef?(z(Z,"Expected pending action"),o&&o.abort(),eS(J.navigation.location,{matches:x,loaderData:I,errors:N,fetchers:new Map(J.fetchers)})):(ew({errors:N,loaderData:eG(J.loaderData,I,x,N),fetchers:new Map(J.fetchers)}),ei=!1),[2]}})})()):(ev.set(t,{routeId:n,path:I}),S=t,E=n,R=I,x=H,k=M,P=U.active,C=A,L=W,_=N,g(function(){var t,r,n,a,o,i;return O(this,function(u){switch(u.label){case 0:if(t=J.fetchers.get(S),eW(S,to(_,t?t.data:void 0),{flushSync:C}),r=new AbortController,n=eJ(e.history,R,r.signal),!P)return[3,2];return[4,tb(k,new URL(n.url).pathname,n.signal,S)];case 1:if("aborted"===(a=u.sent()).type)return[2];if("error"===a.type)return eq(S,E,a.error,{flushSync:C}),[2];if(!a.matches)return eq(S,E,e1(404,{pathname:R}),{flushSync:C}),[2];x=tr(k=a.matches,R);u.label=2;case 2:return ec.set(S,r),o=el,[4,eC("loader",J,n,[x],k,S)];case 3:if(!e4(i=u.sent()[x.route.id]))return[3,5];return[4,te(i,n.signal,!0)];case 4:i=u.sent()||i,u.label=5;case 5:if(ec.get(S)===r&&ec.delete(S),n.signal.aborted)return[2];if(em.has(S))return eW(S,ti(void 0)),[2];if(!e5(i))return[3,8];if(!(ef>o))return[3,6];return eW(S,ti(void 0)),[2];case 6:return eh.add(S),[4,eP(n,i,!1,{preventScrollReset:L})];case 7:return u.sent(),[2];case 8:if(e7(i))return eq(S,E,i.error),[2];return z(!e4(i),"Unhandled fetcher deferred data"),eW(S,ti(i.data)),[2]}})})())},revalidate:function(){if(eN(),ew({revalidation:"loading"}),"submitting"!==J.navigation.state){if("idle"===J.navigation.state)return void eE(J.historyAction,J.location,{startUninterruptedRevalidation:!0});eE(Z||J.historyAction,J.navigation.location,{overrideNavigation:J.navigation,enableViewTransition:!0===et})}},createHref:function(t){return e.history.createHref(t)},encodeLocation:function(t){return e.history.encodeLocation(t)},getFetcher:eY,deleteFetcher:function(e){var t=(ep.get(e)||0)-1;t<=0?(ep.delete(e),em.add(e),y.v7_fetcherPersist||e3(e)):ep.set(e,t),ew({fetchers:new Map(J.fetchers)})},dispose:function(){b&&b(),en&&en(),w.clear(),o&&o.abort(),J.fetchers.forEach(function(e,t){return e3(t)}),J.blockers.forEach(function(e,t){return tl(t)})},getBlocker:function(e,t){var r=J.blockers.get(e)||eT;return eb.get(e)!==t&&eb.set(e,t),r},deleteBlocker:tl,patchRoutes:function(e,n){var a=null==r;eK(e,n,r||h,d,t),a&&(h=L(h),ew({}))},_internalFetchControllers:ec,_internalActiveDeferreds:ey,_internalSetRoutes:function(e){r=Y(e,t,void 0,d={})}}}function eF(e,t,r,n,a,o,i,u){if(i){f=[];var s=!0,c=!1,l=void 0;try{for(var f,d,h,v=t[Symbol.iterator]();!(s=(h=v.next()).done);s=!0){var p=h.value;if(f.push(p),p.route.id===i){d=p;break}}}catch(e){c=!0,l=e}finally{try{s||null==v.return||v.return()}finally{if(c)throw l}}}else f=t,d=t[t.length-1];var m=ef(a||".",el(f,o),ea(e.pathname,r)||e.pathname,"path"===u);if(null==a&&(m.search=e.search,m.hash=e.hash),(null==a||""===a||"."===a)&&d){var y=tt(m.search);if(d.route.index&&!y)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&y){var b=new URLSearchParams(m.search),g=b.getAll("index");b.delete("index"),g.filter(function(e){return e}).forEach(function(e){return b.append("index",e)});var w=b.toString();m.search=w?"?"+w:""}}return n&&"/"!==r&&(m.pathname="/"===m.pathname?r:ed([r,m.pathname])),$(m)}function eI(e,t,r,n){if(!n||!(null!=n&&("formData"in n&&null!=n.formData||"body"in n&&void 0!==n.body)))return{path:r};if(n.formMethod&&(a=n.formMethod,!eC.has(a.toLowerCase())))return{path:r,error:e1(405,{method:n.formMethod})};var a,o,i,u=function(){return{path:r,error:e1(400,{type:"invalid-body"})}},s=n.formMethod||"get",c=e?s.toUpperCase():s.toLowerCase(),l=e3(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!e9(c))return u();var f="string"==typeof n.body?n.body:x(n.body,FormData)||x(n.body,URLSearchParams)?Array.from(n.body.entries()).reduce(function(e,t){var r=D(t,2);return""+e+r[0]+"="+r[1]+"\n"},""):String(n.body);return{path:r,submission:{formMethod:c,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}else if("application/json"===n.formEncType){if(!e9(c))return u();try{var d="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:c,formAction:l,formEncType:n.formEncType,formData:void 0,json:d,text:void 0}}}catch(e){return u()}}}if(z("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=eq(n.formData),i=n.formData;else if(x(n.body,FormData))o=eq(n.body),i=n.body;else if(x(n.body,URLSearchParams))i=eY(o=n.body);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=eY(o)}catch(e){return u()}var h={formMethod:c,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(e9(h.formMethod))return{path:r,submission:h};var v=V(r);return t&&v.search&&tt(v.search)&&o.append("index",""),v.search="?"+o,{path:$(v),submission:h}}function eN(e,t,r){void 0===r&&(r=!1);var n=e.findIndex(function(e){return e.route.id===t});return n>=0?e.slice(0,r?n+1:n):e}function eB(e,t,r,n,a,o,i,u,s,c,l,f,d,h,v,p){var m=p?e7(p[1])?p[1].error:p[1].data:void 0,y=e.createURL(t.location),b=e.createURL(a),g=r;o&&t.errors?g=eN(r,Object.keys(t.errors)[0],!0):p&&e7(p[1])&&(g=eN(r,p[0]));var w=p?p[1].statusCode:void 0,S=i&&w&&w>=400,E=g.filter(function(e,r){var a,i,c,l,f,d=e.route;if(d.lazy)return!0;if(null==d.loader)return!1;if(o)return ez(d,t.loaderData,t.errors);if(a=t.loaderData,i=t.matches[r],c=e,l=!i||c.route.id!==i.route.id,f=void 0===a[c.route.id],l||f||s.some(function(t){return t===e.route.id}))return!0;var h=t.matches[r];return eW(e,U({currentUrl:y,currentParams:h.params,nextUrl:b,nextParams:e.params},n,{actionResult:m,actionStatus:w,defaultShouldRevalidate:!S&&(u||y.pathname+y.search===b.pathname+b.search||y.search!==b.search||eH(h,e))}))}),R=[];return f.forEach(function(e,a){if(!(o||!r.some(function(t){return t.route.id===e.routeId})||l.has(a))){var i=X(h,e.path,v);if(!i)return void R.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});var s=t.fetchers.get(a),f=tr(i,e.path),p=!1;d.has(a)?p=!1:c.has(a)?(c.delete(a),p=!0):p=s&&"idle"!==s.state&&void 0===s.data?u:eW(f,U({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:m,actionStatus:w,defaultShouldRevalidate:!S&&u})),p&&R.push({key:a,routeId:e.routeId,path:e.path,matches:i,match:f,controller:new AbortController})}}),[E,R]}function ez(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;var n=null!=t&&void 0!==t[e.id],a=null!=r&&void 0!==r[e.id];return(!!n||!a)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!n&&!a)}function eH(e,t){var r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function eW(e,t){if(e.route.shouldRevalidate){var r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function eK(e,t,r,n,a){if(e){var o,i,u,s=n[e];z(s,"No route found to patch children into: routeId = "+e),s.children||(s.children=[]),u=s.children}else u=r;var c=Y(t.filter(function(e){return!u.some(function(t){return function e(t,r){return"id"in t&&"id"in r&&t.id===r.id||t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive&&((!t.children||0===t.children.length)&&(!r.children||0===r.children.length)||t.children.every(function(t,n){var a;return null==(a=r.children)?void 0:a.some(function(r){return e(t,r)})}))}(e,t)})}),a,[e||"_","patch",String((null==(i=u)?void 0:i.length)||"0")],n);(o=u).push.apply(o,L(c))}function e$(e){return g(function(){var t;return O(this,function(r){switch(r.label){case 0:return[4,Promise.all((t=e.matches.filter(function(e){return e.shouldLoad})).map(function(e){return e.resolve()}))];case 1:return[2,r.sent().reduce(function(e,r,n){return Object.assign(e,E({},t[n].route.id,r))},{})]}})})()}function eV(e,t,r,n){var a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(ej.test(e)){var o=new URL(e.startsWith("//")?t.protocol+e:e);if(a.includes(o.protocol))throw Error("Invalid redirect location");var i=null!=ea(o.pathname,r);if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}try{var u=n.createURL(e);if(a.includes(u.protocol))throw Error("Invalid redirect location")}catch(e){}return e}function eJ(e,t,r,n){var a=e.createURL(e3(t)).toString(),o={signal:r};if(n&&e9(n.formMethod)){var i=n.formMethod,u=n.formEncType;o.method=i.toUpperCase(),"application/json"===u?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(n.json)):"text/plain"===u?o.body=n.text:"application/x-www-form-urlencoded"===u&&n.formData?o.body=eq(n.formData):o.body=n.formData}return new Request(a,o)}function eq(e){var t=new URLSearchParams,r=!0,n=!1,a=void 0;try{for(var o,i=e.entries()[Symbol.iterator]();!(r=(o=i.next()).done);r=!0){var u=D(o.value,2),s=u[0],c=u[1];t.append(s,"string"==typeof c?c:c.name)}}catch(e){n=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw a}}return t}function eY(e){var t=new FormData,r=!0,n=!1,a=void 0;try{for(var o,i=e.entries()[Symbol.iterator]();!(r=(o=i.next()).done);r=!0){var u=D(o.value,2),s=u[0],c=u[1];t.append(s,c)}}catch(e){n=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw a}}return t}function eX(e,t,r,n,a,o,i){var u,s,c,l,f,d,h=(s={},c=null,l=!1,f={},d=n&&e7(n[1])?n[1].error:void 0,t.forEach(function(e){if(e.route.id in r){var n=e.route.id,a=r[n];if(z(!e5(a),"Cannot handle redirect results in processLoaderData"),e7(a)){var o=a.error;void 0!==d&&(o=d,d=void 0),c=c||{},1;var h=eZ(t,n);null==c[h.route.id]&&(c[h.route.id]=o);s[n]=void 0,l||(l=!0,u=ex(a.error)?a.error.status:500),a.headers&&(f[n]=a.headers)}else e4(a)?(i.set(n,a.deferredData),s[n]=a.deferredData.data,null==a.statusCode||200===a.statusCode||l||(u=a.statusCode)):(s[n]=a.data,a.statusCode&&200!==a.statusCode&&!l&&(u=a.statusCode)),a.headers&&(f[n]=a.headers)}}),void 0!==d&&n&&(c=E({},n[0],d),s[n[0]]=void 0),{loaderData:s,errors:c,statusCode:u||200,loaderHeaders:f}),v=h.loaderData,p=h.errors;return a.forEach(function(t){var r=t.key,n=t.match,a=t.controller,i=o[r];if(z(i,"Did not find corresponding fetcher result"),!a||!a.signal.aborted)if(e7(i)){var u=eZ(e.matches,null==n?void 0:n.route.id);p&&p[u.route.id]||(p=U({},p,E({},u.route.id,i.error))),e.fetchers.delete(r)}else if(e5(i))z(!1,"Unhandled fetcher revalidation redirect");else if(e4(i))z(!1,"Unhandled fetcher deferred data");else{var s=ti(i.data);e.fetchers.set(r,s)}}),{loaderData:v,errors:p}}function eG(e,t,r,n){var a=U({},t),o=!0,i=!1,u=void 0;try{for(var s,c=r[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value,f=l.route.id;if(t.hasOwnProperty(f)?void 0!==t[f]&&(a[f]=t[f]):void 0!==e[f]&&l.route.loader&&(a[f]=e[f]),n&&n.hasOwnProperty(f))break}}catch(e){i=!0,u=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw u}}return a}function eQ(e){return e?e7(e[1])?{actionData:{}}:{actionData:E({},e[0],e[1].data)}:{}}function eZ(e,t){return(t?e.slice(0,e.findIndex(function(e){return e.route.id===t})+1):L(e)).reverse().find(function(e){return!0===e.route.hasErrorBoundary})||e[0]}function e0(e){var t=1===e.length?e[0]:e.find(function(e){return e.index||!e.path||"/"===e.path})||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function e1(e,t){var r=void 0===t?{}:t,n=r.pathname,a=r.routeId,o=r.method,i=r.type;r.message;var u="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(u="Bad Request",o&&n&&a?s="You made a "+o+' request to "'+n+'" but did not provide a `loader` for route "'+a+'", so there is no way to handle the request.':"defer-action"===i?s="defer() is not supported in actions":"invalid-body"===i&&(s="Unable to encode submission body")):403===e?(u="Forbidden",s='Route "'+a+'" does not match URL "'+n+'"'):404===e?(u="Not Found",s='No route matches URL "'+n+'"'):405===e&&(u="Method Not Allowed",o&&n&&a?s="You made a "+o.toUpperCase()+' request to "'+n+'" but did not provide an `action` for route "'+a+'", so there is no way to handle the request.':o&&(s='Invalid request method "'+o.toUpperCase()+'"')),new eR(e||500,u,Error(s),!0)}function e2(e){for(var t=Object.entries(e),r=t.length-1;r>=0;r--){var n=D(t[r],2),a=n[0],o=n[1];if(e5(o))return{key:a,result:o}}}function e3(e){var t="string"==typeof e?V(e):e;return $(U({},t,{hash:""}))}function e4(e){return e.type===f.deferred}function e7(e){return e.type===f.error}function e5(e){return(e&&e.type)===f.redirect}function e6(e){return(void 0===e?"undefined":_(e))==="object"&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function e8(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"===_(e.headers)&&void 0!==e.body}function e9(e){return eP.has(e.toLowerCase())}function te(e,t,r){return g(function(){return O(this,function(n){switch(n.label){case 0:return void 0===r&&(r=!1),[4,e.deferredData.resolveData(t)];case 1:if(n.sent())return[2];if(r)try{return[2,{type:f.data,data:e.deferredData.unwrappedData}]}catch(e){return[2,{type:f.error,error:e}]}return[2,{type:f.data,data:e.deferredData.data}]}})})()}function tt(e){return new URLSearchParams(e).getAll("index").some(function(e){return""===e})}function tr(e,t){var r="string"==typeof t?V(t).search:t.search;if(e[e.length-1].route.index&&tt(r||""))return e[e.length-1];var n=ec(e);return n[n.length-1]}function tn(e){var t=e.formMethod,r=e.formAction,n=e.formEncType,a=e.text,o=e.formData,i=e.json;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};else if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};else if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function ta(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function to(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 ti(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 tu(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ts(e,t,r){return t=td(t),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,tb()?Reflect.construct(t,r||[],td(e).constructor):t.apply(e,r))}function tc(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function tl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tf(e,t,r){return t&&tl(e.prototype,t),r&&tl(e,r),e}function td(e){return(td=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function th(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tp(e,t)}function tv(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function tp(e,t){return(tp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,u=!1;try{for(a=a.call(e);!(i=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){u=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(u)throw n}}return o}}(e,t)||ty(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ty(e,t){if(e){if("string"==typeof e)return tu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tu(e,t)}}function tb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tb=function(){return!!e})()}function tg(){return(tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}Symbol("deferred");var tw=v.createContext(null),tS=v.createContext(null),tE=v.createContext(null),tR=v.createContext(null),tx=v.createContext(null),tk=v.createContext({outlet:null,matches:[],isDataRoute:!1}),tP=v.createContext(null);function tC(e,t){var r=(void 0===t?{}:t).relative;tD()||z(!1);var n=v.useContext(tR),a=n.basename,o=n.navigator,i=tI(e,{relative:r}),u=i.hash,s=i.pathname,c=i.search,l=s;return"/"!==a&&(l="/"===s?a:ed([a,s])),o.createHref({pathname:l,search:c,hash:u})}function tD(){return null!=v.useContext(tx)}function tL(){return tD()||z(!1),v.useContext(tx).location}function t_(){return v.useContext(tx).navigationType}function tA(e){tD()||z(!1);var t=tL().pathname;return v.useMemo(function(){return er(e,en(t))},[t,e])}function tT(e){v.useContext(tR).static||v.useLayoutEffect(e)}function tj(){var e,t,r,n,a,o,i,u,s,c,l,f;return v.useContext(tk).isDataRoute?(e=tJ(t$.UseNavigateStable).router,t=tY(tV.UseNavigateStable),r=v.useRef(!1),tT(function(){r.current=!0}),v.useCallback(function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,tg({fromRouteId:t},a)))},[e,t])):(tD()||z(!1),n=v.useContext(tw),o=(a=v.useContext(tR)).basename,i=a.future,u=a.navigator,s=v.useContext(tk).matches,c=tL().pathname,l=JSON.stringify(el(s,i.v7_relativeSplatPath)),f=v.useRef(!1),tT(function(){f.current=!0}),v.useCallback(function(e,t){if(void 0===t&&(t={}),f.current){if("number"==typeof e)return void u.go(e);var r=ef(e,JSON.parse(l),c,"path"===t.relative);null==n&&"/"!==o&&(r.pathname="/"===r.pathname?o:ed([o,r.pathname])),(t.replace?u.replace:u.push)(r,t.state,t)}},[o,u,l,c,n]))}var tO=v.createContext(null);function tM(){return v.useContext(tO)}function tU(e){var t=v.useContext(tk).outlet;return t?v.createElement(tO.Provider,{value:e},t):t}function tF(){var e=v.useContext(tk).matches,t=e[e.length-1];return t?t.params:{}}function tI(e,t){var r=(void 0===t?{}:t).relative,n=v.useContext(tR).future,a=v.useContext(tk).matches,o=tL().pathname,i=JSON.stringify(el(a,n.v7_relativeSplatPath));return v.useMemo(function(){return ef(e,JSON.parse(i),o,"path"===r)},[e,i,o,r])}function tN(e,t){return tB(e,t)}function tB(e,t,r,n){tD()||z(!1);var a=v.useContext(tR).navigator,o=v.useContext(tk).matches,i=o[o.length-1],u=i?i.params:{};i&&i.pathname;var s=i?i.pathnameBase:"/";i&&i.route;var c=tL();if(t){var f,d,h="string"==typeof t?V(t):t;"/"===s||(null==(d=h.pathname)?void 0:d.startsWith(s))||z(!1),f=h}else f=c;var p=f.pathname||"/",m=p;if("/"!==s){var y=s.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}var b=X(e,{pathname:m}),g=tK(b&&b.map(function(e){return Object.assign({},e,{params:Object.assign({},u,e.params),pathname:ed([s,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?s:ed([s,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})}),o,r,n);return t&&g?v.createElement(tx.Provider,{value:{location:tg({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:l.Pop}},g):g}var tz=v.createElement(function(){var e=t3(),t=ex(e)?e.status+" "+e.statusText:tv(e,Error)?e.message:JSON.stringify(e),r=tv(e,Error)?e.stack:null;return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),r?v.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},r):null,null)},null),tH=function(e){function t(e){var r;return tc(this,t),(r=ts(this,t,[e])).state={location:e.location,revalidation:e.revalidation,error:e.error},r}return th(t,e),tf(t,[{key:"componentDidCatch",value:function(e,t){console.error("React Router caught the following error during render",e,t)}},{key:"render",value:function(){return void 0!==this.state.error?v.createElement(tk.Provider,{value:this.props.routeContext},v.createElement(tP.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{error:e}}},{key:"getDerivedStateFromProps",value:function(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}}]),t}(v.Component);function tW(e){var t=e.routeContext,r=e.match,n=e.children,a=v.useContext(tw);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),v.createElement(tk.Provider,{value:t},n)}function tK(e,t,r,n){if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(null==(o=n)||!o.v7_partialHydration||0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}var a,o,i=e,u=null==(a=r)?void 0:a.errors;if(null!=u){var s=i.findIndex(function(e){return e.route.id&&(null==u?void 0:u[e.route.id])!==void 0});s>=0||z(!1),i=i.slice(0,Math.min(i.length,s+1))}var c=!1,l=-1;if(r&&n&&n.v7_partialHydration)for(var f=0;f<i.length;f++){var d=i[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=f),d.route.id){var h=r.loaderData,p=r.errors,m=d.route.loader&&void 0===h[d.route.id]&&(!p||void 0===p[d.route.id]);if(d.route.lazy||m){c=!0,i=l>=0?i.slice(0,l+1):[i[0]];break}}}return i.reduceRight(function(e,n,a){var o,s,f=!1,d=null,h=null;r&&(s=u&&n.route.id?u[n.route.id]:void 0,d=n.route.errorElement||tz,c&&(l<0&&0===a?(o="route-fallback",t8[o]||(t8[o]=!0),f=!0,h=null):l===a&&(f=!0,h=n.route.hydrateFallbackElement||null)));var p=t.concat(i.slice(0,a+1)),m=function(){var t;return t=s?d:f?h:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(tW,{match:n,routeContext:{outlet:e,matches:p,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?v.createElement(tH,{location:r.location,revalidation:r.revalidation,component:d,error:s,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var t$=((o=t$||{}).UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o),tV=((i=tV||{}).UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i);function tJ(e){var t=v.useContext(tw);return t||z(!1),t}function tq(e){var t=v.useContext(tS);return t||z(!1),t}function tY(e){var t,r=((t=v.useContext(tk))||z(!1),t),n=r.matches[r.matches.length-1];return n.route.id||z(!1),n.route.id}function tX(){return tY(tV.UseRouteId)}function tG(){return tq(tV.UseNavigation).navigation}function tQ(){var e=tJ(t$.UseRevalidator),t=tq(tV.UseRevalidator);return v.useMemo(function(){return{revalidate:e.router.revalidate,state:t.revalidation}},[e.router.revalidate,t.revalidation])}function tZ(){var e=tq(tV.UseMatches),t=e.matches,r=e.loaderData;return v.useMemo(function(){return t.map(function(e){return Q(e,r)})},[t,r])}function t0(){var e=tq(tV.UseLoaderData),t=tY(tV.UseLoaderData);return e.errors&&null!=e.errors[t]?void console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")"):e.loaderData[t]}function t1(e){return tq(tV.UseRouteLoaderData).loaderData[e]}function t2(){var e=tq(tV.UseActionData),t=tY(tV.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function t3(){var e,t=v.useContext(tP),r=tq(tV.UseRouteError),n=tY(tV.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function t4(){var e=v.useContext(tE);return null==e?void 0:e._data}function t7(){var e=v.useContext(tE);return null==e?void 0:e._error}var t5=0;function t6(e){var t=tJ(t$.UseBlocker),r=t.router,n=t.basename,a=tq(tV.UseBlocker),o=tm(v.useState(""),2),i=o[0],u=o[1],s=v.useCallback(function(t){if("function"!=typeof e)return!!e;if("/"===n)return e(t);var r=t.currentLocation,a=t.nextLocation,o=t.historyAction;return e({currentLocation:tg({},r,{pathname:ea(r.pathname,n)||r.pathname}),nextLocation:tg({},a,{pathname:ea(a.pathname,n)||a.pathname}),historyAction:o})},[n,e]);return v.useEffect(function(){var e=String(++t5);return u(e),function(){return r.deleteBlocker(e)}},[r]),v.useEffect(function(){""!==i&&r.getBlocker(i,s)},[r,i,s]),i&&a.blockers.has(i)?a.blockers.get(i):eT}var t8={},t9=function(e,t,r){};function re(e,t){(null==e?void 0:e.v7_startTransition)===void 0&&t9("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(null==e?void 0:e.v7_relativeSplatPath)!==void 0||t&&void 0!==t.v7_relativeSplatPath||t9("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(void 0===t.v7_fetcherPersist&&t9("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),void 0===t.v7_normalizeFormMethod&&t9("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),void 0===t.v7_partialHydration&&t9("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),void 0===t.v7_skipActionErrorRevalidation&&t9("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}var rt=v.startTransition;function rr(e){var t=e.basename,r=e.children,n=e.initialEntries,a=e.initialIndex,o=e.future,i=v.useRef();null==i.current&&(i.current=I({initialEntries:n,initialIndex:a,v5Compat:!0}));var u=i.current,s=tm(v.useState({action:u.action,location:u.location}),2),c=s[0],l=s[1],f=(o||{}).v7_startTransition,d=v.useCallback(function(e){f&&rt?rt(function(){return l(e)}):l(e)},[l,f]);return v.useLayoutEffect(function(){return u.listen(d)},[u,d]),v.useEffect(function(){return re(o)},[o]),v.createElement(ri,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:u,future:o})}function rn(e){var t=e.to,r=e.replace,n=e.state,a=e.relative;tD()||z(!1);var o=v.useContext(tR),i=o.future;o.static;var u=v.useContext(tk).matches,s=tL().pathname,c=tj(),l=JSON.stringify(ef(t,el(u,i.v7_relativeSplatPath),s,"path"===a));return v.useEffect(function(){return c(JSON.parse(l),{replace:r,state:n,relative:a})},[c,l,a,r,n]),null}function ra(e){return tU(e.context)}function ro(e){z(!1)}function ri(e){var t=e.basename,r=e.children,n=e.location,a=e.navigationType,o=void 0===a?l.Pop:a,i=e.navigator,u=e.static,s=void 0!==u&&u,c=e.future;tD()&&z(!1);var f=(void 0===t?"/":t).replace(/^\/*/,"/"),d=v.useMemo(function(){return{basename:f,navigator:i,static:s,future:tg({v7_relativeSplatPath:!1},c)}},[f,c,i,s]);"string"==typeof n&&(n=V(n));var h=n.pathname,p=void 0===h?"/":h,m=n.search,y=void 0===m?"":m,b=n.hash,g=void 0===b?"":b,w=n.state,S=void 0===w?null:w,E=n.key,R=void 0===E?"default":E,x=v.useMemo(function(){var e=ea(p,f);return null==e?null:{location:{pathname:e,search:y,hash:g,state:S,key:R},navigationType:o}},[f,p,y,g,S,R,o]);return null==x?null:v.createElement(tR.Provider,{value:d},v.createElement(tx.Provider,{children:void 0===r?null:r,value:x}))}function ru(e){var t=e.children,r=e.location;return tB(rh(t),r)}function rs(e){var t=e.children,r=e.errorElement,n=e.resolve;return v.createElement(rf,{resolve:n,errorElement:r},v.createElement(rd,null,t))}var rc=((u=rc||{})[u.pending=0]="pending",u[u.success=1]="success",u[u.error=2]="error",u),rl=new Promise(function(){}),rf=function(e){function t(e){var r;return tc(this,t),(r=ts(this,t,[e])).state={error:null},r}return th(t,e),tf(t,[{key:"componentDidCatch",value:function(e,t){console.error("<Await> caught the following error during render",e,t)}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.errorElement,n=e.resolve,a=null,o=rc.pending;if(tv(n,Promise))if(this.state.error){o=rc.error;var i=this.state.error;Object.defineProperty(a=Promise.reject().catch(function(){}),"_tracked",{get:function(){return!0}}),Object.defineProperty(a,"_error",{get:function(){return i}})}else n._tracked?o="_error"in(a=n)?rc.error:"_data"in a?rc.success:rc.pending:(o=rc.pending,Object.defineProperty(n,"_tracked",{get:function(){return!0}}),a=n.then(function(e){return Object.defineProperty(n,"_data",{get:function(){return e}})},function(e){return Object.defineProperty(n,"_error",{get:function(){return e}})}));else o=rc.success,Object.defineProperty(a=Promise.resolve(),"_tracked",{get:function(){return!0}}),Object.defineProperty(a,"_data",{get:function(){return n}});if(o===rc.error&&tv(a._error,ey))throw rl;if(o===rc.error&&!r)throw a._error;if(o===rc.error)return v.createElement(tE.Provider,{value:a,children:r});if(o===rc.success)return v.createElement(tE.Provider,{value:a,children:t});throw a}}],[{key:"getDerivedStateFromError",value:function(e){return{error:e}}}]),t}(v.Component);function rd(e){var t=e.children,r=t4(),n="function"==typeof t?t(r):t;return v.createElement(v.Fragment,null,n)}function rh(e,t){void 0===t&&(t=[]);var r=[];return v.Children.forEach(e,function(e,n){if(v.isValidElement(e)){var a,o=((function(e){if(Array.isArray(e))return tu(e)})(a=t)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||ty(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([n]);if(e.type===v.Fragment)return void r.push.apply(r,rh(e.props.children,o));e.type!==ro&&z(!1),e.props.index&&e.props.children&&z(!1);var i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=rh(e.props.children,o)),r.push(i)}}),r}function rv(e){return tK(e)}function rp(e){var t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:v.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function rm(e,t){return eU({basename:null==t?void 0:t.basename,future:tg({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:I({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:rp,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation}).initialize()}function ry(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function rb(e,t,r,n,a,o,i){try{var u=e[o](i),s=u.value}catch(e){r(e);return}u.done?t(s):Promise.resolve(s).then(n,a)}function rg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,u=!1;try{for(a=a.call(e);!(i=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){u=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(u)throw n}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ry(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ry(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rw(){return(rw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function rS(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var rE="application/x-www-form-urlencoded";function rR(e){return null!=e&&"string"==typeof e.tagName}function rx(e){var t,r;return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||(t=e,null!=(r=URLSearchParams)&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](t):t instanceof r)?e:Object.keys(e).reduce(function(t,r){var n=e[r];return t.concat(Array.isArray(n)?n.map(function(e){return[r,e]}):[[r,n]])},[]))}var rk=null,rP=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rC(e){return null==e||rP.has(e)?e:null}var rD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],rL=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],r_=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}function rA(e,t){return eU({basename:null==t?void 0:t.basename,future:rw({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:N({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||rj(),routes:e,mapRouteProperties:rp,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation,window:null==t?void 0:t.window}).initialize()}function rT(e,t){return eU({basename:null==t?void 0:t.basename,future:rw({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:B({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||rj(),routes:e,mapRouteProperties:rp,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation,window:null==t?void 0:t.window}).initialize()}function rj(){var e,t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=rw({},t,{errors:function(e){if(!e)return null;var t=Object.entries(e),r={},n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var s=rg(i.value,2),c=s[0],l=s[1];if(l&&"RouteErrorResponse"===l.__type)r[c]=new eR(l.status,l.statusText,l.data,!0===l.internal);else if(l&&"Error"===l.__type){if(l.__subType){var f=window[l.__subType];if("function"==typeof f)try{var d=new f(l.message);d.stack="",r[c]=d}catch(e){}}if(null==r[c]){var h=Error(l.message);h.stack="",r[c]=h}}else r[c]=l}}catch(e){a=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}(t.errors)})),t}var rO=v.createContext({isTransitioning:!1}),rM=v.createContext(new Map),rU=v.startTransition,rF=p.flushSync,rI=v.useId;function rN(e){rF?rF(e):e()}var rB=function e(){var t=this;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.status="pending",this.promise=new Promise(function(e,r){t.resolve=function(r){"pending"===t.status&&(t.status="resolved",e(r))},t.reject=function(e){"pending"===t.status&&(t.status="rejected",r(e))}})};function rz(e){var t=e.fallbackElement,r=e.router,n=e.future,a=rg(v.useState(r.state),2),o=a[0],i=a[1],u=rg(v.useState(),2),s=u[0],c=u[1],l=rg(v.useState({isTransitioning:!1}),2),f=l[0],d=l[1],h=rg(v.useState(),2),p=h[0],m=h[1],y=rg(v.useState(),2),b=y[0],g=y[1],w=rg(v.useState(),2),S=w[0],E=w[1],R=v.useRef(new Map),x=(n||{}).v7_startTransition,k=v.useCallback(function(e){if(x)rU?rU(e):e();else e()},[x]),P=v.useCallback(function(e,t){var n=t.deletedFetchers,a=t.flushSync,o=t.viewTransitionOpts;e.fetchers.forEach(function(e,t){void 0!==e.data&&R.current.set(t,e.data)}),n.forEach(function(e){return R.current.delete(e)});var u=null==r.window||null==r.window.document||"function"!=typeof r.window.document.startViewTransition;if(!o||u)return void(a?rN(function(){return i(e)}):k(function(){return i(e)}));if(a){rN(function(){b&&(p&&p.resolve(),b.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})});var s=r.window.document.startViewTransition(function(){rN(function(){return i(e)})});s.finished.finally(function(){rN(function(){m(void 0),g(void 0),c(void 0),d({isTransitioning:!1})})}),rN(function(){return g(s)});return}b?(p&&p.resolve(),b.skipTransition(),E({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(c(e),d({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))},[r.window,b,p,R,k]);v.useLayoutEffect(function(){return r.subscribe(P)},[r,P]),v.useEffect(function(){f.isTransitioning&&!f.flushSync&&m(new rB)},[f]),v.useEffect(function(){if(p&&s&&r.window){var e=p.promise,t=r.window.document.startViewTransition(function(){var t;return(t=function(){return function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:s(0)}),u(i,"throw",{value:s(1)}),u(i,"return",{value:s(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function s(u){return function(s){var c=[u,s];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:return k(function(){return i(s)}),[4,e];case 1:return t.sent(),[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,a){var o=t.apply(e,r);function i(e){rb(o,n,a,i,u,"next",e)}function u(e){rb(o,n,a,i,u,"throw",e)}i(void 0)})})()});t.finished.finally(function(){m(void 0),g(void 0),c(void 0),d({isTransitioning:!1})}),g(t)}},[k,s,p,r.window]),v.useEffect(function(){p&&s&&o.location.key===s.location.key&&p.resolve()},[p,b,o.location,s]),v.useEffect(function(){!f.isTransitioning&&S&&(c(S.state),d({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),E(void 0))},[f.isTransitioning,S]),v.useEffect(function(){},[]);var C=v.useMemo(function(){return{createHref:r.createHref,encodeLocation:r.encodeLocation,go:function(e){return r.navigate(e)},push:function(e,t,n){return r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})},replace:function(e,t,n){return r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})}}},[r]),D=r.basename||"/",L=v.useMemo(function(){return{router:r,navigator:C,static:!1,basename:D}},[r,C,D]),_=v.useMemo(function(){return{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},[r.future.v7_relativeSplatPath]);return v.useEffect(function(){return re(n,r.future)},[n,r.future]),v.createElement(v.Fragment,null,v.createElement(tw.Provider,{value:L},v.createElement(tS.Provider,{value:o},v.createElement(rM.Provider,{value:R.current},v.createElement(rO.Provider,{value:f},v.createElement(ri,{basename:D,location:o.location,navigationType:o.historyAction,navigator:C,future:_},o.initialized||r.future.v7_partialHydration?v.createElement(rH,{routes:r.routes,future:r.future,state:o}):t))))),null)}var rH=v.memo(function(e){var t=e.routes,r=e.future;return tB(t,void 0,e.state,r)});function rW(e){var t=e.basename,r=e.children,n=e.future,a=e.window,o=v.useRef();null==o.current&&(o.current=N({window:a,v5Compat:!0}));var i=o.current,u=rg(v.useState({action:i.action,location:i.location}),2),s=u[0],c=u[1],l=(n||{}).v7_startTransition,f=v.useCallback(function(e){l&&rU?rU(function(){return c(e)}):c(e)},[c,l]);return v.useLayoutEffect(function(){return i.listen(f)},[i,f]),v.useEffect(function(){return re(n)},[n]),v.createElement(ri,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:i,future:n})}function rK(e){var t=e.basename,r=e.children,n=e.future,a=e.window,o=v.useRef();null==o.current&&(o.current=B({window:a,v5Compat:!0}));var i=o.current,u=rg(v.useState({action:i.action,location:i.location}),2),s=u[0],c=u[1],l=(n||{}).v7_startTransition,f=v.useCallback(function(e){l&&rU?rU(function(){return c(e)}):c(e)},[c,l]);return v.useLayoutEffect(function(){return i.listen(f)},[i,f]),v.useEffect(function(){return re(n)},[n]),v.createElement(ri,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:i,future:n})}function r$(e){var t=e.basename,r=e.children,n=e.future,a=e.history,o=rg(v.useState({action:a.action,location:a.location}),2),i=o[0],u=o[1],s=(n||{}).v7_startTransition,c=v.useCallback(function(e){s&&rU?rU(function(){return u(e)}):u(e)},[u,s]);return v.useLayoutEffect(function(){return a.listen(c)},[a,c]),v.useEffect(function(){return re(n)},[n]),v.createElement(ri,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:a,future:n})}var rV="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,rJ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rq=v.forwardRef(function(e,t){var r,n=e.onClick,a=e.relative,o=e.reloadDocument,i=e.replace,u=e.state,s=e.target,c=e.to,l=e.preventScrollReset,f=e.viewTransition,d=rS(e,rD),h=v.useContext(tR).basename,p=!1;if("string"==typeof c&&rJ.test(c)&&(r=c,rV))try{var m=new URL(window.location.href),y=new URL(c.startsWith("//")?m.protocol+c:c),b=ea(y.pathname,h);y.origin===m.origin&&null!=b?c=b+y.search+y.hash:p=!0}catch(e){}var g=tC(c,{relative:a}),w=r0(c,{replace:i,state:u,target:s,preventScrollReset:l,relative:a,viewTransition:f});return v.createElement("a",rw({},d,{href:r||g,onClick:p||o?n:function(e){n&&n(e),e.defaultPrevented||w(e)},ref:t,target:s}))}),rY=v.forwardRef(function(e,t){var r,n=e["aria-current"],a=e.caseSensitive,o=e.className,i=void 0===o?"":o,u=e.end,s=void 0!==u&&u,c=e.style,l=e.to,f=e.viewTransition,d=e.children,h=rS(e,rL),p=tI(l,{relative:h.relative}),m=tL(),y=v.useContext(tS),b=v.useContext(tR),g=b.navigator,w=b.basename,S=null!=y&&nn(p)&&!0===f,E=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,R=m.pathname,x=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;void 0!==a&&a||(R=R.toLowerCase(),x=x?x.toLowerCase():null,E=E.toLowerCase()),x&&w&&(x=ea(x,w)||x);var k="/"!==E&&E.endsWith("/")?E.length-1:E.length,P=R===E||!s&&R.startsWith(E)&&"/"===R.charAt(k),C=null!=x&&(x===E||!s&&x.startsWith(E)&&"/"===x.charAt(E.length)),D={isActive:P,isPending:C,isTransitioning:S},L=P?void 0===n?"page":n:void 0;r="function"==typeof i?i(D):[i,P?"active":null,C?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");var _="function"==typeof c?c(D):c;return v.createElement(rq,rw({},h,{"aria-current":L,className:r,ref:t,style:_,to:l,viewTransition:f}),"function"==typeof d?d(D):d)}),rX=v.forwardRef(function(e,t){var r=e.fetcherKey,n=e.navigate,a=e.reloadDocument,o=e.replace,i=e.state,u=e.method,s=void 0===u?"get":u,c=e.action,l=e.onSubmit,f=e.relative,d=e.preventScrollReset,h=e.viewTransition,p=rS(e,r_),m=r4(),y=r7(c,{relative:f}),b="get"===s.toLowerCase()?"get":"post";return v.createElement("form",rw({ref:t,method:b,action:y,onSubmit:a?l:function(e){if(l&&l(e),!e.defaultPrevented){e.preventDefault();var t=e.nativeEvent.submitter,a=(null==t?void 0:t.getAttribute("formmethod"))||s;m(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:o,state:i,relative:f,preventScrollReset:d,viewTransition:h})}}},p))});function rG(e){return ne({getKey:e.getKey,storageKey:e.storageKey}),null}function rQ(e){var t=v.useContext(tw);return t||z(!1),t}function rZ(e){var t=v.useContext(tS);return t||z(!1),t}function r0(e,t){var r=void 0===t?{}:t,n=r.target,a=r.replace,o=r.state,i=r.preventScrollReset,u=r.relative,s=r.viewTransition,c=tj(),l=tL(),f=tI(e,{relative:u});return v.useCallback(function(t){0!==t.button||n&&"_self"!==n||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),c(e,{replace:void 0!==a?a:$(l)===$(f),state:o,preventScrollReset:i,relative:u,viewTransition:s}))},[l,c,f,a,o,n,e,i,u,s])}function r1(e){var t=v.useRef(rx(e)),r=v.useRef(!1),n=tL(),a=v.useMemo(function(){var e,a,o;return e=n.search,a=r.current?null:t.current,o=rx(e),a&&a.forEach(function(e,t){o.has(t)||a.getAll(t).forEach(function(e){o.append(t,e)})}),o},[n.search]),o=tj(),i=v.useCallback(function(e,t){var n=rx("function"==typeof e?e(a):e);r.current=!0,o("?"+n,t)},[o,a]);return[a,i]}(s=d||(d={})).UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState",(c=h||(h={})).UseFetcher="useFetcher",c.UseFetchers="useFetchers",c.UseScrollRestoration="useScrollRestoration";var r2=0,r3=function(){return"__"+String(++r2)+"__"};function r4(){var e=rQ(d.UseSubmit).router,t=v.useContext(tR).basename,r=tX();return v.useCallback(function(n,a){if(void 0===a&&(a={}),"u"<typeof document)throw Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");var o=function(e,t){if(rR(e)&&"form"===e.tagName.toLowerCase()){var r,n,a,o,i,u=e.getAttribute("action");n=u?ea(u,t):null,r=e.getAttribute("method")||"get",a=rC(e.getAttribute("enctype"))||rE,o=new FormData(e)}else if(rR(e)&&"button"===e.tagName.toLowerCase()||rR(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){var s=e.form;if(null==s)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');var c=e.getAttribute("formaction")||s.getAttribute("action");if(n=c?ea(c,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||"get",a=rC(e.getAttribute("formenctype"))||rC(s.getAttribute("enctype"))||rE,o=new FormData(s,e),!function(){if(null===rk)try{new FormData(document.createElement("form"),0),rk=!1}catch(e){rk=!0}return rk}()){var l=e.name,f=e.type,d=e.value;if("image"===f){var h=l?l+".":"";o.append(h+"x","0"),o.append(h+"y","0")}else l&&o.append(l,d)}}else if(rR(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r="get",n=null,a=rE,i=e;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(n,t),i=o.action,u=o.method,s=o.encType,c=o.formData,l=o.body;if(!1===a.navigate){var f=a.fetcherKey||r3();e.fetch(f,r,a.action||i,{preventScrollReset:a.preventScrollReset,formData:c,body:l,formMethod:a.method||u,formEncType:a.encType||s,flushSync:a.flushSync})}else e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:c,body:l,formMethod:a.method||u,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}function r7(e,t){var r=(void 0===t?{}:t).relative,n=v.useContext(tR).basename,a=v.useContext(tk);a||z(!1);var o=rg(a.matches.slice(-1),1)[0],i=rw({},tI(e||".",{relative:r})),u=tL();if(null==e){i.search=u.search;var s=new URLSearchParams(i.search),c=s.getAll("index");if(c.some(function(e){return""===e})){s.delete("index"),c.filter(function(e){return e}).forEach(function(e){return s.append("index",e)});var l=s.toString();i.search=l?"?"+l:""}}return(!e||"."===e)&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:ed([n,i.pathname])),$(i)}function r5(e){var t,r=(void 0===e?{}:e).key,n=rQ(d.UseFetcher).router,a=rZ(h.UseFetcher),o=v.useContext(rM),i=v.useContext(tk),u=null==(t=i.matches[i.matches.length-1])?void 0:t.route.id;o||z(!1),i||z(!1),null==u&&z(!1);var s=rI?rI():"",c=rg(v.useState(r||s),2),l=c[0],f=c[1];r&&r!==l?f(r):l||f(r3()),v.useEffect(function(){return n.getFetcher(l),function(){n.deleteFetcher(l)}},[n,l]);var p=v.useCallback(function(e,t){u||z(!1),n.fetch(l,u,e,t)},[l,u,n]),m=r4(),y=v.useCallback(function(e,t){m(e,rw({},t,{navigate:!1,fetcherKey:l}))},[l,m]),b=v.useMemo(function(){return v.forwardRef(function(e,t){return v.createElement(rX,rw({},e,{navigate:!1,fetcherKey:l,ref:t}))})},[l]),g=a.fetchers.get(l)||eA,w=o.get(l);return v.useMemo(function(){return rw({Form:b,submit:y,load:p},g,{data:w})},[b,y,p,g,w])}function r6(){return Array.from(rZ(h.UseFetchers).fetchers.entries()).map(function(e){var t=rg(e,2),r=t[0],n=t[1];return rw({},n,{key:r})})}var r8="react-router-scroll-positions",r9={};function ne(e){var t,r,n=void 0===e?{}:e,a=n.getKey,o=n.storageKey,i=rQ(d.UseScrollRestoration).router,u=rZ(h.UseScrollRestoration),s=u.restoreScrollPosition,c=u.preventScrollReset,l=v.useContext(tR).basename,f=tL(),p=tZ(),m=tG();v.useEffect(function(){return window.history.scrollRestoration="manual",function(){window.history.scrollRestoration="auto"}},[]),t=v.useCallback(function(){"idle"===m.state&&(r9[(a?a(f,p):null)||f.key]=window.scrollY);try{sessionStorage.setItem(o||r8,JSON.stringify(r9))}catch(e){}window.history.scrollRestoration="auto"},[o,a,m.state,f,p]),r=void 0,v.useEffect(function(){var e=null!=r?{capture:r}:void 0;return window.addEventListener("pagehide",t,e),function(){window.removeEventListener("pagehide",t,e)}},[t,r]),"u">typeof document&&(v.useLayoutEffect(function(){try{var e=sessionStorage.getItem(o||r8);e&&(r9=JSON.parse(e))}catch(e){}},[o]),v.useLayoutEffect(function(){var e=a&&"/"!==l?function(e,t){return a(rw({},e,{pathname:ea(e.pathname,l)||e.pathname}),t)}:a,t=null==i?void 0:i.enableScrollRestoration(r9,function(){return window.scrollY},e);return function(){return t&&t()}},[i,l,a]),v.useLayoutEffect(function(){if(!1!==s){if("number"==typeof s)return void window.scrollTo(0,s);if(f.hash){var e=document.getElementById(decodeURIComponent(f.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==c&&window.scrollTo(0,0)}},[f,s,c]))}function nt(e,t){var r=(t||{}).capture;v.useEffect(function(){var t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),function(){window.removeEventListener("beforeunload",e,t)}},[e,r])}function nr(e){var t=e.when,r=e.message,n=t6(t);v.useEffect(function(){"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())},[n,r]),v.useEffect(function(){"blocked"!==n.state||t||n.reset()},[n,t])}function nn(e,t){void 0===t&&(t={});var r=v.useContext(rO);null==r&&z(!1);var n=rQ(d.useViewTransitionState).basename,a=tI(e,{relative:t.relative});if(!r.isTransitioning)return!1;var o=ea(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=ea(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=er(a.pathname,i)||null!=er(a.pathname,o)}}}]);
|