Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge remote-tracking branch 'origin/master' into capy/w14-pr4
garrytane98e2094eb59
diff --cc .github/workflows/e2e.ymlindex 9f140b2105,edfd357c59..1045d64043--- a/.github/workflows/e2e.yml+++ b/.github/workflows/e2e.yml@@@ -85,7 -85,7 +85,7 @@@ jobspath: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile# This job runs bare `bun test` (not run-e2e.sh), so the snapshot must# be activated here or the restored tar is never read (the engine gates@@@ -230,7 -230,7 +230,7 @@@path: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile- name: Run frozen E2E partitionshell: bash@@@ -322,7 -322,7 +322,7 @@@path: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile# Bare `bun test` job — activate the restored snapshot (see jsonb-parity).- name: Ensure PGLite snapshot (build-or-validate, non-fatal)@@@ -506,7 -506,7 +506,7 @@@path: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile- name: Run backend matrix (direct Postgres, then PgBouncer)# scripts/e2e-backend-matrix.txt: the E5 executor binding matrix and the@@@ -582,7 -582,7 +582,7 @@@path: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile# Bare `bun test` job — activate the restored snapshot (see jsonb-parity).- name: Ensure PGLite snapshot (build-or-validate, non-fatal)@@@ -876,7 -876,7 +876,7 @@@path: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile- name: Bootstrap isolated E2E schemashell: bashdiff --cc .github/workflows/stress.ymlindex 6b4ff461fe,b145a65c23..b955312e87--- a/.github/workflows/stress.yml+++ b/.github/workflows/stress.yml@@@ -117,7 -117,7 +117,7 @@@ jobspath: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile# Exit 1 means a test failed and the manifest says which; the result job# decides. Exit 2 (setup error) or a signal fails the shard, and thediff --cc .github/workflows/test.ymlindex 939dbb4c66,62d9054093..72a72c1b17--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@@ -311,7 -305,7 +311,7 @@@ jobspath: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile# check:schema-migration-order compares new schema migrations with# origin/master's latest version; a depth-1 fetch of the ref is enough.@@@ -406,7 -400,7 +406,7 @@@path: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile- run: bun run test:serialenv:@@@ -475,13 -469,13 +475,13 @@@path: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3with:path: |test/fixtures/pglite-snapshot-default.tartest/fixtures/pglite-snapshot-default.version- key: pglite-snapshot-default-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-default-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-default-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile- name: Ensure PGLite snapshot (build-or-validate, non-fatal)# Absolutized: this file's batch jobs spawn CLI children with varying@@@ -556,7 -550,7 +556,7 @@@path: |test/fixtures/pglite-snapshot-default.tartest/fixtures/pglite-snapshot-default.version- key: pglite-snapshot-default-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-default-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-default-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile- run: bash scripts/ci-brainbench-gate.shenv:@@@ -593,7 -587,7 +593,7 @@@path: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile- name: Ensure PGLite snapshot (build-or-validate, non-fatal)run: bash -c '. scripts/lib/test-env.sh && ensure_pglite_snapshot slow-perf && echo "GBRAIN_PGLITE_SNAPSHOT=${GBRAIN_PGLITE_SNAPSHOT:-}" >> "$GITHUB_ENV"'@@@ -692,7 -686,7 +692,7 @@@path: |test/fixtures/pglite-snapshot.tartest/fixtures/pglite-snapshot.version- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts') }}++ key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/audit/redact-connection-info.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/search/relational-intent.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts', 'src/core/facts/purge-schema.ts', 'src/core/eligibility/generation-schema.ts', 'src/core/trust/schema.ts', 'src/core/trust/tier.ts', 'src/core/trust/allow-rules.ts', 'src/core/write-gate-schema.ts', 'src/core/loops/loops-schema.ts') }}- run: bun install --frozen-lockfile- name: Run test shard ${{ matrix.shard }}/8shell: bashdiff --cc CHANGELOG.mdindex d316d209ae,e69debacc5..8eb5837c80--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -10,47 -10,32 +10,73 @@@ credits are retained; no result has beeidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [Unreleased]++**Wave 14 PR4: the Google connector, open loops, contacts, calendar, Windows and polish.** Gmail loops now find the person page wherever it lives in the brain, extraction runs under a daily spend cap and your own label exclusions, contacts land next to your people pages, and three Windows reports (parked tests, console windows, backups) get native coverage on CI.++### Google connector and open loops++- **Loops find the person across sources (#5504).** A Gmail source's loop names someone whose page lives in `default:people/<slug>`; resolution now runs in the mail's own source first and then across sources by identity only (the exact email as a page alias, or an `entity_identities` canonical member; names never cross, ties stay unresolved). The loop row records the page's source (`open_loops.counterparty_source_id`, migration `open_loops_counterparty_source`, provisional v233), the `owes_to` / `awaiting_reply_from` edge points there, and the entity card, `gbrain waiting` and `open_loops` read the loop from that page and never from a namesake in another source. The commitment fact stays in the connector source.+- **Daily spend cap on loop extraction.** `loops.extraction_max_usd_per_day` (default $2.00, per UTC day, brain-wide): every `loops_extract` job a sweep or the managed catch-up queues shares the day's spend group through the job spend envelope; an attempt the cap cannot admit is refused before the provider call and a sweep at the cap queues nothing (`daily_spend_cap`; `spend_cap_zero` when the user set 0).+- **Your own label exclusions (#5445).** Per-source `g_loops_exclude_labels` (`gbrain sources add … --loops-exclude-labels`) with the brain-wide `loops.extraction_exclude_labels` as the fallback; label names are resolved once per sweep and gate all three eligibility sites, the execution-time check and grace-hold publication, plus the deterministic detector. A name that does not resolve fails closed for new paid extraction (`excluded_label_unresolved`, visible in the sweep counters and retried every sweep). Contributed by @furuchanchan. Supersedes #5524.+- **Contacts next to your own people (#4845, #6158).** `g_contacts_dir` (default `people`, `--contacts-dir`) decides where a Google contact page renders; an existing page is renamed in place (import the new path, then retire the old one). A connector stub yields to its canonical twin in another source under `link_resolution.cross_source`, and doctor `junk_entity_hubs` names the twin and the exact remedy instead of an open policy question.+- **Calendar window reconciles on `--full` (#5442).** `g_future_days` (`--future-days`) bounds the forward window and a `--full` sync reconciles events that moved out of it through the mass-delete guard.+- **Progress ticks per contact and event (#5349)**, and the sweep's shared Gmail category gate (#5103) applies the same bulk-mail rule to Gemini notes and the deterministic detector.+- `loops_extraction_skipped` in the error registry explains every sweep skip reason (`gbrain errors loops_extraction_skipped`).++### Windows++- **Lease identity is the token (#6028).** `apply-migrations` and every other `gbrain_cycle_locks` lease refresh/release by `(id, holder_pid, acquisition_token)`; the `acquired_at` epoch text, whose session-fragile form made a runner refuse its own lease as `migrations_running` naming its own pid, is diagnostics only.+- **Two files no longer park `bun test` (#5332).** `endPoolBounded`'s guard timer stays ref'd while the race is pending (an unref'd timer was dropped before the await came back), and the spawned-CLI persistence test races every child against one wall-clock timer that fails with the argv instead of waiting on a pipe. Both files run on the `windows-latest` row.+- **Backups (#5312).** The archive write → read → cluster-extract round trip runs natively on the `windows-latest` row; the backup guide tells a hand copier to copy the tree, not just the files. The PGLite `dumpDataDir` ENOENT on Windows stays open.+- **No console windows from detached processes (#4992).** `src/core/spawn.ts` launches subprocesses with `windowsHide: true` by default (an explicit `false` is kept; only `openBrowser` uses it), and the minions supervisor, worker, child runner, readiness probe, isolation, registry and shell handler, the Stop-hook push, `cli/main.ts`, the hook heartbeat, the backup check, `cli-force-exit`, `cli-preflight`, the autopilot lock and commands and `bounded-child-exec` go through it now. `scripts/check-windows-hide.ts` (in `verify`) is a ratchet: a new direct launch fails unless its file is in `NOT_YET_MIGRATED` (89 files today), and a listed file that moves onto the seam must drop its entry. `test/windows-hidden-console.test.ts` proves it natively on the `windows-latest` row (the unhidden control launch must show a window first, or the run fails as `windows_console_gate_unsupported`). Contributed by @rokas-tarasevicius (PR #6105). The remaining sites keep their windows until they migrate.++### Polish++- **`lint` stops inventing `created:` (#5433).** `missing-created` fires only when none of `created`, `event_date`, `date`, `published`, `captured_at`, `ingested_at` parses, is never fixable, and `--fix` (the cycle's lint phase included) no longer copies ingest time into `created`; pages that got one that way keep it.+- **`add_tag` / `remove_tag` defer embedding (#5251).** Tags are not chunk text, so the prepared import reuses stored vectors; the ~1.5 s republication cost in the issue is not addressed and the issue stays open.+- **`bootstrap verify` always removes its probe pages (#6001)**, early exits included; the guide says `bootstrap_last_verify` is silent when no snapshot exists.+- **agent-voice defaults to `sonic-3.6` (#5905)**; `CARTESIA_MODEL_ID` overrides.+- **Admin Dashboard pauses its 30 s poll while the tab is hidden (#5061)** and refreshes once on return (`admin/src/lib/visibility-poll.ts`; `admin/dist` and `src/admin-embedded.ts` rebuilt).+- **Superseded push records (#5799 residual).** `isSupersededPushStatus` / `livePushStatuses` in `workspace-push.ts` drop a `writer_coordinator_required` record and any record whose root is a managed worktree now; the `commands/hook.ts` call site is a stack hunk behind wave 13 (`test.todo` marks the hook-level test).++### Things to watch++- `test/db-lock-fencing.test.ts` and `test/cycle-lock-steal.serial.test.ts` simulate a steal by rotating the acquisition token (what a real successor does) instead of only moving `acquired_at`; a rewrite of `acquired_at` under a live holder is now, deliberately, not a steal.+- `test/junk-entity-guards.test.ts`'s #6158 pin changed from "open policy question" (`operator_judgement`) to a concrete remedy; `test/google-source-reconcile.test.ts`'s calendar reconcile pin flipped from "events outside the window stay" to "they reconcile on `--full`".+- `test/lint-3958.test.ts`, `test/managed-lint.test.ts`, `test/managed-phase-matrix.test.ts` and `test/cycle-lint-durability.test.ts` relied on the `created:` promotion as their one fixable issue and were updated deliberately (#5433).+- `test/migrations-golden.test.ts` carries 232 as a provisional gap until the integrator renumbers the migration at merge-slot time.++### For contributors++- New tests: `test/loops-counterparty-null-entity.test.ts` (+ Postgres arm), `test/loops-exclusion.test.ts`, `test/loops-extract-spend-cap.test.ts`, `test/db-lock-token-predicate.test.ts` (+ Postgres arm, in the PgBouncer matrix), `test/backup-archive-roundtrip-5312.test.ts`, `test/spawn-windows-hide.test.ts`, `test/scripts/windows-hide-guard.test.ts`, `test/windows-hidden-console.test.ts`. The `add_link` per-endpoint source parameters were deferred (the composite-key path is not cleanly scoped yet).++ ## [0.60.160.0] - 2026-10-10++ **Keyword search finds words glued to Chinese, Japanese or Korean text, and you choose which source a self-registered agent writes to when you approve it.**++ A note titled `升级PostgreSQL17` used to be invisible to a keyword search for `PostgreSQL17`, because the index stored the whole glued run as one word. The index now splits wherever CJK text meets Latin letters or digits, and upgrading rebuilds only the pages and chunks that contain such a boundary. When an agent registers itself over OAuth and asks to connect, the approval page now has a "Write source" picker, so you decide which source it reads and writes before it gets a token. On a classic self-hosted Postgres brain, an agent whose page write is refused stops retrying and tells you the real fix: write the file, commit it and run `gbrain sync`. After you upgrade, run `gbrain reindex-search-vector` only if you changed `GBRAIN_FTS_LANGUAGE`; it now rebuilds page vectors too.++ ### Itemized changes++ - **CJK/Latin boundaries in keyword search** (#6370). Every indexing `to_tsvector` and the title query read through a new `gbrain_fts_input()` that inserts a space at each CJK↔ASCII letter or digit boundary; text without CJK is unchanged byte for byte. The upgrade migration rebuilds only rows containing a boundary, in checkpointed batches.+ - **`gbrain reindex-search-vector` rebuilds page vectors** (#6374). Pages now get the same vector the write path builds, so a language change reaches titles and timelines, not only chunks. A page edited during the rebuild is skipped and reindexed by its own save, and facts you withdrew stay out of the index.+ - **Choose a self-registered client's source at first consent** (#6202). Clients that registered themselves through dynamic client registration show a "Write source" picker on their first approval, listing your active sources. Approving with or without a change counts as the client's one first consent; later changes go through the Agents page or `gbrain auth rescope --client`. Clients registered before this release keep read-only consent. A migration adds the `oauth_clients.registered_via` marker.+ - **Classic Postgres write refusals ask instead of retrying** (#6277). `owner_unavailable` with `detail: unbound_source` now renders `retryable: false` and `fix.next: ask_user`, and its guidance says write, commit, `gbrain sync --source <id>`. The guide in [write-refusals](docs/guides/write-refusals.md#unbound-sources-on-postgres) and six skills cover the classic path.+ - **One JSON document on stdout** (#6386): `gbrain sync status --json`, `gbrain sync unblock --json` and `gbrain embed --facts --json` write their JSON to stdout, not stderr.+ - **Bootstrap verify waits like a normal write** (#6356): `gbrain bootstrap verify` uses the CLI write wait instead of a fixed 5 seconds, and a write still pending names its next step.+ - **Local reranker setup** (#6381): the llama-server reranker guide points at the llama.cpp maintainers' model file, the recipe's default names the `qwen3-reranker-0.6b` alias the guide uses, and `gbrain models doctor` reports `config` when the server scores a relevant and an unrelated passage the same.+ - **Codex session hooks** (#6399): a Codex rollout that has only a header ends as `empty_session`, not `parser_drift`.+ - **Link validation** (#6266): the link validator resolves relative links from the page's own directory, the same way link extraction does.+ - **Search latency budget** (#6400): the query-embedding deadline starts at the first embed request, so time spent before it no longer eats the vector search's budget.++ ### For contributors++ - CONTRIBUTING warns before the `git reset --hard` in the line-ending refresh.+ - Every pglite-snapshot cache key in `e2e.yml`, `test.yml` and `stress.yml` also hashes `src/core/audit/redact-connection-info.ts`, which the schema closure now imports.++ Contributed by @dovstern, @javieraldape, @daveove, @benswinney and @dhruvatr.+## [0.60.159.0] - 2026-10-10**Captured memory stops leaking away: failed chats retry until they import, long messages stay whole, sessions file under their own source, and fence writers refuse instead of dropping rows.**diff --cc admin/dist/assets/index-B9c8JuNx.jsindex e2d4e38d0b,f2e999dab9..0b7773b67b--- a/admin/dist/assets/index-B9c8JuNx.js+++ b/admin/dist/assets/index-B9c8JuNx.js@@@ -1,4 -1,4 +1,4 @@@- (function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const j of document.querySelectorAll('link[rel="modulepreload"]'))o(j);new MutationObserver(j=>{for(const A of j)if(A.type==="childList")for(const q of A.addedNodes)q.tagName==="LINK"&&q.rel==="modulepreload"&&o(q)}).observe(document,{childList:!0,subtree:!0});function b(j){const A={};return j.integrity&&(A.integrity=j.integrity),j.referrerPolicy&&(A.referrerPolicy=j.referrerPolicy),j.crossOrigin==="use-credentials"?A.credentials="include":j.crossOrigin==="anonymous"?A.credentials="omit":A.credentials="same-origin",A}function o(j){if(j.ep)return;j.ep=!0;const A=b(j);fetch(j.href,A)}})();function wd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var rs={exports:{}},Tn={};/**-(function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const A of document.querySelectorAll('link[rel="modulepreload"]'))o(A);new MutationObserver(A=>{for(const z of A)if(z.type==="childList")for(const q of z.addedNodes)q.tagName==="LINK"&&q.rel==="modulepreload"&&o(q)}).observe(document,{childList:!0,subtree:!0});function b(A){const z={};return A.integrity&&(z.integrity=A.integrity),A.referrerPolicy&&(z.referrerPolicy=A.referrerPolicy),A.crossOrigin==="use-credentials"?z.credentials="include":A.crossOrigin==="anonymous"?z.credentials="omit":z.credentials="same-origin",z}function o(A){if(A.ep)return;A.ep=!0;const z=b(A);fetch(A.href,z)}})();function Gd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var rs={exports:{}},Tn={};/**++(function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const T of document.querySelectorAll('link[rel="modulepreload"]'))o(T);new MutationObserver(T=>{for(const _ of T)if(_.type==="childList")for(const q of _.addedNodes)q.tagName==="LINK"&&q.rel==="modulepreload"&&o(q)}).observe(document,{childList:!0,subtree:!0});function b(T){const _={};return T.integrity&&(_.integrity=T.integrity),T.referrerPolicy&&(_.referrerPolicy=T.referrerPolicy),T.crossOrigin==="use-credentials"?_.credentials="include":T.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function o(T){if(T.ep)return;T.ep=!0;const _=b(T);fetch(T.href,_)}})();function Gd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var rs={exports:{}},Tn={};/*** @license React* react-jsx-runtime.production.js*@@@ -6,7 -6,7 +6,7 @@@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var Ad;function gy(){if(Ad)return Tn;Ad=1;var s=Symbol.for("react.transitional.element"),x=Symbol.for("react.fragment");function b(o,j,A){var q=null;if(A!==void 0&&(q=""+A),j.key!==void 0&&(q=""+j.key),"key"in j){A={};for(var H in j)H!=="key"&&(A[H]=j[H])}else A=j;return j=A.ref,{$$typeof:s,type:o,key:q,ref:j!==void 0?j:null,props:A}}return Tn.Fragment=x,Tn.jsx=b,Tn.jsxs=b,Tn}var _d;function py(){return _d||(_d=1,rs.exports=gy()),rs.exports}var u=py(),ds={exports:{}},I={};/**- */var Ad;function gy(){if(Ad)return Tn;Ad=1;var s=Symbol.for("react.transitional.element"),x=Symbol.for("react.fragment");function b(o,A,z){var q=null;if(z!==void 0&&(q=""+z),A.key!==void 0&&(q=""+A.key),"key"in A){z={};for(var H in A)H!=="key"&&(z[H]=A[H])}else z=A;return A=z.ref,{$$typeof:s,type:o,key:q,ref:A!==void 0?A:null,props:z}}return Tn.Fragment=x,Tn.jsx=b,Tn.jsxs=b,Tn}var _d;function py(){return _d||(_d=1,rs.exports=gy()),rs.exports}var u=py(),ds={exports:{}},I={};/**++ */var Ad;function gy(){if(Ad)return Tn;Ad=1;var s=Symbol.for("react.transitional.element"),x=Symbol.for("react.fragment");function b(o,T,_){var q=null;if(_!==void 0&&(q=""+_),T.key!==void 0&&(q=""+T.key),"key"in T){_={};for(var H in T)H!=="key"&&(_[H]=T[H])}else _=T;return T=_.ref,{$$typeof:s,type:o,key:q,ref:T!==void 0?T:null,props:_}}return Tn.Fragment=x,Tn.jsx=b,Tn.jsxs=b,Tn}var _d;function py(){return _d||(_d=1,rs.exports=gy()),rs.exports}var u=py(),ds={exports:{}},I={};/*** @license React* react.production.js*@@@ -14,7 -14,7 +14,7 @@@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var zd;function by(){if(zd)return I;zd=1;var s=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),q=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),M=Symbol.iterator;function Q(m){return m===null||typeof m!="object"?null:(m=M&&m[M]||m["@@iterator"],typeof m=="function"?m:null)}var G={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z=Object.assign,W={};function ae(m,D,B){this.props=m,this.context=D,this.refs=W,this.updater=B||G}ae.prototype.isReactComponent={},ae.prototype.setState=function(m,D){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,D,"setState")},ae.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function $(){}$.prototype=ae.prototype;function le(m,D,B){this.props=m,this.context=D,this.refs=W,this.updater=B||G}var ne=le.prototype=new $;ne.constructor=le,Z(ne,ae.prototype),ne.isPureReactComponent=!0;var be=Array.isArray;function k(){}var V={H:null,A:null,T:null,S:null},xe=Object.prototype.hasOwnProperty;function Se(m,D,B){var X=B.ref;return{$$typeof:s,type:m,key:D,ref:X!==void 0?X:null,props:B}}function se(m,D){return Se(m.type,D,m.props)}function F(m){return typeof m=="object"&&m!==null&&m.$$typeof===s}function de(m){var D={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(B){return D[B]})}var Ge=/\/+/g;function Ce(m,D){return typeof m=="object"&&m!==null&&m.key!=null?de(""+m.key):D.toString(36)}function Ze(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(k,k):(m.status="pending",m.then(function(D){m.status==="pending"&&(m.status="fulfilled",m.value=D)},function(D){m.status==="pending"&&(m.status="rejected",m.reason=D)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function T(m,D,B,X,P){var ie=typeof m;(ie==="undefined"||ie==="boolean")&&(m=null);var ve=!1;if(m===null)ve=!0;else switch(ie){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(m.$$typeof){case s:case x:ve=!0;break;case R:return ve=m._init,T(ve(m._payload),D,B,X,P)}}if(ve)return P=P(m),ve=X===""?"."+Ce(m,0):X,be(P)?(B="",ve!=null&&(B=ve.replace(Ge,"$&/")+"/"),T(P,D,B,"",function(Na){return Na})):P!=null&&(F(P)&&(P=se(P,B+(P.key==null||m&&m.key===P.key?"":(""+P.key).replace(Ge,"$&/")+"/")+ve)),D.push(P)),1;ve=0;var et=X===""?".":X+":";if(be(m))for(var He=0;He<m.length;He++)X=m[He],ie=et+Ce(X,He),ve+=T(X,D,B,ie,P);else if(He=Q(m),typeof He=="function")for(m=He.call(m),He=0;!(X=m.next()).done;)X=X.value,ie=et+Ce(X,He++),ve+=T(X,D,B,ie,P);else if(ie==="object"){if(typeof m.then=="function")return T(Ze(m),D,B,X,P);throw D=String(m),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return ve}function N(m,D,B){if(m==null)return m;var X=[],P=0;return T(m,X,"","",function(ie){return D.call(B,ie,P++)}),X}function Y(m){if(m._status===-1){var D=m._result;D=D(),D.then(function(B){(m._status===0||m._status===-1)&&(m._status=1,m._result=B)},function(B){(m._status===0||m._status===-1)&&(m._status=2,m._result=B)}),m._status===-1&&(m._status=0,m._result=D)}if(m._status===1)return m._result.default;throw m._result}var je=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},_e={map:N,forEach:function(m,D,B){N(m,function(){D.apply(this,arguments)},B)},count:function(m){var D=0;return N(m,function(){D++}),D},toArray:function(m){return N(m,function(D){return D})||[]},only:function(m){if(!F(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return I.Activity=z,I.Children=_e,I.Component=ae,I.Fragment=b,I.Profiler=j,I.PureComponent=le,I.StrictMode=o,I.Suspense=_,I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,I.__COMPILER_RUNTIME={__proto__:null,c:function(m){return V.H.useMemoCache(m)}},I.cache=function(m){return function(){return m.apply(null,arguments)}},I.cacheSignal=function(){return null},I.cloneElement=function(m,D,B){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var X=Z({},m.props),P=m.key;if(D!=null)for(ie in D.key!==void 0&&(P=""+D.key),D)!xe.call(D,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&D.ref===void 0||(X[ie]=D[ie]);var ie=arguments.length-2;if(ie===1)X.children=B;else if(1<ie){for(var ve=Array(ie),et=0;et<ie;et++)ve[et]=arguments[et+2];X.children=ve}return Se(m.type,P,X)},I.createContext=function(m){return m={$$typeof:q,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:A,_context:m},m},I.createElement=function(m,D,B){var X,P={},ie=null;if(D!=null)for(X in D.key!==void 0&&(ie=""+D.key),D)xe.call(D,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(P[X]=D[X]);var ve=arguments.length-2;if(ve===1)P.children=B;else if(1<ve){for(var et=Array(ve),He=0;He<ve;He++)et[He]=arguments[He+2];P.children=et}if(m&&m.defaultProps)for(X in ve=m.defaultProps,ve)P[X]===void 0&&(P[X]=ve[X]);return Se(m,ie,P)},I.createRef=function(){return{current:null}},I.forwardRef=function(m){return{$$typeof:H,render:m}},I.isValidElement=F,I.lazy=function(m){return{$$typeof:R,_payload:{_status:-1,_result:m},_init:Y}},I.memo=function(m,D){return{$$typeof:d,type:m,compare:D===void 0?null:D}},I.startTransition=function(m){var D=V.T,B={};V.T=B;try{var X=m(),P=V.S;P!==null&&P(B,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(k,je)}catch(ie){je(ie)}finally{D!==null&&B.types!==null&&(D.types=B.types),V.T=D}},I.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},I.use=function(m){return V.H.use(m)},I.useActionState=function(m,D,B){return V.H.useActionState(m,D,B)},I.useCallback=function(m,D){return V.H.useCallback(m,D)},I.useContext=function(m){return V.H.useContext(m)},I.useDebugValue=function(){},I.useDeferredValue=function(m,D){return V.H.useDeferredValue(m,D)},I.useEffect=function(m,D){return V.H.useEffect(m,D)},I.useEffectEvent=function(m){return V.H.useEffectEvent(m)},I.useId=function(){return V.H.useId()},I.useImperativeHandle=function(m,D,B){return V.H.useImperativeHandle(m,D,B)},I.useInsertionEffect=function(m,D){return V.H.useInsertionEffect(m,D)},I.useLayoutEffect=function(m,D){return V.H.useLayoutEffect(m,D)},I.useMemo=function(m,D){return V.H.useMemo(m,D)},I.useOptimistic=function(m,D){return V.H.useOptimistic(m,D)},I.useReducer=function(m,D,B){return V.H.useReducer(m,D,B)},I.useRef=function(m){return V.H.useRef(m)},I.useState=function(m){return V.H.useState(m)},I.useSyncExternalStore=function(m,D,B){return V.H.useSyncExternalStore(m,D,B)},I.useTransition=function(){return V.H.useTransition()},I.version="19.2.5",I}var Od;function xs(){return Od||(Od=1,ds.exports=by()),ds.exports}var U=xs();const Xd=wd(U);var hs={exports:{}},En={},ms={exports:{}},ys={};/**- */var zd;function by(){if(zd)return I;zd=1;var s=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),q=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),C=Symbol.iterator;function Y(m){return m===null||typeof m!="object"?null:(m=C&&m[C]||m["@@iterator"],typeof m=="function"?m:null)}var G={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z=Object.assign,W={};function ae(m,M,B){this.props=m,this.context=M,this.refs=W,this.updater=B||G}ae.prototype.isReactComponent={},ae.prototype.setState=function(m,M){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,M,"setState")},ae.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function $(){}$.prototype=ae.prototype;function le(m,M,B){this.props=m,this.context=M,this.refs=W,this.updater=B||G}var ne=le.prototype=new $;ne.constructor=le,Z(ne,ae.prototype),ne.isPureReactComponent=!0;var xe=Array.isArray;function k(){}var V={H:null,A:null,T:null,S:null},Se=Object.prototype.hasOwnProperty;function je(m,M,B){var Q=B.ref;return{$$typeof:s,type:m,key:M,ref:Q!==void 0?Q:null,props:B}}function se(m,M){return je(m.type,M,m.props)}function F(m){return typeof m=="object"&&m!==null&&m.$$typeof===s}function de(m){var M={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(B){return M[B]})}var we=/\/+/g;function Ne(m,M){return typeof m=="object"&&m!==null&&m.key!=null?de(""+m.key):M.toString(36)}function Ze(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(k,k):(m.status="pending",m.then(function(M){m.status==="pending"&&(m.status="fulfilled",m.value=M)},function(M){m.status==="pending"&&(m.status="rejected",m.reason=M)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function T(m,M,B,Q,P){var ie=typeof m;(ie==="undefined"||ie==="boolean")&&(m=null);var ve=!1;if(m===null)ve=!0;else switch(ie){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(m.$$typeof){case s:case x:ve=!0;break;case U:return ve=m._init,T(ve(m._payload),M,B,Q,P)}}if(ve)return P=P(m),ve=Q===""?"."+Ne(m,0):Q,xe(P)?(B="",ve!=null&&(B=ve.replace(we,"$&/")+"/"),T(P,M,B,"",function(Ca){return Ca})):P!=null&&(F(P)&&(P=se(P,B+(P.key==null||m&&m.key===P.key?"":(""+P.key).replace(we,"$&/")+"/")+ve)),M.push(P)),1;ve=0;var et=Q===""?".":Q+":";if(xe(m))for(var He=0;He<m.length;He++)Q=m[He],ie=et+Ne(Q,He),ve+=T(Q,M,B,ie,P);else if(He=Y(m),typeof He=="function")for(m=He.call(m),He=0;!(Q=m.next()).done;)Q=Q.value,ie=et+Ne(Q,He++),ve+=T(Q,M,B,ie,P);else if(ie==="object"){if(typeof m.then=="function")return T(Ze(m),M,B,Q,P);throw M=String(m),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return ve}function N(m,M,B){if(m==null)return m;var Q=[],P=0;return T(m,Q,"","",function(ie){return M.call(B,ie,P++)}),Q}function w(m){if(m._status===-1){var M=m._result;M=M(),M.then(function(B){(m._status===0||m._status===-1)&&(m._status=1,m._result=B)},function(B){(m._status===0||m._status===-1)&&(m._status=2,m._result=B)}),m._status===-1&&(m._status=0,m._result=M)}if(m._status===1)return m._result.default;throw m._result}var Te=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},ze={map:N,forEach:function(m,M,B){N(m,function(){M.apply(this,arguments)},B)},count:function(m){var M=0;return N(m,function(){M++}),M},toArray:function(m){return N(m,function(M){return M})||[]},only:function(m){if(!F(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return I.Activity=j,I.Children=ze,I.Component=ae,I.Fragment=b,I.Profiler=A,I.PureComponent=le,I.StrictMode=o,I.Suspense=_,I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,I.__COMPILER_RUNTIME={__proto__:null,c:function(m){return V.H.useMemoCache(m)}},I.cache=function(m){return function(){return m.apply(null,arguments)}},I.cacheSignal=function(){return null},I.cloneElement=function(m,M,B){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var Q=Z({},m.props),P=m.key;if(M!=null)for(ie in M.key!==void 0&&(P=""+M.key),M)!Se.call(M,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&M.ref===void 0||(Q[ie]=M[ie]);var ie=arguments.length-2;if(ie===1)Q.children=B;else if(1<ie){for(var ve=Array(ie),et=0;et<ie;et++)ve[et]=arguments[et+2];Q.children=ve}return je(m.type,P,Q)},I.createContext=function(m){return m={$$typeof:q,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:z,_context:m},m},I.createElement=function(m,M,B){var Q,P={},ie=null;if(M!=null)for(Q in M.key!==void 0&&(ie=""+M.key),M)Se.call(M,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(P[Q]=M[Q]);var ve=arguments.length-2;if(ve===1)P.children=B;else if(1<ve){for(var et=Array(ve),He=0;He<ve;He++)et[He]=arguments[He+2];P.children=et}if(m&&m.defaultProps)for(Q in ve=m.defaultProps,ve)P[Q]===void 0&&(P[Q]=ve[Q]);return je(m,ie,P)},I.createRef=function(){return{current:null}},I.forwardRef=function(m){return{$$typeof:H,render:m}},I.isValidElement=F,I.lazy=function(m){return{$$typeof:U,_payload:{_status:-1,_result:m},_init:w}},I.memo=function(m,M){return{$$typeof:h,type:m,compare:M===void 0?null:M}},I.startTransition=function(m){var M=V.T,B={};V.T=B;try{var Q=m(),P=V.S;P!==null&&P(B,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(k,Te)}catch(ie){Te(ie)}finally{M!==null&&B.types!==null&&(M.types=B.types),V.T=M}},I.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},I.use=function(m){return V.H.use(m)},I.useActionState=function(m,M,B){return V.H.useActionState(m,M,B)},I.useCallback=function(m,M){return V.H.useCallback(m,M)},I.useContext=function(m){return V.H.useContext(m)},I.useDebugValue=function(){},I.useDeferredValue=function(m,M){return V.H.useDeferredValue(m,M)},I.useEffect=function(m,M){return V.H.useEffect(m,M)},I.useEffectEvent=function(m){return V.H.useEffectEvent(m)},I.useId=function(){return V.H.useId()},I.useImperativeHandle=function(m,M,B){return V.H.useImperativeHandle(m,M,B)},I.useInsertionEffect=function(m,M){return V.H.useInsertionEffect(m,M)},I.useLayoutEffect=function(m,M){return V.H.useLayoutEffect(m,M)},I.useMemo=function(m,M){return V.H.useMemo(m,M)},I.useOptimistic=function(m,M){return V.H.useOptimistic(m,M)},I.useReducer=function(m,M,B){return V.H.useReducer(m,M,B)},I.useRef=function(m){return V.H.useRef(m)},I.useState=function(m){return V.H.useState(m)},I.useSyncExternalStore=function(m,M,B){return V.H.useSyncExternalStore(m,M,B)},I.useTransition=function(){return V.H.useTransition()},I.version="19.2.5",I}var Od;function xs(){return Od||(Od=1,ds.exports=by()),ds.exports}var R=xs();const Xd=Gd(R);var hs={exports:{}},En={},ms={exports:{}},ys={};/**++ */var zd;function by(){if(zd)return I;zd=1;var s=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),q=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),C=Symbol.iterator;function Y(m){return m===null||typeof m!="object"?null:(m=C&&m[C]||m["@@iterator"],typeof m=="function"?m:null)}var G={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z=Object.assign,W={};function ae(m,M,B){this.props=m,this.context=M,this.refs=W,this.updater=B||G}ae.prototype.isReactComponent={},ae.prototype.setState=function(m,M){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,M,"setState")},ae.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function $(){}$.prototype=ae.prototype;function le(m,M,B){this.props=m,this.context=M,this.refs=W,this.updater=B||G}var ne=le.prototype=new $;ne.constructor=le,Z(ne,ae.prototype),ne.isPureReactComponent=!0;var be=Array.isArray;function k(){}var V={H:null,A:null,T:null,S:null},xe=Object.prototype.hasOwnProperty;function Se(m,M,B){var Q=B.ref;return{$$typeof:s,type:m,key:M,ref:Q!==void 0?Q:null,props:B}}function se(m,M){return Se(m.type,M,m.props)}function F(m){return typeof m=="object"&&m!==null&&m.$$typeof===s}function de(m){var M={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(B){return M[B]})}var we=/\/+/g;function Ne(m,M){return typeof m=="object"&&m!==null&&m.key!=null?de(""+m.key):M.toString(36)}function Ze(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(k,k):(m.status="pending",m.then(function(M){m.status==="pending"&&(m.status="fulfilled",m.value=M)},function(M){m.status==="pending"&&(m.status="rejected",m.reason=M)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function E(m,M,B,Q,P){var ie=typeof m;(ie==="undefined"||ie==="boolean")&&(m=null);var ve=!1;if(m===null)ve=!0;else switch(ie){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(m.$$typeof){case s:case x:ve=!0;break;case U:return ve=m._init,E(ve(m._payload),M,B,Q,P)}}if(ve)return P=P(m),ve=Q===""?"."+Ne(m,0):Q,be(P)?(B="",ve!=null&&(B=ve.replace(we,"$&/")+"/"),E(P,M,B,"",function(Ca){return Ca})):P!=null&&(F(P)&&(P=se(P,B+(P.key==null||m&&m.key===P.key?"":(""+P.key).replace(we,"$&/")+"/")+ve)),M.push(P)),1;ve=0;var et=Q===""?".":Q+":";if(be(m))for(var He=0;He<m.length;He++)Q=m[He],ie=et+Ne(Q,He),ve+=E(Q,M,B,ie,P);else if(He=Y(m),typeof He=="function")for(m=He.call(m),He=0;!(Q=m.next()).done;)Q=Q.value,ie=et+Ne(Q,He++),ve+=E(Q,M,B,ie,P);else if(ie==="object"){if(typeof m.then=="function")return E(Ze(m),M,B,Q,P);throw M=String(m),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return ve}function N(m,M,B){if(m==null)return m;var Q=[],P=0;return E(m,Q,"","",function(ie){return M.call(B,ie,P++)}),Q}function w(m){if(m._status===-1){var M=m._result;M=M(),M.then(function(B){(m._status===0||m._status===-1)&&(m._status=1,m._result=B)},function(B){(m._status===0||m._status===-1)&&(m._status=2,m._result=B)}),m._status===-1&&(m._status=0,m._result=M)}if(m._status===1)return m._result.default;throw m._result}var je=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},_e={map:N,forEach:function(m,M,B){N(m,function(){M.apply(this,arguments)},B)},count:function(m){var M=0;return N(m,function(){M++}),M},toArray:function(m){return N(m,function(M){return M})||[]},only:function(m){if(!F(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return I.Activity=S,I.Children=_e,I.Component=ae,I.Fragment=b,I.Profiler=T,I.PureComponent=le,I.StrictMode=o,I.Suspense=z,I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,I.__COMPILER_RUNTIME={__proto__:null,c:function(m){return V.H.useMemoCache(m)}},I.cache=function(m){return function(){return m.apply(null,arguments)}},I.cacheSignal=function(){return null},I.cloneElement=function(m,M,B){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var Q=Z({},m.props),P=m.key;if(M!=null)for(ie in M.key!==void 0&&(P=""+M.key),M)!xe.call(M,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&M.ref===void 0||(Q[ie]=M[ie]);var ie=arguments.length-2;if(ie===1)Q.children=B;else if(1<ie){for(var ve=Array(ie),et=0;et<ie;et++)ve[et]=arguments[et+2];Q.children=ve}return Se(m.type,P,Q)},I.createContext=function(m){return m={$$typeof:q,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:_,_context:m},m},I.createElement=function(m,M,B){var Q,P={},ie=null;if(M!=null)for(Q in M.key!==void 0&&(ie=""+M.key),M)xe.call(M,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(P[Q]=M[Q]);var ve=arguments.length-2;if(ve===1)P.children=B;else if(1<ve){for(var et=Array(ve),He=0;He<ve;He++)et[He]=arguments[He+2];P.children=et}if(m&&m.defaultProps)for(Q in ve=m.defaultProps,ve)P[Q]===void 0&&(P[Q]=ve[Q]);return Se(m,ie,P)},I.createRef=function(){return{current:null}},I.forwardRef=function(m){return{$$typeof:H,render:m}},I.isValidElement=F,I.lazy=function(m){return{$$typeof:U,_payload:{_status:-1,_result:m},_init:w}},I.memo=function(m,M){return{$$typeof:h,type:m,compare:M===void 0?null:M}},I.startTransition=function(m){var M=V.T,B={};V.T=B;try{var Q=m(),P=V.S;P!==null&&P(B,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(k,je)}catch(ie){je(ie)}finally{M!==null&&B.types!==null&&(M.types=B.types),V.T=M}},I.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},I.use=function(m){return V.H.use(m)},I.useActionState=function(m,M,B){return V.H.useActionState(m,M,B)},I.useCallback=function(m,M){return V.H.useCallback(m,M)},I.useContext=function(m){return V.H.useContext(m)},I.useDebugValue=function(){},I.useDeferredValue=function(m,M){return V.H.useDeferredValue(m,M)},I.useEffect=function(m,M){return V.H.useEffect(m,M)},I.useEffectEvent=function(m){return V.H.useEffectEvent(m)},I.useId=function(){return V.H.useId()},I.useImperativeHandle=function(m,M,B){return V.H.useImperativeHandle(m,M,B)},I.useInsertionEffect=function(m,M){return V.H.useInsertionEffect(m,M)},I.useLayoutEffect=function(m,M){return V.H.useLayoutEffect(m,M)},I.useMemo=function(m,M){return V.H.useMemo(m,M)},I.useOptimistic=function(m,M){return V.H.useOptimistic(m,M)},I.useReducer=function(m,M,B){return V.H.useReducer(m,M,B)},I.useRef=function(m){return V.H.useRef(m)},I.useState=function(m){return V.H.useState(m)},I.useSyncExternalStore=function(m,M,B){return V.H.useSyncExternalStore(m,M,B)},I.useTransition=function(){return V.H.useTransition()},I.version="19.2.5",I}var Od;function xs(){return Od||(Od=1,ds.exports=by()),ds.exports}var R=xs();const Xd=Gd(R);var hs={exports:{}},En={},ms={exports:{}},ys={};/*** @license React* scheduler.production.js*@@@ -22,7 -22,7 +22,7 @@@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var Nd;function xy(){return Nd||(Nd=1,(function(s){function x(T,N){var Y=T.length;T.push(N);e:for(;0<Y;){var je=Y-1>>>1,_e=T[je];if(0<j(_e,N))T[je]=N,T[Y]=_e,Y=je;else break e}}function b(T){return T.length===0?null:T[0]}function o(T){if(T.length===0)return null;var N=T[0],Y=T.pop();if(Y!==N){T[0]=Y;e:for(var je=0,_e=T.length,m=_e>>>1;je<m;){var D=2*(je+1)-1,B=T[D],X=D+1,P=T[X];if(0>j(B,Y))X<_e&&0>j(P,B)?(T[je]=P,T[X]=Y,je=X):(T[je]=B,T[D]=Y,je=D);else if(X<_e&&0>j(P,Y))T[je]=P,T[X]=Y,je=X;else break e}}return N}function j(T,N){var Y=T.sortIndex-N.sortIndex;return Y!==0?Y:T.id-N.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var A=performance;s.unstable_now=function(){return A.now()}}else{var q=Date,H=q.now();s.unstable_now=function(){return q.now()-H}}var _=[],d=[],R=1,z=null,M=3,Q=!1,G=!1,Z=!1,W=!1,ae=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,le=typeof setImmediate<"u"?setImmediate:null;function ne(T){for(var N=b(d);N!==null;){if(N.callback===null)o(d);else if(N.startTime<=T)o(d),N.sortIndex=N.expirationTime,x(_,N);else break;N=b(d)}}function be(T){if(Z=!1,ne(T),!G)if(b(_)!==null)G=!0,k||(k=!0,de());else{var N=b(d);N!==null&&Ze(be,N.startTime-T)}}var k=!1,V=-1,xe=5,Se=-1;function se(){return W?!0:!(s.unstable_now()-Se<xe)}function F(){if(W=!1,k){var T=s.unstable_now();Se=T;var N=!0;try{e:{G=!1,Z&&(Z=!1,$(V),V=-1),Q=!0;var Y=M;try{t:{for(ne(T),z=b(_);z!==null&&!(z.expirationTime>T&&se());){var je=z.callback;if(typeof je=="function"){z.callback=null,M=z.priorityLevel;var _e=je(z.expirationTime<=T);if(T=s.unstable_now(),typeof _e=="function"){z.callback=_e,ne(T),N=!0;break t}z===b(_)&&o(_),ne(T)}else o(_);z=b(_)}if(z!==null)N=!0;else{var m=b(d);m!==null&&Ze(be,m.startTime-T),N=!1}}break e}finally{z=null,M=Y,Q=!1}N=void 0}}finally{N?de():k=!1}}}var de;if(typeof le=="function")de=function(){le(F)};else if(typeof MessageChannel<"u"){var Ge=new MessageChannel,Ce=Ge.port2;Ge.port1.onmessage=F,de=function(){Ce.postMessage(null)}}else de=function(){ae(F,0)};function Ze(T,N){V=ae(function(){T(s.unstable_now())},N)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(T){T.callback=null},s.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):xe=0<T?Math.floor(1e3/T):5},s.unstable_getCurrentPriorityLevel=function(){return M},s.unstable_next=function(T){switch(M){case 1:case 2:case 3:var N=3;break;default:N=M}var Y=M;M=N;try{return T()}finally{M=Y}},s.unstable_requestPaint=function(){W=!0},s.unstable_runWithPriority=function(T,N){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var Y=M;M=T;try{return N()}finally{M=Y}},s.unstable_scheduleCallback=function(T,N,Y){var je=s.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?je+Y:je):Y=je,T){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=Y+_e,T={id:R++,callback:N,priorityLevel:T,startTime:Y,expirationTime:_e,sortIndex:-1},Y>je?(T.sortIndex=Y,x(d,T),b(_)===null&&T===b(d)&&(Z?($(V),V=-1):Z=!0,Ze(be,Y-je))):(T.sortIndex=_e,x(_,T),G||Q||(G=!0,k||(k=!0,de()))),T},s.unstable_shouldYield=se,s.unstable_wrapCallback=function(T){var N=M;return function(){var Y=M;M=N;try{return T.apply(this,arguments)}finally{M=Y}}}})(ys)),ys}var Cd;function Sy(){return Cd||(Cd=1,ms.exports=xy()),ms.exports}var vs={exports:{}},Pe={};/**- */var Cd;function xy(){return Cd||(Cd=1,(function(s){function x(T,N){var w=T.length;T.push(N);e:for(;0<w;){var Te=w-1>>>1,ze=T[Te];if(0<A(ze,N))T[Te]=N,T[w]=ze,w=Te;else break e}}function b(T){return T.length===0?null:T[0]}function o(T){if(T.length===0)return null;var N=T[0],w=T.pop();if(w!==N){T[0]=w;e:for(var Te=0,ze=T.length,m=ze>>>1;Te<m;){var M=2*(Te+1)-1,B=T[M],Q=M+1,P=T[Q];if(0>A(B,w))Q<ze&&0>A(P,B)?(T[Te]=P,T[Q]=w,Te=Q):(T[Te]=B,T[M]=w,Te=M);else if(Q<ze&&0>A(P,w))T[Te]=P,T[Q]=w,Te=Q;else break e}}return N}function A(T,N){var w=T.sortIndex-N.sortIndex;return w!==0?w:T.id-N.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var z=performance;s.unstable_now=function(){return z.now()}}else{var q=Date,H=q.now();s.unstable_now=function(){return q.now()-H}}var _=[],h=[],U=1,j=null,C=3,Y=!1,G=!1,Z=!1,W=!1,ae=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,le=typeof setImmediate<"u"?setImmediate:null;function ne(T){for(var N=b(h);N!==null;){if(N.callback===null)o(h);else if(N.startTime<=T)o(h),N.sortIndex=N.expirationTime,x(_,N);else break;N=b(h)}}function xe(T){if(Z=!1,ne(T),!G)if(b(_)!==null)G=!0,k||(k=!0,de());else{var N=b(h);N!==null&&Ze(xe,N.startTime-T)}}var k=!1,V=-1,Se=5,je=-1;function se(){return W?!0:!(s.unstable_now()-je<Se)}function F(){if(W=!1,k){var T=s.unstable_now();je=T;var N=!0;try{e:{G=!1,Z&&(Z=!1,$(V),V=-1),Y=!0;var w=C;try{t:{for(ne(T),j=b(_);j!==null&&!(j.expirationTime>T&&se());){var Te=j.callback;if(typeof Te=="function"){j.callback=null,C=j.priorityLevel;var ze=Te(j.expirationTime<=T);if(T=s.unstable_now(),typeof ze=="function"){j.callback=ze,ne(T),N=!0;break t}j===b(_)&&o(_),ne(T)}else o(_);j=b(_)}if(j!==null)N=!0;else{var m=b(h);m!==null&&Ze(xe,m.startTime-T),N=!1}}break e}finally{j=null,C=w,Y=!1}N=void 0}}finally{N?de():k=!1}}}var de;if(typeof le=="function")de=function(){le(F)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,Ne=we.port2;we.port1.onmessage=F,de=function(){Ne.postMessage(null)}}else de=function(){ae(F,0)};function Ze(T,N){V=ae(function(){T(s.unstable_now())},N)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(T){T.callback=null},s.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Se=0<T?Math.floor(1e3/T):5},s.unstable_getCurrentPriorityLevel=function(){return C},s.unstable_next=function(T){switch(C){case 1:case 2:case 3:var N=3;break;default:N=C}var w=C;C=N;try{return T()}finally{C=w}},s.unstable_requestPaint=function(){W=!0},s.unstable_runWithPriority=function(T,N){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var w=C;C=T;try{return N()}finally{C=w}},s.unstable_scheduleCallback=function(T,N,w){var Te=s.unstable_now();switch(typeof w=="object"&&w!==null?(w=w.delay,w=typeof w=="number"&&0<w?Te+w:Te):w=Te,T){case 1:var ze=-1;break;case 2:ze=250;break;case 5:ze=1073741823;break;case 4:ze=1e4;break;default:ze=5e3}return ze=w+ze,T={id:U++,callback:N,priorityLevel:T,startTime:w,expirationTime:ze,sortIndex:-1},w>Te?(T.sortIndex=w,x(h,T),b(_)===null&&T===b(h)&&(Z?($(V),V=-1):Z=!0,Ze(xe,w-Te))):(T.sortIndex=ze,x(_,T),G||Y||(G=!0,k||(k=!0,de()))),T},s.unstable_shouldYield=se,s.unstable_wrapCallback=function(T){var N=C;return function(){var w=C;C=N;try{return T.apply(this,arguments)}finally{C=w}}}})(ys)),ys}var Nd;function Sy(){return Nd||(Nd=1,ms.exports=xy()),ms.exports}var vs={exports:{}},Pe={};/**++ */var Cd;function xy(){return Cd||(Cd=1,(function(s){function x(E,N){var w=E.length;E.push(N);e:for(;0<w;){var je=w-1>>>1,_e=E[je];if(0<T(_e,N))E[je]=N,E[w]=_e,w=je;else break e}}function b(E){return E.length===0?null:E[0]}function o(E){if(E.length===0)return null;var N=E[0],w=E.pop();if(w!==N){E[0]=w;e:for(var je=0,_e=E.length,m=_e>>>1;je<m;){var M=2*(je+1)-1,B=E[M],Q=M+1,P=E[Q];if(0>T(B,w))Q<_e&&0>T(P,B)?(E[je]=P,E[Q]=w,je=Q):(E[je]=B,E[M]=w,je=M);else if(Q<_e&&0>T(P,w))E[je]=P,E[Q]=w,je=Q;else break e}}return N}function T(E,N){var w=E.sortIndex-N.sortIndex;return w!==0?w:E.id-N.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;s.unstable_now=function(){return _.now()}}else{var q=Date,H=q.now();s.unstable_now=function(){return q.now()-H}}var z=[],h=[],U=1,S=null,C=3,Y=!1,G=!1,Z=!1,W=!1,ae=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,le=typeof setImmediate<"u"?setImmediate:null;function ne(E){for(var N=b(h);N!==null;){if(N.callback===null)o(h);else if(N.startTime<=E)o(h),N.sortIndex=N.expirationTime,x(z,N);else break;N=b(h)}}function be(E){if(Z=!1,ne(E),!G)if(b(z)!==null)G=!0,k||(k=!0,de());else{var N=b(h);N!==null&&Ze(be,N.startTime-E)}}var k=!1,V=-1,xe=5,Se=-1;function se(){return W?!0:!(s.unstable_now()-Se<xe)}function F(){if(W=!1,k){var E=s.unstable_now();Se=E;var N=!0;try{e:{G=!1,Z&&(Z=!1,$(V),V=-1),Y=!0;var w=C;try{t:{for(ne(E),S=b(z);S!==null&&!(S.expirationTime>E&&se());){var je=S.callback;if(typeof je=="function"){S.callback=null,C=S.priorityLevel;var _e=je(S.expirationTime<=E);if(E=s.unstable_now(),typeof _e=="function"){S.callback=_e,ne(E),N=!0;break t}S===b(z)&&o(z),ne(E)}else o(z);S=b(z)}if(S!==null)N=!0;else{var m=b(h);m!==null&&Ze(be,m.startTime-E),N=!1}}break e}finally{S=null,C=w,Y=!1}N=void 0}}finally{N?de():k=!1}}}var de;if(typeof le=="function")de=function(){le(F)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,Ne=we.port2;we.port1.onmessage=F,de=function(){Ne.postMessage(null)}}else de=function(){ae(F,0)};function Ze(E,N){V=ae(function(){E(s.unstable_now())},N)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(E){E.callback=null},s.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):xe=0<E?Math.floor(1e3/E):5},s.unstable_getCurrentPriorityLevel=function(){return C},s.unstable_next=function(E){switch(C){case 1:case 2:case 3:var N=3;break;default:N=C}var w=C;C=N;try{return E()}finally{C=w}},s.unstable_requestPaint=function(){W=!0},s.unstable_runWithPriority=function(E,N){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var w=C;C=E;try{return N()}finally{C=w}},s.unstable_scheduleCallback=function(E,N,w){var je=s.unstable_now();switch(typeof w=="object"&&w!==null?(w=w.delay,w=typeof w=="number"&&0<w?je+w:je):w=je,E){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=w+_e,E={id:U++,callback:N,priorityLevel:E,startTime:w,expirationTime:_e,sortIndex:-1},w>je?(E.sortIndex=w,x(h,E),b(z)===null&&E===b(h)&&(Z?($(V),V=-1):Z=!0,Ze(be,w-je))):(E.sortIndex=_e,x(z,E),G||Y||(G=!0,k||(k=!0,de()))),E},s.unstable_shouldYield=se,s.unstable_wrapCallback=function(E){var N=C;return function(){var w=C;C=N;try{return E.apply(this,arguments)}finally{C=w}}}})(ys)),ys}var Nd;function Sy(){return Nd||(Nd=1,ms.exports=xy()),ms.exports}var vs={exports:{}},Pe={};/*** @license React* react-dom.production.js*@@@ -30,7 -30,7 +30,7 @@@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var Dd;function jy(){if(Dd)return Pe;Dd=1;var s=xs();function x(_){var d="https://react.dev/errors/"+_;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var R=2;R<arguments.length;R++)d+="&args[]="+encodeURIComponent(arguments[R])}return"Minified React error #"+_+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function b(){}var o={d:{f:b,r:function(){throw Error(x(522))},D:b,C:b,L:b,m:b,X:b,S:b,M:b},p:0,findDOMNode:null},j=Symbol.for("react.portal");function A(_,d,R){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:z==null?null:""+z,children:_,containerInfo:d,implementation:R}}var q=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function H(_,d){if(_==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Pe.createPortal=function(_,d){var R=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(x(299));return A(_,d,null,R)},Pe.flushSync=function(_){var d=q.T,R=o.p;try{if(q.T=null,o.p=2,_)return _()}finally{q.T=d,o.p=R,o.d.f()}},Pe.preconnect=function(_,d){typeof _=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,o.d.C(_,d))},Pe.prefetchDNS=function(_){typeof _=="string"&&o.d.D(_)},Pe.preinit=function(_,d){if(typeof _=="string"&&d&&typeof d.as=="string"){var R=d.as,z=H(R,d.crossOrigin),M=typeof d.integrity=="string"?d.integrity:void 0,Q=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;R==="style"?o.d.S(_,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:z,integrity:M,fetchPriority:Q}):R==="script"&&o.d.X(_,{crossOrigin:z,integrity:M,fetchPriority:Q,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Pe.preinitModule=function(_,d){if(typeof _=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var R=H(d.as,d.crossOrigin);o.d.M(_,{crossOrigin:R,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&o.d.M(_)},Pe.preload=function(_,d){if(typeof _=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var R=d.as,z=H(R,d.crossOrigin);o.d.L(_,R,{crossOrigin:z,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Pe.preloadModule=function(_,d){if(typeof _=="string")if(d){var R=H(d.as,d.crossOrigin);o.d.m(_,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:R,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else o.d.m(_)},Pe.requestFormReset=function(_){o.d.r(_)},Pe.unstable_batchedUpdates=function(_,d){return _(d)},Pe.useFormState=function(_,d,R){return q.H.useFormState(_,d,R)},Pe.useFormStatus=function(){return q.H.useHostTransitionStatus()},Pe.version="19.2.5",Pe}var Md;function Ty(){if(Md)return vs.exports;Md=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(x){console.error(x)}}return s(),vs.exports=jy(),vs.exports}/**- */var Dd;function jy(){if(Dd)return Pe;Dd=1;var s=xs();function x(_){var h="https://react.dev/errors/"+_;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var U=2;U<arguments.length;U++)h+="&args[]="+encodeURIComponent(arguments[U])}return"Minified React error #"+_+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function b(){}var o={d:{f:b,r:function(){throw Error(x(522))},D:b,C:b,L:b,m:b,X:b,S:b,M:b},p:0,findDOMNode:null},A=Symbol.for("react.portal");function z(_,h,U){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:j==null?null:""+j,children:_,containerInfo:h,implementation:U}}var q=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function H(_,h){if(_==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Pe.createPortal=function(_,h){var U=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(x(299));return z(_,h,null,U)},Pe.flushSync=function(_){var h=q.T,U=o.p;try{if(q.T=null,o.p=2,_)return _()}finally{q.T=h,o.p=U,o.d.f()}},Pe.preconnect=function(_,h){typeof _=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(_,h))},Pe.prefetchDNS=function(_){typeof _=="string"&&o.d.D(_)},Pe.preinit=function(_,h){if(typeof _=="string"&&h&&typeof h.as=="string"){var U=h.as,j=H(U,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,Y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;U==="style"?o.d.S(_,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:j,integrity:C,fetchPriority:Y}):U==="script"&&o.d.X(_,{crossOrigin:j,integrity:C,fetchPriority:Y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Pe.preinitModule=function(_,h){if(typeof _=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var U=H(h.as,h.crossOrigin);o.d.M(_,{crossOrigin:U,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(_)},Pe.preload=function(_,h){if(typeof _=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var U=h.as,j=H(U,h.crossOrigin);o.d.L(_,U,{crossOrigin:j,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Pe.preloadModule=function(_,h){if(typeof _=="string")if(h){var U=H(h.as,h.crossOrigin);o.d.m(_,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:U,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(_)},Pe.requestFormReset=function(_){o.d.r(_)},Pe.unstable_batchedUpdates=function(_,h){return _(h)},Pe.useFormState=function(_,h,U){return q.H.useFormState(_,h,U)},Pe.useFormStatus=function(){return q.H.useHostTransitionStatus()},Pe.version="19.2.5",Pe}var Md;function Ty(){if(Md)return vs.exports;Md=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(x){console.error(x)}}return s(),vs.exports=jy(),vs.exports}/**++ */var Dd;function jy(){if(Dd)return Pe;Dd=1;var s=xs();function x(z){var h="https://react.dev/errors/"+z;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var U=2;U<arguments.length;U++)h+="&args[]="+encodeURIComponent(arguments[U])}return"Minified React error #"+z+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function b(){}var o={d:{f:b,r:function(){throw Error(x(522))},D:b,C:b,L:b,m:b,X:b,S:b,M:b},p:0,findDOMNode:null},T=Symbol.for("react.portal");function _(z,h,U){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:S==null?null:""+S,children:z,containerInfo:h,implementation:U}}var q=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function H(z,h){if(z==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Pe.createPortal=function(z,h){var U=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(x(299));return _(z,h,null,U)},Pe.flushSync=function(z){var h=q.T,U=o.p;try{if(q.T=null,o.p=2,z)return z()}finally{q.T=h,o.p=U,o.d.f()}},Pe.preconnect=function(z,h){typeof z=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(z,h))},Pe.prefetchDNS=function(z){typeof z=="string"&&o.d.D(z)},Pe.preinit=function(z,h){if(typeof z=="string"&&h&&typeof h.as=="string"){var U=h.as,S=H(U,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,Y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;U==="style"?o.d.S(z,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:S,integrity:C,fetchPriority:Y}):U==="script"&&o.d.X(z,{crossOrigin:S,integrity:C,fetchPriority:Y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Pe.preinitModule=function(z,h){if(typeof z=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var U=H(h.as,h.crossOrigin);o.d.M(z,{crossOrigin:U,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(z)},Pe.preload=function(z,h){if(typeof z=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var U=h.as,S=H(U,h.crossOrigin);o.d.L(z,U,{crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Pe.preloadModule=function(z,h){if(typeof z=="string")if(h){var U=H(h.as,h.crossOrigin);o.d.m(z,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:U,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(z)},Pe.requestFormReset=function(z){o.d.r(z)},Pe.unstable_batchedUpdates=function(z,h){return z(h)},Pe.useFormState=function(z,h,U){return q.H.useFormState(z,h,U)},Pe.useFormStatus=function(){return q.H.useHostTransitionStatus()},Pe.version="19.2.5",Pe}var Md;function Ty(){if(Md)return vs.exports;Md=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(x){console.error(x)}}return s(),vs.exports=jy(),vs.exports}/*** @license React* react-dom-client.production.js*@@@ -38,17 -38,17 +38,17 @@@** This source code is licensed under the MIT license found in the* LICENSE file in the root directory of this source tree.- */var Rd;function Ey(){if(Rd)return En;Rd=1;var s=Sy(),x=xs(),b=Ty();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function j(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function A(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function q(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function H(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _(e){if(A(e)!==e)throw Error(o(188))}function d(e){var t=e.alternate;if(!t){if(t=A(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,a=t;;){var n=l.return;if(n===null)break;var i=n.alternate;if(i===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===l)return _(n),e;if(i===a)return _(n),t;i=i.sibling}throw Error(o(188))}if(l.return!==a.return)l=n,a=i;else{for(var c=!1,f=n.child;f;){if(f===l){c=!0,l=n,a=i;break}if(f===a){c=!0,a=n,l=i;break}f=f.sibling}if(!c){for(f=i.child;f;){if(f===l){c=!0,l=i,a=n;break}if(f===a){c=!0,a=i,l=n;break}f=f.sibling}if(!c)throw Error(o(189))}}if(l.alternate!==a)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function R(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=R(e),t!==null)return t;e=e.sibling}return null}var z=Object.assign,M=Symbol.for("react.element"),Q=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),le=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),be=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),Se=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function de(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Symbol.for("react.client.reference");function Ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case ae:return"Profiler";case W:return"StrictMode";case be:return"Suspense";case k:return"SuspenseList";case Se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case G:return"Portal";case le:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:Ce(e.type)||"Memo";case xe:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var Ze=Array.isArray,T=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=b.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},je=[],_e=-1;function m(e){return{current:e}}function D(e){0>_e||(e.current=je[_e],je[_e]=null,_e--)}function B(e,t){_e++,je[_e]=e.current,e.current=t}var X=m(null),P=m(null),ie=m(null),ve=m(null);function et(e,t){switch(B(ie,t),B(P,e),B(X,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kr(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kr(t),e=Wr(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(X),B(X,e)}function He(){D(X),D(P),D(ie)}function Na(e){e.memoizedState!==null&&B(ve,e);var t=X.current,l=Wr(t,e.type);t!==l&&(B(P,e),B(X,l))}function zn(e){P.current===e&&(D(X),D(P)),ve.current===e&&(D(ve),bn._currentValue=Y)}var Ji,js;function Al(e){if(Ji===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Ji=t&&t[1]||"",js=-1<l.stack.indexOf(`- */var Rd;function Ey(){if(Rd)return En;Rd=1;var s=Sy(),x=xs(),b=Ty();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function A(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function z(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function q(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function H(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _(e){if(z(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=z(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,a=t;;){var n=l.return;if(n===null)break;var i=n.alternate;if(i===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===l)return _(n),e;if(i===a)return _(n),t;i=i.sibling}throw Error(o(188))}if(l.return!==a.return)l=n,a=i;else{for(var c=!1,f=n.child;f;){if(f===l){c=!0,l=n,a=i;break}if(f===a){c=!0,a=n,l=i;break}f=f.sibling}if(!c){for(f=i.child;f;){if(f===l){c=!0,l=i,a=n;break}if(f===a){c=!0,a=i,l=n;break}f=f.sibling}if(!c)throw Error(o(189))}}if(l.alternate!==a)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function U(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=U(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,C=Symbol.for("react.element"),Y=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),le=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),je=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function de(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var we=Symbol.for("react.client.reference");function Ne(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===we?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case ae:return"Profiler";case W:return"StrictMode";case xe:return"Suspense";case k:return"SuspenseList";case je:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case G:return"Portal";case le:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:Ne(e.type)||"Memo";case Se:t=e._payload,e=e._init;try{return Ne(e(t))}catch{}}return null}var Ze=Array.isArray,T=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=b.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,w={pending:!1,data:null,method:null,action:null},Te=[],ze=-1;function m(e){return{current:e}}function M(e){0>ze||(e.current=Te[ze],Te[ze]=null,ze--)}function B(e,t){ze++,Te[ze]=e.current,e.current=t}var Q=m(null),P=m(null),ie=m(null),ve=m(null);function et(e,t){switch(B(ie,t),B(P,e),B(Q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kr(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kr(t),e=Wr(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}M(Q),B(Q,e)}function He(){M(Q),M(P),M(ie)}function Ca(e){e.memoizedState!==null&&B(ve,e);var t=Q.current,l=Wr(t,e.type);t!==l&&(B(P,e),B(Q,l))}function zn(e){P.current===e&&(M(Q),M(P)),ve.current===e&&(M(ve),bn._currentValue=w)}var Ji,js;function Al(e){if(Ji===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Ji=t&&t[1]||"",js=-1<l.stack.indexOf(`++ */var Rd;function Ey(){if(Rd)return En;Rd=1;var s=Sy(),x=xs(),b=Ty();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function T(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function q(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function H(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function z(e){if(_(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=_(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,a=t;;){var n=l.return;if(n===null)break;var i=n.alternate;if(i===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===l)return z(n),e;if(i===a)return z(n),t;i=i.sibling}throw Error(o(188))}if(l.return!==a.return)l=n,a=i;else{for(var c=!1,f=n.child;f;){if(f===l){c=!0,l=n,a=i;break}if(f===a){c=!0,a=n,l=i;break}f=f.sibling}if(!c){for(f=i.child;f;){if(f===l){c=!0,l=i,a=n;break}if(f===a){c=!0,a=i,l=n;break}f=f.sibling}if(!c)throw Error(o(189))}}if(l.alternate!==a)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function U(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=U(e),t!==null)return t;e=e.sibling}return null}var S=Object.assign,C=Symbol.for("react.element"),Y=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),le=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),be=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),Se=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function de(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var we=Symbol.for("react.client.reference");function Ne(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===we?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case ae:return"Profiler";case W:return"StrictMode";case be:return"Suspense";case k:return"SuspenseList";case Se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case G:return"Portal";case le:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:Ne(e.type)||"Memo";case xe:t=e._payload,e=e._init;try{return Ne(e(t))}catch{}}return null}var Ze=Array.isArray,E=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=b.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,w={pending:!1,data:null,method:null,action:null},je=[],_e=-1;function m(e){return{current:e}}function M(e){0>_e||(e.current=je[_e],je[_e]=null,_e--)}function B(e,t){_e++,je[_e]=e.current,e.current=t}var Q=m(null),P=m(null),ie=m(null),ve=m(null);function et(e,t){switch(B(ie,t),B(P,e),B(Q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kr(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kr(t),e=Wr(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}M(Q),B(Q,e)}function He(){M(Q),M(P),M(ie)}function Ca(e){e.memoizedState!==null&&B(ve,e);var t=Q.current,l=Wr(t,e.type);t!==l&&(B(P,e),B(Q,l))}function zn(e){P.current===e&&(M(Q),M(P)),ve.current===e&&(M(ve),bn._currentValue=w)}var Ji,js;function Al(e){if(Ji===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Ji=t&&t[1]||"",js=-1<l.stack.indexOf(`at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`- `+Ji+e+js}var ki=!1;function Wi(e,t){if(!e||ki)return"";ki=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(S){var p=S}Reflect.construct(e,[],C)}else{try{C.call()}catch(S){p=S}e.call(C.prototype)}}else{try{throw Error()}catch(S){p=S}(C=e())&&typeof C.catch=="function"&&C.catch(function(){})}}catch(S){if(S&&p&&typeof S.stack=="string")return[S.stack,p.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=a.DetermineComponentFrameRoot(),c=i[0],f=i[1];if(c&&f){var r=c.split(`-`+Ji+e+js}var ki=!1;function Wi(e,t){if(!e||ki)return"";ki=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var D=function(){throw Error()};if(Object.defineProperty(D.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(D,[])}catch(S){var p=S}Reflect.construct(e,[],D)}else{try{D.call()}catch(S){p=S}e.call(D.prototype)}}else{try{throw Error()}catch(S){p=S}(D=e())&&typeof D.catch=="function"&&D.catch(function(){})}}catch(S){if(S&&p&&typeof S.stack=="string")return[S.stack,p.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=a.DetermineComponentFrameRoot(),c=i[0],f=i[1];if(c&&f){var r=c.split(`++`+Ji+e+js}var ki=!1;function Wi(e,t){if(!e||ki)return"";ki=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var D=function(){throw Error()};if(Object.defineProperty(D.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(D,[])}catch(j){var p=j}Reflect.construct(e,[],D)}else{try{D.call()}catch(j){p=j}e.call(D.prototype)}}else{try{throw Error()}catch(j){p=j}(D=e())&&typeof D.catch=="function"&&D.catch(function(){})}}catch(j){if(j&&p&&typeof j.stack=="string")return[j.stack,p.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=a.DetermineComponentFrameRoot(),c=i[0],f=i[1];if(c&&f){var r=c.split(``),g=f.split(`--`);for(n=a=0;a<r.length&&!r[a].includes("DetermineComponentFrameRoot");)a++;for(;n<g.length&&!g[n].includes("DetermineComponentFrameRoot");)n++;if(a===r.length||n===g.length)for(a=r.length-1,n=g.length-1;1<=a&&0<=n&&r[a]!==g[n];)n--;for(;1<=a&&0<=n;a--,n--)if(r[a]!==g[n]){if(a!==1||n!==1)do if(a--,n--,0>n||r[a]!==g[n]){var E=`--`+r[a].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),E}while(1<=a&&0<=n);break}}}finally{ki=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Al(l):""}function kd(e,t){switch(e.tag){case 26:case 27:case 5:return Al(e.type);case 16:return Al("Lazy");case 13:return e.child!==t&&t!==null?Al("Suspense Fallback"):Al("Suspense");case 19:return Al("SuspenseList");case 0:case 15:return Wi(e.type,!1);case 11:return Wi(e.type.render,!1);case 1:return Wi(e.type,!0);case 31:return Al("Activity");default:return""}}function Ts(e){try{var t="",l=null;do t+=kd(e,l),l=e,e=e.return;while(e);return t}catch(a){return`++`);for(n=a=0;a<r.length&&!r[a].includes("DetermineComponentFrameRoot");)a++;for(;n<g.length&&!g[n].includes("DetermineComponentFrameRoot");)n++;if(a===r.length||n===g.length)for(a=r.length-1,n=g.length-1;1<=a&&0<=n&&r[a]!==g[n];)n--;for(;1<=a&&0<=n;a--,n--)if(r[a]!==g[n]){if(a!==1||n!==1)do if(a--,n--,0>n||r[a]!==g[n]){var A=`++`+r[a].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),A}while(1<=a&&0<=n);break}}}finally{ki=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Al(l):""}function kd(e,t){switch(e.tag){case 26:case 27:case 5:return Al(e.type);case 16:return Al("Lazy");case 13:return e.child!==t&&t!==null?Al("Suspense Fallback"):Al("Suspense");case 19:return Al("SuspenseList");case 0:case 15:return Wi(e.type,!1);case 11:return Wi(e.type.render,!1);case 1:return Wi(e.type,!0);case 31:return Al("Activity");default:return""}}function Ts(e){try{var t="",l=null;do t+=kd(e,l),l=e,e=e.return;while(e);return t}catch(a){return`Error generating stack: `+a.message+`- `+a.stack}}var $i=Object.prototype.hasOwnProperty,Fi=s.unstable_scheduleCallback,Ii=s.unstable_cancelCallback,Wd=s.unstable_shouldYield,$d=s.unstable_requestPaint,ft=s.unstable_now,Fd=s.unstable_getCurrentPriorityLevel,Es=s.unstable_ImmediatePriority,As=s.unstable_UserBlockingPriority,On=s.unstable_NormalPriority,Id=s.unstable_LowPriority,_s=s.unstable_IdlePriority,Pd=s.log,eh=s.unstable_setDisableYieldValue,Ca=null,ot=null;function el(e){if(typeof Pd=="function"&&eh(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(Ca,e)}catch{}}var rt=Math.clz32?Math.clz32:ah,th=Math.log,lh=Math.LN2;function ah(e){return e>>>=0,e===0?32:31-(th(e)/lh|0)|0}var Nn=256,Cn=262144,Dn=4194304;function _l(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Mn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,i=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~i,a!==0?n=_l(a):(c&=f,c!==0?n=_l(c):l||(l=f&~e,l!==0&&(n=_l(l))))):(f=a&~i,f!==0?n=_l(f):c!==0?n=_l(c):l||(l=a&~e,l!==0&&(n=_l(l)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:n}function Da(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nh(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zs(){var e=Dn;return Dn<<=1,(Dn&62914560)===0&&(Dn=4194304),e}function Pi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ma(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ih(e,t,l,a,n,i){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var f=e.entanglements,r=e.expirationTimes,g=e.hiddenUpdates;for(l=c&~l;0<l;){var E=31-rt(l),C=1<<E;f[E]=0,r[E]=-1;var p=g[E];if(p!==null)for(g[E]=null,E=0;E<p.length;E++){var S=p[E];S!==null&&(S.lane&=-536870913)}l&=~C}a!==0&&Os(e,a,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(c&~t))}function Os(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-rt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Ns(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-rt(l),n=1<<a;n&t|e[a]&t&&(e[a]|=t),l&=~n}}function Cs(e,t){var l=t&-t;return l=(l&42)!==0?1:eu(l),(l&(e.suspendedLanes|t))!==0?0:l}function eu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ds(){var e=N.p;return e!==0?e:(e=window.event,e===void 0?32:pd(e.type))}function Ms(e,t){var l=N.p;try{return N.p=e,t()}finally{N.p=l}}var tl=Math.random().toString(36).slice(2),ke="__reactFiber$"+tl,lt="__reactProps$"+tl,Zl="__reactContainer$"+tl,lu="__reactEvents$"+tl,uh="__reactListeners$"+tl,ch="__reactHandles$"+tl,Rs="__reactResources$"+tl,Ra="__reactMarker$"+tl;function au(e){delete e[ke],delete e[lt],delete e[lu],delete e[uh],delete e[ch]}function Vl(e){var t=e[ke];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Zl]||l[ke]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=ld(e);e!==null;){if(l=e[ke])return l;e=ld(e)}return t}e=l,l=e.parentNode}return null}function Kl(e){if(e=e[ke]||e[Zl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ua(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Jl(e){var t=e[Rs];return t||(t=e[Rs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ke(e){e[Ra]=!0}var Us=new Set,qs={};function zl(e,t){kl(e,t),kl(e+"Capture",t)}function kl(e,t){for(qs[e]=t,e=0;e<t.length;e++)Us.add(t[e])}var sh=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Hs={},Bs={};function fh(e){return $i.call(Bs,e)?!0:$i.call(Hs,e)?!1:sh.test(e)?Bs[e]=!0:(Hs[e]=!0,!1)}function Rn(e,t,l){if(fh(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Un(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Ht(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function bt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ys(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oh(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var n=a.get,i=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(c){l=""+c,i.call(this,c)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nu(e){if(!e._valueTracker){var t=Ys(e)?"checked":"value";e._valueTracker=oh(e,t,""+e[t])}}function Gs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=Ys(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function qn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var rh=/[\n"\\]/g;function xt(e){return e.replace(rh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function iu(e,t,l,a,n,i,c,f){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+bt(t)):e.value!==""+bt(t)&&(e.value=""+bt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?uu(e,c,bt(t)):l!=null?uu(e,c,bt(l)):a!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+bt(f):e.removeAttribute("name")}function ws(e,t,l,a,n,i,c,f){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){nu(e);return}l=l!=null?""+bt(l):"",t=t!=null?""+bt(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),nu(e)}function uu(e,t,l){t==="number"&&qn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Wl(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n<l.length;n++)t["$"+l[n]]=!0;for(l=0;l<e.length;l++)n=t.hasOwnProperty("$"+e[l].value),e[l].selected!==n&&(e[l].selected=n),n&&a&&(e[l].defaultSelected=!0)}else{for(l=""+bt(l),t=null,n=0;n<e.length;n++){if(e[n].value===l){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Xs(e,t,l){if(t!=null&&(t=""+bt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+bt(l):""}function Qs(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(o(92));if(Ze(a)){if(1<a.length)throw Error(o(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=bt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),nu(e)}function $l(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var dh=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ls(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||dh.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Zs(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&l[n]!==a&&Ls(e,n,a)}else for(var i in t)t.hasOwnProperty(i)&&Ls(e,i,t[i])}function cu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var hh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),mh=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hn(e){return mh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Bt(){}var su=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fl=null,Il=null;function Vs(e){var t=Kl(e);if(t&&(e=t.stateNode)){var l=e[lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(iu(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+xt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var n=a[lt]||null;if(!n)throw Error(o(90));iu(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&Gs(a)}break e;case"textarea":Xs(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Wl(e,!!l.multiple,t,!1)}}}var ou=!1;function Ks(e,t,l){if(ou)return e(t,l);ou=!0;try{var a=e(t);return a}finally{if(ou=!1,(Fl!==null||Il!==null)&&(Ti(),Fl&&(t=Fl,e=Il,Il=Fl=null,Vs(t),e)))for(t=0;t<e.length;t++)Vs(e[t])}}function qa(e,t){var l=e.stateNode;if(l===null)return null;var a=l[lt]||null;if(a===null)return null;l=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(o(231,t,typeof l));return l}var Yt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ru=!1;if(Yt)try{var Ha={};Object.defineProperty(Ha,"passive",{get:function(){ru=!0}}),window.addEventListener("test",Ha,Ha),window.removeEventListener("test",Ha,Ha)}catch{ru=!1}var ll=null,du=null,Bn=null;function Js(){if(Bn)return Bn;var e,t=du,l=t.length,a,n="value"in ll?ll.value:ll.textContent,i=n.length;for(e=0;e<l&&t[e]===n[e];e++);var c=l-e;for(a=1;a<=c&&t[l-a]===n[i-a];a++);return Bn=n.slice(e,1<a?1-a:void 0)}function Yn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Gn(){return!0}function ks(){return!1}function at(e){function t(l,a,n,i,c){this._reactName=l,this._targetInst=n,this.type=a,this.nativeEvent=i,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(i):i[f]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Gn:ks,this.isPropagationStopped=ks,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Gn)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Gn)},persist:function(){},isPersistent:Gn}),t}var Ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=at(Ol),Ba=z({},Ol,{view:0,detail:0}),yh=at(Ba),hu,mu,Ya,Xn=z({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ya&&(Ya&&e.type==="mousemove"?(hu=e.screenX-Ya.screenX,mu=e.screenY-Ya.screenY):mu=hu=0,Ya=e),hu)},movementY:function(e){return"movementY"in e?e.movementY:mu}}),Ws=at(Xn),vh=z({},Xn,{dataTransfer:0}),gh=at(vh),ph=z({},Ba,{relatedTarget:0}),yu=at(ph),bh=z({},Ol,{animationName:0,elapsedTime:0,pseudoElement:0}),xh=at(bh),Sh=z({},Ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jh=at(Sh),Th=z({},Ol,{data:0}),$s=at(Th),Eh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ah={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_h={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_h[e])?!!t[e]:!1}function vu(){return zh}var Oh=z({},Ba,{key:function(e){if(e.key){var t=Eh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ah[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(e){return e.type==="keypress"?Yn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Nh=at(Oh),Ch=z({},Xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fs=at(Ch),Dh=z({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),Mh=at(Dh),Rh=z({},Ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uh=at(Rh),qh=z({},Xn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Hh=at(qh),Bh=z({},Ol,{newState:0,oldState:0}),Yh=at(Bh),Gh=[9,13,27,32],gu=Yt&&"CompositionEvent"in window,Ga=null;Yt&&"documentMode"in document&&(Ga=document.documentMode);var wh=Yt&&"TextEvent"in window&&!Ga,Is=Yt&&(!gu||Ga&&8<Ga&&11>=Ga),Ps=" ",ef=!1;function tf(e,t){switch(e){case"keyup":return Gh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pl=!1;function Xh(e,t){switch(e){case"compositionend":return lf(t);case"keypress":return t.which!==32?null:(ef=!0,Ps);case"textInput":return e=t.data,e===Ps&&ef?null:e;default:return null}}function Qh(e,t){if(Pl)return e==="compositionend"||!gu&&tf(e,t)?(e=Js(),Bn=du=ll=null,Pl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Is&&t.locale!=="ko"?null:t.data;default:return null}}var Lh={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function af(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lh[e.type]:t==="textarea"}function nf(e,t,l,a){Fl?Il?Il.push(a):Il=[a]:Fl=a,t=Ci(t,"onChange"),0<t.length&&(l=new wn("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var wa=null,Xa=null;function Zh(e){Qr(e,0)}function Qn(e){var t=Ua(e);if(Gs(t))return e}function uf(e,t){if(e==="change")return t}var cf=!1;if(Yt){var pu;if(Yt){var bu="oninput"in document;if(!bu){var sf=document.createElement("div");sf.setAttribute("oninput","return;"),bu=typeof sf.oninput=="function"}pu=bu}else pu=!1;cf=pu&&(!document.documentMode||9<document.documentMode)}function ff(){wa&&(wa.detachEvent("onpropertychange",of),Xa=wa=null)}function of(e){if(e.propertyName==="value"&&Qn(Xa)){var t=[];nf(t,Xa,e,fu(e)),Ks(Zh,t)}}function Vh(e,t,l){e==="focusin"?(ff(),wa=t,Xa=l,wa.attachEvent("onpropertychange",of)):e==="focusout"&&ff()}function Kh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qn(Xa)}function Jh(e,t){if(e==="click")return Qn(t)}function kh(e,t){if(e==="input"||e==="change")return Qn(t)}function Wh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dt=typeof Object.is=="function"?Object.is:Wh;function Qa(e,t){if(dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var n=l[a];if(!$i.call(t,n)||!dt(e[n],t[n]))return!1}return!0}function rf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function df(e,t){var l=rf(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=rf(l)}}function hf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=qn(e.document)}return t}function xu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var $h=Yt&&"documentMode"in document&&11>=document.documentMode,ea=null,Su=null,La=null,ju=!1;function yf(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ju||ea==null||ea!==qn(a)||(a=ea,"selectionStart"in a&&xu(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),La&&Qa(La,a)||(La=a,a=Ci(Su,"onSelect"),0<a.length&&(t=new wn("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ea)))}function Nl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ta={animationend:Nl("Animation","AnimationEnd"),animationiteration:Nl("Animation","AnimationIteration"),animationstart:Nl("Animation","AnimationStart"),transitionrun:Nl("Transition","TransitionRun"),transitionstart:Nl("Transition","TransitionStart"),transitioncancel:Nl("Transition","TransitionCancel"),transitionend:Nl("Transition","TransitionEnd")},Tu={},vf={};Yt&&(vf=document.createElement("div").style,"AnimationEvent"in window||(delete ta.animationend.animation,delete ta.animationiteration.animation,delete ta.animationstart.animation),"TransitionEvent"in window||delete ta.transitionend.transition);function Cl(e){if(Tu[e])return Tu[e];if(!ta[e])return e;var t=ta[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in vf)return Tu[e]=t[l];return e}var gf=Cl("animationend"),pf=Cl("animationiteration"),bf=Cl("animationstart"),Fh=Cl("transitionrun"),Ih=Cl("transitionstart"),Ph=Cl("transitioncancel"),xf=Cl("transitionend"),Sf=new Map,Eu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Eu.push("scrollEnd");function Nt(e,t){Sf.set(e,t),zl(t,[e])}var Ln=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},St=[],la=0,Au=0;function Zn(){for(var e=la,t=Au=la=0;t<e;){var l=St[t];St[t++]=null;var a=St[t];St[t++]=null;var n=St[t];St[t++]=null;var i=St[t];if(St[t++]=null,a!==null&&n!==null){var c=a.pending;c===null?n.next=n:(n.next=c.next,c.next=n),a.pending=n}i!==0&&jf(l,n,i)}}function Vn(e,t,l,a){St[la++]=e,St[la++]=t,St[la++]=l,St[la++]=a,Au|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function _u(e,t,l,a){return Vn(e,t,l,a),Kn(e)}function Dl(e,t){return Vn(e,null,null,t),Kn(e)}function jf(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var n=!1,i=e.return;i!==null;)i.childLanes|=l,a=i.alternate,a!==null&&(a.childLanes|=l),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-rt(l),e=i.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=l|536870912),i):null}function Kn(e){if(50<dn)throw dn=0,qc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var aa={};function em(e,t,l,a){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ht(e,t,l,a){return new em(e,t,l,a)}function zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gt(e,t){var l=e.alternate;return l===null?(l=ht(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Tf(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Jn(e,t,l,a,n,i){var c=0;if(a=e,typeof e=="function")zu(e)&&(c=1);else if(typeof e=="string")c=iy(e,l,X.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Se:return e=ht(31,l,t,n),e.elementType=Se,e.lanes=i,e;case Z:return Ml(l.children,n,i,t);case W:c=8,n|=24;break;case ae:return e=ht(12,l,t,n|2),e.elementType=ae,e.lanes=i,e;case be:return e=ht(13,l,t,n),e.elementType=be,e.lanes=i,e;case k:return e=ht(19,l,t,n),e.elementType=k,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:c=10;break e;case $:c=9;break e;case ne:c=11;break e;case V:c=14;break e;case xe:c=16,a=null;break e}c=29,l=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=ht(c,l,t,n),t.elementType=e,t.type=a,t.lanes=i,t}function Ml(e,t,l,a){return e=ht(7,e,a,t),e.lanes=l,e}function Ou(e,t,l){return e=ht(6,e,null,t),e.lanes=l,e}function Ef(e){var t=ht(18,null,null,0);return t.stateNode=e,t}function Nu(e,t,l){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Af=new WeakMap;function jt(e,t){if(typeof e=="object"&&e!==null){var l=Af.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Ts(t)},Af.set(e,t),t)}return{value:e,source:t,stack:Ts(t)}}var na=[],ia=0,kn=null,Za=0,Tt=[],Et=0,al=null,Mt=1,Rt="";function wt(e,t){na[ia++]=Za,na[ia++]=kn,kn=e,Za=t}function _f(e,t,l){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,al=e;var a=Mt;e=Rt;var n=32-rt(a)-1;a&=~(1<<n),l+=1;var i=32-rt(t)+n;if(30<i){var c=n-n%5;i=(a&(1<<c)-1).toString(32),a>>=c,n-=c,Mt=1<<32-rt(t)+n|l<<n|a,Rt=i+e}else Mt=1<<i|l<<n|a,Rt=e}function Cu(e){e.return!==null&&(wt(e,1),_f(e,1,0))}function Du(e){for(;e===kn;)kn=na[--ia],na[ia]=null,Za=na[--ia],na[ia]=null;for(;e===al;)al=Tt[--Et],Tt[Et]=null,Rt=Tt[--Et],Tt[Et]=null,Mt=Tt[--Et],Tt[Et]=null}function zf(e,t){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,Mt=t.id,Rt=t.overflow,al=e}var We=null,De=null,re=!1,nl=null,At=!1,Mu=Error(o(519));function il(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Va(jt(t,e)),Mu}function Of(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[ke]=e,t[lt]=a,l){case"dialog":ce("cancel",t),ce("close",t);break;case"iframe":case"object":case"embed":ce("load",t);break;case"video":case"audio":for(l=0;l<mn.length;l++)ce(mn[l],t);break;case"source":ce("error",t);break;case"img":case"image":case"link":ce("error",t),ce("load",t);break;case"details":ce("toggle",t);break;case"input":ce("invalid",t),ws(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ce("invalid",t);break;case"textarea":ce("invalid",t),Qs(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||Kr(t.textContent,l)?(a.popover!=null&&(ce("beforetoggle",t),ce("toggle",t)),a.onScroll!=null&&ce("scroll",t),a.onScrollEnd!=null&&ce("scrollend",t),a.onClick!=null&&(t.onclick=Bt),t=!0):t=!1,t||il(e,!0)}function Nf(e){for(We=e.return;We;)switch(We.tag){case 5:case 31:case 13:At=!1;return;case 27:case 3:At=!0;return;default:We=We.return}}function ua(e){if(e!==We)return!1;if(!re)return Nf(e),re=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||$c(e.type,e.memoizedProps)),l=!l),l&&De&&il(e),Nf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else t===27?(t=De,bl(e.type)?(e=ts,ts=null,De=e):De=t):De=We?zt(e.stateNode.nextSibling):null;return!0}function Rl(){De=We=null,re=!1}function Ru(){var e=nl;return e!==null&&(ct===null?ct=e:ct.push.apply(ct,e),nl=null),e}function Va(e){nl===null?nl=[e]:nl.push(e)}var Uu=m(null),Ul=null,Xt=null;function ul(e,t,l){B(Uu,t._currentValue),t._currentValue=l}function Qt(e){e._currentValue=Uu.current,D(Uu)}function qu(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Hu(e,t,l,a){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var c=n.child;i=i.firstContext;e:for(;i!==null;){var f=i;i=n;for(var r=0;r<t.length;r++)if(f.context===t[r]){i.lanes|=l,f=i.alternate,f!==null&&(f.lanes|=l),qu(i.return,l,e),a||(c=null);break e}i=f.next}}else if(n.tag===18){if(c=n.return,c===null)throw Error(o(341));c.lanes|=l,i=c.alternate,i!==null&&(i.lanes|=l),qu(c,l,e),c=null}else c=n.child;if(c!==null)c.return=n;else for(c=n;c!==null;){if(c===e){c=null;break}if(n=c.sibling,n!==null){n.return=c.return,c=n;break}c=c.return}n=c}}function ca(e,t,l,a){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var c=n.alternate;if(c===null)throw Error(o(387));if(c=c.memoizedProps,c!==null){var f=n.type;dt(n.pendingProps.value,c.value)||(e!==null?e.push(f):e=[f])}}else if(n===ve.current){if(c=n.alternate,c===null)throw Error(o(387));c.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(bn):e=[bn])}n=n.return}e!==null&&Hu(t,e,l,a),t.flags|=262144}function Wn(e){for(e=e.firstContext;e!==null;){if(!dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ql(e){Ul=e,Xt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $e(e){return Cf(Ul,e)}function $n(e,t){return Ul===null&&ql(e),Cf(e,t)}function Cf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Xt===null){if(e===null)throw Error(o(308));Xt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xt=Xt.next=t;return l}var tm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},lm=s.unstable_scheduleCallback,am=s.unstable_NormalPriority,we={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bu(){return{controller:new tm,data:new Map,refCount:0}}function Ka(e){e.refCount--,e.refCount===0&&lm(am,function(){e.controller.abort()})}var Ja=null,Yu=0,sa=0,fa=null;function nm(e,t){if(Ja===null){var l=Ja=[];Yu=0,sa=Xc(),fa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return Yu++,t.then(Df,Df),t}function Df(){if(--Yu===0&&Ja!==null){fa!==null&&(fa.status="fulfilled");var e=Ja;Ja=null,sa=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function im(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(n){l.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<l.length;n++)(0,l[n])(t)},function(n){for(a.status="rejected",a.reason=n,n=0;n<l.length;n++)(0,l[n])(void 0)}),a}var Mf=T.S;T.S=function(e,t){vr=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&nm(e,t),Mf!==null&&Mf(e,t)};var Hl=m(null);function Gu(){var e=Hl.current;return e!==null?e:ze.pooledCache}function Fn(e,t){t===null?B(Hl,Hl.current):B(Hl,t.pool)}function Rf(){var e=Gu();return e===null?null:{parent:we._currentValue,pool:e}}var oa=Error(o(460)),wu=Error(o(474)),In=Error(o(542)),Pn={then:function(){}};function Uf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Bt,Bt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e;default:if(typeof t.status=="string")t.then(Bt,Bt);else{if(e=ze,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e}throw Yl=t,oa}}function Bl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Yl=l,oa):l}}var Yl=null;function Hf(){if(Yl===null)throw Error(o(459));var e=Yl;return Yl=null,e}function Bf(e){if(e===oa||e===In)throw Error(o(483))}var ra=null,ka=0;function ei(e){var t=ka;return ka+=1,ra===null&&(ra=[]),qf(ra,e,t)}function Wa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ti(e,t){throw t.$$typeof===M?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yf(e){function t(y,h){if(e){var v=y.deletions;v===null?(y.deletions=[h],y.flags|=16):v.push(h)}}function l(y,h){if(!e)return null;for(;h!==null;)t(y,h),h=h.sibling;return null}function a(y){for(var h=new Map;y!==null;)y.key!==null?h.set(y.key,y):h.set(y.index,y),y=y.sibling;return h}function n(y,h){return y=Gt(y,h),y.index=0,y.sibling=null,y}function i(y,h,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<h?(y.flags|=67108866,h):v):(y.flags|=67108866,h)):(y.flags|=1048576,h)}function c(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function f(y,h,v,O){return h===null||h.tag!==6?(h=Ou(v,y.mode,O),h.return=y,h):(h=n(h,v),h.return=y,h)}function r(y,h,v,O){var K=v.type;return K===Z?E(y,h,v.props.children,O,v.key):h!==null&&(h.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===xe&&Bl(K)===h.type)?(h=n(h,v.props),Wa(h,v),h.return=y,h):(h=Jn(v.type,v.key,v.props,null,y.mode,O),Wa(h,v),h.return=y,h)}function g(y,h,v,O){return h===null||h.tag!==4||h.stateNode.containerInfo!==v.containerInfo||h.stateNode.implementation!==v.implementation?(h=Nu(v,y.mode,O),h.return=y,h):(h=n(h,v.children||[]),h.return=y,h)}function E(y,h,v,O,K){return h===null||h.tag!==7?(h=Ml(v,y.mode,O,K),h.return=y,h):(h=n(h,v),h.return=y,h)}function C(y,h,v){if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return h=Ou(""+h,y.mode,v),h.return=y,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Q:return v=Jn(h.type,h.key,h.props,null,y.mode,v),Wa(v,h),v.return=y,v;case G:return h=Nu(h,y.mode,v),h.return=y,h;case xe:return h=Bl(h),C(y,h,v)}if(Ze(h)||de(h))return h=Ml(h,y.mode,v,null),h.return=y,h;if(typeof h.then=="function")return C(y,ei(h),v);if(h.$$typeof===le)return C(y,$n(y,h),v);ti(y,h)}return null}function p(y,h,v,O){var K=h!==null?h.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return K!==null?null:f(y,h,""+v,O);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Q:return v.key===K?r(y,h,v,O):null;case G:return v.key===K?g(y,h,v,O):null;case xe:return v=Bl(v),p(y,h,v,O)}if(Ze(v)||de(v))return K!==null?null:E(y,h,v,O,null);if(typeof v.then=="function")return p(y,h,ei(v),O);if(v.$$typeof===le)return p(y,h,$n(y,v),O);ti(y,v)}return null}function S(y,h,v,O,K){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return y=y.get(v)||null,f(h,y,""+O,K);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case Q:return y=y.get(O.key===null?v:O.key)||null,r(h,y,O,K);case G:return y=y.get(O.key===null?v:O.key)||null,g(h,y,O,K);case xe:return O=Bl(O),S(y,h,v,O,K)}if(Ze(O)||de(O))return y=y.get(v)||null,E(h,y,O,K,null);if(typeof O.then=="function")return S(y,h,v,ei(O),K);if(O.$$typeof===le)return S(y,h,v,$n(h,O),K);ti(h,O)}return null}function w(y,h,v,O){for(var K=null,he=null,L=h,te=h=0,oe=null;L!==null&&te<v.length;te++){L.index>te?(oe=L,L=null):oe=L.sibling;var me=p(y,L,v[te],O);if(me===null){L===null&&(L=oe);break}e&&L&&me.alternate===null&&t(y,L),h=i(me,h,te),he===null?K=me:he.sibling=me,he=me,L=oe}if(te===v.length)return l(y,L),re&&wt(y,te),K;if(L===null){for(;te<v.length;te++)L=C(y,v[te],O),L!==null&&(h=i(L,h,te),he===null?K=L:he.sibling=L,he=L);return re&&wt(y,te),K}for(L=a(L);te<v.length;te++)oe=S(L,y,te,v[te],O),oe!==null&&(e&&oe.alternate!==null&&L.delete(oe.key===null?te:oe.key),h=i(oe,h,te),he===null?K=oe:he.sibling=oe,he=oe);return e&&L.forEach(function(El){return t(y,El)}),re&&wt(y,te),K}function J(y,h,v,O){if(v==null)throw Error(o(151));for(var K=null,he=null,L=h,te=h=0,oe=null,me=v.next();L!==null&&!me.done;te++,me=v.next()){L.index>te?(oe=L,L=null):oe=L.sibling;var El=p(y,L,me.value,O);if(El===null){L===null&&(L=oe);break}e&&L&&El.alternate===null&&t(y,L),h=i(El,h,te),he===null?K=El:he.sibling=El,he=El,L=oe}if(me.done)return l(y,L),re&&wt(y,te),K;if(L===null){for(;!me.done;te++,me=v.next())me=C(y,me.value,O),me!==null&&(h=i(me,h,te),he===null?K=me:he.sibling=me,he=me);return re&&wt(y,te),K}for(L=a(L);!me.done;te++,me=v.next())me=S(L,y,te,me.value,O),me!==null&&(e&&me.alternate!==null&&L.delete(me.key===null?te:me.key),h=i(me,h,te),he===null?K=me:he.sibling=me,he=me);return e&&L.forEach(function(vy){return t(y,vy)}),re&&wt(y,te),K}function Ae(y,h,v,O){if(typeof v=="object"&&v!==null&&v.type===Z&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Q:e:{for(var K=v.key;h!==null;){if(h.key===K){if(K=v.type,K===Z){if(h.tag===7){l(y,h.sibling),O=n(h,v.props.children),O.return=y,y=O;break e}}else if(h.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===xe&&Bl(K)===h.type){l(y,h.sibling),O=n(h,v.props),Wa(O,v),O.return=y,y=O;break e}l(y,h);break}else t(y,h);h=h.sibling}v.type===Z?(O=Ml(v.props.children,y.mode,O,v.key),O.return=y,y=O):(O=Jn(v.type,v.key,v.props,null,y.mode,O),Wa(O,v),O.return=y,y=O)}return c(y);case G:e:{for(K=v.key;h!==null;){if(h.key===K)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){l(y,h.sibling),O=n(h,v.children||[]),O.return=y,y=O;break e}else{l(y,h);break}else t(y,h);h=h.sibling}O=Nu(v,y.mode,O),O.return=y,y=O}return c(y);case xe:return v=Bl(v),Ae(y,h,v,O)}if(Ze(v))return w(y,h,v,O);if(de(v)){if(K=de(v),typeof K!="function")throw Error(o(150));return v=K.call(v),J(y,h,v,O)}if(typeof v.then=="function")return Ae(y,h,ei(v),O);if(v.$$typeof===le)return Ae(y,h,$n(y,v),O);ti(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,h!==null&&h.tag===6?(l(y,h.sibling),O=n(h,v),O.return=y,y=O):(l(y,h),O=Ou(v,y.mode,O),O.return=y,y=O),c(y)):l(y,h)}return function(y,h,v,O){try{ka=0;var K=Ae(y,h,v,O);return ra=null,K}catch(L){if(L===oa||L===In)throw L;var he=ht(29,L,null,y.mode);return he.lanes=O,he.return=y,he}finally{}}}var Gl=Yf(!0),Gf=Yf(!1),cl=!1;function Xu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function sl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ye&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=Kn(e),jf(e,null,l),t}return Vn(e,a,t,l),Kn(e)}function $a(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Ns(e,l)}}function Lu(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?n=i=c:i=i.next=c,l=l.next}while(l!==null);i===null?n=i=t:i=i.next=t}else n=i=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Zu=!1;function Fa(){if(Zu){var e=fa;if(e!==null)throw e}}function Ia(e,t,l,a){Zu=!1;var n=e.updateQueue;cl=!1;var i=n.firstBaseUpdate,c=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var r=f,g=r.next;r.next=null,c===null?i=g:c.next=g,c=r;var E=e.alternate;E!==null&&(E=E.updateQueue,f=E.lastBaseUpdate,f!==c&&(f===null?E.firstBaseUpdate=g:f.next=g,E.lastBaseUpdate=r))}if(i!==null){var C=n.baseState;c=0,E=g=r=null,f=i;do{var p=f.lane&-536870913,S=p!==f.lane;if(S?(fe&p)===p:(a&p)===p){p!==0&&p===sa&&(Zu=!0),E!==null&&(E=E.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var w=e,J=f;p=t;var Ae=l;switch(J.tag){case 1:if(w=J.payload,typeof w=="function"){C=w.call(Ae,C,p);break e}C=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=J.payload,p=typeof w=="function"?w.call(Ae,C,p):w,p==null)break e;C=z({},C,p);break e;case 2:cl=!0}}p=f.callback,p!==null&&(e.flags|=64,S&&(e.flags|=8192),S=n.callbacks,S===null?n.callbacks=[p]:S.push(p))}else S={lane:p,tag:f.tag,payload:f.payload,callback:f.callback,next:null},E===null?(g=E=S,r=C):E=E.next=S,c|=p;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;S=f,f=S.next,S.next=null,n.lastBaseUpdate=S,n.shared.pending=null}}while(!0);E===null&&(r=C),n.baseState=r,n.firstBaseUpdate=g,n.lastBaseUpdate=E,i===null&&(n.shared.lanes=0),ml|=c,e.lanes=c,e.memoizedState=C}}function wf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Xf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)wf(l[e],t)}var da=m(null),li=m(0);function Qf(e,t){e=Ft,B(li,e),B(da,t),Ft=e|t.baseLanes}function Vu(){B(li,Ft),B(da,da.current)}function Ku(){Ft=li.current,D(da),D(li)}var mt=m(null),_t=null;function ol(e){var t=e.alternate;B(Be,Be.current&1),B(mt,e),_t===null&&(t===null||da.current!==null||t.memoizedState!==null)&&(_t=e)}function Ju(e){B(Be,Be.current),B(mt,e),_t===null&&(_t=e)}function Lf(e){e.tag===22?(B(Be,Be.current),B(mt,e),_t===null&&(_t=e)):rl()}function rl(){B(Be,Be.current),B(mt,mt.current)}function yt(e){D(mt),_t===e&&(_t=null),D(Be)}var Be=m(0);function ai(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Pc(l)||es(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Lt=0,ee=null,Te=null,Xe=null,ni=!1,ha=!1,wl=!1,ii=0,Pa=0,ma=null,um=0;function Ue(){throw Error(o(321))}function ku(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!dt(e[l],t[l]))return!1;return!0}function Wu(e,t,l,a,n,i){return Lt=i,ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?zo:oc,wl=!1,i=l(a,n),wl=!1,ha&&(i=Vf(t,l,a,n)),Zf(e),i}function Zf(e){T.H=ln;var t=Te!==null&&Te.next!==null;if(Lt=0,Xe=Te=ee=null,ni=!1,Pa=0,ma=null,t)throw Error(o(300));e===null||Qe||(e=e.dependencies,e!==null&&Wn(e)&&(Qe=!0))}function Vf(e,t,l,a){ee=e;var n=0;do{if(ha&&(ma=null),Pa=0,ha=!1,25<=n)throw Error(o(301));if(n+=1,Xe=Te=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}T.H=Oo,i=t(l,a)}while(ha);return i}function cm(){var e=T.H,t=e.useState()[0];return t=typeof t.then=="function"?en(t):t,e=e.useState()[0],(Te!==null?Te.memoizedState:null)!==e&&(ee.flags|=1024),t}function $u(){var e=ii!==0;return ii=0,e}function Fu(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Iu(e){if(ni){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ni=!1}Lt=0,Xe=Te=ee=null,ha=!1,Pa=ii=0,ma=null}function tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ye(){if(Te===null){var e=ee.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=Xe===null?ee.memoizedState:Xe.next;if(t!==null)Xe=t,Te=e;else{if(e===null)throw ee.alternate===null?Error(o(467)):Error(o(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function ui(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function en(e){var t=Pa;return Pa+=1,ma===null&&(ma=[]),e=qf(ma,e,t),t=ee,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?zo:oc),e}function ci(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return en(e);if(e.$$typeof===le)return $e(e)}throw Error(o(438,String(e)))}function Pu(e){var t=null,l=ee.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=ee.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=ui(),ee.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=se;return t.index++,l}function Zt(e,t){return typeof t=="function"?t(e):t}function si(e){var t=Ye();return ec(t,Te,e)}function ec(e,t,l){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=l;var n=e.baseQueue,i=a.pending;if(i!==null){if(n!==null){var c=n.next;n.next=i.next,i.next=c}t.baseQueue=n=i,a.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var f=c=null,r=null,g=t,E=!1;do{var C=g.lane&-536870913;if(C!==g.lane?(fe&C)===C:(Lt&C)===C){var p=g.revertLane;if(p===0)r!==null&&(r=r.next={lane:0,revertLane:0,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null}),C===sa&&(E=!0);else if((Lt&p)===p){g=g.next,p===sa&&(E=!0);continue}else C={lane:0,revertLane:g.revertLane,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=C,c=i):r=r.next=C,ee.lanes|=p,ml|=p;C=g.action,wl&&l(i,C),i=g.hasEagerState?g.eagerState:l(i,C)}else p={lane:C,revertLane:g.revertLane,gesture:g.gesture,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=p,c=i):r=r.next=p,ee.lanes|=C,ml|=C;g=g.next}while(g!==null&&g!==t);if(r===null?c=i:r.next=f,!dt(i,e.memoizedState)&&(Qe=!0,E&&(l=fa,l!==null)))throw l;e.memoizedState=i,e.baseState=c,e.baseQueue=r,a.lastRenderedState=i}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function tc(e){var t=Ye(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var a=l.dispatch,n=l.pending,i=t.memoizedState;if(n!==null){l.pending=null;var c=n=n.next;do i=e(i,c.action),c=c.next;while(c!==n);dt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),l.lastRenderedState=i}return[i,a]}function Kf(e,t,l){var a=ee,n=Ye(),i=re;if(i){if(l===void 0)throw Error(o(407));l=l()}else l=t();var c=!dt((Te||n).memoizedState,l);if(c&&(n.memoizedState=l,Qe=!0),n=n.queue,nc(Wf.bind(null,a,n,e),[e]),n.getSnapshot!==t||c||Xe!==null&&Xe.memoizedState.tag&1){if(a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,n,l,t),null),ze===null)throw Error(o(349));i||(Lt&127)!==0||Jf(a,t,l)}return l}function Jf(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ee.updateQueue,t===null?(t=ui(),ee.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function kf(e,t,l,a){t.value=l,t.getSnapshot=a,$f(t)&&Ff(e)}function Wf(e,t,l){return l(function(){$f(t)&&Ff(e)})}function $f(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!dt(e,l)}catch{return!0}}function Ff(e){var t=Dl(e,2);t!==null&&st(t,e,2)}function lc(e){var t=tt();if(typeof e=="function"){var l=e;if(e=l(),wl){el(!0);try{l()}finally{el(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:e},t}function If(e,t,l,a){return e.baseState=l,ec(e,Te,typeof a=="function"?a:Zt)}function sm(e,t,l,a,n){if(ri(e))throw Error(o(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){i.listeners.push(c)}};T.T!==null?l(!0):i.isTransition=!1,a(i),l=t.pending,l===null?(i.next=t.pending=i,Pf(t,i)):(i.next=l.next,t.pending=l.next=i)}}function Pf(e,t){var l=t.action,a=t.payload,n=e.state;if(t.isTransition){var i=T.T,c={};T.T=c;try{var f=l(n,a),r=T.S;r!==null&&r(c,f),eo(e,t,f)}catch(g){ac(e,t,g)}finally{i!==null&&c.types!==null&&(i.types=c.types),T.T=i}}else try{i=l(n,a),eo(e,t,i)}catch(g){ac(e,t,g)}}function eo(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){to(e,t,a)},function(a){return ac(e,t,a)}):to(e,t,l)}function to(e,t,l){t.status="fulfilled",t.value=l,lo(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Pf(e,l)))}function ac(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,lo(t),t=t.next;while(t!==a)}e.action=null}function lo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ao(e,t){return t}function no(e,t){if(re){var l=ze.formState;if(l!==null){e:{var a=ee;if(re){if(De){t:{for(var n=De,i=At;n.nodeType!==8;){if(!i){n=null;break t}if(n=zt(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){De=zt(n.nextSibling),a=n.data==="F!";break e}}il(a)}a=!1}a&&(t=l[0])}}return l=tt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:t},l.queue=a,l=Eo.bind(null,ee,a),a.dispatch=l,a=lc(!1),i=fc.bind(null,ee,!1,a.queue),a=tt(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,l=sm.bind(null,ee,n,i,l),n.dispatch=l,a.memoizedState=e,[t,l,!1]}function io(e){var t=Ye();return uo(t,Te,e)}function uo(e,t,l){if(t=ec(e,t,ao)[0],e=si(Zt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=en(t)}catch(c){throw c===oa?In:c}else a=t;t=Ye();var n=t.queue,i=n.dispatch;return l!==t.memoizedState&&(ee.flags|=2048,ya(9,{destroy:void 0},fm.bind(null,n,l),null)),[a,i,e]}function fm(e,t){e.action=t}function co(e){var t=Ye(),l=Te;if(l!==null)return uo(t,l,e);Ye(),t=t.memoizedState,l=Ye();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function ya(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=ee.updateQueue,t===null&&(t=ui(),ee.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function so(){return Ye().memoizedState}function fi(e,t,l,a){var n=tt();ee.flags|=e,n.memoizedState=ya(1|t,{destroy:void 0},l,a===void 0?null:a)}function oi(e,t,l,a){var n=Ye();a=a===void 0?null:a;var i=n.memoizedState.inst;Te!==null&&a!==null&&ku(a,Te.memoizedState.deps)?n.memoizedState=ya(t,i,l,a):(ee.flags|=e,n.memoizedState=ya(1|t,i,l,a))}function fo(e,t){fi(8390656,8,e,t)}function nc(e,t){oi(2048,8,e,t)}function om(e){ee.flags|=4;var t=ee.updateQueue;if(t===null)t=ui(),ee.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function oo(e){var t=Ye().memoizedState;return om({ref:t,nextImpl:e}),function(){if((ye&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ro(e,t){return oi(4,2,e,t)}function ho(e,t){return oi(4,4,e,t)}function mo(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yo(e,t,l){l=l!=null?l.concat([e]):null,oi(4,4,mo.bind(null,t,e),l)}function ic(){}function vo(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&ku(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function go(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&ku(t,a[1]))return a[0];if(a=e(),wl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a}function uc(e,t,l){return l===void 0||(Lt&1073741824)!==0&&(fe&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=pr(),ee.lanes|=e,ml|=e,l)}function po(e,t,l,a){return dt(l,t)?l:da.current!==null?(e=uc(e,l,a),dt(e,t)||(Qe=!0),e):(Lt&42)===0||(Lt&1073741824)!==0&&(fe&261930)===0?(Qe=!0,e.memoizedState=l):(e=pr(),ee.lanes|=e,ml|=e,t)}function bo(e,t,l,a,n){var i=N.p;N.p=i!==0&&8>i?i:8;var c=T.T,f={};T.T=f,fc(e,!1,t,l);try{var r=n(),g=T.S;if(g!==null&&g(f,r),r!==null&&typeof r=="object"&&typeof r.then=="function"){var E=im(r,a);tn(e,t,E,pt(e))}else tn(e,t,a,pt(e))}catch(C){tn(e,t,{then:function(){},status:"rejected",reason:C},pt())}finally{N.p=i,c!==null&&f.types!==null&&(c.types=f.types),T.T=c}}function rm(){}function cc(e,t,l,a){if(e.tag!==5)throw Error(o(476));var n=xo(e).queue;bo(e,n,t,Y,l===null?rm:function(){return So(e),l(a)})}function xo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:Y},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function So(e){var t=xo(e);t.next===null&&(t=e.alternate.memoizedState),tn(e,t.next.queue,{},pt())}function sc(){return $e(bn)}function jo(){return Ye().memoizedState}function To(){return Ye().memoizedState}function dm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=pt();e=sl(l);var a=fl(t,e,l);a!==null&&(st(a,t,l),$a(a,t,l)),t={cache:Bu()},e.payload=t;return}t=t.return}}function hm(e,t,l){var a=pt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ri(e)?Ao(t,l):(l=_u(e,t,l,a),l!==null&&(st(l,e,a),_o(l,t,a)))}function Eo(e,t,l){var a=pt();tn(e,t,l,a)}function tn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ri(e))Ao(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var c=t.lastRenderedState,f=i(c,l);if(n.hasEagerState=!0,n.eagerState=f,dt(f,c))return Vn(e,t,n,0),ze===null&&Zn(),!1}catch{}finally{}if(l=_u(e,t,n,a),l!==null)return st(l,e,a),_o(l,t,a),!0}return!1}function fc(e,t,l,a){if(a={lane:2,revertLane:Xc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ri(e)){if(t)throw Error(o(479))}else t=_u(e,l,a,2),t!==null&&st(t,e,2)}function ri(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function Ao(e,t){ha=ni=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function _o(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Ns(e,l)}}var ln={readContext:$e,use:ci,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useLayoutEffect:Ue,useInsertionEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useSyncExternalStore:Ue,useId:Ue,useHostTransitionStatus:Ue,useFormState:Ue,useActionState:Ue,useOptimistic:Ue,useMemoCache:Ue,useCacheRefresh:Ue};ln.useEffectEvent=Ue;var zo={readContext:$e,use:ci,useCallback:function(e,t){return tt().memoizedState=[e,t===void 0?null:t],e},useContext:$e,useEffect:fo,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,fi(4194308,4,mo.bind(null,t,e),l)},useLayoutEffect:function(e,t){return fi(4194308,4,e,t)},useInsertionEffect:function(e,t){fi(4,2,e,t)},useMemo:function(e,t){var l=tt();t=t===void 0?null:t;var a=e();if(wl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=tt();if(l!==void 0){var n=l(t);if(wl){el(!0);try{l(t)}finally{el(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=hm.bind(null,ee,e),[a.memoizedState,e]},useRef:function(e){var t=tt();return e={current:e},t.memoizedState=e},useState:function(e){e=lc(e);var t=e.queue,l=Eo.bind(null,ee,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:ic,useDeferredValue:function(e,t){var l=tt();return uc(l,e,t)},useTransition:function(){var e=lc(!1);return e=bo.bind(null,ee,e.queue,!0,!1),tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ee,n=tt();if(re){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),ze===null)throw Error(o(349));(fe&127)!==0||Jf(a,t,l)}n.memoizedState=l;var i={value:l,getSnapshot:t};return n.queue=i,fo(Wf.bind(null,a,i,e),[e]),a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,i,l,t),null),l},useId:function(){var e=tt(),t=ze.identifierPrefix;if(re){var l=Rt,a=Mt;l=(a&~(1<<32-rt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ii++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=um++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:sc,useFormState:no,useActionState:no,useOptimistic:function(e){var t=tt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=fc.bind(null,ee,!0,l),l.dispatch=t,[e,t]},useMemoCache:Pu,useCacheRefresh:function(){return tt().memoizedState=dm.bind(null,ee)},useEffectEvent:function(e){var t=tt(),l={impl:e};return t.memoizedState=l,function(){if((ye&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},oc={readContext:$e,use:ci,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:si,useRef:so,useState:function(){return si(Zt)},useDebugValue:ic,useDeferredValue:function(e,t){var l=Ye();return po(l,Te.memoizedState,e,t)},useTransition:function(){var e=si(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:io,useActionState:io,useOptimistic:function(e,t){var l=Ye();return If(l,Te,e,t)},useMemoCache:Pu,useCacheRefresh:To};oc.useEffectEvent=oo;var Oo={readContext:$e,use:ci,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:tc,useRef:so,useState:function(){return tc(Zt)},useDebugValue:ic,useDeferredValue:function(e,t){var l=Ye();return Te===null?uc(l,e,t):po(l,Te.memoizedState,e,t)},useTransition:function(){var e=tc(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:co,useActionState:co,useOptimistic:function(e,t){var l=Ye();return Te!==null?If(l,Te,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Pu,useCacheRefresh:To};Oo.useEffectEvent=oo;function rc(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:z({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var dc={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.tag=1,n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=pt(),a=sl(l);a.tag=2,t!=null&&(a.callback=t),t=fl(e,a,l),t!==null&&(st(t,e,l),$a(t,e,l))}};function No(e,t,l,a,n,i,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,i,c):t.prototype&&t.prototype.isPureReactComponent?!Qa(l,a)||!Qa(n,i):!0}function Co(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&dc.enqueueReplaceState(t,t.state,null)}function Xl(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=z({},l));for(var n in e)l[n]===void 0&&(l[n]=e[n])}return l}function Do(e){Ln(e)}function Mo(e){console.error(e)}function Ro(e){Ln(e)}function di(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Uo(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function hc(e,t,l){return l=sl(l),l.tag=3,l.payload={element:null},l.callback=function(){di(e,t)},l}function qo(e){return e=sl(e),e.tag=3,e}function Ho(e,t,l,a){var n=l.type.getDerivedStateFromError;if(typeof n=="function"){var i=a.value;e.payload=function(){return n(i)},e.callback=function(){Uo(t,l,a)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){Uo(t,l,a),typeof n!="function"&&(yl===null?yl=new Set([this]):yl.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function mm(e,t,l,a,n){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&ca(t,l,n,!0),l=mt.current,l!==null){switch(l.tag){case 31:case 13:return _t===null?Ei():l.alternate===null&&qe===0&&(qe=3),l.flags&=-257,l.flags|=65536,l.lanes=n,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),Yc(e,a,n)),!1;case 22:return l.flags|=65536,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),Yc(e,a,n)),!1}throw Error(o(435,l.tag))}return Yc(e,a,n),Ei(),!1}if(re)return t=mt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==Mu&&(e=Error(o(422),{cause:a}),Va(jt(e,l)))):(a!==Mu&&(t=Error(o(423),{cause:a}),Va(jt(t,l))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=jt(a,l),n=hc(e.stateNode,a,n),Lu(e,n),qe!==4&&(qe=2)),!1;var i=Error(o(520),{cause:a});if(i=jt(i,l),rn===null?rn=[i]:rn.push(i),qe!==4&&(qe=2),t===null)return!0;a=jt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=n&-n,l.lanes|=e,e=hc(l.stateNode,a,e),Lu(l,e),!1;case 1:if(t=l.type,i=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(yl===null||!yl.has(i))))return l.flags|=65536,n&=-n,l.lanes|=n,n=qo(n),Ho(n,e,l,a),Lu(l,n),!1}l=l.return}while(l!==null);return!1}var mc=Error(o(461)),Qe=!1;function Fe(e,t,l,a){t.child=e===null?Gf(t,null,l,a):Gl(t,e.child,l,a)}function Bo(e,t,l,a,n){l=l.render;var i=t.ref;if("ref"in a){var c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}else c=a;return ql(t),a=Wu(e,t,l,c,i,n),f=$u(),e!==null&&!Qe?(Fu(e,t,n),Vt(e,t,n)):(re&&f&&Cu(t),t.flags|=1,Fe(e,t,a,n),t.child)}function Yo(e,t,l,a,n){if(e===null){var i=l.type;return typeof i=="function"&&!zu(i)&&i.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=i,Go(e,t,i,a,n)):(e=Jn(l.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!jc(e,n)){var c=i.memoizedProps;if(l=l.compare,l=l!==null?l:Qa,l(c,a)&&e.ref===t.ref)return Vt(e,t,n)}return t.flags|=1,e=Gt(i,a),e.ref=t.ref,e.return=t,t.child=e}function Go(e,t,l,a,n){if(e!==null){var i=e.memoizedProps;if(Qa(i,a)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=a=i,jc(e,n))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,Vt(e,t,n)}return yc(e,t,l,a,n)}function wo(e,t,l,a){var n=a.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|l:l,e!==null){for(a=t.child=e.child,n=0;a!==null;)n=n|a.lanes|a.childLanes,a=a.sibling;a=n&~i}else a=0,t.child=null;return Xo(e,t,i,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fn(t,i!==null?i.cachePool:null),i!==null?Qf(t,i):Vu(),Lf(t);else return a=t.lanes=536870912,Xo(e,t,i!==null?i.baseLanes|l:l,l,a)}else i!==null?(Fn(t,i.cachePool),Qf(t,i),rl(),t.memoizedState=null):(e!==null&&Fn(t,null),Vu(),rl());return Fe(e,t,n,l),t.child}function an(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xo(e,t,l,a,n){var i=Gu();return i=i===null?null:{parent:we._currentValue,pool:i},t.memoizedState={baseLanes:l,cachePool:i},e!==null&&Fn(t,null),Vu(),Lf(t),e!==null&&ca(e,t,a,!0),t.childLanes=n,null}function hi(e,t){return t=yi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qo(e,t,l){return Gl(t,e.child,null,l),e=hi(t,t.pendingProps),e.flags|=2,yt(t),t.memoizedState=null,e}function ym(e,t,l){var a=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(re){if(a.mode==="hidden")return e=hi(t,a),t.lanes=536870912,an(null,e);if(Ju(t),(e=De)?(e=ed(e,At),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw il(t);return t.lanes=536870912,null}return hi(t,a)}var i=e.memoizedState;if(i!==null){var c=i.dehydrated;if(Ju(t),n)if(t.flags&256)t.flags&=-257,t=Qo(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Qe||ca(e,t,l,!1),n=(l&e.childLanes)!==0,Qe||n){if(a=ze,a!==null&&(c=Cs(a,l),c!==0&&c!==i.retryLane))throw i.retryLane=c,Dl(e,c),st(a,e,c),mc;Ei(),t=Qo(e,t,l)}else e=i.treeContext,De=zt(c.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=hi(t,a),t.flags|=4096;return t}return e=Gt(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mi(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function yc(e,t,l,a,n){return ql(t),l=Wu(e,t,l,a,void 0,n),a=$u(),e!==null&&!Qe?(Fu(e,t,n),Vt(e,t,n)):(re&&a&&Cu(t),t.flags|=1,Fe(e,t,l,n),t.child)}function Lo(e,t,l,a,n,i){return ql(t),t.updateQueue=null,l=Vf(t,a,l,n),Zf(e),a=$u(),e!==null&&!Qe?(Fu(e,t,i),Vt(e,t,i)):(re&&a&&Cu(t),t.flags|=1,Fe(e,t,l,i),t.child)}function Zo(e,t,l,a,n){if(ql(t),t.stateNode===null){var i=aa,c=l.contextType;typeof c=="object"&&c!==null&&(i=$e(c)),i=new l(a,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=dc,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=a,i.state=t.memoizedState,i.refs={},Xu(t),c=l.contextType,i.context=typeof c=="object"&&c!==null?$e(c):aa,i.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(rc(t,l,c,a),i.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(c=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),c!==i.state&&dc.enqueueReplaceState(i,i.state,null),Ia(t,a,i,n),Fa(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){i=t.stateNode;var f=t.memoizedProps,r=Xl(l,f);i.props=r;var g=i.context,E=l.contextType;c=aa,typeof E=="object"&&E!==null&&(c=$e(E));var C=l.getDerivedStateFromProps;E=typeof C=="function"||typeof i.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,E||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(f||g!==c)&&Co(t,i,a,c),cl=!1;var p=t.memoizedState;i.state=p,Ia(t,a,i,n),Fa(),g=t.memoizedState,f||p!==g||cl?(typeof C=="function"&&(rc(t,l,C,a),g=t.memoizedState),(r=cl||No(t,l,r,a,p,g,c))?(E||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=g),i.props=a,i.state=g,i.context=c,a=r):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{i=t.stateNode,Qu(e,t),c=t.memoizedProps,E=Xl(l,c),i.props=E,C=t.pendingProps,p=i.context,g=l.contextType,r=aa,typeof g=="object"&&g!==null&&(r=$e(g)),f=l.getDerivedStateFromProps,(g=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(c!==C||p!==r)&&Co(t,i,a,r),cl=!1,p=t.memoizedState,i.state=p,Ia(t,a,i,n),Fa();var S=t.memoizedState;c!==C||p!==S||cl||e!==null&&e.dependencies!==null&&Wn(e.dependencies)?(typeof f=="function"&&(rc(t,l,f,a),S=t.memoizedState),(E=cl||No(t,l,E,a,p,S,r)||e!==null&&e.dependencies!==null&&Wn(e.dependencies))?(g||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(a,S,r),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(a,S,r)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=S),i.props=a,i.state=S,i.context=r,a=E):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),a=!1)}return i=a,mi(e,t),a=(t.flags&128)!==0,i||a?(i=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&a?(t.child=Gl(t,e.child,null,n),t.child=Gl(t,null,l,n)):Fe(e,t,l,n),t.memoizedState=i.state,e=t.child):e=Vt(e,t,n),e}function Vo(e,t,l,a){return Rl(),t.flags|=256,Fe(e,t,l,a),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:Rf()}}function pc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=gt),e}function Ko(e,t,l){var a=t.pendingProps,n=!1,i=(t.flags&128)!==0,c;if((c=i)||(c=e!==null&&e.memoizedState===null?!1:(Be.current&2)!==0),c&&(n=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(re){if(n?ol(t):rl(),(e=De)?(e=ed(e,At),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw il(t);return es(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,n?(rl(),n=t.mode,f=yi({mode:"hidden",children:f},n),a=Ml(a,n,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,an(null,a)):(ol(t),bc(t,f))}var r=e.memoizedState;if(r!==null&&(f=r.dehydrated,f!==null)){if(i)t.flags&256?(ol(t),t.flags&=-257,t=xc(e,t,l)):t.memoizedState!==null?(rl(),t.child=e.child,t.flags|=128,t=null):(rl(),f=a.fallback,n=t.mode,a=yi({mode:"visible",children:a.children},n),f=Ml(f,n,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,Gl(t,e.child,null,l),a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,t=an(null,a));else if(ol(t),es(f)){if(c=f.nextSibling&&f.nextSibling.dataset,c)var g=c.dgst;c=g,a=Error(o(419)),a.stack="",a.digest=c,Va({value:a,source:null,stack:null}),t=xc(e,t,l)}else if(Qe||ca(e,t,l,!1),c=(l&e.childLanes)!==0,Qe||c){if(c=ze,c!==null&&(a=Cs(c,l),a!==0&&a!==r.retryLane))throw r.retryLane=a,Dl(e,a),st(c,e,a),mc;Pc(f)||Ei(),t=xc(e,t,l)}else Pc(f)?(t.flags|=192,t.child=e.child,t=null):(e=r.treeContext,De=zt(f.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=bc(t,a.children),t.flags|=4096);return t}return n?(rl(),f=a.fallback,n=t.mode,r=e.child,g=r.sibling,a=Gt(r,{mode:"hidden",children:a.children}),a.subtreeFlags=r.subtreeFlags&65011712,g!==null?f=Gt(g,f):(f=Ml(f,n,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,an(null,a),a=t.child,f=e.child.memoizedState,f===null?f=gc(l):(n=f.cachePool,n!==null?(r=we._currentValue,n=n.parent!==r?{parent:r,pool:r}:n):n=Rf(),f={baseLanes:f.baseLanes|l,cachePool:n}),a.memoizedState=f,a.childLanes=pc(e,c,l),t.memoizedState=vc,an(e.child,a)):(ol(t),l=e.child,e=l.sibling,l=Gt(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function bc(e,t){return t=yi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yi(e,t){return e=ht(22,e,null,t),e.lanes=0,e}function xc(e,t,l){return Gl(t,e.child,null,l),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jo(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),qu(e.return,t,l)}function Sc(e,t,l,a,n,i){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:n,treeForkCount:i}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=l,c.tailMode=n,c.treeForkCount=i)}function ko(e,t,l){var a=t.pendingProps,n=a.revealOrder,i=a.tail;a=a.children;var c=Be.current,f=(c&2)!==0;if(f?(c=c&1|2,t.flags|=128):c&=1,B(Be,c),Fe(e,t,a,l),a=re?Za:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jo(e,l,t);else if(e.tag===19)Jo(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(l=t.child,n=null;l!==null;)e=l.alternate,e!==null&&ai(e)===null&&(n=l),l=l.sibling;l=n,l===null?(n=t.child,t.child=null):(n=l.sibling,l.sibling=null),Sc(t,!1,n,l,i,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&ai(e)===null){t.child=n;break}e=n.sibling,n.sibling=l,l=n,n=e}Sc(t,!0,l,null,i,a);break;case"together":Sc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Vt(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),ml|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(ca(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=Gt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Gt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wn(e)))}function vm(e,t,l){switch(t.tag){case 3:et(t,t.stateNode.containerInfo),ul(t,we,e.memoizedState.cache),Rl();break;case 27:case 5:Na(t);break;case 4:et(t,t.stateNode.containerInfo);break;case 10:ul(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ju(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ol(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Ko(e,t,l):(ol(t),e=Vt(e,t,l),e!==null?e.sibling:null);ol(t);break;case 19:var n=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(ca(e,t,l,!1),a=(l&t.childLanes)!==0),n){if(a)return ko(e,t,l);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),B(Be,Be.current),a)break;return null;case 22:return t.lanes=0,wo(e,t,l,t.pendingProps);case 24:ul(t,we,e.memoizedState.cache)}return Vt(e,t,l)}function Wo(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!jc(e,l)&&(t.flags&128)===0)return Qe=!1,vm(e,t,l);Qe=(e.flags&131072)!==0}else Qe=!1,re&&(t.flags&1048576)!==0&&_f(t,Za,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Bl(t.elementType),t.type=e,typeof e=="function")zu(e)?(a=Xl(e,a),t.tag=1,t=Zo(null,t,e,a,l)):(t.tag=0,t=yc(null,t,e,a,l));else{if(e!=null){var n=e.$$typeof;if(n===ne){t.tag=11,t=Bo(null,t,e,a,l);break e}else if(n===V){t.tag=14,t=Yo(null,t,e,a,l);break e}}throw t=Ce(e)||e,Error(o(306,t,""))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,n=Xl(a,t.pendingProps),Zo(e,t,a,n,l);case 3:e:{if(et(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var i=t.memoizedState;n=i.element,Qu(e,t),Ia(t,a,null,l);var c=t.memoizedState;if(a=c.cache,ul(t,we,a),a!==i.cache&&Hu(t,[we],l,!0),Fa(),a=c.element,i.isDehydrated)if(i={element:a,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Vo(e,t,a,l);break e}else if(a!==n){n=jt(Error(o(424)),t),Va(n),t=Vo(e,t,a,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(De=zt(e.firstChild),We=t,re=!0,nl=null,At=!0,l=Gf(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Rl(),a===n){t=Vt(e,t,l);break e}Fe(e,t,a,l)}t=t.child}return t;case 26:return mi(e,t),e===null?(l=ud(t.type,null,t.pendingProps,null))?t.memoizedState=l:re||(l=t.type,e=t.pendingProps,a=Di(ie.current).createElement(l),a[ke]=t,a[lt]=e,Ie(a,l,e),Ke(a),t.stateNode=a):t.memoizedState=ud(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Na(t),e===null&&re&&(a=t.stateNode=ad(t.type,t.pendingProps,ie.current),We=t,At=!0,n=De,bl(t.type)?(ts=n,De=zt(a.firstChild)):De=n),Fe(e,t,t.pendingProps.children,l),mi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&re&&((n=a=De)&&(a=Km(a,t.type,t.pendingProps,At),a!==null?(t.stateNode=a,We=t,De=zt(a.firstChild),At=!1,n=!0):n=!1),n||il(t)),Na(t),n=t.type,i=t.pendingProps,c=e!==null?e.memoizedProps:null,a=i.children,$c(n,i)?a=null:c!==null&&$c(n,c)&&(t.flags|=32),t.memoizedState!==null&&(n=Wu(e,t,cm,null,null,l),bn._currentValue=n),mi(e,t),Fe(e,t,a,l),t.child;case 6:return e===null&&re&&((e=l=De)&&(l=Jm(l,t.pendingProps,At),l!==null?(t.stateNode=l,We=t,De=null,e=!0):e=!1),e||il(t)),null;case 13:return Ko(e,t,l);case 4:return et(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Gl(t,null,a,l):Fe(e,t,a,l),t.child;case 11:return Bo(e,t,t.type,t.pendingProps,l);case 7:return Fe(e,t,t.pendingProps,l),t.child;case 8:return Fe(e,t,t.pendingProps.children,l),t.child;case 12:return Fe(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,ul(t,t.type,a.value),Fe(e,t,a.children,l),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,ql(t),n=$e(n),a=a(n),t.flags|=1,Fe(e,t,a,l),t.child;case 14:return Yo(e,t,t.type,t.pendingProps,l);case 15:return Go(e,t,t.type,t.pendingProps,l);case 19:return ko(e,t,l);case 31:return ym(e,t,l);case 22:return wo(e,t,l,t.pendingProps);case 24:return ql(t),a=$e(we),e===null?(n=Gu(),n===null&&(n=ze,i=Bu(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=l),n=i),t.memoizedState={parent:a,cache:n},Xu(t),ul(t,we,n)):((e.lanes&l)!==0&&(Qu(e,t),Ia(t,null,null,l),Fa()),n=e.memoizedState,i=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),ul(t,we,a)):(a=i.cache,ul(t,we,a),a!==n.cache&&Hu(t,[we],l,!0))),Fe(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Kt(e){e.flags|=4}function Tc(e,t,l,a,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(jr())e.flags|=8192;else throw Yl=Pn,wu}else e.flags&=-16777217}function $o(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rd(t))if(jr())e.flags|=8192;else throw Yl=Pn,wu}function vi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zs():536870912,e.lanes|=t,ba|=t)}function nn(e,t){if(!re)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function gm(e,t,l){var a=t.pendingProps;switch(Du(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return Me(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Qt(we),He(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ua(t)?Kt(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ru())),Me(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(Kt(t),i!==null?(Me(t),$o(t,i)):(Me(t),Tc(t,n,null,a,l))):i?i!==e.memoizedState?(Kt(t),Me(t),$o(t,i)):(Me(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Kt(t),Me(t),Tc(t,n,e,a,l)),null;case 27:if(zn(t),l=ie.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}e=X.current,ua(t)?Of(t):(e=ad(n,a,l),t.stateNode=e,Kt(t))}return Me(t),null;case 5:if(zn(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}if(i=X.current,ua(t))Of(t);else{var c=Di(ie.current);switch(i){case 1:i=c.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=c.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=c.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}i[ke]=t,i[lt]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=i;e:switch(Ie(i,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Kt(t)}}return Me(t),Tc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=ie.current,ua(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=We,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[ke]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Kr(e.nodeValue,l)),e||il(t,!0)}else e=Di(e).createTextNode(a),e[ke]=t,t.stateNode=e}return Me(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=ua(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),e=!1}else l=Ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Me(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ua(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),n=!1}else n=Ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),vi(t,t.updateQueue),Me(t),null);case 4:return He(),e===null&&Vc(t.stateNode.containerInfo),Me(t),null;case 10:return Qt(t.type),Me(t),null;case 19:if(D(Be),a=t.memoizedState,a===null)return Me(t),null;if(n=(t.flags&128)!==0,i=a.rendering,i===null)if(n)nn(a,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=ai(e),i!==null){for(t.flags|=128,nn(a,!1),e=i.updateQueue,t.updateQueue=e,vi(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Tf(l,e),l=l.sibling;return B(Be,Be.current&1|2),re&&wt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ft()>Si&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304)}else{if(!n)if(e=ai(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,vi(t,e),nn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!re)return Me(t),null}else 2*ft()-a.renderingStartTime>Si&&l!==536870912&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ft(),e.sibling=null,l=Be.current,B(Be,n?l&1|2:l&1),re&&wt(t,a.treeForkCount),e):(Me(t),null);case 22:case 23:return yt(t),Ku(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),l=t.updateQueue,l!==null&&vi(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&D(Hl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Qt(we),Me(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function pm(e,t){switch(Du(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qt(we),He(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return zn(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Be),null;case 4:return He(),null;case 10:return Qt(t.type),null;case 22:case 23:return yt(t),Ku(),e!==null&&D(Hl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qt(we),null;case 25:return null;default:return null}}function Fo(e,t){switch(Du(t),t.tag){case 3:Qt(we),He();break;case 26:case 27:case 5:zn(t);break;case 4:He();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:D(Be);break;case 10:Qt(t.type);break;case 22:case 23:yt(t),Ku(),e!==null&&D(Hl);break;case 24:Qt(we)}}function un(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var i=l.create,c=l.inst;a=i(),c.destroy=a}l=l.next}while(l!==n)}}catch(f){pe(t,t.return,f)}}function dl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){var c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,n=t;var r=l,g=f;try{g()}catch(E){pe(n,r,E)}}}a=a.next}while(a!==i)}}catch(E){pe(t,t.return,E)}}function Io(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Xf(t,l)}catch(a){pe(e,e.return,a)}}}function Po(e,t,l){l.props=Xl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){pe(e,t,a)}}function cn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){pe(e,t,n)}}function Ut(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){pe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){pe(e,t,n)}else l.current=null}function er(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){pe(e,e.return,n)}}function Ec(e,t,l){try{var a=e.stateNode;wm(a,e.type,l,t),a[lt]=t}catch(n){pe(e,e.return,n)}}function tr(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bl(e.type)||e.tag===4}function Ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tr(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&bl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _c(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Bt));else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(_c(e,t,l),e=e.sibling;e!==null;)_c(e,t,l),e=e.sibling}function gi(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(gi(e,t,l),e=e.sibling;e!==null;)gi(e,t,l),e=e.sibling}function lr(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ie(t,a,l),t[ke]=e,t[lt]=l}catch(i){pe(e,e.return,i)}}var Jt=!1,Le=!1,zc=!1,ar=typeof WeakSet=="function"?WeakSet:Set,Je=null;function bm(e,t){if(e=e.containerInfo,kc=Yi,e=mf(e),xu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var c=0,f=-1,r=-1,g=0,E=0,C=e,p=null;t:for(;;){for(var S;C!==l||n!==0&&C.nodeType!==3||(f=c+n),C!==i||a!==0&&C.nodeType!==3||(r=c+a),C.nodeType===3&&(c+=C.nodeValue.length),(S=C.firstChild)!==null;)p=C,C=S;for(;;){if(C===e)break t;if(p===l&&++g===n&&(f=c),p===i&&++E===a&&(r=c),(S=C.nextSibling)!==null)break;C=p,p=C.parentNode}C=S}l=f===-1||r===-1?null:{start:f,end:r}}else l=null}l=l||{start:0,end:0}}else l=null;for(Wc={focusedElem:e,selectionRange:l},Yi=!1,Je=t;Je!==null;)if(t=Je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Je=e;else for(;Je!==null;){switch(t=Je,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)n=e[l],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,l=t,n=i.memoizedProps,i=i.memoizedState,a=l.stateNode;try{var w=Xl(l.type,n);e=a.getSnapshotBeforeUpdate(w,i),a.__reactInternalSnapshotBeforeUpdate=e}catch(J){pe(l,l.return,J)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Ic(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ic(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Je=e;break}Je=t.return}}function nr(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Wt(e,l),a&4&&un(5,l);break;case 1:if(Wt(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){pe(l,l.return,c)}else{var n=Xl(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){pe(l,l.return,c)}}a&64&&Io(l),a&512&&cn(l,l.return);break;case 3:if(Wt(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Xf(e,t)}catch(c){pe(l,l.return,c)}}break;case 27:t===null&&a&4&&lr(l);case 26:case 5:Wt(e,l),t===null&&a&4&&er(l),a&512&&cn(l,l.return);break;case 12:Wt(e,l);break;case 31:Wt(e,l),a&4&&cr(e,l);break;case 13:Wt(e,l),a&4&&sr(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Om.bind(null,l),km(e,l))));break;case 22:if(a=l.memoizedState!==null||Jt,!a){t=t!==null&&t.memoizedState!==null||Le,n=Jt;var i=Le;Jt=a,(Le=t)&&!i?$t(e,l,(l.subtreeFlags&8772)!==0):Wt(e,l),Jt=n,Le=i}break;case 30:break;default:Wt(e,l)}}function ir(e){var t=e.alternate;t!==null&&(e.alternate=null,ir(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&au(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Re=null,nt=!1;function kt(e,t,l){for(l=l.child;l!==null;)ur(e,t,l),l=l.sibling}function ur(e,t,l){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(Ca,l)}catch{}switch(l.tag){case 26:Le||Ut(l,t),kt(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Le||Ut(l,t);var a=Re,n=nt;bl(l.type)&&(Re=l.stateNode,nt=!1),kt(e,t,l),vn(l.stateNode),Re=a,nt=n;break;case 5:Le||Ut(l,t);case 6:if(a=Re,n=nt,Re=null,kt(e,t,l),Re=a,nt=n,Re!==null)if(nt)try{(Re.nodeType===9?Re.body:Re.nodeName==="HTML"?Re.ownerDocument.body:Re).removeChild(l.stateNode)}catch(i){pe(l,t,i)}else try{Re.removeChild(l.stateNode)}catch(i){pe(l,t,i)}break;case 18:Re!==null&&(nt?(e=Re,Ir(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),za(e)):Ir(Re,l.stateNode));break;case 4:a=Re,n=nt,Re=l.stateNode.containerInfo,nt=!0,kt(e,t,l),Re=a,nt=n;break;case 0:case 11:case 14:case 15:dl(2,l,t),Le||dl(4,l,t),kt(e,t,l);break;case 1:Le||(Ut(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Po(l,t,a)),kt(e,t,l);break;case 21:kt(e,t,l);break;case 22:Le=(a=Le)||l.memoizedState!==null,kt(e,t,l),Le=a;break;default:kt(e,t,l)}}function cr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{za(e)}catch(l){pe(t,t.return,l)}}}function sr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{za(e)}catch(l){pe(t,t.return,l)}}function xm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ar),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ar),t;default:throw Error(o(435,e.tag))}}function pi(e,t){var l=xm(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var n=Nm.bind(null,e,a);a.then(n,n)}})}function it(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var n=l[a],i=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(bl(f.type)){Re=f.stateNode,nt=!1;break e}break;case 5:Re=f.stateNode,nt=!1;break e;case 3:case 4:Re=f.stateNode.containerInfo,nt=!0;break e}f=f.return}if(Re===null)throw Error(o(160));ur(i,c,n),Re=null,nt=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fr(t,e),t=t.sibling}var Ct=null;function fr(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:it(t,e),ut(e),a&4&&(dl(3,e,e.return),un(3,e),dl(5,e,e.return));break;case 1:it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),a&64&&Jt&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var n=Ct;if(it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),a&4){var i=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":i=n.getElementsByTagName("title")[0],(!i||i[Ra]||i[ke]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(a),n.head.insertBefore(i,n.querySelector("head > title"))),Ie(i,a,l),i[ke]=e,Ke(i),a=i;break e;case"link":var c=fd("link","href",n).get(a+(l.href||""));if(c){for(var f=0;f<c.length;f++)if(i=c[f],i.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&i.getAttribute("rel")===(l.rel==null?null:l.rel)&&i.getAttribute("title")===(l.title==null?null:l.title)&&i.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(f,1);break t}}i=n.createElement(a),Ie(i,a,l),n.head.appendChild(i);break;case"meta":if(c=fd("meta","content",n).get(a+(l.content||""))){for(f=0;f<c.length;f++)if(i=c[f],i.getAttribute("content")===(l.content==null?null:""+l.content)&&i.getAttribute("name")===(l.name==null?null:l.name)&&i.getAttribute("property")===(l.property==null?null:l.property)&&i.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&i.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(f,1);break t}}i=n.createElement(a),Ie(i,a,l),n.head.appendChild(i);break;default:throw Error(o(468,a))}i[ke]=e,Ke(i),a=i}e.stateNode=a}else od(n,e.type,e.stateNode);else e.stateNode=sd(n,a,e.memoizedProps);else i!==a?(i===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):i.count--,a===null?od(n,e.type,e.stateNode):sd(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Ec(e,e.memoizedProps,l.memoizedProps)}break;case 27:it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),l!==null&&a&4&&Ec(e,e.memoizedProps,l.memoizedProps);break;case 5:if(it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),e.flags&32){n=e.stateNode;try{$l(n,"")}catch(w){pe(e,e.return,w)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,Ec(e,n,l!==null?l.memoizedProps:n)),a&1024&&(zc=!0);break;case 6:if(it(t,e),ut(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(w){pe(e,e.return,w)}}break;case 3:if(Ui=null,n=Ct,Ct=Mi(t.containerInfo),it(t,e),Ct=n,ut(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{za(t.containerInfo)}catch(w){pe(e,e.return,w)}zc&&(zc=!1,or(e));break;case 4:a=Ct,Ct=Mi(e.stateNode.containerInfo),it(t,e),ut(e),Ct=a;break;case 12:it(t,e),ut(e);break;case 31:it(t,e),ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pi(e,a)));break;case 13:it(t,e),ut(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(xi=ft()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pi(e,a)));break;case 22:n=e.memoizedState!==null;var r=l!==null&&l.memoizedState!==null,g=Jt,E=Le;if(Jt=g||n,Le=E||r,it(t,e),Le=E,Jt=g,ut(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(l===null||r||Jt||Le||Ql(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){r=l=t;try{if(i=r.stateNode,n)c=i.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{f=r.stateNode;var C=r.memoizedProps.style,p=C!=null&&C.hasOwnProperty("display")?C.display:null;f.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(w){pe(r,r.return,w)}}}else if(t.tag===6){if(l===null){r=t;try{r.stateNode.nodeValue=n?"":r.memoizedProps}catch(w){pe(r,r.return,w)}}}else if(t.tag===18){if(l===null){r=t;try{var S=r.stateNode;n?Pr(S,!0):Pr(r.stateNode,!1)}catch(w){pe(r,r.return,w)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,pi(e,l))));break;case 19:it(t,e),ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pi(e,a)));break;case 30:break;case 21:break;default:it(t,e),ut(e)}}function ut(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(tr(a)){l=a;break}a=a.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var n=l.stateNode,i=Ac(e);gi(e,i,n);break;case 5:var c=l.stateNode;l.flags&32&&($l(c,""),l.flags&=-33);var f=Ac(e);gi(e,f,c);break;case 3:case 4:var r=l.stateNode.containerInfo,g=Ac(e);_c(e,g,r);break;default:throw Error(o(161))}}catch(E){pe(e,e.return,E)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function or(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;or(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wt(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nr(e,t.alternate,t),t=t.sibling}function Ql(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:dl(4,t,t.return),Ql(t);break;case 1:Ut(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Po(t,t.return,l),Ql(t);break;case 27:vn(t.stateNode);case 26:case 5:Ut(t,t.return),Ql(t);break;case 22:t.memoizedState===null&&Ql(t);break;case 30:Ql(t);break;default:Ql(t)}e=e.sibling}}function $t(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,n=e,i=t,c=i.flags;switch(i.tag){case 0:case 11:case 15:$t(n,i,l),un(4,i);break;case 1:if($t(n,i,l),a=i,n=a.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(g){pe(a,a.return,g)}if(a=i,n=a.updateQueue,n!==null){var f=a.stateNode;try{var r=n.shared.hiddenCallbacks;if(r!==null)for(n.shared.hiddenCallbacks=null,n=0;n<r.length;n++)wf(r[n],f)}catch(g){pe(a,a.return,g)}}l&&c&64&&Io(i),cn(i,i.return);break;case 27:lr(i);case 26:case 5:$t(n,i,l),l&&a===null&&c&4&&er(i),cn(i,i.return);break;case 12:$t(n,i,l);break;case 31:$t(n,i,l),l&&c&4&&cr(n,i);break;case 13:$t(n,i,l),l&&c&4&&sr(n,i);break;case 22:i.memoizedState===null&&$t(n,i,l),cn(i,i.return);break;case 30:break;default:$t(n,i,l)}t=t.sibling}}function Oc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Ka(l))}function Nc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e))}function Dt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rr(e,t,l,a),t=t.sibling}function rr(e,t,l,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Dt(e,t,l,a),n&2048&&un(9,t);break;case 1:Dt(e,t,l,a);break;case 3:Dt(e,t,l,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e)));break;case 12:if(n&2048){Dt(e,t,l,a),e=t.stateNode;try{var i=t.memoizedProps,c=i.id,f=i.onPostCommit;typeof f=="function"&&f(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(r){pe(t,t.return,r)}}else Dt(e,t,l,a);break;case 31:Dt(e,t,l,a);break;case 13:Dt(e,t,l,a);break;case 23:break;case 22:i=t.stateNode,c=t.alternate,t.memoizedState!==null?i._visibility&2?Dt(e,t,l,a):sn(e,t):i._visibility&2?Dt(e,t,l,a):(i._visibility|=2,va(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Oc(c,t);break;case 24:Dt(e,t,l,a),n&2048&&Nc(t.alternate,t);break;default:Dt(e,t,l,a)}}function va(e,t,l,a,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,c=t,f=l,r=a,g=c.flags;switch(c.tag){case 0:case 11:case 15:va(i,c,f,r,n),un(8,c);break;case 23:break;case 22:var E=c.stateNode;c.memoizedState!==null?E._visibility&2?va(i,c,f,r,n):sn(i,c):(E._visibility|=2,va(i,c,f,r,n)),n&&g&2048&&Oc(c.alternate,c);break;case 24:va(i,c,f,r,n),n&&g&2048&&Nc(c.alternate,c);break;default:va(i,c,f,r,n)}t=t.sibling}}function sn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,n=a.flags;switch(a.tag){case 22:sn(l,a),n&2048&&Oc(a.alternate,a);break;case 24:sn(l,a),n&2048&&Nc(a.alternate,a);break;default:sn(l,a)}t=t.sibling}}var fn=8192;function ga(e,t,l){if(e.subtreeFlags&fn)for(e=e.child;e!==null;)dr(e,t,l),e=e.sibling}function dr(e,t,l){switch(e.tag){case 26:ga(e,t,l),e.flags&fn&&e.memoizedState!==null&&uy(l,Ct,e.memoizedState,e.memoizedProps);break;case 5:ga(e,t,l);break;case 3:case 4:var a=Ct;Ct=Mi(e.stateNode.containerInfo),ga(e,t,l),Ct=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=fn,fn=16777216,ga(e,t,l),fn=a):ga(e,t,l));break;default:ga(e,t,l)}}function hr(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function on(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)mr(e),e=e.sibling}function mr(e){switch(e.tag){case 0:case 11:case 15:on(e),e.flags&2048&&dl(9,e,e.return);break;case 3:on(e);break;case 12:on(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,bi(e)):on(e);break;default:on(e)}}function bi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:dl(8,t,t.return),bi(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,bi(t));break;default:bi(t)}e=e.sibling}}function yr(e,t){for(;Je!==null;){var l=Je;switch(l.tag){case 0:case 11:case 15:dl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ka(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,Je=a;else e:for(l=e;Je!==null;){a=Je;var n=a.sibling,i=a.return;if(ir(a),a===l){Je=null;break e}if(n!==null){n.return=i,Je=n;break e}Je=i}}}var Sm={getCacheForType:function(e){var t=$e(we),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return $e(we).controller.signal}},jm=typeof WeakMap=="function"?WeakMap:Map,ye=0,ze=null,ue=null,fe=0,ge=0,vt=null,hl=!1,pa=!1,Cc=!1,Ft=0,qe=0,ml=0,Ll=0,Dc=0,gt=0,ba=0,rn=null,ct=null,Mc=!1,xi=0,vr=0,Si=1/0,ji=null,yl=null,Ve=0,vl=null,xa=null,It=0,Rc=0,Uc=null,gr=null,dn=0,qc=null;function pt(){return(ye&2)!==0&&fe!==0?fe&-fe:T.T!==null?Xc():Ds()}function pr(){if(gt===0)if((fe&536870912)===0||re){var e=Cn;Cn<<=1,(Cn&3932160)===0&&(Cn=262144),gt=e}else gt=536870912;return e=mt.current,e!==null&&(e.flags|=32),gt}function st(e,t,l){(e===ze&&(ge===2||ge===9)||e.cancelPendingCommit!==null)&&(Sa(e,0),gl(e,fe,gt,!1)),Ma(e,l),((ye&2)===0||e!==ze)&&(e===ze&&((ye&2)===0&&(Ll|=l),qe===4&&gl(e,fe,gt,!1)),qt(e))}function br(e,t,l){if((ye&6)!==0)throw Error(o(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Da(e,t),n=a?Am(e,t):Bc(e,t,!0),i=a;do{if(n===0){pa&&!a&&gl(e,t,0,!1);break}else{if(l=e.current.alternate,i&&!Tm(l)){n=Bc(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var f=e;n=rn;var r=f.current.memoizedState.isDehydrated;if(r&&(Sa(f,c).flags|=256),c=Bc(f,c,!1),c!==2){if(Cc&&!r){f.errorRecoveryDisabledLanes|=i,Ll|=i,n=4;break e}i=ct,ct=n,i!==null&&(ct===null?ct=i:ct.push.apply(ct,i))}n=c}if(i=!1,n!==2)continue}}if(n===1){Sa(e,0),gl(e,t,0,!0);break}e:{switch(a=e,i=n,i){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:gl(a,t,gt,!hl);break e;case 2:ct=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(n=xi+300-ft(),10<n)){if(gl(a,t,gt,!hl),Mn(a,0,!0)!==0)break e;It=t,a.timeoutHandle=$r(xr.bind(null,a,l,ct,ji,Mc,t,gt,Ll,ba,hl,i,"Throttled",-0,0),n);break e}xr(a,l,ct,ji,Mc,t,gt,Ll,ba,hl,i,null,-0,0)}}break}while(!0);qt(e)}function xr(e,t,l,a,n,i,c,f,r,g,E,C,p,S){if(e.timeoutHandle=-1,C=t.subtreeFlags,C&8192||(C&16785408)===16785408){C={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bt},dr(t,i,C);var w=(i&62914560)===i?xi-ft():(i&4194048)===i?vr-ft():0;if(w=cy(C,w),w!==null){It=i,e.cancelPendingCommit=w(Or.bind(null,e,t,i,l,a,n,c,f,r,E,C,null,p,S)),gl(e,i,c,!g);return}}Or(e,t,i,l,a,n,c,f,r)}function Tm(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var n=l[a],i=n.getSnapshot;n=n.value;try{if(!dt(i(),n))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gl(e,t,l,a){t&=~Dc,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var i=31-rt(n),c=1<<i;a[i]=-1,n&=~c}l!==0&&Os(e,l,t)}function Ti(){return(ye&6)===0?(hn(0),!1):!0}function Hc(){if(ue!==null){if(ge===0)var e=ue.return;else e=ue,Xt=Ul=null,Iu(e),ra=null,ka=0,e=ue;for(;e!==null;)Fo(e.alternate,e),e=e.return;ue=null}}function Sa(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Lm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),It=0,Hc(),ze=e,ue=l=Gt(e.current,null),fe=t,ge=0,vt=null,hl=!1,pa=Da(e,t),Cc=!1,ba=gt=Dc=Ll=ml=qe=0,ct=rn=null,Mc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-rt(a),i=1<<n;t|=e[n],a&=~i}return Ft=t,Zn(),l}function Sr(e,t){ee=null,T.H=ln,t===oa||t===In?(t=Hf(),ge=3):t===wu?(t=Hf(),ge=4):ge=t===mc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,vt=t,ue===null&&(qe=1,di(e,jt(t,e.current)))}function jr(){var e=mt.current;return e===null?!0:(fe&4194048)===fe?_t===null:(fe&62914560)===fe||(fe&536870912)!==0?e===_t:!1}function Tr(){var e=T.H;return T.H=ln,e===null?ln:e}function Er(){var e=T.A;return T.A=Sm,e}function Ei(){qe=4,hl||(fe&4194048)!==fe&&mt.current!==null||(pa=!0),(ml&134217727)===0&&(Ll&134217727)===0||ze===null||gl(ze,fe,gt,!1)}function Bc(e,t,l){var a=ye;ye|=2;var n=Tr(),i=Er();(ze!==e||fe!==t)&&(ji=null,Sa(e,t)),t=!1;var c=qe;e:do try{if(ge!==0&&ue!==null){var f=ue,r=vt;switch(ge){case 8:Hc(),c=6;break e;case 3:case 2:case 9:case 6:mt.current===null&&(t=!0);var g=ge;if(ge=0,vt=null,ja(e,f,r,g),l&&pa){c=0;break e}break;default:g=ge,ge=0,vt=null,ja(e,f,r,g)}}Em(),c=qe;break}catch(E){Sr(e,E)}while(!0);return t&&e.shellSuspendCounter++,Xt=Ul=null,ye=a,T.H=n,T.A=i,ue===null&&(ze=null,fe=0,Zn()),c}function Em(){for(;ue!==null;)Ar(ue)}function Am(e,t){var l=ye;ye|=2;var a=Tr(),n=Er();ze!==e||fe!==t?(ji=null,Si=ft()+500,Sa(e,t)):pa=Da(e,t);e:do try{if(ge!==0&&ue!==null){t=ue;var i=vt;t:switch(ge){case 1:ge=0,vt=null,ja(e,t,i,1);break;case 2:case 9:if(Uf(i)){ge=0,vt=null,_r(t);break}t=function(){ge!==2&&ge!==9||ze!==e||(ge=7),qt(e)},i.then(t,t);break e;case 3:ge=7;break e;case 4:ge=5;break e;case 7:Uf(i)?(ge=0,vt=null,_r(t)):(ge=0,vt=null,ja(e,t,i,7));break;case 5:var c=null;switch(ue.tag){case 26:c=ue.memoizedState;case 5:case 27:var f=ue;if(c?rd(c):f.stateNode.complete){ge=0,vt=null;var r=f.sibling;if(r!==null)ue=r;else{var g=f.return;g!==null?(ue=g,Ai(g)):ue=null}break t}}ge=0,vt=null,ja(e,t,i,5);break;case 6:ge=0,vt=null,ja(e,t,i,6);break;case 8:Hc(),qe=6;break e;default:throw Error(o(462))}}_m();break}catch(E){Sr(e,E)}while(!0);return Xt=Ul=null,T.H=a,T.A=n,ye=l,ue!==null?0:(ze=null,fe=0,Zn(),qe)}function _m(){for(;ue!==null&&!Wd();)Ar(ue)}function Ar(e){var t=Wo(e.alternate,e,Ft);e.memoizedProps=e.pendingProps,t===null?Ai(e):ue=t}function _r(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Lo(l,t,t.pendingProps,t.type,void 0,fe);break;case 11:t=Lo(l,t,t.pendingProps,t.type.render,t.ref,fe);break;case 5:Iu(t);default:Fo(l,t),t=ue=Tf(t,Ft),t=Wo(l,t,Ft)}e.memoizedProps=e.pendingProps,t===null?Ai(e):ue=t}function ja(e,t,l,a){Xt=Ul=null,Iu(t),ra=null,ka=0;var n=t.return;try{if(mm(e,n,t,l,fe)){qe=1,di(e,jt(l,e.current)),ue=null;return}}catch(i){if(n!==null)throw ue=n,i;qe=1,di(e,jt(l,e.current)),ue=null;return}t.flags&32768?(re||a===1?e=!0:pa||(fe&536870912)!==0?e=!1:(hl=e=!0,(a===2||a===9||a===3||a===6)&&(a=mt.current,a!==null&&a.tag===13&&(a.flags|=16384))),zr(t,e)):Ai(t)}function Ai(e){var t=e;do{if((t.flags&32768)!==0){zr(t,hl);return}e=t.return;var l=gm(t.alternate,t,Ft);if(l!==null){ue=l;return}if(t=t.sibling,t!==null){ue=t;return}ue=t=e}while(t!==null);qe===0&&(qe=5)}function zr(e,t){do{var l=pm(e.alternate,e);if(l!==null){l.flags&=32767,ue=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ue=e;return}ue=e=l}while(e!==null);qe=6,ue=null}function Or(e,t,l,a,n,i,c,f,r){e.cancelPendingCommit=null;do _i();while(Ve!==0);if((ye&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(i=t.lanes|t.childLanes,i|=Au,ih(e,l,i,c,f,r),e===ze&&(ue=ze=null,fe=0),xa=t,vl=e,It=l,Rc=i,Uc=n,gr=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Cm(On,function(){return Rr(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=T.T,T.T=null,n=N.p,N.p=2,c=ye,ye|=4;try{bm(e,t,l)}finally{ye=c,N.p=n,T.T=a}}Ve=1,Nr(),Cr(),Dr()}}function Nr(){if(Ve===1){Ve=0;var e=vl,t=xa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=T.T,T.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{fr(t,e);var i=Wc,c=mf(e.containerInfo),f=i.focusedElem,r=i.selectionRange;if(c!==f&&f&&f.ownerDocument&&hf(f.ownerDocument.documentElement,f)){if(r!==null&&xu(f)){var g=r.start,E=r.end;if(E===void 0&&(E=g),"selectionStart"in f)f.selectionStart=g,f.selectionEnd=Math.min(E,f.value.length);else{var C=f.ownerDocument||document,p=C&&C.defaultView||window;if(p.getSelection){var S=p.getSelection(),w=f.textContent.length,J=Math.min(r.start,w),Ae=r.end===void 0?J:Math.min(r.end,w);!S.extend&&J>Ae&&(c=Ae,Ae=J,J=c);var y=df(f,J),h=df(f,Ae);if(y&&h&&(S.rangeCount!==1||S.anchorNode!==y.node||S.anchorOffset!==y.offset||S.focusNode!==h.node||S.focusOffset!==h.offset)){var v=C.createRange();v.setStart(y.node,y.offset),S.removeAllRanges(),J>Ae?(S.addRange(v),S.extend(h.node,h.offset)):(v.setEnd(h.node,h.offset),S.addRange(v))}}}}for(C=[],S=f;S=S.parentNode;)S.nodeType===1&&C.push({element:S,left:S.scrollLeft,top:S.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<C.length;f++){var O=C[f];O.element.scrollLeft=O.left,O.element.scrollTop=O.top}}Yi=!!kc,Wc=kc=null}finally{ye=n,N.p=a,T.T=l}}e.current=t,Ve=2}}function Cr(){if(Ve===2){Ve=0;var e=vl,t=xa,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=T.T,T.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{nr(e,t.alternate,t)}finally{ye=n,N.p=a,T.T=l}}Ve=3}}function Dr(){if(Ve===4||Ve===3){Ve=0,$d();var e=vl,t=xa,l=It,a=gr;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ve=5:(Ve=0,xa=vl=null,Mr(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(yl=null),tu(l),t=t.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(Ca,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=T.T,n=N.p,N.p=2,T.T=null;try{for(var i=e.onRecoverableError,c=0;c<a.length;c++){var f=a[c];i(f.value,{componentStack:f.stack})}}finally{T.T=t,N.p=n}}(It&3)!==0&&_i(),qt(e),n=e.pendingLanes,(l&261930)!==0&&(n&42)!==0?e===qc?dn++:(dn=0,qc=e):dn=0,hn(0)}}function Mr(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ka(t)))}function _i(){return Nr(),Cr(),Dr(),Rr()}function Rr(){if(Ve!==5)return!1;var e=vl,t=Rc;Rc=0;var l=tu(It),a=T.T,n=N.p;try{N.p=32>l?32:l,T.T=null,l=Uc,Uc=null;var i=vl,c=It;if(Ve=0,xa=vl=null,It=0,(ye&6)!==0)throw Error(o(331));var f=ye;if(ye|=4,mr(i.current),rr(i,i.current,c,l),ye=f,hn(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(Ca,i)}catch{}return!0}finally{N.p=n,T.T=a,Mr(e,t)}}function Ur(e,t,l){t=jt(l,t),t=hc(e.stateNode,t,2),e=fl(e,t,2),e!==null&&(Ma(e,2),qt(e))}function pe(e,t,l){if(e.tag===3)Ur(e,e,l);else for(;t!==null;){if(t.tag===3){Ur(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(yl===null||!yl.has(a))){e=jt(l,e),l=qo(2),a=fl(t,l,2),a!==null&&(Ho(l,a,t,e),Ma(a,2),qt(a));break}}t=t.return}}function Yc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new jm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Cc=!0,n.add(l),e=zm.bind(null,e,t,l),t.then(e,e))}function zm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,ze===e&&(fe&l)===l&&(qe===4||qe===3&&(fe&62914560)===fe&&300>ft()-xi?(ye&2)===0&&Sa(e,0):Dc|=l,ba===fe&&(ba=0)),qt(e)}function qr(e,t){t===0&&(t=zs()),e=Dl(e,t),e!==null&&(Ma(e,t),qt(e))}function Om(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),qr(e,l)}function Nm(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),qr(e,l)}function Cm(e,t){return Fi(e,t)}var zi=null,Ta=null,Gc=!1,Oi=!1,wc=!1,pl=0;function qt(e){e!==Ta&&e.next===null&&(Ta===null?zi=Ta=e:Ta=Ta.next=e),Oi=!0,Gc||(Gc=!0,Mm())}function hn(e,t){if(!wc&&Oi){wc=!0;do for(var l=!1,a=zi;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var i=0;else{var c=a.suspendedLanes,f=a.pingedLanes;i=(1<<31-rt(42|e)+1)-1,i&=n&~(c&~f),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,Gr(a,i))}else i=fe,i=Mn(a,a===ze?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Da(a,i)||(l=!0,Gr(a,i));a=a.next}while(l);wc=!1}}function Dm(){Hr()}function Hr(){Oi=Gc=!1;var e=0;pl!==0&&Qm()&&(e=pl);for(var t=ft(),l=null,a=zi;a!==null;){var n=a.next,i=Br(a,t);i===0?(a.next=null,l===null?zi=n:l.next=n,n===null&&(Ta=l)):(l=a,(e!==0||(i&3)!==0)&&(Oi=!0)),a=n}Ve!==0&&Ve!==5||hn(e),pl!==0&&(pl=0)}function Br(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var c=31-rt(i),f=1<<c,r=n[c];r===-1?((f&l)===0||(f&a)!==0)&&(n[c]=nh(f,t)):r<=t&&(e.expiredLanes|=f),i&=~f}if(t=ze,l=fe,l=Mn(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(ge===2||ge===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Ii(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Da(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Ii(a),tu(l)){case 2:case 8:l=As;break;case 32:l=On;break;case 268435456:l=_s;break;default:l=On}return a=Yr.bind(null,e),l=Fi(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Ii(a),e.callbackPriority=2,e.callbackNode=null,2}function Yr(e,t){if(Ve!==0&&Ve!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(_i()&&e.callbackNode!==l)return null;var a=fe;return a=Mn(e,e===ze?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(br(e,a,t),Br(e,ft()),e.callbackNode!=null&&e.callbackNode===l?Yr.bind(null,e):null)}function Gr(e,t){if(_i())return null;br(e,t,!0)}function Mm(){Zm(function(){(ye&6)!==0?Fi(Es,Dm):Hr()})}function Xc(){if(pl===0){var e=sa;e===0&&(e=Nn,Nn<<=1,(Nn&261888)===0&&(Nn=256)),pl=e}return pl}function wr(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Hn(""+e)}function Xr(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Rm(e,t,l,a,n){if(t==="submit"&&l&&l.stateNode===n){var i=wr((n[lt]||null).action),c=a.submitter;c&&(t=(t=c[lt]||null)?wr(t.formAction):c.getAttribute("formAction"),t!==null&&(i=t,c=null));var f=new wn("action","action",null,a,n);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(pl!==0){var r=c?Xr(n,c):new FormData(n);cc(l,{pending:!0,data:r,method:n.method,action:i},null,r)}}else typeof i=="function"&&(f.preventDefault(),r=c?Xr(n,c):new FormData(n),cc(l,{pending:!0,data:r,method:n.method,action:i},i,r))},currentTarget:n}]})}}for(var Qc=0;Qc<Eu.length;Qc++){var Lc=Eu[Qc],Um=Lc.toLowerCase(),qm=Lc[0].toUpperCase()+Lc.slice(1);Nt(Um,"on"+qm)}Nt(gf,"onAnimationEnd"),Nt(pf,"onAnimationIteration"),Nt(bf,"onAnimationStart"),Nt("dblclick","onDoubleClick"),Nt("focusin","onFocus"),Nt("focusout","onBlur"),Nt(Fh,"onTransitionRun"),Nt(Ih,"onTransitionStart"),Nt(Ph,"onTransitionCancel"),Nt(xf,"onTransitionEnd"),kl("onMouseEnter",["mouseout","mouseover"]),kl("onMouseLeave",["mouseout","mouseover"]),kl("onPointerEnter",["pointerout","pointerover"]),kl("onPointerLeave",["pointerout","pointerover"]),zl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zl("onBeforeInput",["compositionend","keypress","textInput","paste"]),zl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Hm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mn));function Qr(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],n=a.event;a=a.listeners;e:{var i=void 0;if(t)for(var c=a.length-1;0<=c;c--){var f=a[c],r=f.instance,g=f.currentTarget;if(f=f.listener,r!==i&&n.isPropagationStopped())break e;i=f,n.currentTarget=g;try{i(n)}catch(E){Ln(E)}n.currentTarget=null,i=r}else for(c=0;c<a.length;c++){if(f=a[c],r=f.instance,g=f.currentTarget,f=f.listener,r!==i&&n.isPropagationStopped())break e;i=f,n.currentTarget=g;try{i(n)}catch(E){Ln(E)}n.currentTarget=null,i=r}}}}function ce(e,t){var l=t[lu];l===void 0&&(l=t[lu]=new Set);var a=e+"__bubble";l.has(a)||(Lr(t,e,2,!1),l.add(a))}function Zc(e,t,l){var a=0;t&&(a|=4),Lr(l,e,a,t)}var Ni="_reactListening"+Math.random().toString(36).slice(2);function Vc(e){if(!e[Ni]){e[Ni]=!0,Us.forEach(function(l){l!=="selectionchange"&&(Hm.has(l)||Zc(l,!1,e),Zc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ni]||(t[Ni]=!0,Zc("selectionchange",!1,t))}}function Lr(e,t,l,a){switch(pd(t)){case 2:var n=oy;break;case 8:n=ry;break;default:n=us}l=n.bind(null,t,l,e),n=void 0,!ru||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,l,{capture:!0,passive:n}):e.addEventListener(t,l,!0):n!==void 0?e.addEventListener(t,l,{passive:n}):e.addEventListener(t,l,!1)}function Kc(e,t,l,a,n){var i=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var c=a.tag;if(c===3||c===4){var f=a.stateNode.containerInfo;if(f===n)break;if(c===4)for(c=a.return;c!==null;){var r=c.tag;if((r===3||r===4)&&c.stateNode.containerInfo===n)return;c=c.return}for(;f!==null;){if(c=Vl(f),c===null)return;if(r=c.tag,r===5||r===6||r===26||r===27){a=i=c;continue e}f=f.parentNode}}a=a.return}Ks(function(){var g=i,E=fu(l),C=[];e:{var p=Sf.get(e);if(p!==void 0){var S=wn,w=e;switch(e){case"keypress":if(Yn(l)===0)break e;case"keydown":case"keyup":S=Nh;break;case"focusin":w="focus",S=yu;break;case"focusout":w="blur",S=yu;break;case"beforeblur":case"afterblur":S=yu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":S=Ws;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=gh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=Mh;break;case gf:case pf:case bf:S=xh;break;case xf:S=Uh;break;case"scroll":case"scrollend":S=yh;break;case"wheel":S=Hh;break;case"copy":case"cut":case"paste":S=jh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=Fs;break;case"toggle":case"beforetoggle":S=Yh}var J=(t&4)!==0,Ae=!J&&(e==="scroll"||e==="scrollend"),y=J?p!==null?p+"Capture":null:p;J=[];for(var h=g,v;h!==null;){var O=h;if(v=O.stateNode,O=O.tag,O!==5&&O!==26&&O!==27||v===null||y===null||(O=qa(h,y),O!=null&&J.push(yn(h,O,v))),Ae)break;h=h.return}0<J.length&&(p=new S(p,w,null,l,E),C.push({event:p,listeners:J}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",p&&l!==su&&(w=l.relatedTarget||l.fromElement)&&(Vl(w)||w[Zl]))break e;if((S||p)&&(p=E.window===E?E:(p=E.ownerDocument)?p.defaultView||p.parentWindow:window,S?(w=l.relatedTarget||l.toElement,S=g,w=w?Vl(w):null,w!==null&&(Ae=A(w),J=w.tag,w!==Ae||J!==5&&J!==27&&J!==6)&&(w=null)):(S=null,w=g),S!==w)){if(J=Ws,O="onMouseLeave",y="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(J=Fs,O="onPointerLeave",y="onPointerEnter",h="pointer"),Ae=S==null?p:Ua(S),v=w==null?p:Ua(w),p=new J(O,h+"leave",S,l,E),p.target=Ae,p.relatedTarget=v,O=null,Vl(E)===g&&(J=new J(y,h+"enter",w,l,E),J.target=v,J.relatedTarget=Ae,O=J),Ae=O,S&&w)t:{for(J=Bm,y=S,h=w,v=0,O=y;O;O=J(O))v++;O=0;for(var K=h;K;K=J(K))O++;for(;0<v-O;)y=J(y),v--;for(;0<O-v;)h=J(h),O--;for(;v--;){if(y===h||h!==null&&y===h.alternate){J=y;break t}y=J(y),h=J(h)}J=null}else J=null;S!==null&&Zr(C,p,S,J,!1),w!==null&&Ae!==null&&Zr(C,Ae,w,J,!0)}}e:{if(p=g?Ua(g):window,S=p.nodeName&&p.nodeName.toLowerCase(),S==="select"||S==="input"&&p.type==="file")var he=uf;else if(af(p))if(cf)he=kh;else{he=Kh;var L=Vh}else S=p.nodeName,!S||S.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?g&&cu(g.elementType)&&(he=uf):he=Jh;if(he&&(he=he(e,g))){nf(C,he,l,E);break e}L&&L(e,p,g),e==="focusout"&&g&&p.type==="number"&&g.memoizedProps.value!=null&&uu(p,"number",p.value)}switch(L=g?Ua(g):window,e){case"focusin":(af(L)||L.contentEditable==="true")&&(ea=L,Su=g,La=null);break;case"focusout":La=Su=ea=null;break;case"mousedown":ju=!0;break;case"contextmenu":case"mouseup":case"dragend":ju=!1,yf(C,l,E);break;case"selectionchange":if($h)break;case"keydown":case"keyup":yf(C,l,E)}var te;if(gu)e:{switch(e){case"compositionstart":var oe="onCompositionStart";break e;case"compositionend":oe="onCompositionEnd";break e;case"compositionupdate":oe="onCompositionUpdate";break e}oe=void 0}else Pl?tf(e,l)&&(oe="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(oe="onCompositionStart");oe&&(Is&&l.locale!=="ko"&&(Pl||oe!=="onCompositionStart"?oe==="onCompositionEnd"&&Pl&&(te=Js()):(ll=E,du="value"in ll?ll.value:ll.textContent,Pl=!0)),L=Ci(g,oe),0<L.length&&(oe=new $s(oe,e,null,l,E),C.push({event:oe,listeners:L}),te?oe.data=te:(te=lf(l),te!==null&&(oe.data=te)))),(te=wh?Xh(e,l):Qh(e,l))&&(oe=Ci(g,"onBeforeInput"),0<oe.length&&(L=new $s("onBeforeInput","beforeinput",null,l,E),C.push({event:L,listeners:oe}),L.data=te)),Rm(C,e,g,l,E)}Qr(C,t)})}function yn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Ci(e,t){for(var l=t+"Capture",a=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=qa(e,l),n!=null&&a.unshift(yn(e,n,i)),n=qa(e,t),n!=null&&a.push(yn(e,n,i))),e.tag===3)return a;e=e.return}return[]}function Bm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zr(e,t,l,a,n){for(var i=t._reactName,c=[];l!==null&&l!==a;){var f=l,r=f.alternate,g=f.stateNode;if(f=f.tag,r!==null&&r===a)break;f!==5&&f!==26&&f!==27||g===null||(r=g,n?(g=qa(l,i),g!=null&&c.unshift(yn(l,g,r))):n||(g=qa(l,i),g!=null&&c.push(yn(l,g,r)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var Ym=/\r\n?/g,Gm=/\u0000|\uFFFD/g;function Vr(e){return(typeof e=="string"?e:""+e).replace(Ym,`- `).replace(Gm,"")}function Kr(e,t){return t=Vr(t),Vr(e)===t}function Ee(e,t,l,a,n,i){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||$l(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&$l(e,""+a);break;case"className":Un(e,"class",a);break;case"tabIndex":Un(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Un(e,l,a);break;case"style":Zs(e,a,i);break;case"data":if(t!=="object"){Un(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(l==="formAction"?(t!=="input"&&Ee(e,t,"name",n.name,n,null),Ee(e,t,"formEncType",n.formEncType,n,null),Ee(e,t,"formMethod",n.formMethod,n,null),Ee(e,t,"formTarget",n.formTarget,n,null)):(Ee(e,t,"encType",n.encType,n,null),Ee(e,t,"method",n.method,n,null),Ee(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Hn(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":ce("beforetoggle",e),ce("toggle",e),Rn(e,"popover",a);break;case"xlinkActuate":Ht(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ht(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ht(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ht(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ht(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ht(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Rn(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=hh.get(l)||l,Rn(e,l,a))}}function Jc(e,t,l,a,n,i){switch(l){case"style":Zs(e,a,i);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof a=="string"?$l(e,a):(typeof a=="number"||typeof a=="bigint")&&$l(e,""+a);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qs.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(n=l.endsWith("Capture"),t=l.slice(2,n?l.length-7:void 0),i=e[lt]||null,i=i!=null?i[l]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof a=="function")){typeof i!="function"&&i!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,n);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):Rn(e,l,a)}}}function Ie(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ce("error",e),ce("load",e);var a=!1,n=!1,i;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];if(c!=null)switch(i){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ee(e,t,i,c,l,null)}}n&&Ee(e,t,"srcSet",l.srcSet,l,null),a&&Ee(e,t,"src",l.src,l,null);return;case"input":ce("invalid",e);var f=i=c=n=null,r=null,g=null;for(a in l)if(l.hasOwnProperty(a)){var E=l[a];if(E!=null)switch(a){case"name":n=E;break;case"type":c=E;break;case"checked":r=E;break;case"defaultChecked":g=E;break;case"value":i=E;break;case"defaultValue":f=E;break;case"children":case"dangerouslySetInnerHTML":if(E!=null)throw Error(o(137,t));break;default:Ee(e,t,a,E,l,null)}}ws(e,i,f,r,g,c,n,!1);return;case"select":ce("invalid",e),a=c=i=null;for(n in l)if(l.hasOwnProperty(n)&&(f=l[n],f!=null))switch(n){case"value":i=f;break;case"defaultValue":c=f;break;case"multiple":a=f;default:Ee(e,t,n,f,l,null)}t=i,l=c,e.multiple=!!a,t!=null?Wl(e,!!a,t,!1):l!=null&&Wl(e,!!a,l,!0);return;case"textarea":ce("invalid",e),i=n=a=null;for(c in l)if(l.hasOwnProperty(c)&&(f=l[c],f!=null))switch(c){case"value":a=f;break;case"defaultValue":n=f;break;case"children":i=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:Ee(e,t,c,f,l,null)}Qs(e,a,n,i);return;case"option":for(r in l)if(l.hasOwnProperty(r)&&(a=l[r],a!=null))switch(r){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ee(e,t,r,a,l,null)}return;case"dialog":ce("beforetoggle",e),ce("toggle",e),ce("cancel",e),ce("close",e);break;case"iframe":case"object":ce("load",e);break;case"video":case"audio":for(a=0;a<mn.length;a++)ce(mn[a],e);break;case"image":ce("error",e),ce("load",e);break;case"details":ce("toggle",e);break;case"embed":case"source":case"link":ce("error",e),ce("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(g in l)if(l.hasOwnProperty(g)&&(a=l[g],a!=null))switch(g){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ee(e,t,g,a,l,null)}return;default:if(cu(t)){for(E in l)l.hasOwnProperty(E)&&(a=l[E],a!==void 0&&Jc(e,t,E,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Ee(e,t,f,a,l,null))}function wm(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,c=null,f=null,r=null,g=null,E=null;for(S in l){var C=l[S];if(l.hasOwnProperty(S)&&C!=null)switch(S){case"checked":break;case"value":break;case"defaultValue":r=C;default:a.hasOwnProperty(S)||Ee(e,t,S,null,a,C)}}for(var p in a){var S=a[p];if(C=l[p],a.hasOwnProperty(p)&&(S!=null||C!=null))switch(p){case"type":i=S;break;case"name":n=S;break;case"checked":g=S;break;case"defaultChecked":E=S;break;case"value":c=S;break;case"defaultValue":f=S;break;case"children":case"dangerouslySetInnerHTML":if(S!=null)throw Error(o(137,t));break;default:S!==C&&Ee(e,t,p,S,a,C)}}iu(e,c,f,r,g,E,i,n);return;case"select":S=c=f=p=null;for(i in l)if(r=l[i],l.hasOwnProperty(i)&&r!=null)switch(i){case"value":break;case"multiple":S=r;default:a.hasOwnProperty(i)||Ee(e,t,i,null,a,r)}for(n in a)if(i=a[n],r=l[n],a.hasOwnProperty(n)&&(i!=null||r!=null))switch(n){case"value":p=i;break;case"defaultValue":f=i;break;case"multiple":c=i;default:i!==r&&Ee(e,t,n,i,a,r)}t=f,l=c,a=S,p!=null?Wl(e,!!l,p,!1):!!a!=!!l&&(t!=null?Wl(e,!!l,t,!0):Wl(e,!!l,l?[]:"",!1));return;case"textarea":S=p=null;for(f in l)if(n=l[f],l.hasOwnProperty(f)&&n!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Ee(e,t,f,null,a,n)}for(c in a)if(n=a[c],i=l[c],a.hasOwnProperty(c)&&(n!=null||i!=null))switch(c){case"value":p=n;break;case"defaultValue":S=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(o(91));break;default:n!==i&&Ee(e,t,c,n,a,i)}Xs(e,p,S);return;case"option":for(var w in l)if(p=l[w],l.hasOwnProperty(w)&&p!=null&&!a.hasOwnProperty(w))switch(w){case"selected":e.selected=!1;break;default:Ee(e,t,w,null,a,p)}for(r in a)if(p=a[r],S=l[r],a.hasOwnProperty(r)&&p!==S&&(p!=null||S!=null))switch(r){case"selected":e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Ee(e,t,r,p,a,S)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var J in l)p=l[J],l.hasOwnProperty(J)&&p!=null&&!a.hasOwnProperty(J)&&Ee(e,t,J,null,a,p);for(g in a)if(p=a[g],S=l[g],a.hasOwnProperty(g)&&p!==S&&(p!=null||S!=null))switch(g){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(137,t));break;default:Ee(e,t,g,p,a,S)}return;default:if(cu(t)){for(var Ae in l)p=l[Ae],l.hasOwnProperty(Ae)&&p!==void 0&&!a.hasOwnProperty(Ae)&&Jc(e,t,Ae,void 0,a,p);for(E in a)p=a[E],S=l[E],!a.hasOwnProperty(E)||p===S||p===void 0&&S===void 0||Jc(e,t,E,p,a,S);return}}for(var y in l)p=l[y],l.hasOwnProperty(y)&&p!=null&&!a.hasOwnProperty(y)&&Ee(e,t,y,null,a,p);for(C in a)p=a[C],S=l[C],!a.hasOwnProperty(C)||p===S||p==null&&S==null||Ee(e,t,C,p,a,S)}function Jr(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var n=l[a],i=n.transferSize,c=n.initiatorType,f=n.duration;if(i&&f&&Jr(c)){for(c=0,f=n.responseEnd,a+=1;a<l.length;a++){var r=l[a],g=r.startTime;if(g>f)break;var E=r.transferSize,C=r.initiatorType;E&&Jr(C)&&(r=r.responseEnd,c+=E*(r<f?1:(f-g)/(r-g)))}if(--a,t+=8*(i+c)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var kc=null,Wc=null;function Di(e){return e.nodeType===9?e:e.ownerDocument}function kr(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Wr(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function $c(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Fc=null;function Qm(){var e=window.event;return e&&e.type==="popstate"?e===Fc?!1:(Fc=e,!0):(Fc=null,!1)}var $r=typeof setTimeout=="function"?setTimeout:void 0,Lm=typeof clearTimeout=="function"?clearTimeout:void 0,Fr=typeof Promise=="function"?Promise:void 0,Zm=typeof queueMicrotask=="function"?queueMicrotask:typeof Fr<"u"?function(e){return Fr.resolve(null).then(e).catch(Vm)}:$r;function Vm(e){setTimeout(function(){throw e})}function bl(e){return e==="head"}function Ir(e,t){var l=t,a=0;do{var n=l.nextSibling;if(e.removeChild(l),n&&n.nodeType===8)if(l=n.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(n),za(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")vn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,vn(l);for(var i=l.firstChild;i;){var c=i.nextSibling,f=i.nodeName;i[Ra]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&i.rel.toLowerCase()==="stylesheet"||l.removeChild(i),i=c}}else l==="body"&&vn(e.ownerDocument.body);l=n}while(l);za(t)}function Pr(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Ic(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ic(l),au(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Km(e,t,l,a){for(;e.nodeType===1;){var n=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Ra])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=zt(e.nextSibling),e===null)break}return null}function Jm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=zt(e.nextSibling),e===null))return null;return e}function ed(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=zt(e.nextSibling),e===null))return null;return e}function Pc(e){return e.data==="$?"||e.data==="$~"}function es(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function km(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function zt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ts=null;function td(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return zt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function ld(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function ad(e,t,l){switch(t=Di(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function vn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);au(e)}var Ot=new Map,nd=new Set;function Mi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pt=N.d;N.d={f:Wm,r:$m,D:Fm,C:Im,L:Pm,m:ey,X:ly,S:ty,M:ay};function Wm(){var e=Pt.f(),t=Ti();return e||t}function $m(e){var t=Kl(e);t!==null&&t.tag===5&&t.type==="form"?So(t):Pt.r(e)}var Ea=typeof document>"u"?null:document;function id(e,t,l){var a=Ea;if(a&&typeof t=="string"&&t){var n=xt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),nd.has(n)||(nd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function Fm(e){Pt.D(e),id("dns-prefetch",e,null)}function Im(e,t){Pt.C(e,t),id("preconnect",e,t)}function Pm(e,t,l){Pt.L(e,t,l);var a=Ea;if(a&&e&&t){var n='link[rel="preload"][as="'+xt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+xt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+xt(l.imageSizes)+'"]')):n+='[href="'+xt(e)+'"]';var i=n;switch(t){case"style":i=Aa(e);break;case"script":i=_a(e)}Ot.has(i)||(e=z({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ot.set(i,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(gn(i))||t==="script"&&a.querySelector(pn(i))||(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function ey(e,t){Pt.m(e,t);var l=Ea;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+xt(a)+'"][href="'+xt(e)+'"]',i=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=_a(e)}if(!Ot.has(i)&&(e=z({rel:"modulepreload",href:e},t),Ot.set(i,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(pn(i)))return}a=l.createElement("link"),Ie(a,"link",e),Ke(a),l.head.appendChild(a)}}}function ty(e,t,l){Pt.S(e,t,l);var a=Ea;if(a&&e){var n=Jl(a).hoistableStyles,i=Aa(e);t=t||"default";var c=n.get(i);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(gn(i)))f.loading=5;else{e=z({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ot.get(i))&&ls(e,l);var r=c=a.createElement("link");Ke(r),Ie(r,"link",e),r._p=new Promise(function(g,E){r.onload=g,r.onerror=E}),r.addEventListener("load",function(){f.loading|=1}),r.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Ri(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:f},n.set(i,c)}}}function ly(e,t){Pt.X(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),i=a.get(n);i||(i=l.querySelector(pn(n)),i||(e=z({src:e,async:!0},t),(t=Ot.get(n))&&as(e,t),i=l.createElement("script"),Ke(i),Ie(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function ay(e,t){Pt.M(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),i=a.get(n);i||(i=l.querySelector(pn(n)),i||(e=z({src:e,async:!0,type:"module"},t),(t=Ot.get(n))&&as(e,t),i=l.createElement("script"),Ke(i),Ie(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function ud(e,t,l,a){var n=(n=ie.current)?Mi(n):null;if(!n)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Aa(l.href),l=Jl(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Aa(l.href);var i=Jl(n).hoistableStyles,c=i.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,c),(i=n.querySelector(gn(e)))&&!i._p&&(c.instance=i,c.state.loading=5),Ot.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ot.set(e,l),i||ny(n,e,l,c.state))),t&&a===null)throw Error(o(528,""));return c}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_a(l),l=Jl(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Aa(e){return'href="'+xt(e)+'"'}function gn(e){return'link[rel="stylesheet"]['+e+"]"}function cd(e){return z({},e,{"data-precedence":e.precedence,precedence:null})}function ny(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Ie(t,"link",l),Ke(t),e.head.appendChild(t))}function _a(e){return'[src="'+xt(e)+'"]'}function pn(e){return"script[async]"+e}function sd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+xt(l.href)+'"]');if(a)return t.instance=a,Ke(a),a;var n=z({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ke(a),Ie(a,"style",n),Ri(a,l.precedence,e),t.instance=a;case"stylesheet":n=Aa(l.href);var i=e.querySelector(gn(n));if(i)return t.state.loading|=4,t.instance=i,Ke(i),i;a=cd(l),(n=Ot.get(n))&&ls(a,n),i=(e.ownerDocument||e).createElement("link"),Ke(i);var c=i;return c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(i,"link",a),t.state.loading|=4,Ri(i,l.precedence,e),t.instance=i;case"script":return i=_a(l.src),(n=e.querySelector(pn(i)))?(t.instance=n,Ke(n),n):(a=l,(n=Ot.get(i))&&(a=z({},l),as(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Ke(n),Ie(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ri(a,l.precedence,e));return t.instance}function Ri(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,i=n,c=0;c<a.length;c++){var f=a[c];if(f.dataset.precedence===t)i=f;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function ls(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function as(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ui=null;function fd(e,t,l){if(Ui===null){var a=new Map,n=Ui=new Map;n.set(l,a)}else n=Ui,a=n.get(l),a||(a=new Map,n.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),n=0;n<l.length;n++){var i=l[n];if(!(i[Ra]||i[ke]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var c=i.getAttribute(t)||"";c=e+c;var f=a.get(c);f?f.push(i):a.set(c,[i])}}return a}function od(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function iy(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function rd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function uy(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Aa(a.href),i=t.querySelector(gn(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=qi.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,Ke(i);return}i=t.ownerDocument||t,a=cd(a),(n=Ot.get(n))&&ls(a,n),i=i.createElement("link"),Ke(i);var c=i;c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(i,"link",a),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=qi.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ns=0;function cy(e,t){return e.stylesheets&&e.count===0&&Bi(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&Bi(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&ns===0&&(ns=62500*Xm());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bi(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>ns?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function qi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hi=null;function Bi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hi=new Map,t.forEach(sy,e),Hi=null,qi.call(e))}function sy(e,t){if(!(t.state.loading&4)){var l=Hi.get(e);if(l)var a=l.get(null);else{l=new Map,Hi.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var c=n[i];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),a=c)}a&&l.set(null,a)}n=t.instance,c=n.getAttribute("data-precedence"),i=l.get(c)||a,i===a&&l.set(null,n),l.set(c,n),this.count++,a=qi.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var bn={$$typeof:le,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function fy(e,t,l,a,n,i,c,f,r){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pi(0),this.hiddenUpdates=Pi(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=r,this.incompleteTransitions=new Map}function dd(e,t,l,a,n,i,c,f,r,g,E,C){return e=new fy(e,t,l,c,r,g,E,C,f),t=1,i===!0&&(t|=24),i=ht(3,null,null,t),e.current=i,i.stateNode=e,t=Bu(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:a,isDehydrated:l,cache:t},Xu(i),e}function hd(e){return e?(e=aa,e):aa}function md(e,t,l,a,n,i){n=hd(n),a.context===null?a.context=n:a.pendingContext=n,a=sl(t),a.payload={element:l},i=i===void 0?null:i,i!==null&&(a.callback=i),l=fl(e,a,t),l!==null&&(st(l,e,t),$a(l,e,t))}function yd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function is(e,t){yd(e,t),(e=e.alternate)&&yd(e,t)}function vd(e){if(e.tag===13||e.tag===31){var t=Dl(e,67108864);t!==null&&st(t,e,67108864),is(e,67108864)}}function gd(e){if(e.tag===13||e.tag===31){var t=pt();t=eu(t);var l=Dl(e,t);l!==null&&st(l,e,t),is(e,t)}}var Yi=!0;function oy(e,t,l,a){var n=T.T;T.T=null;var i=N.p;try{N.p=2,us(e,t,l,a)}finally{N.p=i,T.T=n}}function ry(e,t,l,a){var n=T.T;T.T=null;var i=N.p;try{N.p=8,us(e,t,l,a)}finally{N.p=i,T.T=n}}function us(e,t,l,a){if(Yi){var n=cs(a);if(n===null)Kc(e,t,a,Gi,l),bd(e,a);else if(hy(n,e,t,l,a))a.stopPropagation();else if(bd(e,a),t&4&&-1<dy.indexOf(e)){for(;n!==null;){var i=Kl(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var c=_l(i.pendingLanes);if(c!==0){var f=i;for(f.pendingLanes|=2,f.entangledLanes|=2;c;){var r=1<<31-rt(c);f.entanglements[1]|=r,c&=~r}qt(i),(ye&6)===0&&(Si=ft()+500,hn(0))}}break;case 31:case 13:f=Dl(i,2),f!==null&&st(f,i,2),Ti(),is(i,2)}if(i=cs(a),i===null&&Kc(e,t,a,Gi,l),i===n)break;n=i}n!==null&&a.stopPropagation()}else Kc(e,t,a,null,l)}}function cs(e){return e=fu(e),ss(e)}var Gi=null;function ss(e){if(Gi=null,e=Vl(e),e!==null){var t=A(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=q(t),e!==null)return e;e=null}else if(l===31){if(e=H(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Gi=e,null}function pd(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Fd()){case Es:return 2;case As:return 8;case On:case Id:return 32;case _s:return 268435456;default:return 32}default:return 32}}var fs=!1,xl=null,Sl=null,jl=null,xn=new Map,Sn=new Map,Tl=[],dy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function bd(e,t){switch(e){case"focusin":case"focusout":xl=null;break;case"dragenter":case"dragleave":Sl=null;break;case"mouseover":case"mouseout":jl=null;break;case"pointerover":case"pointerout":xn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sn.delete(t.pointerId)}}function jn(e,t,l,a,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:i,targetContainers:[n]},t!==null&&(t=Kl(t),t!==null&&vd(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function hy(e,t,l,a,n){switch(t){case"focusin":return xl=jn(xl,e,t,l,a,n),!0;case"dragenter":return Sl=jn(Sl,e,t,l,a,n),!0;case"mouseover":return jl=jn(jl,e,t,l,a,n),!0;case"pointerover":var i=n.pointerId;return xn.set(i,jn(xn.get(i)||null,e,t,l,a,n)),!0;case"gotpointercapture":return i=n.pointerId,Sn.set(i,jn(Sn.get(i)||null,e,t,l,a,n)),!0}return!1}function xd(e){var t=Vl(e.target);if(t!==null){var l=A(t);if(l!==null){if(t=l.tag,t===13){if(t=q(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===31){if(t=H(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=cs(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);su=a,l.target.dispatchEvent(a),su=null}else return t=Kl(l),t!==null&&vd(t),e.blockedOn=l,!1;t.shift()}return!0}function Sd(e,t,l){wi(e)&&l.delete(t)}function my(){fs=!1,xl!==null&&wi(xl)&&(xl=null),Sl!==null&&wi(Sl)&&(Sl=null),jl!==null&&wi(jl)&&(jl=null),xn.forEach(Sd),Sn.forEach(Sd)}function Xi(e,t){e.blockedOn===t&&(e.blockedOn=null,fs||(fs=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,my)))}var Qi=null;function jd(e){Qi!==e&&(Qi=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Qi===e&&(Qi=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],n=e[t+2];if(typeof a!="function"){if(ss(a||l)===null)continue;break}var i=Kl(l);i!==null&&(e.splice(t,3),t-=3,cc(i,{pending:!0,data:n,method:l.method,action:a},a,n))}}))}function za(e){function t(r){return Xi(r,e)}xl!==null&&Xi(xl,e),Sl!==null&&Xi(Sl,e),jl!==null&&Xi(jl,e),xn.forEach(t),Sn.forEach(t);for(var l=0;l<Tl.length;l++){var a=Tl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Tl.length&&(l=Tl[0],l.blockedOn===null);)xd(l),l.blockedOn===null&&Tl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var n=l[a],i=l[a+1],c=n[lt]||null;if(typeof i=="function")c||jd(l);else if(c){var f=null;if(i&&i.hasAttribute("formAction")){if(n=i,c=i[lt]||null)f=c.formAction;else if(ss(n)!==null)continue}else f=c.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),jd(l)}}}function Td(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(c){return n=c})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function os(e){this._internalRoot=e}Li.prototype.render=os.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,a=pt();md(l,a,e,t,null,null)},Li.prototype.unmount=os.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;md(e.current,2,null,e,null,null),Ti(),t[Zl]=null}};function Li(e){this._internalRoot=e}Li.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ds();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Tl.length&&t!==0&&t<Tl[l].priority;l++);Tl.splice(l,0,e),l===0&&xd(e)}};var Ed=x.version;if(Ed!=="19.2.5")throw Error(o(527,Ed,"19.2.5"));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=d(t),e=e!==null?R(e):null,e=e===null?null:e.stateNode,e};var yy={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zi.isDisabled&&Zi.supportsFiber)try{Ca=Zi.inject(yy),ot=Zi}catch{}}return En.createRoot=function(e,t){if(!j(e))throw Error(o(299));var l=!1,a="",n=Do,i=Mo,c=Ro;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dd(e,1,!1,null,null,l,a,null,n,i,c,Td),e[Zl]=t.current,Vc(e),new os(t)},En.hydrateRoot=function(e,t,l){if(!j(e))throw Error(o(299));var a=!1,n="",i=Do,c=Mo,f=Ro,r=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(n=l.identifierPrefix),l.onUncaughtError!==void 0&&(i=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(r=l.formState)),t=dd(e,1,!0,t,l??null,a,n,r,i,c,f,Td),t.context=hd(null),l=t.current,a=pt(),a=eu(a),n=sl(a),n.callback=null,fl(l,n,a),l=a,t.current.lanes=l,Ma(t,l),qt(t),e[Zl]=t.current,Vc(e),new Li(t)},En.version="19.2.5",En}var Ud;function Ay(){if(Ud)return hs.exports;Ud=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(x){console.error(x)}}return s(),hs.exports=Ey(),hs.exports}var _y=Ay();const zy=wd(_y),Qd="";class An extends Error{constructor(x,b,o){super(x),this.status=b,this.outcome=o}}function Ss(s){return s instanceof An?s.outcome?s.outcome==="unknown":s.status>=500||s.status===408:!0}async function Ne(s,x){const b=await fetch(`${Qd}${s}`,{...x,credentials:"same-origin",headers:{"Content-Type":"application/json",...x==null?void 0:x.headers}});if(!b.ok){const o=await b.json().catch(()=>null);b.status===401&&(window.location.hash="#login");const j=b.status===429?` Wait ${b.headers.get("retry-after")||"60"} seconds before retrying.`:"",A=typeof(o==null?void 0:o.message)=="string"?o.message:typeof(o==null?void 0:o.error)=="string"?o.error:`HTTP ${b.status}`,q=typeof(o==null?void 0:o.next_action)=="string"?` ${o.next_action}`:"",H=(o==null?void 0:o.outcome)==="unknown"||(o==null?void 0:o.outcome)==="failed"?o.outcome:void 0;throw new An(A+q+j,b.status,H)}return b.json()}async function Oy(s){const x=await fetch(`${Qd}${s}`,{credentials:"same-origin"});if(x.status===401)throw window.location.hash="#login",new Error("Unauthorized");if(!x.ok)throw new Error(`HTTP ${x.status}`);return x.text()}const Oe={oauthRequest:s=>Ne(`/admin/api/oauth-requests/${encodeURIComponent(s)}`),decideOAuthRequest:(s,x,b)=>Ne(`/admin/api/oauth-requests/${encodeURIComponent(s)}`,{method:"POST",body:JSON.stringify({decision:x,csrf:b})}),login:s=>Ne("/admin/login",{method:"POST",body:JSON.stringify({token:s})}),signOutEverywhere:()=>Ne("/admin/api/sign-out-everywhere",{method:"POST"}),stats:()=>Ne("/admin/api/stats"),health:()=>Ne("/admin/api/health-indicators"),agents:()=>Ne("/admin/api/agents"),agentsSpend:()=>Ne("/admin/api/agents/spend"),sources:()=>Ne("/admin/api/sources"),grantCatalog:()=>Ne("/admin/api/grant-catalog"),clientGrant:s=>Ne(`/admin/api/grants/${encodeURIComponent(s)}`),clientDetails:s=>Ne(`/admin/api/clients/${encodeURIComponent(s)}`),clientSetup:(s,x,b)=>{const o=new URLSearchParams({harness:x});return b&&o.set("flow",b),Ne(`/admin/api/clients/${encodeURIComponent(s)}/setup?${o}`)},clientLifecycle:(s,x)=>Ne(`/admin/api/clients/${encodeURIComponent(s)}/lifecycle`,{method:"POST",body:JSON.stringify(x)}),registerClient:s=>Ne("/admin/api/register-client",{method:"POST",body:JSON.stringify(s)}),recoverClient:(s,x,b)=>Ne("/admin/api/recover-client",{method:"POST",body:JSON.stringify({clientId:s,harness:x,flow:b})}),updateClientGrant:(s,x)=>Ne("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({...x,clientId:s})}),requests:(s=1,x="")=>Ne(`/admin/api/requests?page=${s}${x}`),apiKeys:()=>Ne("/admin/api/api-keys"),createApiKey(s,x){return Ne("/admin/api/api-keys",{method:"POST",body:JSON.stringify({name:s,scopes:x})})},revokeApiKey(s){return Ne("/admin/api/api-keys/revoke",{method:"POST",body:JSON.stringify({id:s})})},updateClientTtl:(s,x)=>Ne("/admin/api/update-client-ttl",{method:"POST",body:JSON.stringify({clientId:s,tokenTtl:x})}),rescopeClient:(s,x,b)=>Ne("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({clientId:s,sourceId:x,federatedRead:b})}),revokeClient:s=>Ne("/admin/api/revoke-client",{method:"POST",body:JSON.stringify({clientId:s})}),calibrationProfile:s=>Ne(`/admin/api/calibration/profile${s?`?holder=${encodeURIComponent(s)}`:""}`),calibrationChart:(s,x)=>Oy(`/admin/api/calibration/charts/${encodeURIComponent(s)}${x?`?holder=${encodeURIComponent(x)}`:""}`),jobsWatch:()=>Ne("/admin/api/jobs/watch")},ps="gbrain.pending-oauth-request",qd=s=>s!==null&&/^[a-f0-9]{64}$/.test(s);function Ki(){const s=new URL(window.location.href).searchParams.get("oauth_request");if(qd(s)){try{window.sessionStorage.setItem(ps,s)}catch{}return s}try{const x=window.sessionStorage.getItem(ps);if(qd(x))return x}catch{}}function Hd(){try{window.sessionStorage.removeItem(ps)}catch{}const s=new URL(window.location.href);s.searchParams.delete("oauth_request"),window.history.replaceState(null,"",s)}function Ny(s,x){const b=x?` --oauth-request ${x}`:"";return`Give me an owner admin login link for ${s}. On the brain host, run gbrain mcp admin login-link --url ${s}${b} using its protected owner credential. Deliver the single-use link privately and do not open it before I do.`}function Cy({onLogin:s}){const[x,b]=U.useState(""),[o,j]=U.useState(""),[A,q]=U.useState(!1),[H,_]=U.useState(!1),[d,R]=U.useState(""),[z,M]=U.useState(),[Q,G]=U.useState(""),[Z,W]=U.useState(0),ae=Ki(),$=z?Ny(z,ae):void 0;U.useEffect(()=>{let ne=!0;const be=new AbortController,k=setTimeout(()=>be.abort(),1e4);return M(void 0),G(""),_(!1),fetch("/.well-known/gbrain",{credentials:"omit",redirect:"error",cache:"no-store",signal:be.signal}).then(async V=>{if(!V.ok)throw new Error("Server discovery is unavailable.");const xe=await V.json();if(typeof(xe==null?void 0:xe.endpoint)!="string")throw new Error("Server discovery has no MCP endpoint.");const Se=new URL(xe.endpoint);if(!["https:","http:"].includes(Se.protocol)||Se.username||Se.password||Se.search||Se.hash||Se.pathname!=="/mcp")throw new Error("Server discovery returned an invalid MCP endpoint.");ne&&M(Se.toString())}).catch(()=>{ne&&G("The configured MCP endpoint could not be discovered. Ask the brain host administrator to check the server’s configured public URL. You can still sign in with the owner credential below.")}).finally(()=>clearTimeout(k)),()=>{ne=!1,clearTimeout(k),be.abort()}},[Z]);const le=async ne=>{ne.preventDefault(),j(""),q(!0);try{await Oe.login(x),b(""),s()}catch(be){j(be instanceof An&&be.status===401?"The owner bootstrap credential was not accepted. An OAuth access token or client secret cannot log into this dashboard. Ask the brain host administrator for a fresh login link.":be instanceof Error?be.message:"Could not reach the owner login service. Check the server and retry.")}finally{q(!1)}};return u.jsx("div",{className:"login-page",children:u.jsxs("section",{className:"login-box","aria-labelledby":"owner-login-title",style:{maxWidth:560},children:[u.jsx("h1",{id:"owner-login-title",className:"login-logo",children:"GBrain owner login"}),u.jsx("p",{style:{marginBottom:16},children:"Ask the agent that administers the brain host for a login link. Ordinary MCP clients cannot create owner login links, even with an admin scope."}),ae&&u.jsx("p",{role:"status",style:{marginBottom:16},children:"A client connection is waiting for owner approval. The prompt below preserves that request when you open the login link in another browser or tab."}),$&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"owner-login-prompt",children:"Prompt for the host administrator"}),u.jsx("textarea",{id:"owner-login-prompt",rows:7,readOnly:!0,value:$,style:{fontFamily:"var(--font-mono)",fontSize:12}}),u.jsx("button",{type:"button",className:"btn btn-secondary",style:{marginTop:8},onClick:()=>{R(""),navigator.clipboard.writeText($).then(()=>_(!0)).catch(()=>R("Clipboard unavailable. Select and copy the prompt above."))},children:H?"Prompt copied":"Copy owner login prompt"})]}),!$&&!Q&&u.jsx("p",{role:"status",children:"Discovering the server’s configured MCP endpoint…"}),Q&&u.jsxs("p",{role:"alert",children:[Q," ",u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>W(ne=>ne+1),children:"Retry server discovery"})]}),d&&u.jsx("p",{role:"alert",children:d}),u.jsx("p",{className:"grant-help",style:{margin:"12px 0 20px"},children:"Login links expire after five minutes and can be used once. A client’s PKCE sign-in requests access to memory; owner login approves that request."}),u.jsxs("details",{children:[u.jsx("summary",{style:{cursor:"pointer"},children:"Sign in with the owner bootstrap credential"}),u.jsxs("form",{onSubmit:le,style:{marginTop:12},children:[u.jsx("label",{htmlFor:"owner-bootstrap-token",children:"Owner bootstrap credential"}),u.jsx("input",{id:"owner-bootstrap-token",type:"password",autoComplete:"off",value:x,disabled:A,onChange:ne=>b(ne.target.value)}),u.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%",marginTop:12},disabled:A||!x.trim(),children:A?"Signing in…":"Sign in as owner"}),o&&u.jsx("p",{role:"alert",className:"login-error",children:o})]})]})]})})}function Dy(s,x,b,o=globalThis){let j=null;const A=()=>{j!==null&&(o.clearInterval(j),j=null)},q=()=>{j===null&&(j=o.setInterval(s,x))},H=()=>{if(b.hidden){A();return}s(),q()};return b.addEventListener("visibilitychange",H),b.hidden||q(),()=>{b.removeEventListener("visibilitychange",H),A()}}function My(){const[s,x]=U.useState({connected_agents:0,requests_today:0,active_tokens:0}),[b,o]=U.useState({expiring_soon:0,error_rate:"0%"}),[j,A]=U.useState([]),[q,H]=U.useState("connecting"),_=U.useRef(null);U.useEffect(()=>{const R=()=>{Oe.stats().then(x).catch(()=>{}),Oe.health().then(o).catch(()=>{})};R();const z=new EventSource("/admin/events",{withCredentials:!0});_.current=z,z.onopen=()=>H("connected"),z.onmessage=Q=>{try{const G=JSON.parse(Q.data);A(Z=>[G,...Z].slice(0,50))}catch{}},z.onerror=()=>{H("disconnected"),setTimeout(()=>{H("connecting"),z.close()},3e3)};const M=Dy(R,3e4,document);return()=>{z.close(),M()}},[]);const d=R=>{const z=Date.now()-new Date(R).getTime();return z<6e4?`${Math.floor(z/1e3)}s ago`:z<36e5?`${Math.floor(z/6e4)} min ago`:`${Math.floor(z/36e5)}h ago`};return u.jsxs(u.Fragment,{children:[u.jsx("h1",{className:"page-title",children:"Dashboard"}),u.jsxs("div",{style:{display:"flex",gap:24},children:[u.jsxs("div",{style:{flex:1},children:[u.jsxs("div",{className:"metrics",children:[u.jsxs("div",{className:"metric",children:[u.jsx("div",{className:"metric-value",children:s.connected_agents}),u.jsx("div",{className:"metric-label",children:"Connected Agents"})]}),u.jsxs("div",{className:"metric",children:[u.jsx("div",{className:"metric-value",children:s.requests_today}),u.jsx("div",{className:"metric-label",children:"Requests Today"})]}),u.jsxs("div",{className:"metric",children:[u.jsx("div",{className:"metric-value",children:s.active_tokens}),u.jsx("div",{className:"metric-label",children:"Active Tokens"})]})]}),u.jsxs("h2",{className:"section-title",children:["Live Activity",u.jsx("span",{style:{marginLeft:8,fontSize:10,color:q==="connected"?"var(--success)":q==="connecting"?"var(--warning)":"var(--error)"},children:q==="connected"?"● connected":q==="connecting"?"● connecting...":"● disconnected"})]}),u.jsx("div",{className:"feed",children:j.length===0?u.jsx("div",{className:"feed-empty",children:q==="connected"?"No requests yet. Agents will appear when they connect.":"Connecting..."}):u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Agent"}),u.jsx("th",{children:"Operation"}),u.jsx("th",{children:"Scopes"}),u.jsx("th",{children:"Latency"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Time"})]})}),u.jsx("tbody",{children:j.map((R,z)=>u.jsxs("tr",{children:[u.jsx("td",{className:"mono",children:R.agent}),u.jsx("td",{className:"mono",children:R.operation}),u.jsx("td",{children:R.scopes.split(",").map(M=>u.jsx("span",{className:`badge badge-${M.trim()}`,style:{marginRight:4},children:M.trim()},M))}),u.jsxs("td",{className:"mono",children:[R.latency_ms," ms"]}),u.jsx("td",{children:u.jsx("span",{className:`badge badge-${R.status}`,children:R.status})}),u.jsx("td",{style:{color:"var(--text-secondary)"},children:d(R.timestamp)})]},z))})]})})]}),u.jsxs("div",{style:{width:220},children:[u.jsx("h2",{className:"section-title",children:"Token Health"}),u.jsxs("div",{className:"health-panel",children:[u.jsxs("div",{className:"health-row",children:[u.jsx("span",{style:{color:"var(--warning)"},children:"Expiring Soon"}),u.jsx("span",{className:"mono",children:b.expiring_soon})]}),u.jsxs("div",{className:"health-row",children:[u.jsx("span",{style:{color:"var(--error)"},children:"Error Rate"}),u.jsx("span",{className:"mono",children:b.error_rate})]})]})]})]})]})}const Oa=s=>s.split(/[\s,]+/).filter(Boolean);function bs(s){var x,b,o;return{profile:(s==null?void 0:s.profile)??"memory-writer",applyProfile:!s,source:(s==null?void 0:s.sourceId)??"default",reads:(s==null?void 0:s.federatedRead)??["default"],scopes:(s==null?void 0:s.scopes.join(" "))??"",directPrefixes:((x=s==null?void 0:s.boundSlugPrefixes)==null?void 0:x.join(`-`+a.stack}}var $i=Object.prototype.hasOwnProperty,Fi=s.unstable_scheduleCallback,Ii=s.unstable_cancelCallback,Wd=s.unstable_shouldYield,$d=s.unstable_requestPaint,ft=s.unstable_now,Fd=s.unstable_getCurrentPriorityLevel,Es=s.unstable_ImmediatePriority,As=s.unstable_UserBlockingPriority,On=s.unstable_NormalPriority,Id=s.unstable_LowPriority,_s=s.unstable_IdlePriority,Pd=s.log,eh=s.unstable_setDisableYieldValue,Na=null,ot=null;function el(e){if(typeof Pd=="function"&&eh(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(Na,e)}catch{}}var rt=Math.clz32?Math.clz32:ah,th=Math.log,lh=Math.LN2;function ah(e){return e>>>=0,e===0?32:31-(th(e)/lh|0)|0}var Cn=256,Nn=262144,Dn=4194304;function _l(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Mn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,i=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~i,a!==0?n=_l(a):(c&=f,c!==0?n=_l(c):l||(l=f&~e,l!==0&&(n=_l(l))))):(f=a&~i,f!==0?n=_l(f):c!==0?n=_l(c):l||(l=a&~e,l!==0&&(n=_l(l)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:n}function Da(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nh(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zs(){var e=Dn;return Dn<<=1,(Dn&62914560)===0&&(Dn=4194304),e}function Pi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ma(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ih(e,t,l,a,n,i){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var f=e.entanglements,r=e.expirationTimes,g=e.hiddenUpdates;for(l=c&~l;0<l;){var E=31-rt(l),D=1<<E;f[E]=0,r[E]=-1;var p=g[E];if(p!==null)for(g[E]=null,E=0;E<p.length;E++){var S=p[E];S!==null&&(S.lane&=-536870913)}l&=~D}a!==0&&Os(e,a,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(c&~t))}function Os(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-rt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Cs(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-rt(l),n=1<<a;n&t|e[a]&t&&(e[a]|=t),l&=~n}}function Ns(e,t){var l=t&-t;return l=(l&42)!==0?1:eu(l),(l&(e.suspendedLanes|t))!==0?0:l}function eu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ds(){var e=N.p;return e!==0?e:(e=window.event,e===void 0?32:pd(e.type))}function Ms(e,t){var l=N.p;try{return N.p=e,t()}finally{N.p=l}}var tl=Math.random().toString(36).slice(2),ke="__reactFiber$"+tl,lt="__reactProps$"+tl,Zl="__reactContainer$"+tl,lu="__reactEvents$"+tl,uh="__reactListeners$"+tl,ch="__reactHandles$"+tl,Rs="__reactResources$"+tl,Ra="__reactMarker$"+tl;function au(e){delete e[ke],delete e[lt],delete e[lu],delete e[uh],delete e[ch]}function Vl(e){var t=e[ke];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Zl]||l[ke]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=ld(e);e!==null;){if(l=e[ke])return l;e=ld(e)}return t}e=l,l=e.parentNode}return null}function Kl(e){if(e=e[ke]||e[Zl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ua(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Jl(e){var t=e[Rs];return t||(t=e[Rs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ke(e){e[Ra]=!0}var Us=new Set,qs={};function zl(e,t){kl(e,t),kl(e+"Capture",t)}function kl(e,t){for(qs[e]=t,e=0;e<t.length;e++)Us.add(t[e])}var sh=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Hs={},Bs={};function fh(e){return $i.call(Bs,e)?!0:$i.call(Hs,e)?!1:sh.test(e)?Bs[e]=!0:(Hs[e]=!0,!1)}function Rn(e,t,l){if(fh(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Un(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Ht(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function bt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ys(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oh(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var n=a.get,i=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(c){l=""+c,i.call(this,c)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nu(e){if(!e._valueTracker){var t=Ys(e)?"checked":"value";e._valueTracker=oh(e,t,""+e[t])}}function ws(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=Ys(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function qn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var rh=/[\n"\\]/g;function xt(e){return e.replace(rh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function iu(e,t,l,a,n,i,c,f){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+bt(t)):e.value!==""+bt(t)&&(e.value=""+bt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?uu(e,c,bt(t)):l!=null?uu(e,c,bt(l)):a!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+bt(f):e.removeAttribute("name")}function Gs(e,t,l,a,n,i,c,f){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){nu(e);return}l=l!=null?""+bt(l):"",t=t!=null?""+bt(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),nu(e)}function uu(e,t,l){t==="number"&&qn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Wl(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n<l.length;n++)t["$"+l[n]]=!0;for(l=0;l<e.length;l++)n=t.hasOwnProperty("$"+e[l].value),e[l].selected!==n&&(e[l].selected=n),n&&a&&(e[l].defaultSelected=!0)}else{for(l=""+bt(l),t=null,n=0;n<e.length;n++){if(e[n].value===l){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Xs(e,t,l){if(t!=null&&(t=""+bt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+bt(l):""}function Qs(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(o(92));if(Ze(a)){if(1<a.length)throw Error(o(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=bt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),nu(e)}function $l(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var dh=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ls(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||dh.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Zs(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&l[n]!==a&&Ls(e,n,a)}else for(var i in t)t.hasOwnProperty(i)&&Ls(e,i,t[i])}function cu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var hh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),mh=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hn(e){return mh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Bt(){}var su=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fl=null,Il=null;function Vs(e){var t=Kl(e);if(t&&(e=t.stateNode)){var l=e[lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(iu(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+xt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var n=a[lt]||null;if(!n)throw Error(o(90));iu(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&ws(a)}break e;case"textarea":Xs(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Wl(e,!!l.multiple,t,!1)}}}var ou=!1;function Ks(e,t,l){if(ou)return e(t,l);ou=!0;try{var a=e(t);return a}finally{if(ou=!1,(Fl!==null||Il!==null)&&(Ti(),Fl&&(t=Fl,e=Il,Il=Fl=null,Vs(t),e)))for(t=0;t<e.length;t++)Vs(e[t])}}function qa(e,t){var l=e.stateNode;if(l===null)return null;var a=l[lt]||null;if(a===null)return null;l=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(o(231,t,typeof l));return l}var Yt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ru=!1;if(Yt)try{var Ha={};Object.defineProperty(Ha,"passive",{get:function(){ru=!0}}),window.addEventListener("test",Ha,Ha),window.removeEventListener("test",Ha,Ha)}catch{ru=!1}var ll=null,du=null,Bn=null;function Js(){if(Bn)return Bn;var e,t=du,l=t.length,a,n="value"in ll?ll.value:ll.textContent,i=n.length;for(e=0;e<l&&t[e]===n[e];e++);var c=l-e;for(a=1;a<=c&&t[l-a]===n[i-a];a++);return Bn=n.slice(e,1<a?1-a:void 0)}function Yn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function wn(){return!0}function ks(){return!1}function at(e){function t(l,a,n,i,c){this._reactName=l,this._targetInst=n,this.type=a,this.nativeEvent=i,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(i):i[f]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?wn:ks,this.isPropagationStopped=ks,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gn=at(Ol),Ba=j({},Ol,{view:0,detail:0}),yh=at(Ba),hu,mu,Ya,Xn=j({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ya&&(Ya&&e.type==="mousemove"?(hu=e.screenX-Ya.screenX,mu=e.screenY-Ya.screenY):mu=hu=0,Ya=e),hu)},movementY:function(e){return"movementY"in e?e.movementY:mu}}),Ws=at(Xn),vh=j({},Xn,{dataTransfer:0}),gh=at(vh),ph=j({},Ba,{relatedTarget:0}),yu=at(ph),bh=j({},Ol,{animationName:0,elapsedTime:0,pseudoElement:0}),xh=at(bh),Sh=j({},Ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jh=at(Sh),Th=j({},Ol,{data:0}),$s=at(Th),Eh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ah={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_h={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_h[e])?!!t[e]:!1}function vu(){return zh}var Oh=j({},Ba,{key:function(e){if(e.key){var t=Eh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ah[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(e){return e.type==="keypress"?Yn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ch=at(Oh),Nh=j({},Xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fs=at(Nh),Dh=j({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),Mh=at(Dh),Rh=j({},Ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uh=at(Rh),qh=j({},Xn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Hh=at(qh),Bh=j({},Ol,{newState:0,oldState:0}),Yh=at(Bh),wh=[9,13,27,32],gu=Yt&&"CompositionEvent"in window,wa=null;Yt&&"documentMode"in document&&(wa=document.documentMode);var Gh=Yt&&"TextEvent"in window&&!wa,Is=Yt&&(!gu||wa&&8<wa&&11>=wa),Ps=" ",ef=!1;function tf(e,t){switch(e){case"keyup":return wh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pl=!1;function Xh(e,t){switch(e){case"compositionend":return lf(t);case"keypress":return t.which!==32?null:(ef=!0,Ps);case"textInput":return e=t.data,e===Ps&&ef?null:e;default:return null}}function Qh(e,t){if(Pl)return e==="compositionend"||!gu&&tf(e,t)?(e=Js(),Bn=du=ll=null,Pl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Is&&t.locale!=="ko"?null:t.data;default:return null}}var Lh={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function af(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lh[e.type]:t==="textarea"}function nf(e,t,l,a){Fl?Il?Il.push(a):Il=[a]:Fl=a,t=Ni(t,"onChange"),0<t.length&&(l=new Gn("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var Ga=null,Xa=null;function Zh(e){Qr(e,0)}function Qn(e){var t=Ua(e);if(ws(t))return e}function uf(e,t){if(e==="change")return t}var cf=!1;if(Yt){var pu;if(Yt){var bu="oninput"in document;if(!bu){var sf=document.createElement("div");sf.setAttribute("oninput","return;"),bu=typeof sf.oninput=="function"}pu=bu}else pu=!1;cf=pu&&(!document.documentMode||9<document.documentMode)}function ff(){Ga&&(Ga.detachEvent("onpropertychange",of),Xa=Ga=null)}function of(e){if(e.propertyName==="value"&&Qn(Xa)){var t=[];nf(t,Xa,e,fu(e)),Ks(Zh,t)}}function Vh(e,t,l){e==="focusin"?(ff(),Ga=t,Xa=l,Ga.attachEvent("onpropertychange",of)):e==="focusout"&&ff()}function Kh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qn(Xa)}function Jh(e,t){if(e==="click")return Qn(t)}function kh(e,t){if(e==="input"||e==="change")return Qn(t)}function Wh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dt=typeof Object.is=="function"?Object.is:Wh;function Qa(e,t){if(dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var n=l[a];if(!$i.call(t,n)||!dt(e[n],t[n]))return!1}return!0}function rf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function df(e,t){var l=rf(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=rf(l)}}function hf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=qn(e.document)}return t}function xu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var $h=Yt&&"documentMode"in document&&11>=document.documentMode,ea=null,Su=null,La=null,ju=!1;function yf(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ju||ea==null||ea!==qn(a)||(a=ea,"selectionStart"in a&&xu(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),La&&Qa(La,a)||(La=a,a=Ni(Su,"onSelect"),0<a.length&&(t=new Gn("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ea)))}function Cl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ta={animationend:Cl("Animation","AnimationEnd"),animationiteration:Cl("Animation","AnimationIteration"),animationstart:Cl("Animation","AnimationStart"),transitionrun:Cl("Transition","TransitionRun"),transitionstart:Cl("Transition","TransitionStart"),transitioncancel:Cl("Transition","TransitionCancel"),transitionend:Cl("Transition","TransitionEnd")},Tu={},vf={};Yt&&(vf=document.createElement("div").style,"AnimationEvent"in window||(delete ta.animationend.animation,delete ta.animationiteration.animation,delete ta.animationstart.animation),"TransitionEvent"in window||delete ta.transitionend.transition);function Nl(e){if(Tu[e])return Tu[e];if(!ta[e])return e;var t=ta[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in vf)return Tu[e]=t[l];return e}var gf=Nl("animationend"),pf=Nl("animationiteration"),bf=Nl("animationstart"),Fh=Nl("transitionrun"),Ih=Nl("transitionstart"),Ph=Nl("transitioncancel"),xf=Nl("transitionend"),Sf=new Map,Eu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Eu.push("scrollEnd");function Ct(e,t){Sf.set(e,t),zl(t,[e])}var Ln=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},St=[],la=0,Au=0;function Zn(){for(var e=la,t=Au=la=0;t<e;){var l=St[t];St[t++]=null;var a=St[t];St[t++]=null;var n=St[t];St[t++]=null;var i=St[t];if(St[t++]=null,a!==null&&n!==null){var c=a.pending;c===null?n.next=n:(n.next=c.next,c.next=n),a.pending=n}i!==0&&jf(l,n,i)}}function Vn(e,t,l,a){St[la++]=e,St[la++]=t,St[la++]=l,St[la++]=a,Au|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function _u(e,t,l,a){return Vn(e,t,l,a),Kn(e)}function Dl(e,t){return Vn(e,null,null,t),Kn(e)}function jf(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var n=!1,i=e.return;i!==null;)i.childLanes|=l,a=i.alternate,a!==null&&(a.childLanes|=l),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-rt(l),e=i.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=l|536870912),i):null}function Kn(e){if(50<dn)throw dn=0,qc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var aa={};function em(e,t,l,a){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ht(e,t,l,a){return new em(e,t,l,a)}function zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wt(e,t){var l=e.alternate;return l===null?(l=ht(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Tf(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Jn(e,t,l,a,n,i){var c=0;if(a=e,typeof e=="function")zu(e)&&(c=1);else if(typeof e=="string")c=iy(e,l,Q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case je:return e=ht(31,l,t,n),e.elementType=je,e.lanes=i,e;case Z:return Ml(l.children,n,i,t);case W:c=8,n|=24;break;case ae:return e=ht(12,l,t,n|2),e.elementType=ae,e.lanes=i,e;case xe:return e=ht(13,l,t,n),e.elementType=xe,e.lanes=i,e;case k:return e=ht(19,l,t,n),e.elementType=k,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:c=10;break e;case $:c=9;break e;case ne:c=11;break e;case V:c=14;break e;case Se:c=16,a=null;break e}c=29,l=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=ht(c,l,t,n),t.elementType=e,t.type=a,t.lanes=i,t}function Ml(e,t,l,a){return e=ht(7,e,a,t),e.lanes=l,e}function Ou(e,t,l){return e=ht(6,e,null,t),e.lanes=l,e}function Ef(e){var t=ht(18,null,null,0);return t.stateNode=e,t}function Cu(e,t,l){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Af=new WeakMap;function jt(e,t){if(typeof e=="object"&&e!==null){var l=Af.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Ts(t)},Af.set(e,t),t)}return{value:e,source:t,stack:Ts(t)}}var na=[],ia=0,kn=null,Za=0,Tt=[],Et=0,al=null,Mt=1,Rt="";function Gt(e,t){na[ia++]=Za,na[ia++]=kn,kn=e,Za=t}function _f(e,t,l){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,al=e;var a=Mt;e=Rt;var n=32-rt(a)-1;a&=~(1<<n),l+=1;var i=32-rt(t)+n;if(30<i){var c=n-n%5;i=(a&(1<<c)-1).toString(32),a>>=c,n-=c,Mt=1<<32-rt(t)+n|l<<n|a,Rt=i+e}else Mt=1<<i|l<<n|a,Rt=e}function Nu(e){e.return!==null&&(Gt(e,1),_f(e,1,0))}function Du(e){for(;e===kn;)kn=na[--ia],na[ia]=null,Za=na[--ia],na[ia]=null;for(;e===al;)al=Tt[--Et],Tt[Et]=null,Rt=Tt[--Et],Tt[Et]=null,Mt=Tt[--Et],Tt[Et]=null}function zf(e,t){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,Mt=t.id,Rt=t.overflow,al=e}var We=null,De=null,re=!1,nl=null,At=!1,Mu=Error(o(519));function il(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Va(jt(t,e)),Mu}function Of(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[ke]=e,t[lt]=a,l){case"dialog":ce("cancel",t),ce("close",t);break;case"iframe":case"object":case"embed":ce("load",t);break;case"video":case"audio":for(l=0;l<mn.length;l++)ce(mn[l],t);break;case"source":ce("error",t);break;case"img":case"image":case"link":ce("error",t),ce("load",t);break;case"details":ce("toggle",t);break;case"input":ce("invalid",t),Gs(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ce("invalid",t);break;case"textarea":ce("invalid",t),Qs(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||Kr(t.textContent,l)?(a.popover!=null&&(ce("beforetoggle",t),ce("toggle",t)),a.onScroll!=null&&ce("scroll",t),a.onScrollEnd!=null&&ce("scrollend",t),a.onClick!=null&&(t.onclick=Bt),t=!0):t=!1,t||il(e,!0)}function Cf(e){for(We=e.return;We;)switch(We.tag){case 5:case 31:case 13:At=!1;return;case 27:case 3:At=!0;return;default:We=We.return}}function ua(e){if(e!==We)return!1;if(!re)return Cf(e),re=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||$c(e.type,e.memoizedProps)),l=!l),l&&De&&il(e),Cf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else t===27?(t=De,bl(e.type)?(e=ts,ts=null,De=e):De=t):De=We?zt(e.stateNode.nextSibling):null;return!0}function Rl(){De=We=null,re=!1}function Ru(){var e=nl;return e!==null&&(ct===null?ct=e:ct.push.apply(ct,e),nl=null),e}function Va(e){nl===null?nl=[e]:nl.push(e)}var Uu=m(null),Ul=null,Xt=null;function ul(e,t,l){B(Uu,t._currentValue),t._currentValue=l}function Qt(e){e._currentValue=Uu.current,M(Uu)}function qu(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Hu(e,t,l,a){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var c=n.child;i=i.firstContext;e:for(;i!==null;){var f=i;i=n;for(var r=0;r<t.length;r++)if(f.context===t[r]){i.lanes|=l,f=i.alternate,f!==null&&(f.lanes|=l),qu(i.return,l,e),a||(c=null);break e}i=f.next}}else if(n.tag===18){if(c=n.return,c===null)throw Error(o(341));c.lanes|=l,i=c.alternate,i!==null&&(i.lanes|=l),qu(c,l,e),c=null}else c=n.child;if(c!==null)c.return=n;else for(c=n;c!==null;){if(c===e){c=null;break}if(n=c.sibling,n!==null){n.return=c.return,c=n;break}c=c.return}n=c}}function ca(e,t,l,a){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var c=n.alternate;if(c===null)throw Error(o(387));if(c=c.memoizedProps,c!==null){var f=n.type;dt(n.pendingProps.value,c.value)||(e!==null?e.push(f):e=[f])}}else if(n===ve.current){if(c=n.alternate,c===null)throw Error(o(387));c.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(bn):e=[bn])}n=n.return}e!==null&&Hu(t,e,l,a),t.flags|=262144}function Wn(e){for(e=e.firstContext;e!==null;){if(!dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ql(e){Ul=e,Xt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $e(e){return Nf(Ul,e)}function $n(e,t){return Ul===null&&ql(e),Nf(e,t)}function Nf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Xt===null){if(e===null)throw Error(o(308));Xt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xt=Xt.next=t;return l}var tm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},lm=s.unstable_scheduleCallback,am=s.unstable_NormalPriority,Ge={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bu(){return{controller:new tm,data:new Map,refCount:0}}function Ka(e){e.refCount--,e.refCount===0&&lm(am,function(){e.controller.abort()})}var Ja=null,Yu=0,sa=0,fa=null;function nm(e,t){if(Ja===null){var l=Ja=[];Yu=0,sa=Xc(),fa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return Yu++,t.then(Df,Df),t}function Df(){if(--Yu===0&&Ja!==null){fa!==null&&(fa.status="fulfilled");var e=Ja;Ja=null,sa=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function im(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(n){l.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<l.length;n++)(0,l[n])(t)},function(n){for(a.status="rejected",a.reason=n,n=0;n<l.length;n++)(0,l[n])(void 0)}),a}var Mf=T.S;T.S=function(e,t){vr=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&nm(e,t),Mf!==null&&Mf(e,t)};var Hl=m(null);function wu(){var e=Hl.current;return e!==null?e:Oe.pooledCache}function Fn(e,t){t===null?B(Hl,Hl.current):B(Hl,t.pool)}function Rf(){var e=wu();return e===null?null:{parent:Ge._currentValue,pool:e}}var oa=Error(o(460)),Gu=Error(o(474)),In=Error(o(542)),Pn={then:function(){}};function Uf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Bt,Bt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e;default:if(typeof t.status=="string")t.then(Bt,Bt);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e}throw Yl=t,oa}}function Bl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Yl=l,oa):l}}var Yl=null;function Hf(){if(Yl===null)throw Error(o(459));var e=Yl;return Yl=null,e}function Bf(e){if(e===oa||e===In)throw Error(o(483))}var ra=null,ka=0;function ei(e){var t=ka;return ka+=1,ra===null&&(ra=[]),qf(ra,e,t)}function Wa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ti(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yf(e){function t(y,d){if(e){var v=y.deletions;v===null?(y.deletions=[d],y.flags|=16):v.push(d)}}function l(y,d){if(!e)return null;for(;d!==null;)t(y,d),d=d.sibling;return null}function a(y){for(var d=new Map;y!==null;)y.key!==null?d.set(y.key,y):d.set(y.index,y),y=y.sibling;return d}function n(y,d){return y=wt(y,d),y.index=0,y.sibling=null,y}function i(y,d,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<d?(y.flags|=67108866,d):v):(y.flags|=67108866,d)):(y.flags|=1048576,d)}function c(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function f(y,d,v,O){return d===null||d.tag!==6?(d=Ou(v,y.mode,O),d.return=y,d):(d=n(d,v),d.return=y,d)}function r(y,d,v,O){var K=v.type;return K===Z?E(y,d,v.props.children,O,v.key):d!==null&&(d.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Se&&Bl(K)===d.type)?(d=n(d,v.props),Wa(d,v),d.return=y,d):(d=Jn(v.type,v.key,v.props,null,y.mode,O),Wa(d,v),d.return=y,d)}function g(y,d,v,O){return d===null||d.tag!==4||d.stateNode.containerInfo!==v.containerInfo||d.stateNode.implementation!==v.implementation?(d=Cu(v,y.mode,O),d.return=y,d):(d=n(d,v.children||[]),d.return=y,d)}function E(y,d,v,O,K){return d===null||d.tag!==7?(d=Ml(v,y.mode,O,K),d.return=y,d):(d=n(d,v),d.return=y,d)}function D(y,d,v){if(typeof d=="string"&&d!==""||typeof d=="number"||typeof d=="bigint")return d=Ou(""+d,y.mode,v),d.return=y,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Y:return v=Jn(d.type,d.key,d.props,null,y.mode,v),Wa(v,d),v.return=y,v;case G:return d=Cu(d,y.mode,v),d.return=y,d;case Se:return d=Bl(d),D(y,d,v)}if(Ze(d)||de(d))return d=Ml(d,y.mode,v,null),d.return=y,d;if(typeof d.then=="function")return D(y,ei(d),v);if(d.$$typeof===le)return D(y,$n(y,d),v);ti(y,d)}return null}function p(y,d,v,O){var K=d!==null?d.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return K!==null?null:f(y,d,""+v,O);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Y:return v.key===K?r(y,d,v,O):null;case G:return v.key===K?g(y,d,v,O):null;case Se:return v=Bl(v),p(y,d,v,O)}if(Ze(v)||de(v))return K!==null?null:E(y,d,v,O,null);if(typeof v.then=="function")return p(y,d,ei(v),O);if(v.$$typeof===le)return p(y,d,$n(y,v),O);ti(y,v)}return null}function S(y,d,v,O,K){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return y=y.get(v)||null,f(d,y,""+O,K);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case Y:return y=y.get(O.key===null?v:O.key)||null,r(d,y,O,K);case G:return y=y.get(O.key===null?v:O.key)||null,g(d,y,O,K);case Se:return O=Bl(O),S(y,d,v,O,K)}if(Ze(O)||de(O))return y=y.get(v)||null,E(d,y,O,K,null);if(typeof O.then=="function")return S(y,d,v,ei(O),K);if(O.$$typeof===le)return S(y,d,v,$n(d,O),K);ti(d,O)}return null}function X(y,d,v,O){for(var K=null,he=null,L=d,te=d=0,oe=null;L!==null&&te<v.length;te++){L.index>te?(oe=L,L=null):oe=L.sibling;var me=p(y,L,v[te],O);if(me===null){L===null&&(L=oe);break}e&&L&&me.alternate===null&&t(y,L),d=i(me,d,te),he===null?K=me:he.sibling=me,he=me,L=oe}if(te===v.length)return l(y,L),re&&Gt(y,te),K;if(L===null){for(;te<v.length;te++)L=D(y,v[te],O),L!==null&&(d=i(L,d,te),he===null?K=L:he.sibling=L,he=L);return re&&Gt(y,te),K}for(L=a(L);te<v.length;te++)oe=S(L,y,te,v[te],O),oe!==null&&(e&&oe.alternate!==null&&L.delete(oe.key===null?te:oe.key),d=i(oe,d,te),he===null?K=oe:he.sibling=oe,he=oe);return e&&L.forEach(function(El){return t(y,El)}),re&&Gt(y,te),K}function J(y,d,v,O){if(v==null)throw Error(o(151));for(var K=null,he=null,L=d,te=d=0,oe=null,me=v.next();L!==null&&!me.done;te++,me=v.next()){L.index>te?(oe=L,L=null):oe=L.sibling;var El=p(y,L,me.value,O);if(El===null){L===null&&(L=oe);break}e&&L&&El.alternate===null&&t(y,L),d=i(El,d,te),he===null?K=El:he.sibling=El,he=El,L=oe}if(me.done)return l(y,L),re&&Gt(y,te),K;if(L===null){for(;!me.done;te++,me=v.next())me=D(y,me.value,O),me!==null&&(d=i(me,d,te),he===null?K=me:he.sibling=me,he=me);return re&&Gt(y,te),K}for(L=a(L);!me.done;te++,me=v.next())me=S(L,y,te,me.value,O),me!==null&&(e&&me.alternate!==null&&L.delete(me.key===null?te:me.key),d=i(me,d,te),he===null?K=me:he.sibling=me,he=me);return e&&L.forEach(function(vy){return t(y,vy)}),re&&Gt(y,te),K}function _e(y,d,v,O){if(typeof v=="object"&&v!==null&&v.type===Z&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Y:e:{for(var K=v.key;d!==null;){if(d.key===K){if(K=v.type,K===Z){if(d.tag===7){l(y,d.sibling),O=n(d,v.props.children),O.return=y,y=O;break e}}else if(d.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===Se&&Bl(K)===d.type){l(y,d.sibling),O=n(d,v.props),Wa(O,v),O.return=y,y=O;break e}l(y,d);break}else t(y,d);d=d.sibling}v.type===Z?(O=Ml(v.props.children,y.mode,O,v.key),O.return=y,y=O):(O=Jn(v.type,v.key,v.props,null,y.mode,O),Wa(O,v),O.return=y,y=O)}return c(y);case G:e:{for(K=v.key;d!==null;){if(d.key===K)if(d.tag===4&&d.stateNode.containerInfo===v.containerInfo&&d.stateNode.implementation===v.implementation){l(y,d.sibling),O=n(d,v.children||[]),O.return=y,y=O;break e}else{l(y,d);break}else t(y,d);d=d.sibling}O=Cu(v,y.mode,O),O.return=y,y=O}return c(y);case Se:return v=Bl(v),_e(y,d,v,O)}if(Ze(v))return X(y,d,v,O);if(de(v)){if(K=de(v),typeof K!="function")throw Error(o(150));return v=K.call(v),J(y,d,v,O)}if(typeof v.then=="function")return _e(y,d,ei(v),O);if(v.$$typeof===le)return _e(y,d,$n(y,v),O);ti(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,d!==null&&d.tag===6?(l(y,d.sibling),O=n(d,v),O.return=y,y=O):(l(y,d),O=Ou(v,y.mode,O),O.return=y,y=O),c(y)):l(y,d)}return function(y,d,v,O){try{ka=0;var K=_e(y,d,v,O);return ra=null,K}catch(L){if(L===oa||L===In)throw L;var he=ht(29,L,null,y.mode);return he.lanes=O,he.return=y,he}finally{}}}var wl=Yf(!0),wf=Yf(!1),cl=!1;function Xu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function sl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ye&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=Kn(e),jf(e,null,l),t}return Vn(e,a,t,l),Kn(e)}function $a(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Cs(e,l)}}function Lu(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?n=i=c:i=i.next=c,l=l.next}while(l!==null);i===null?n=i=t:i=i.next=t}else n=i=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Zu=!1;function Fa(){if(Zu){var e=fa;if(e!==null)throw e}}function Ia(e,t,l,a){Zu=!1;var n=e.updateQueue;cl=!1;var i=n.firstBaseUpdate,c=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var r=f,g=r.next;r.next=null,c===null?i=g:c.next=g,c=r;var E=e.alternate;E!==null&&(E=E.updateQueue,f=E.lastBaseUpdate,f!==c&&(f===null?E.firstBaseUpdate=g:f.next=g,E.lastBaseUpdate=r))}if(i!==null){var D=n.baseState;c=0,E=g=r=null,f=i;do{var p=f.lane&-536870913,S=p!==f.lane;if(S?(fe&p)===p:(a&p)===p){p!==0&&p===sa&&(Zu=!0),E!==null&&(E=E.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var X=e,J=f;p=t;var _e=l;switch(J.tag){case 1:if(X=J.payload,typeof X=="function"){D=X.call(_e,D,p);break e}D=X;break e;case 3:X.flags=X.flags&-65537|128;case 0:if(X=J.payload,p=typeof X=="function"?X.call(_e,D,p):X,p==null)break e;D=j({},D,p);break e;case 2:cl=!0}}p=f.callback,p!==null&&(e.flags|=64,S&&(e.flags|=8192),S=n.callbacks,S===null?n.callbacks=[p]:S.push(p))}else S={lane:p,tag:f.tag,payload:f.payload,callback:f.callback,next:null},E===null?(g=E=S,r=D):E=E.next=S,c|=p;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;S=f,f=S.next,S.next=null,n.lastBaseUpdate=S,n.shared.pending=null}}while(!0);E===null&&(r=D),n.baseState=r,n.firstBaseUpdate=g,n.lastBaseUpdate=E,i===null&&(n.shared.lanes=0),ml|=c,e.lanes=c,e.memoizedState=D}}function Gf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Xf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Gf(l[e],t)}var da=m(null),li=m(0);function Qf(e,t){e=Ft,B(li,e),B(da,t),Ft=e|t.baseLanes}function Vu(){B(li,Ft),B(da,da.current)}function Ku(){Ft=li.current,M(da),M(li)}var mt=m(null),_t=null;function ol(e){var t=e.alternate;B(Be,Be.current&1),B(mt,e),_t===null&&(t===null||da.current!==null||t.memoizedState!==null)&&(_t=e)}function Ju(e){B(Be,Be.current),B(mt,e),_t===null&&(_t=e)}function Lf(e){e.tag===22?(B(Be,Be.current),B(mt,e),_t===null&&(_t=e)):rl()}function rl(){B(Be,Be.current),B(mt,mt.current)}function yt(e){M(mt),_t===e&&(_t=null),M(Be)}var Be=m(0);function ai(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Pc(l)||es(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Lt=0,ee=null,Ee=null,Xe=null,ni=!1,ha=!1,Gl=!1,ii=0,Pa=0,ma=null,um=0;function Ue(){throw Error(o(321))}function ku(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!dt(e[l],t[l]))return!1;return!0}function Wu(e,t,l,a,n,i){return Lt=i,ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?zo:oc,Gl=!1,i=l(a,n),Gl=!1,ha&&(i=Vf(t,l,a,n)),Zf(e),i}function Zf(e){T.H=ln;var t=Ee!==null&&Ee.next!==null;if(Lt=0,Xe=Ee=ee=null,ni=!1,Pa=0,ma=null,t)throw Error(o(300));e===null||Qe||(e=e.dependencies,e!==null&&Wn(e)&&(Qe=!0))}function Vf(e,t,l,a){ee=e;var n=0;do{if(ha&&(ma=null),Pa=0,ha=!1,25<=n)throw Error(o(301));if(n+=1,Xe=Ee=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}T.H=Oo,i=t(l,a)}while(ha);return i}function cm(){var e=T.H,t=e.useState()[0];return t=typeof t.then=="function"?en(t):t,e=e.useState()[0],(Ee!==null?Ee.memoizedState:null)!==e&&(ee.flags|=1024),t}function $u(){var e=ii!==0;return ii=0,e}function Fu(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Iu(e){if(ni){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ni=!1}Lt=0,Xe=Ee=ee=null,ha=!1,Pa=ii=0,ma=null}function tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ye(){if(Ee===null){var e=ee.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=Xe===null?ee.memoizedState:Xe.next;if(t!==null)Xe=t,Ee=e;else{if(e===null)throw ee.alternate===null?Error(o(467)):Error(o(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function ui(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function en(e){var t=Pa;return Pa+=1,ma===null&&(ma=[]),e=qf(ma,e,t),t=ee,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?zo:oc),e}function ci(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return en(e);if(e.$$typeof===le)return $e(e)}throw Error(o(438,String(e)))}function Pu(e){var t=null,l=ee.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=ee.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=ui(),ee.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=se;return t.index++,l}function Zt(e,t){return typeof t=="function"?t(e):t}function si(e){var t=Ye();return ec(t,Ee,e)}function ec(e,t,l){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=l;var n=e.baseQueue,i=a.pending;if(i!==null){if(n!==null){var c=n.next;n.next=i.next,i.next=c}t.baseQueue=n=i,a.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var f=c=null,r=null,g=t,E=!1;do{var D=g.lane&-536870913;if(D!==g.lane?(fe&D)===D:(Lt&D)===D){var p=g.revertLane;if(p===0)r!==null&&(r=r.next={lane:0,revertLane:0,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null}),D===sa&&(E=!0);else if((Lt&p)===p){g=g.next,p===sa&&(E=!0);continue}else D={lane:0,revertLane:g.revertLane,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=D,c=i):r=r.next=D,ee.lanes|=p,ml|=p;D=g.action,Gl&&l(i,D),i=g.hasEagerState?g.eagerState:l(i,D)}else p={lane:D,revertLane:g.revertLane,gesture:g.gesture,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=p,c=i):r=r.next=p,ee.lanes|=D,ml|=D;g=g.next}while(g!==null&&g!==t);if(r===null?c=i:r.next=f,!dt(i,e.memoizedState)&&(Qe=!0,E&&(l=fa,l!==null)))throw l;e.memoizedState=i,e.baseState=c,e.baseQueue=r,a.lastRenderedState=i}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function tc(e){var t=Ye(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var a=l.dispatch,n=l.pending,i=t.memoizedState;if(n!==null){l.pending=null;var c=n=n.next;do i=e(i,c.action),c=c.next;while(c!==n);dt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),l.lastRenderedState=i}return[i,a]}function Kf(e,t,l){var a=ee,n=Ye(),i=re;if(i){if(l===void 0)throw Error(o(407));l=l()}else l=t();var c=!dt((Ee||n).memoizedState,l);if(c&&(n.memoizedState=l,Qe=!0),n=n.queue,nc(Wf.bind(null,a,n,e),[e]),n.getSnapshot!==t||c||Xe!==null&&Xe.memoizedState.tag&1){if(a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,n,l,t),null),Oe===null)throw Error(o(349));i||(Lt&127)!==0||Jf(a,t,l)}return l}function Jf(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ee.updateQueue,t===null?(t=ui(),ee.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function kf(e,t,l,a){t.value=l,t.getSnapshot=a,$f(t)&&Ff(e)}function Wf(e,t,l){return l(function(){$f(t)&&Ff(e)})}function $f(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!dt(e,l)}catch{return!0}}function Ff(e){var t=Dl(e,2);t!==null&&st(t,e,2)}function lc(e){var t=tt();if(typeof e=="function"){var l=e;if(e=l(),Gl){el(!0);try{l()}finally{el(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:e},t}function If(e,t,l,a){return e.baseState=l,ec(e,Ee,typeof a=="function"?a:Zt)}function sm(e,t,l,a,n){if(ri(e))throw Error(o(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){i.listeners.push(c)}};T.T!==null?l(!0):i.isTransition=!1,a(i),l=t.pending,l===null?(i.next=t.pending=i,Pf(t,i)):(i.next=l.next,t.pending=l.next=i)}}function Pf(e,t){var l=t.action,a=t.payload,n=e.state;if(t.isTransition){var i=T.T,c={};T.T=c;try{var f=l(n,a),r=T.S;r!==null&&r(c,f),eo(e,t,f)}catch(g){ac(e,t,g)}finally{i!==null&&c.types!==null&&(i.types=c.types),T.T=i}}else try{i=l(n,a),eo(e,t,i)}catch(g){ac(e,t,g)}}function eo(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){to(e,t,a)},function(a){return ac(e,t,a)}):to(e,t,l)}function to(e,t,l){t.status="fulfilled",t.value=l,lo(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Pf(e,l)))}function ac(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,lo(t),t=t.next;while(t!==a)}e.action=null}function lo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ao(e,t){return t}function no(e,t){if(re){var l=Oe.formState;if(l!==null){e:{var a=ee;if(re){if(De){t:{for(var n=De,i=At;n.nodeType!==8;){if(!i){n=null;break t}if(n=zt(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){De=zt(n.nextSibling),a=n.data==="F!";break e}}il(a)}a=!1}a&&(t=l[0])}}return l=tt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:t},l.queue=a,l=Eo.bind(null,ee,a),a.dispatch=l,a=lc(!1),i=fc.bind(null,ee,!1,a.queue),a=tt(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,l=sm.bind(null,ee,n,i,l),n.dispatch=l,a.memoizedState=e,[t,l,!1]}function io(e){var t=Ye();return uo(t,Ee,e)}function uo(e,t,l){if(t=ec(e,t,ao)[0],e=si(Zt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=en(t)}catch(c){throw c===oa?In:c}else a=t;t=Ye();var n=t.queue,i=n.dispatch;return l!==t.memoizedState&&(ee.flags|=2048,ya(9,{destroy:void 0},fm.bind(null,n,l),null)),[a,i,e]}function fm(e,t){e.action=t}function co(e){var t=Ye(),l=Ee;if(l!==null)return uo(t,l,e);Ye(),t=t.memoizedState,l=Ye();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function ya(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=ee.updateQueue,t===null&&(t=ui(),ee.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function so(){return Ye().memoizedState}function fi(e,t,l,a){var n=tt();ee.flags|=e,n.memoizedState=ya(1|t,{destroy:void 0},l,a===void 0?null:a)}function oi(e,t,l,a){var n=Ye();a=a===void 0?null:a;var i=n.memoizedState.inst;Ee!==null&&a!==null&&ku(a,Ee.memoizedState.deps)?n.memoizedState=ya(t,i,l,a):(ee.flags|=e,n.memoizedState=ya(1|t,i,l,a))}function fo(e,t){fi(8390656,8,e,t)}function nc(e,t){oi(2048,8,e,t)}function om(e){ee.flags|=4;var t=ee.updateQueue;if(t===null)t=ui(),ee.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function oo(e){var t=Ye().memoizedState;return om({ref:t,nextImpl:e}),function(){if((ye&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ro(e,t){return oi(4,2,e,t)}function ho(e,t){return oi(4,4,e,t)}function mo(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yo(e,t,l){l=l!=null?l.concat([e]):null,oi(4,4,mo.bind(null,t,e),l)}function ic(){}function vo(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&ku(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function go(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&ku(t,a[1]))return a[0];if(a=e(),Gl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a}function uc(e,t,l){return l===void 0||(Lt&1073741824)!==0&&(fe&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=pr(),ee.lanes|=e,ml|=e,l)}function po(e,t,l,a){return dt(l,t)?l:da.current!==null?(e=uc(e,l,a),dt(e,t)||(Qe=!0),e):(Lt&42)===0||(Lt&1073741824)!==0&&(fe&261930)===0?(Qe=!0,e.memoizedState=l):(e=pr(),ee.lanes|=e,ml|=e,t)}function bo(e,t,l,a,n){var i=N.p;N.p=i!==0&&8>i?i:8;var c=T.T,f={};T.T=f,fc(e,!1,t,l);try{var r=n(),g=T.S;if(g!==null&&g(f,r),r!==null&&typeof r=="object"&&typeof r.then=="function"){var E=im(r,a);tn(e,t,E,pt(e))}else tn(e,t,a,pt(e))}catch(D){tn(e,t,{then:function(){},status:"rejected",reason:D},pt())}finally{N.p=i,c!==null&&f.types!==null&&(c.types=f.types),T.T=c}}function rm(){}function cc(e,t,l,a){if(e.tag!==5)throw Error(o(476));var n=xo(e).queue;bo(e,n,t,w,l===null?rm:function(){return So(e),l(a)})}function xo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:w,baseState:w,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:w},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function So(e){var t=xo(e);t.next===null&&(t=e.alternate.memoizedState),tn(e,t.next.queue,{},pt())}function sc(){return $e(bn)}function jo(){return Ye().memoizedState}function To(){return Ye().memoizedState}function dm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=pt();e=sl(l);var a=fl(t,e,l);a!==null&&(st(a,t,l),$a(a,t,l)),t={cache:Bu()},e.payload=t;return}t=t.return}}function hm(e,t,l){var a=pt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ri(e)?Ao(t,l):(l=_u(e,t,l,a),l!==null&&(st(l,e,a),_o(l,t,a)))}function Eo(e,t,l){var a=pt();tn(e,t,l,a)}function tn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ri(e))Ao(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var c=t.lastRenderedState,f=i(c,l);if(n.hasEagerState=!0,n.eagerState=f,dt(f,c))return Vn(e,t,n,0),Oe===null&&Zn(),!1}catch{}finally{}if(l=_u(e,t,n,a),l!==null)return st(l,e,a),_o(l,t,a),!0}return!1}function fc(e,t,l,a){if(a={lane:2,revertLane:Xc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ri(e)){if(t)throw Error(o(479))}else t=_u(e,l,a,2),t!==null&&st(t,e,2)}function ri(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function Ao(e,t){ha=ni=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function _o(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Cs(e,l)}}var ln={readContext:$e,use:ci,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useLayoutEffect:Ue,useInsertionEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useSyncExternalStore:Ue,useId:Ue,useHostTransitionStatus:Ue,useFormState:Ue,useActionState:Ue,useOptimistic:Ue,useMemoCache:Ue,useCacheRefresh:Ue};ln.useEffectEvent=Ue;var zo={readContext:$e,use:ci,useCallback:function(e,t){return tt().memoizedState=[e,t===void 0?null:t],e},useContext:$e,useEffect:fo,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,fi(4194308,4,mo.bind(null,t,e),l)},useLayoutEffect:function(e,t){return fi(4194308,4,e,t)},useInsertionEffect:function(e,t){fi(4,2,e,t)},useMemo:function(e,t){var l=tt();t=t===void 0?null:t;var a=e();if(Gl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=tt();if(l!==void 0){var n=l(t);if(Gl){el(!0);try{l(t)}finally{el(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=hm.bind(null,ee,e),[a.memoizedState,e]},useRef:function(e){var t=tt();return e={current:e},t.memoizedState=e},useState:function(e){e=lc(e);var t=e.queue,l=Eo.bind(null,ee,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:ic,useDeferredValue:function(e,t){var l=tt();return uc(l,e,t)},useTransition:function(){var e=lc(!1);return e=bo.bind(null,ee,e.queue,!0,!1),tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ee,n=tt();if(re){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Oe===null)throw Error(o(349));(fe&127)!==0||Jf(a,t,l)}n.memoizedState=l;var i={value:l,getSnapshot:t};return n.queue=i,fo(Wf.bind(null,a,i,e),[e]),a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,i,l,t),null),l},useId:function(){var e=tt(),t=Oe.identifierPrefix;if(re){var l=Rt,a=Mt;l=(a&~(1<<32-rt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ii++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=um++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:sc,useFormState:no,useActionState:no,useOptimistic:function(e){var t=tt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=fc.bind(null,ee,!0,l),l.dispatch=t,[e,t]},useMemoCache:Pu,useCacheRefresh:function(){return tt().memoizedState=dm.bind(null,ee)},useEffectEvent:function(e){var t=tt(),l={impl:e};return t.memoizedState=l,function(){if((ye&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},oc={readContext:$e,use:ci,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:si,useRef:so,useState:function(){return si(Zt)},useDebugValue:ic,useDeferredValue:function(e,t){var l=Ye();return po(l,Ee.memoizedState,e,t)},useTransition:function(){var e=si(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:io,useActionState:io,useOptimistic:function(e,t){var l=Ye();return If(l,Ee,e,t)},useMemoCache:Pu,useCacheRefresh:To};oc.useEffectEvent=oo;var Oo={readContext:$e,use:ci,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:tc,useRef:so,useState:function(){return tc(Zt)},useDebugValue:ic,useDeferredValue:function(e,t){var l=Ye();return Ee===null?uc(l,e,t):po(l,Ee.memoizedState,e,t)},useTransition:function(){var e=tc(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:co,useActionState:co,useOptimistic:function(e,t){var l=Ye();return Ee!==null?If(l,Ee,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Pu,useCacheRefresh:To};Oo.useEffectEvent=oo;function rc(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:j({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var dc={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.tag=1,n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=pt(),a=sl(l);a.tag=2,t!=null&&(a.callback=t),t=fl(e,a,l),t!==null&&(st(t,e,l),$a(t,e,l))}};function Co(e,t,l,a,n,i,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,i,c):t.prototype&&t.prototype.isPureReactComponent?!Qa(l,a)||!Qa(n,i):!0}function No(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&dc.enqueueReplaceState(t,t.state,null)}function Xl(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=j({},l));for(var n in e)l[n]===void 0&&(l[n]=e[n])}return l}function Do(e){Ln(e)}function Mo(e){console.error(e)}function Ro(e){Ln(e)}function di(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Uo(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function hc(e,t,l){return l=sl(l),l.tag=3,l.payload={element:null},l.callback=function(){di(e,t)},l}function qo(e){return e=sl(e),e.tag=3,e}function Ho(e,t,l,a){var n=l.type.getDerivedStateFromError;if(typeof n=="function"){var i=a.value;e.payload=function(){return n(i)},e.callback=function(){Uo(t,l,a)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){Uo(t,l,a),typeof n!="function"&&(yl===null?yl=new Set([this]):yl.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function mm(e,t,l,a,n){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&ca(t,l,n,!0),l=mt.current,l!==null){switch(l.tag){case 31:case 13:return _t===null?Ei():l.alternate===null&&qe===0&&(qe=3),l.flags&=-257,l.flags|=65536,l.lanes=n,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),Yc(e,a,n)),!1;case 22:return l.flags|=65536,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),Yc(e,a,n)),!1}throw Error(o(435,l.tag))}return Yc(e,a,n),Ei(),!1}if(re)return t=mt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==Mu&&(e=Error(o(422),{cause:a}),Va(jt(e,l)))):(a!==Mu&&(t=Error(o(423),{cause:a}),Va(jt(t,l))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=jt(a,l),n=hc(e.stateNode,a,n),Lu(e,n),qe!==4&&(qe=2)),!1;var i=Error(o(520),{cause:a});if(i=jt(i,l),rn===null?rn=[i]:rn.push(i),qe!==4&&(qe=2),t===null)return!0;a=jt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=n&-n,l.lanes|=e,e=hc(l.stateNode,a,e),Lu(l,e),!1;case 1:if(t=l.type,i=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(yl===null||!yl.has(i))))return l.flags|=65536,n&=-n,l.lanes|=n,n=qo(n),Ho(n,e,l,a),Lu(l,n),!1}l=l.return}while(l!==null);return!1}var mc=Error(o(461)),Qe=!1;function Fe(e,t,l,a){t.child=e===null?wf(t,null,l,a):wl(t,e.child,l,a)}function Bo(e,t,l,a,n){l=l.render;var i=t.ref;if("ref"in a){var c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}else c=a;return ql(t),a=Wu(e,t,l,c,i,n),f=$u(),e!==null&&!Qe?(Fu(e,t,n),Vt(e,t,n)):(re&&f&&Nu(t),t.flags|=1,Fe(e,t,a,n),t.child)}function Yo(e,t,l,a,n){if(e===null){var i=l.type;return typeof i=="function"&&!zu(i)&&i.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=i,wo(e,t,i,a,n)):(e=Jn(l.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!jc(e,n)){var c=i.memoizedProps;if(l=l.compare,l=l!==null?l:Qa,l(c,a)&&e.ref===t.ref)return Vt(e,t,n)}return t.flags|=1,e=wt(i,a),e.ref=t.ref,e.return=t,t.child=e}function wo(e,t,l,a,n){if(e!==null){var i=e.memoizedProps;if(Qa(i,a)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=a=i,jc(e,n))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,Vt(e,t,n)}return yc(e,t,l,a,n)}function Go(e,t,l,a){var n=a.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|l:l,e!==null){for(a=t.child=e.child,n=0;a!==null;)n=n|a.lanes|a.childLanes,a=a.sibling;a=n&~i}else a=0,t.child=null;return Xo(e,t,i,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fn(t,i!==null?i.cachePool:null),i!==null?Qf(t,i):Vu(),Lf(t);else return a=t.lanes=536870912,Xo(e,t,i!==null?i.baseLanes|l:l,l,a)}else i!==null?(Fn(t,i.cachePool),Qf(t,i),rl(),t.memoizedState=null):(e!==null&&Fn(t,null),Vu(),rl());return Fe(e,t,n,l),t.child}function an(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xo(e,t,l,a,n){var i=wu();return i=i===null?null:{parent:Ge._currentValue,pool:i},t.memoizedState={baseLanes:l,cachePool:i},e!==null&&Fn(t,null),Vu(),Lf(t),e!==null&&ca(e,t,a,!0),t.childLanes=n,null}function hi(e,t){return t=yi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qo(e,t,l){return wl(t,e.child,null,l),e=hi(t,t.pendingProps),e.flags|=2,yt(t),t.memoizedState=null,e}function ym(e,t,l){var a=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(re){if(a.mode==="hidden")return e=hi(t,a),t.lanes=536870912,an(null,e);if(Ju(t),(e=De)?(e=ed(e,At),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw il(t);return t.lanes=536870912,null}return hi(t,a)}var i=e.memoizedState;if(i!==null){var c=i.dehydrated;if(Ju(t),n)if(t.flags&256)t.flags&=-257,t=Qo(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Qe||ca(e,t,l,!1),n=(l&e.childLanes)!==0,Qe||n){if(a=Oe,a!==null&&(c=Ns(a,l),c!==0&&c!==i.retryLane))throw i.retryLane=c,Dl(e,c),st(a,e,c),mc;Ei(),t=Qo(e,t,l)}else e=i.treeContext,De=zt(c.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=hi(t,a),t.flags|=4096;return t}return e=wt(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mi(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function yc(e,t,l,a,n){return ql(t),l=Wu(e,t,l,a,void 0,n),a=$u(),e!==null&&!Qe?(Fu(e,t,n),Vt(e,t,n)):(re&&a&&Nu(t),t.flags|=1,Fe(e,t,l,n),t.child)}function Lo(e,t,l,a,n,i){return ql(t),t.updateQueue=null,l=Vf(t,a,l,n),Zf(e),a=$u(),e!==null&&!Qe?(Fu(e,t,i),Vt(e,t,i)):(re&&a&&Nu(t),t.flags|=1,Fe(e,t,l,i),t.child)}function Zo(e,t,l,a,n){if(ql(t),t.stateNode===null){var i=aa,c=l.contextType;typeof c=="object"&&c!==null&&(i=$e(c)),i=new l(a,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=dc,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=a,i.state=t.memoizedState,i.refs={},Xu(t),c=l.contextType,i.context=typeof c=="object"&&c!==null?$e(c):aa,i.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(rc(t,l,c,a),i.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(c=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),c!==i.state&&dc.enqueueReplaceState(i,i.state,null),Ia(t,a,i,n),Fa(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){i=t.stateNode;var f=t.memoizedProps,r=Xl(l,f);i.props=r;var g=i.context,E=l.contextType;c=aa,typeof E=="object"&&E!==null&&(c=$e(E));var D=l.getDerivedStateFromProps;E=typeof D=="function"||typeof i.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,E||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(f||g!==c)&&No(t,i,a,c),cl=!1;var p=t.memoizedState;i.state=p,Ia(t,a,i,n),Fa(),g=t.memoizedState,f||p!==g||cl?(typeof D=="function"&&(rc(t,l,D,a),g=t.memoizedState),(r=cl||Co(t,l,r,a,p,g,c))?(E||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=g),i.props=a,i.state=g,i.context=c,a=r):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{i=t.stateNode,Qu(e,t),c=t.memoizedProps,E=Xl(l,c),i.props=E,D=t.pendingProps,p=i.context,g=l.contextType,r=aa,typeof g=="object"&&g!==null&&(r=$e(g)),f=l.getDerivedStateFromProps,(g=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(c!==D||p!==r)&&No(t,i,a,r),cl=!1,p=t.memoizedState,i.state=p,Ia(t,a,i,n),Fa();var S=t.memoizedState;c!==D||p!==S||cl||e!==null&&e.dependencies!==null&&Wn(e.dependencies)?(typeof f=="function"&&(rc(t,l,f,a),S=t.memoizedState),(E=cl||Co(t,l,E,a,p,S,r)||e!==null&&e.dependencies!==null&&Wn(e.dependencies))?(g||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(a,S,r),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(a,S,r)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=S),i.props=a,i.state=S,i.context=r,a=E):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),a=!1)}return i=a,mi(e,t),a=(t.flags&128)!==0,i||a?(i=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&a?(t.child=wl(t,e.child,null,n),t.child=wl(t,null,l,n)):Fe(e,t,l,n),t.memoizedState=i.state,e=t.child):e=Vt(e,t,n),e}function Vo(e,t,l,a){return Rl(),t.flags|=256,Fe(e,t,l,a),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:Rf()}}function pc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=gt),e}function Ko(e,t,l){var a=t.pendingProps,n=!1,i=(t.flags&128)!==0,c;if((c=i)||(c=e!==null&&e.memoizedState===null?!1:(Be.current&2)!==0),c&&(n=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(re){if(n?ol(t):rl(),(e=De)?(e=ed(e,At),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw il(t);return es(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,n?(rl(),n=t.mode,f=yi({mode:"hidden",children:f},n),a=Ml(a,n,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,an(null,a)):(ol(t),bc(t,f))}var r=e.memoizedState;if(r!==null&&(f=r.dehydrated,f!==null)){if(i)t.flags&256?(ol(t),t.flags&=-257,t=xc(e,t,l)):t.memoizedState!==null?(rl(),t.child=e.child,t.flags|=128,t=null):(rl(),f=a.fallback,n=t.mode,a=yi({mode:"visible",children:a.children},n),f=Ml(f,n,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,wl(t,e.child,null,l),a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,t=an(null,a));else if(ol(t),es(f)){if(c=f.nextSibling&&f.nextSibling.dataset,c)var g=c.dgst;c=g,a=Error(o(419)),a.stack="",a.digest=c,Va({value:a,source:null,stack:null}),t=xc(e,t,l)}else if(Qe||ca(e,t,l,!1),c=(l&e.childLanes)!==0,Qe||c){if(c=Oe,c!==null&&(a=Ns(c,l),a!==0&&a!==r.retryLane))throw r.retryLane=a,Dl(e,a),st(c,e,a),mc;Pc(f)||Ei(),t=xc(e,t,l)}else Pc(f)?(t.flags|=192,t.child=e.child,t=null):(e=r.treeContext,De=zt(f.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=bc(t,a.children),t.flags|=4096);return t}return n?(rl(),f=a.fallback,n=t.mode,r=e.child,g=r.sibling,a=wt(r,{mode:"hidden",children:a.children}),a.subtreeFlags=r.subtreeFlags&65011712,g!==null?f=wt(g,f):(f=Ml(f,n,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,an(null,a),a=t.child,f=e.child.memoizedState,f===null?f=gc(l):(n=f.cachePool,n!==null?(r=Ge._currentValue,n=n.parent!==r?{parent:r,pool:r}:n):n=Rf(),f={baseLanes:f.baseLanes|l,cachePool:n}),a.memoizedState=f,a.childLanes=pc(e,c,l),t.memoizedState=vc,an(e.child,a)):(ol(t),l=e.child,e=l.sibling,l=wt(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function bc(e,t){return t=yi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yi(e,t){return e=ht(22,e,null,t),e.lanes=0,e}function xc(e,t,l){return wl(t,e.child,null,l),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jo(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),qu(e.return,t,l)}function Sc(e,t,l,a,n,i){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:n,treeForkCount:i}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=l,c.tailMode=n,c.treeForkCount=i)}function ko(e,t,l){var a=t.pendingProps,n=a.revealOrder,i=a.tail;a=a.children;var c=Be.current,f=(c&2)!==0;if(f?(c=c&1|2,t.flags|=128):c&=1,B(Be,c),Fe(e,t,a,l),a=re?Za:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jo(e,l,t);else if(e.tag===19)Jo(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(l=t.child,n=null;l!==null;)e=l.alternate,e!==null&&ai(e)===null&&(n=l),l=l.sibling;l=n,l===null?(n=t.child,t.child=null):(n=l.sibling,l.sibling=null),Sc(t,!1,n,l,i,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&ai(e)===null){t.child=n;break}e=n.sibling,n.sibling=l,l=n,n=e}Sc(t,!0,l,null,i,a);break;case"together":Sc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Vt(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),ml|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(ca(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=wt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=wt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wn(e)))}function vm(e,t,l){switch(t.tag){case 3:et(t,t.stateNode.containerInfo),ul(t,Ge,e.memoizedState.cache),Rl();break;case 27:case 5:Ca(t);break;case 4:et(t,t.stateNode.containerInfo);break;case 10:ul(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ju(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ol(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Ko(e,t,l):(ol(t),e=Vt(e,t,l),e!==null?e.sibling:null);ol(t);break;case 19:var n=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(ca(e,t,l,!1),a=(l&t.childLanes)!==0),n){if(a)return ko(e,t,l);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),B(Be,Be.current),a)break;return null;case 22:return t.lanes=0,Go(e,t,l,t.pendingProps);case 24:ul(t,Ge,e.memoizedState.cache)}return Vt(e,t,l)}function Wo(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!jc(e,l)&&(t.flags&128)===0)return Qe=!1,vm(e,t,l);Qe=(e.flags&131072)!==0}else Qe=!1,re&&(t.flags&1048576)!==0&&_f(t,Za,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Bl(t.elementType),t.type=e,typeof e=="function")zu(e)?(a=Xl(e,a),t.tag=1,t=Zo(null,t,e,a,l)):(t.tag=0,t=yc(null,t,e,a,l));else{if(e!=null){var n=e.$$typeof;if(n===ne){t.tag=11,t=Bo(null,t,e,a,l);break e}else if(n===V){t.tag=14,t=Yo(null,t,e,a,l);break e}}throw t=Ne(e)||e,Error(o(306,t,""))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,n=Xl(a,t.pendingProps),Zo(e,t,a,n,l);case 3:e:{if(et(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var i=t.memoizedState;n=i.element,Qu(e,t),Ia(t,a,null,l);var c=t.memoizedState;if(a=c.cache,ul(t,Ge,a),a!==i.cache&&Hu(t,[Ge],l,!0),Fa(),a=c.element,i.isDehydrated)if(i={element:a,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Vo(e,t,a,l);break e}else if(a!==n){n=jt(Error(o(424)),t),Va(n),t=Vo(e,t,a,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(De=zt(e.firstChild),We=t,re=!0,nl=null,At=!0,l=wf(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Rl(),a===n){t=Vt(e,t,l);break e}Fe(e,t,a,l)}t=t.child}return t;case 26:return mi(e,t),e===null?(l=ud(t.type,null,t.pendingProps,null))?t.memoizedState=l:re||(l=t.type,e=t.pendingProps,a=Di(ie.current).createElement(l),a[ke]=t,a[lt]=e,Ie(a,l,e),Ke(a),t.stateNode=a):t.memoizedState=ud(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ca(t),e===null&&re&&(a=t.stateNode=ad(t.type,t.pendingProps,ie.current),We=t,At=!0,n=De,bl(t.type)?(ts=n,De=zt(a.firstChild)):De=n),Fe(e,t,t.pendingProps.children,l),mi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&re&&((n=a=De)&&(a=Km(a,t.type,t.pendingProps,At),a!==null?(t.stateNode=a,We=t,De=zt(a.firstChild),At=!1,n=!0):n=!1),n||il(t)),Ca(t),n=t.type,i=t.pendingProps,c=e!==null?e.memoizedProps:null,a=i.children,$c(n,i)?a=null:c!==null&&$c(n,c)&&(t.flags|=32),t.memoizedState!==null&&(n=Wu(e,t,cm,null,null,l),bn._currentValue=n),mi(e,t),Fe(e,t,a,l),t.child;case 6:return e===null&&re&&((e=l=De)&&(l=Jm(l,t.pendingProps,At),l!==null?(t.stateNode=l,We=t,De=null,e=!0):e=!1),e||il(t)),null;case 13:return Ko(e,t,l);case 4:return et(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=wl(t,null,a,l):Fe(e,t,a,l),t.child;case 11:return Bo(e,t,t.type,t.pendingProps,l);case 7:return Fe(e,t,t.pendingProps,l),t.child;case 8:return Fe(e,t,t.pendingProps.children,l),t.child;case 12:return Fe(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,ul(t,t.type,a.value),Fe(e,t,a.children,l),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,ql(t),n=$e(n),a=a(n),t.flags|=1,Fe(e,t,a,l),t.child;case 14:return Yo(e,t,t.type,t.pendingProps,l);case 15:return wo(e,t,t.type,t.pendingProps,l);case 19:return ko(e,t,l);case 31:return ym(e,t,l);case 22:return Go(e,t,l,t.pendingProps);case 24:return ql(t),a=$e(Ge),e===null?(n=wu(),n===null&&(n=Oe,i=Bu(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=l),n=i),t.memoizedState={parent:a,cache:n},Xu(t),ul(t,Ge,n)):((e.lanes&l)!==0&&(Qu(e,t),Ia(t,null,null,l),Fa()),n=e.memoizedState,i=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),ul(t,Ge,a)):(a=i.cache,ul(t,Ge,a),a!==n.cache&&Hu(t,[Ge],l,!0))),Fe(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Kt(e){e.flags|=4}function Tc(e,t,l,a,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(jr())e.flags|=8192;else throw Yl=Pn,Gu}else e.flags&=-16777217}function $o(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rd(t))if(jr())e.flags|=8192;else throw Yl=Pn,Gu}function vi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zs():536870912,e.lanes|=t,ba|=t)}function nn(e,t){if(!re)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function gm(e,t,l){var a=t.pendingProps;switch(Du(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return Me(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Qt(Ge),He(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ua(t)?Kt(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ru())),Me(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(Kt(t),i!==null?(Me(t),$o(t,i)):(Me(t),Tc(t,n,null,a,l))):i?i!==e.memoizedState?(Kt(t),Me(t),$o(t,i)):(Me(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Kt(t),Me(t),Tc(t,n,e,a,l)),null;case 27:if(zn(t),l=ie.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}e=Q.current,ua(t)?Of(t):(e=ad(n,a,l),t.stateNode=e,Kt(t))}return Me(t),null;case 5:if(zn(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}if(i=Q.current,ua(t))Of(t);else{var c=Di(ie.current);switch(i){case 1:i=c.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=c.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=c.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}i[ke]=t,i[lt]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=i;e:switch(Ie(i,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Kt(t)}}return Me(t),Tc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=ie.current,ua(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=We,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[ke]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Kr(e.nodeValue,l)),e||il(t,!0)}else e=Di(e).createTextNode(a),e[ke]=t,t.stateNode=e}return Me(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=ua(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),e=!1}else l=Ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Me(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ua(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),n=!1}else n=Ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),vi(t,t.updateQueue),Me(t),null);case 4:return He(),e===null&&Vc(t.stateNode.containerInfo),Me(t),null;case 10:return Qt(t.type),Me(t),null;case 19:if(M(Be),a=t.memoizedState,a===null)return Me(t),null;if(n=(t.flags&128)!==0,i=a.rendering,i===null)if(n)nn(a,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=ai(e),i!==null){for(t.flags|=128,nn(a,!1),e=i.updateQueue,t.updateQueue=e,vi(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Tf(l,e),l=l.sibling;return B(Be,Be.current&1|2),re&&Gt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ft()>Si&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304)}else{if(!n)if(e=ai(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,vi(t,e),nn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!re)return Me(t),null}else 2*ft()-a.renderingStartTime>Si&&l!==536870912&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ft(),e.sibling=null,l=Be.current,B(Be,n?l&1|2:l&1),re&&Gt(t,a.treeForkCount),e):(Me(t),null);case 22:case 23:return yt(t),Ku(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),l=t.updateQueue,l!==null&&vi(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&M(Hl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Qt(Ge),Me(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function pm(e,t){switch(Du(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qt(Ge),He(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return zn(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return M(Be),null;case 4:return He(),null;case 10:return Qt(t.type),null;case 22:case 23:return yt(t),Ku(),e!==null&&M(Hl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qt(Ge),null;case 25:return null;default:return null}}function Fo(e,t){switch(Du(t),t.tag){case 3:Qt(Ge),He();break;case 26:case 27:case 5:zn(t);break;case 4:He();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:M(Be);break;case 10:Qt(t.type);break;case 22:case 23:yt(t),Ku(),e!==null&&M(Hl);break;case 24:Qt(Ge)}}function un(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var i=l.create,c=l.inst;a=i(),c.destroy=a}l=l.next}while(l!==n)}}catch(f){pe(t,t.return,f)}}function dl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){var c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,n=t;var r=l,g=f;try{g()}catch(E){pe(n,r,E)}}}a=a.next}while(a!==i)}}catch(E){pe(t,t.return,E)}}function Io(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Xf(t,l)}catch(a){pe(e,e.return,a)}}}function Po(e,t,l){l.props=Xl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){pe(e,t,a)}}function cn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){pe(e,t,n)}}function Ut(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){pe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){pe(e,t,n)}else l.current=null}function er(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){pe(e,e.return,n)}}function Ec(e,t,l){try{var a=e.stateNode;Gm(a,e.type,l,t),a[lt]=t}catch(n){pe(e,e.return,n)}}function tr(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bl(e.type)||e.tag===4}function Ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tr(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&bl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _c(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Bt));else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(_c(e,t,l),e=e.sibling;e!==null;)_c(e,t,l),e=e.sibling}function gi(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(gi(e,t,l),e=e.sibling;e!==null;)gi(e,t,l),e=e.sibling}function lr(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ie(t,a,l),t[ke]=e,t[lt]=l}catch(i){pe(e,e.return,i)}}var Jt=!1,Le=!1,zc=!1,ar=typeof WeakSet=="function"?WeakSet:Set,Je=null;function bm(e,t){if(e=e.containerInfo,kc=Yi,e=mf(e),xu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var c=0,f=-1,r=-1,g=0,E=0,D=e,p=null;t:for(;;){for(var S;D!==l||n!==0&&D.nodeType!==3||(f=c+n),D!==i||a!==0&&D.nodeType!==3||(r=c+a),D.nodeType===3&&(c+=D.nodeValue.length),(S=D.firstChild)!==null;)p=D,D=S;for(;;){if(D===e)break t;if(p===l&&++g===n&&(f=c),p===i&&++E===a&&(r=c),(S=D.nextSibling)!==null)break;D=p,p=D.parentNode}D=S}l=f===-1||r===-1?null:{start:f,end:r}}else l=null}l=l||{start:0,end:0}}else l=null;for(Wc={focusedElem:e,selectionRange:l},Yi=!1,Je=t;Je!==null;)if(t=Je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Je=e;else for(;Je!==null;){switch(t=Je,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)n=e[l],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,l=t,n=i.memoizedProps,i=i.memoizedState,a=l.stateNode;try{var X=Xl(l.type,n);e=a.getSnapshotBeforeUpdate(X,i),a.__reactInternalSnapshotBeforeUpdate=e}catch(J){pe(l,l.return,J)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Ic(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ic(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Je=e;break}Je=t.return}}function nr(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Wt(e,l),a&4&&un(5,l);break;case 1:if(Wt(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){pe(l,l.return,c)}else{var n=Xl(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){pe(l,l.return,c)}}a&64&&Io(l),a&512&&cn(l,l.return);break;case 3:if(Wt(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Xf(e,t)}catch(c){pe(l,l.return,c)}}break;case 27:t===null&&a&4&&lr(l);case 26:case 5:Wt(e,l),t===null&&a&4&&er(l),a&512&&cn(l,l.return);break;case 12:Wt(e,l);break;case 31:Wt(e,l),a&4&&cr(e,l);break;case 13:Wt(e,l),a&4&&sr(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Om.bind(null,l),km(e,l))));break;case 22:if(a=l.memoizedState!==null||Jt,!a){t=t!==null&&t.memoizedState!==null||Le,n=Jt;var i=Le;Jt=a,(Le=t)&&!i?$t(e,l,(l.subtreeFlags&8772)!==0):Wt(e,l),Jt=n,Le=i}break;case 30:break;default:Wt(e,l)}}function ir(e){var t=e.alternate;t!==null&&(e.alternate=null,ir(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&au(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Re=null,nt=!1;function kt(e,t,l){for(l=l.child;l!==null;)ur(e,t,l),l=l.sibling}function ur(e,t,l){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(Na,l)}catch{}switch(l.tag){case 26:Le||Ut(l,t),kt(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Le||Ut(l,t);var a=Re,n=nt;bl(l.type)&&(Re=l.stateNode,nt=!1),kt(e,t,l),vn(l.stateNode),Re=a,nt=n;break;case 5:Le||Ut(l,t);case 6:if(a=Re,n=nt,Re=null,kt(e,t,l),Re=a,nt=n,Re!==null)if(nt)try{(Re.nodeType===9?Re.body:Re.nodeName==="HTML"?Re.ownerDocument.body:Re).removeChild(l.stateNode)}catch(i){pe(l,t,i)}else try{Re.removeChild(l.stateNode)}catch(i){pe(l,t,i)}break;case 18:Re!==null&&(nt?(e=Re,Ir(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),za(e)):Ir(Re,l.stateNode));break;case 4:a=Re,n=nt,Re=l.stateNode.containerInfo,nt=!0,kt(e,t,l),Re=a,nt=n;break;case 0:case 11:case 14:case 15:dl(2,l,t),Le||dl(4,l,t),kt(e,t,l);break;case 1:Le||(Ut(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Po(l,t,a)),kt(e,t,l);break;case 21:kt(e,t,l);break;case 22:Le=(a=Le)||l.memoizedState!==null,kt(e,t,l),Le=a;break;default:kt(e,t,l)}}function cr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{za(e)}catch(l){pe(t,t.return,l)}}}function sr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{za(e)}catch(l){pe(t,t.return,l)}}function xm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ar),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ar),t;default:throw Error(o(435,e.tag))}}function pi(e,t){var l=xm(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var n=Cm.bind(null,e,a);a.then(n,n)}})}function it(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var n=l[a],i=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(bl(f.type)){Re=f.stateNode,nt=!1;break e}break;case 5:Re=f.stateNode,nt=!1;break e;case 3:case 4:Re=f.stateNode.containerInfo,nt=!0;break e}f=f.return}if(Re===null)throw Error(o(160));ur(i,c,n),Re=null,nt=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fr(t,e),t=t.sibling}var Nt=null;function fr(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:it(t,e),ut(e),a&4&&(dl(3,e,e.return),un(3,e),dl(5,e,e.return));break;case 1:it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),a&64&&Jt&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var n=Nt;if(it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),a&4){var i=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":i=n.getElementsByTagName("title")[0],(!i||i[Ra]||i[ke]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(a),n.head.insertBefore(i,n.querySelector("head > title"))),Ie(i,a,l),i[ke]=e,Ke(i),a=i;break e;case"link":var c=fd("link","href",n).get(a+(l.href||""));if(c){for(var f=0;f<c.length;f++)if(i=c[f],i.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&i.getAttribute("rel")===(l.rel==null?null:l.rel)&&i.getAttribute("title")===(l.title==null?null:l.title)&&i.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(f,1);break t}}i=n.createElement(a),Ie(i,a,l),n.head.appendChild(i);break;case"meta":if(c=fd("meta","content",n).get(a+(l.content||""))){for(f=0;f<c.length;f++)if(i=c[f],i.getAttribute("content")===(l.content==null?null:""+l.content)&&i.getAttribute("name")===(l.name==null?null:l.name)&&i.getAttribute("property")===(l.property==null?null:l.property)&&i.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&i.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(f,1);break t}}i=n.createElement(a),Ie(i,a,l),n.head.appendChild(i);break;default:throw Error(o(468,a))}i[ke]=e,Ke(i),a=i}e.stateNode=a}else od(n,e.type,e.stateNode);else e.stateNode=sd(n,a,e.memoizedProps);else i!==a?(i===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):i.count--,a===null?od(n,e.type,e.stateNode):sd(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Ec(e,e.memoizedProps,l.memoizedProps)}break;case 27:it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),l!==null&&a&4&&Ec(e,e.memoizedProps,l.memoizedProps);break;case 5:if(it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),e.flags&32){n=e.stateNode;try{$l(n,"")}catch(X){pe(e,e.return,X)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,Ec(e,n,l!==null?l.memoizedProps:n)),a&1024&&(zc=!0);break;case 6:if(it(t,e),ut(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(X){pe(e,e.return,X)}}break;case 3:if(Ui=null,n=Nt,Nt=Mi(t.containerInfo),it(t,e),Nt=n,ut(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{za(t.containerInfo)}catch(X){pe(e,e.return,X)}zc&&(zc=!1,or(e));break;case 4:a=Nt,Nt=Mi(e.stateNode.containerInfo),it(t,e),ut(e),Nt=a;break;case 12:it(t,e),ut(e);break;case 31:it(t,e),ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pi(e,a)));break;case 13:it(t,e),ut(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(xi=ft()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pi(e,a)));break;case 22:n=e.memoizedState!==null;var r=l!==null&&l.memoizedState!==null,g=Jt,E=Le;if(Jt=g||n,Le=E||r,it(t,e),Le=E,Jt=g,ut(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(l===null||r||Jt||Le||Ql(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){r=l=t;try{if(i=r.stateNode,n)c=i.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{f=r.stateNode;var D=r.memoizedProps.style,p=D!=null&&D.hasOwnProperty("display")?D.display:null;f.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(X){pe(r,r.return,X)}}}else if(t.tag===6){if(l===null){r=t;try{r.stateNode.nodeValue=n?"":r.memoizedProps}catch(X){pe(r,r.return,X)}}}else if(t.tag===18){if(l===null){r=t;try{var S=r.stateNode;n?Pr(S,!0):Pr(r.stateNode,!1)}catch(X){pe(r,r.return,X)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,pi(e,l))));break;case 19:it(t,e),ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pi(e,a)));break;case 30:break;case 21:break;default:it(t,e),ut(e)}}function ut(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(tr(a)){l=a;break}a=a.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var n=l.stateNode,i=Ac(e);gi(e,i,n);break;case 5:var c=l.stateNode;l.flags&32&&($l(c,""),l.flags&=-33);var f=Ac(e);gi(e,f,c);break;case 3:case 4:var r=l.stateNode.containerInfo,g=Ac(e);_c(e,g,r);break;default:throw Error(o(161))}}catch(E){pe(e,e.return,E)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function or(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;or(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wt(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nr(e,t.alternate,t),t=t.sibling}function Ql(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:dl(4,t,t.return),Ql(t);break;case 1:Ut(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Po(t,t.return,l),Ql(t);break;case 27:vn(t.stateNode);case 26:case 5:Ut(t,t.return),Ql(t);break;case 22:t.memoizedState===null&&Ql(t);break;case 30:Ql(t);break;default:Ql(t)}e=e.sibling}}function $t(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,n=e,i=t,c=i.flags;switch(i.tag){case 0:case 11:case 15:$t(n,i,l),un(4,i);break;case 1:if($t(n,i,l),a=i,n=a.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(g){pe(a,a.return,g)}if(a=i,n=a.updateQueue,n!==null){var f=a.stateNode;try{var r=n.shared.hiddenCallbacks;if(r!==null)for(n.shared.hiddenCallbacks=null,n=0;n<r.length;n++)Gf(r[n],f)}catch(g){pe(a,a.return,g)}}l&&c&64&&Io(i),cn(i,i.return);break;case 27:lr(i);case 26:case 5:$t(n,i,l),l&&a===null&&c&4&&er(i),cn(i,i.return);break;case 12:$t(n,i,l);break;case 31:$t(n,i,l),l&&c&4&&cr(n,i);break;case 13:$t(n,i,l),l&&c&4&&sr(n,i);break;case 22:i.memoizedState===null&&$t(n,i,l),cn(i,i.return);break;case 30:break;default:$t(n,i,l)}t=t.sibling}}function Oc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Ka(l))}function Cc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e))}function Dt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rr(e,t,l,a),t=t.sibling}function rr(e,t,l,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Dt(e,t,l,a),n&2048&&un(9,t);break;case 1:Dt(e,t,l,a);break;case 3:Dt(e,t,l,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e)));break;case 12:if(n&2048){Dt(e,t,l,a),e=t.stateNode;try{var i=t.memoizedProps,c=i.id,f=i.onPostCommit;typeof f=="function"&&f(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(r){pe(t,t.return,r)}}else Dt(e,t,l,a);break;case 31:Dt(e,t,l,a);break;case 13:Dt(e,t,l,a);break;case 23:break;case 22:i=t.stateNode,c=t.alternate,t.memoizedState!==null?i._visibility&2?Dt(e,t,l,a):sn(e,t):i._visibility&2?Dt(e,t,l,a):(i._visibility|=2,va(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Oc(c,t);break;case 24:Dt(e,t,l,a),n&2048&&Cc(t.alternate,t);break;default:Dt(e,t,l,a)}}function va(e,t,l,a,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,c=t,f=l,r=a,g=c.flags;switch(c.tag){case 0:case 11:case 15:va(i,c,f,r,n),un(8,c);break;case 23:break;case 22:var E=c.stateNode;c.memoizedState!==null?E._visibility&2?va(i,c,f,r,n):sn(i,c):(E._visibility|=2,va(i,c,f,r,n)),n&&g&2048&&Oc(c.alternate,c);break;case 24:va(i,c,f,r,n),n&&g&2048&&Cc(c.alternate,c);break;default:va(i,c,f,r,n)}t=t.sibling}}function sn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,n=a.flags;switch(a.tag){case 22:sn(l,a),n&2048&&Oc(a.alternate,a);break;case 24:sn(l,a),n&2048&&Cc(a.alternate,a);break;default:sn(l,a)}t=t.sibling}}var fn=8192;function ga(e,t,l){if(e.subtreeFlags&fn)for(e=e.child;e!==null;)dr(e,t,l),e=e.sibling}function dr(e,t,l){switch(e.tag){case 26:ga(e,t,l),e.flags&fn&&e.memoizedState!==null&&uy(l,Nt,e.memoizedState,e.memoizedProps);break;case 5:ga(e,t,l);break;case 3:case 4:var a=Nt;Nt=Mi(e.stateNode.containerInfo),ga(e,t,l),Nt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=fn,fn=16777216,ga(e,t,l),fn=a):ga(e,t,l));break;default:ga(e,t,l)}}function hr(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function on(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)mr(e),e=e.sibling}function mr(e){switch(e.tag){case 0:case 11:case 15:on(e),e.flags&2048&&dl(9,e,e.return);break;case 3:on(e);break;case 12:on(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,bi(e)):on(e);break;default:on(e)}}function bi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:dl(8,t,t.return),bi(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,bi(t));break;default:bi(t)}e=e.sibling}}function yr(e,t){for(;Je!==null;){var l=Je;switch(l.tag){case 0:case 11:case 15:dl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ka(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,Je=a;else e:for(l=e;Je!==null;){a=Je;var n=a.sibling,i=a.return;if(ir(a),a===l){Je=null;break e}if(n!==null){n.return=i,Je=n;break e}Je=i}}}var Sm={getCacheForType:function(e){var t=$e(Ge),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return $e(Ge).controller.signal}},jm=typeof WeakMap=="function"?WeakMap:Map,ye=0,Oe=null,ue=null,fe=0,ge=0,vt=null,hl=!1,pa=!1,Nc=!1,Ft=0,qe=0,ml=0,Ll=0,Dc=0,gt=0,ba=0,rn=null,ct=null,Mc=!1,xi=0,vr=0,Si=1/0,ji=null,yl=null,Ve=0,vl=null,xa=null,It=0,Rc=0,Uc=null,gr=null,dn=0,qc=null;function pt(){return(ye&2)!==0&&fe!==0?fe&-fe:T.T!==null?Xc():Ds()}function pr(){if(gt===0)if((fe&536870912)===0||re){var e=Nn;Nn<<=1,(Nn&3932160)===0&&(Nn=262144),gt=e}else gt=536870912;return e=mt.current,e!==null&&(e.flags|=32),gt}function st(e,t,l){(e===Oe&&(ge===2||ge===9)||e.cancelPendingCommit!==null)&&(Sa(e,0),gl(e,fe,gt,!1)),Ma(e,l),((ye&2)===0||e!==Oe)&&(e===Oe&&((ye&2)===0&&(Ll|=l),qe===4&&gl(e,fe,gt,!1)),qt(e))}function br(e,t,l){if((ye&6)!==0)throw Error(o(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Da(e,t),n=a?Am(e,t):Bc(e,t,!0),i=a;do{if(n===0){pa&&!a&&gl(e,t,0,!1);break}else{if(l=e.current.alternate,i&&!Tm(l)){n=Bc(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var f=e;n=rn;var r=f.current.memoizedState.isDehydrated;if(r&&(Sa(f,c).flags|=256),c=Bc(f,c,!1),c!==2){if(Nc&&!r){f.errorRecoveryDisabledLanes|=i,Ll|=i,n=4;break e}i=ct,ct=n,i!==null&&(ct===null?ct=i:ct.push.apply(ct,i))}n=c}if(i=!1,n!==2)continue}}if(n===1){Sa(e,0),gl(e,t,0,!0);break}e:{switch(a=e,i=n,i){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:gl(a,t,gt,!hl);break e;case 2:ct=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(n=xi+300-ft(),10<n)){if(gl(a,t,gt,!hl),Mn(a,0,!0)!==0)break e;It=t,a.timeoutHandle=$r(xr.bind(null,a,l,ct,ji,Mc,t,gt,Ll,ba,hl,i,"Throttled",-0,0),n);break e}xr(a,l,ct,ji,Mc,t,gt,Ll,ba,hl,i,null,-0,0)}}break}while(!0);qt(e)}function xr(e,t,l,a,n,i,c,f,r,g,E,D,p,S){if(e.timeoutHandle=-1,D=t.subtreeFlags,D&8192||(D&16785408)===16785408){D={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bt},dr(t,i,D);var X=(i&62914560)===i?xi-ft():(i&4194048)===i?vr-ft():0;if(X=cy(D,X),X!==null){It=i,e.cancelPendingCommit=X(Or.bind(null,e,t,i,l,a,n,c,f,r,E,D,null,p,S)),gl(e,i,c,!g);return}}Or(e,t,i,l,a,n,c,f,r)}function Tm(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var n=l[a],i=n.getSnapshot;n=n.value;try{if(!dt(i(),n))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gl(e,t,l,a){t&=~Dc,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var i=31-rt(n),c=1<<i;a[i]=-1,n&=~c}l!==0&&Os(e,l,t)}function Ti(){return(ye&6)===0?(hn(0),!1):!0}function Hc(){if(ue!==null){if(ge===0)var e=ue.return;else e=ue,Xt=Ul=null,Iu(e),ra=null,ka=0,e=ue;for(;e!==null;)Fo(e.alternate,e),e=e.return;ue=null}}function Sa(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Lm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),It=0,Hc(),Oe=e,ue=l=wt(e.current,null),fe=t,ge=0,vt=null,hl=!1,pa=Da(e,t),Nc=!1,ba=gt=Dc=Ll=ml=qe=0,ct=rn=null,Mc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-rt(a),i=1<<n;t|=e[n],a&=~i}return Ft=t,Zn(),l}function Sr(e,t){ee=null,T.H=ln,t===oa||t===In?(t=Hf(),ge=3):t===Gu?(t=Hf(),ge=4):ge=t===mc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,vt=t,ue===null&&(qe=1,di(e,jt(t,e.current)))}function jr(){var e=mt.current;return e===null?!0:(fe&4194048)===fe?_t===null:(fe&62914560)===fe||(fe&536870912)!==0?e===_t:!1}function Tr(){var e=T.H;return T.H=ln,e===null?ln:e}function Er(){var e=T.A;return T.A=Sm,e}function Ei(){qe=4,hl||(fe&4194048)!==fe&&mt.current!==null||(pa=!0),(ml&134217727)===0&&(Ll&134217727)===0||Oe===null||gl(Oe,fe,gt,!1)}function Bc(e,t,l){var a=ye;ye|=2;var n=Tr(),i=Er();(Oe!==e||fe!==t)&&(ji=null,Sa(e,t)),t=!1;var c=qe;e:do try{if(ge!==0&&ue!==null){var f=ue,r=vt;switch(ge){case 8:Hc(),c=6;break e;case 3:case 2:case 9:case 6:mt.current===null&&(t=!0);var g=ge;if(ge=0,vt=null,ja(e,f,r,g),l&&pa){c=0;break e}break;default:g=ge,ge=0,vt=null,ja(e,f,r,g)}}Em(),c=qe;break}catch(E){Sr(e,E)}while(!0);return t&&e.shellSuspendCounter++,Xt=Ul=null,ye=a,T.H=n,T.A=i,ue===null&&(Oe=null,fe=0,Zn()),c}function Em(){for(;ue!==null;)Ar(ue)}function Am(e,t){var l=ye;ye|=2;var a=Tr(),n=Er();Oe!==e||fe!==t?(ji=null,Si=ft()+500,Sa(e,t)):pa=Da(e,t);e:do try{if(ge!==0&&ue!==null){t=ue;var i=vt;t:switch(ge){case 1:ge=0,vt=null,ja(e,t,i,1);break;case 2:case 9:if(Uf(i)){ge=0,vt=null,_r(t);break}t=function(){ge!==2&&ge!==9||Oe!==e||(ge=7),qt(e)},i.then(t,t);break e;case 3:ge=7;break e;case 4:ge=5;break e;case 7:Uf(i)?(ge=0,vt=null,_r(t)):(ge=0,vt=null,ja(e,t,i,7));break;case 5:var c=null;switch(ue.tag){case 26:c=ue.memoizedState;case 5:case 27:var f=ue;if(c?rd(c):f.stateNode.complete){ge=0,vt=null;var r=f.sibling;if(r!==null)ue=r;else{var g=f.return;g!==null?(ue=g,Ai(g)):ue=null}break t}}ge=0,vt=null,ja(e,t,i,5);break;case 6:ge=0,vt=null,ja(e,t,i,6);break;case 8:Hc(),qe=6;break e;default:throw Error(o(462))}}_m();break}catch(E){Sr(e,E)}while(!0);return Xt=Ul=null,T.H=a,T.A=n,ye=l,ue!==null?0:(Oe=null,fe=0,Zn(),qe)}function _m(){for(;ue!==null&&!Wd();)Ar(ue)}function Ar(e){var t=Wo(e.alternate,e,Ft);e.memoizedProps=e.pendingProps,t===null?Ai(e):ue=t}function _r(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Lo(l,t,t.pendingProps,t.type,void 0,fe);break;case 11:t=Lo(l,t,t.pendingProps,t.type.render,t.ref,fe);break;case 5:Iu(t);default:Fo(l,t),t=ue=Tf(t,Ft),t=Wo(l,t,Ft)}e.memoizedProps=e.pendingProps,t===null?Ai(e):ue=t}function ja(e,t,l,a){Xt=Ul=null,Iu(t),ra=null,ka=0;var n=t.return;try{if(mm(e,n,t,l,fe)){qe=1,di(e,jt(l,e.current)),ue=null;return}}catch(i){if(n!==null)throw ue=n,i;qe=1,di(e,jt(l,e.current)),ue=null;return}t.flags&32768?(re||a===1?e=!0:pa||(fe&536870912)!==0?e=!1:(hl=e=!0,(a===2||a===9||a===3||a===6)&&(a=mt.current,a!==null&&a.tag===13&&(a.flags|=16384))),zr(t,e)):Ai(t)}function Ai(e){var t=e;do{if((t.flags&32768)!==0){zr(t,hl);return}e=t.return;var l=gm(t.alternate,t,Ft);if(l!==null){ue=l;return}if(t=t.sibling,t!==null){ue=t;return}ue=t=e}while(t!==null);qe===0&&(qe=5)}function zr(e,t){do{var l=pm(e.alternate,e);if(l!==null){l.flags&=32767,ue=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ue=e;return}ue=e=l}while(e!==null);qe=6,ue=null}function Or(e,t,l,a,n,i,c,f,r){e.cancelPendingCommit=null;do _i();while(Ve!==0);if((ye&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(i=t.lanes|t.childLanes,i|=Au,ih(e,l,i,c,f,r),e===Oe&&(ue=Oe=null,fe=0),xa=t,vl=e,It=l,Rc=i,Uc=n,gr=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Nm(On,function(){return Rr(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=T.T,T.T=null,n=N.p,N.p=2,c=ye,ye|=4;try{bm(e,t,l)}finally{ye=c,N.p=n,T.T=a}}Ve=1,Cr(),Nr(),Dr()}}function Cr(){if(Ve===1){Ve=0;var e=vl,t=xa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=T.T,T.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{fr(t,e);var i=Wc,c=mf(e.containerInfo),f=i.focusedElem,r=i.selectionRange;if(c!==f&&f&&f.ownerDocument&&hf(f.ownerDocument.documentElement,f)){if(r!==null&&xu(f)){var g=r.start,E=r.end;if(E===void 0&&(E=g),"selectionStart"in f)f.selectionStart=g,f.selectionEnd=Math.min(E,f.value.length);else{var D=f.ownerDocument||document,p=D&&D.defaultView||window;if(p.getSelection){var S=p.getSelection(),X=f.textContent.length,J=Math.min(r.start,X),_e=r.end===void 0?J:Math.min(r.end,X);!S.extend&&J>_e&&(c=_e,_e=J,J=c);var y=df(f,J),d=df(f,_e);if(y&&d&&(S.rangeCount!==1||S.anchorNode!==y.node||S.anchorOffset!==y.offset||S.focusNode!==d.node||S.focusOffset!==d.offset)){var v=D.createRange();v.setStart(y.node,y.offset),S.removeAllRanges(),J>_e?(S.addRange(v),S.extend(d.node,d.offset)):(v.setEnd(d.node,d.offset),S.addRange(v))}}}}for(D=[],S=f;S=S.parentNode;)S.nodeType===1&&D.push({element:S,left:S.scrollLeft,top:S.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<D.length;f++){var O=D[f];O.element.scrollLeft=O.left,O.element.scrollTop=O.top}}Yi=!!kc,Wc=kc=null}finally{ye=n,N.p=a,T.T=l}}e.current=t,Ve=2}}function Nr(){if(Ve===2){Ve=0;var e=vl,t=xa,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=T.T,T.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{nr(e,t.alternate,t)}finally{ye=n,N.p=a,T.T=l}}Ve=3}}function Dr(){if(Ve===4||Ve===3){Ve=0,$d();var e=vl,t=xa,l=It,a=gr;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ve=5:(Ve=0,xa=vl=null,Mr(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(yl=null),tu(l),t=t.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(Na,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=T.T,n=N.p,N.p=2,T.T=null;try{for(var i=e.onRecoverableError,c=0;c<a.length;c++){var f=a[c];i(f.value,{componentStack:f.stack})}}finally{T.T=t,N.p=n}}(It&3)!==0&&_i(),qt(e),n=e.pendingLanes,(l&261930)!==0&&(n&42)!==0?e===qc?dn++:(dn=0,qc=e):dn=0,hn(0)}}function Mr(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ka(t)))}function _i(){return Cr(),Nr(),Dr(),Rr()}function Rr(){if(Ve!==5)return!1;var e=vl,t=Rc;Rc=0;var l=tu(It),a=T.T,n=N.p;try{N.p=32>l?32:l,T.T=null,l=Uc,Uc=null;var i=vl,c=It;if(Ve=0,xa=vl=null,It=0,(ye&6)!==0)throw Error(o(331));var f=ye;if(ye|=4,mr(i.current),rr(i,i.current,c,l),ye=f,hn(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(Na,i)}catch{}return!0}finally{N.p=n,T.T=a,Mr(e,t)}}function Ur(e,t,l){t=jt(l,t),t=hc(e.stateNode,t,2),e=fl(e,t,2),e!==null&&(Ma(e,2),qt(e))}function pe(e,t,l){if(e.tag===3)Ur(e,e,l);else for(;t!==null;){if(t.tag===3){Ur(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(yl===null||!yl.has(a))){e=jt(l,e),l=qo(2),a=fl(t,l,2),a!==null&&(Ho(l,a,t,e),Ma(a,2),qt(a));break}}t=t.return}}function Yc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new jm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Nc=!0,n.add(l),e=zm.bind(null,e,t,l),t.then(e,e))}function zm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Oe===e&&(fe&l)===l&&(qe===4||qe===3&&(fe&62914560)===fe&&300>ft()-xi?(ye&2)===0&&Sa(e,0):Dc|=l,ba===fe&&(ba=0)),qt(e)}function qr(e,t){t===0&&(t=zs()),e=Dl(e,t),e!==null&&(Ma(e,t),qt(e))}function Om(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),qr(e,l)}function Cm(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),qr(e,l)}function Nm(e,t){return Fi(e,t)}var zi=null,Ta=null,wc=!1,Oi=!1,Gc=!1,pl=0;function qt(e){e!==Ta&&e.next===null&&(Ta===null?zi=Ta=e:Ta=Ta.next=e),Oi=!0,wc||(wc=!0,Mm())}function hn(e,t){if(!Gc&&Oi){Gc=!0;do for(var l=!1,a=zi;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var i=0;else{var c=a.suspendedLanes,f=a.pingedLanes;i=(1<<31-rt(42|e)+1)-1,i&=n&~(c&~f),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,wr(a,i))}else i=fe,i=Mn(a,a===Oe?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Da(a,i)||(l=!0,wr(a,i));a=a.next}while(l);Gc=!1}}function Dm(){Hr()}function Hr(){Oi=wc=!1;var e=0;pl!==0&&Qm()&&(e=pl);for(var t=ft(),l=null,a=zi;a!==null;){var n=a.next,i=Br(a,t);i===0?(a.next=null,l===null?zi=n:l.next=n,n===null&&(Ta=l)):(l=a,(e!==0||(i&3)!==0)&&(Oi=!0)),a=n}Ve!==0&&Ve!==5||hn(e),pl!==0&&(pl=0)}function Br(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var c=31-rt(i),f=1<<c,r=n[c];r===-1?((f&l)===0||(f&a)!==0)&&(n[c]=nh(f,t)):r<=t&&(e.expiredLanes|=f),i&=~f}if(t=Oe,l=fe,l=Mn(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(ge===2||ge===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Ii(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Da(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Ii(a),tu(l)){case 2:case 8:l=As;break;case 32:l=On;break;case 268435456:l=_s;break;default:l=On}return a=Yr.bind(null,e),l=Fi(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Ii(a),e.callbackPriority=2,e.callbackNode=null,2}function Yr(e,t){if(Ve!==0&&Ve!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(_i()&&e.callbackNode!==l)return null;var a=fe;return a=Mn(e,e===Oe?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(br(e,a,t),Br(e,ft()),e.callbackNode!=null&&e.callbackNode===l?Yr.bind(null,e):null)}function wr(e,t){if(_i())return null;br(e,t,!0)}function Mm(){Zm(function(){(ye&6)!==0?Fi(Es,Dm):Hr()})}function Xc(){if(pl===0){var e=sa;e===0&&(e=Cn,Cn<<=1,(Cn&261888)===0&&(Cn=256)),pl=e}return pl}function Gr(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Hn(""+e)}function Xr(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Rm(e,t,l,a,n){if(t==="submit"&&l&&l.stateNode===n){var i=Gr((n[lt]||null).action),c=a.submitter;c&&(t=(t=c[lt]||null)?Gr(t.formAction):c.getAttribute("formAction"),t!==null&&(i=t,c=null));var f=new Gn("action","action",null,a,n);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(pl!==0){var r=c?Xr(n,c):new FormData(n);cc(l,{pending:!0,data:r,method:n.method,action:i},null,r)}}else typeof i=="function"&&(f.preventDefault(),r=c?Xr(n,c):new FormData(n),cc(l,{pending:!0,data:r,method:n.method,action:i},i,r))},currentTarget:n}]})}}for(var Qc=0;Qc<Eu.length;Qc++){var Lc=Eu[Qc],Um=Lc.toLowerCase(),qm=Lc[0].toUpperCase()+Lc.slice(1);Ct(Um,"on"+qm)}Ct(gf,"onAnimationEnd"),Ct(pf,"onAnimationIteration"),Ct(bf,"onAnimationStart"),Ct("dblclick","onDoubleClick"),Ct("focusin","onFocus"),Ct("focusout","onBlur"),Ct(Fh,"onTransitionRun"),Ct(Ih,"onTransitionStart"),Ct(Ph,"onTransitionCancel"),Ct(xf,"onTransitionEnd"),kl("onMouseEnter",["mouseout","mouseover"]),kl("onMouseLeave",["mouseout","mouseover"]),kl("onPointerEnter",["pointerout","pointerover"]),kl("onPointerLeave",["pointerout","pointerover"]),zl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zl("onBeforeInput",["compositionend","keypress","textInput","paste"]),zl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Hm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mn));function Qr(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],n=a.event;a=a.listeners;e:{var i=void 0;if(t)for(var c=a.length-1;0<=c;c--){var f=a[c],r=f.instance,g=f.currentTarget;if(f=f.listener,r!==i&&n.isPropagationStopped())break e;i=f,n.currentTarget=g;try{i(n)}catch(E){Ln(E)}n.currentTarget=null,i=r}else for(c=0;c<a.length;c++){if(f=a[c],r=f.instance,g=f.currentTarget,f=f.listener,r!==i&&n.isPropagationStopped())break e;i=f,n.currentTarget=g;try{i(n)}catch(E){Ln(E)}n.currentTarget=null,i=r}}}}function ce(e,t){var l=t[lu];l===void 0&&(l=t[lu]=new Set);var a=e+"__bubble";l.has(a)||(Lr(t,e,2,!1),l.add(a))}function Zc(e,t,l){var a=0;t&&(a|=4),Lr(l,e,a,t)}var Ci="_reactListening"+Math.random().toString(36).slice(2);function Vc(e){if(!e[Ci]){e[Ci]=!0,Us.forEach(function(l){l!=="selectionchange"&&(Hm.has(l)||Zc(l,!1,e),Zc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ci]||(t[Ci]=!0,Zc("selectionchange",!1,t))}}function Lr(e,t,l,a){switch(pd(t)){case 2:var n=oy;break;case 8:n=ry;break;default:n=us}l=n.bind(null,t,l,e),n=void 0,!ru||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,l,{capture:!0,passive:n}):e.addEventListener(t,l,!0):n!==void 0?e.addEventListener(t,l,{passive:n}):e.addEventListener(t,l,!1)}function Kc(e,t,l,a,n){var i=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var c=a.tag;if(c===3||c===4){var f=a.stateNode.containerInfo;if(f===n)break;if(c===4)for(c=a.return;c!==null;){var r=c.tag;if((r===3||r===4)&&c.stateNode.containerInfo===n)return;c=c.return}for(;f!==null;){if(c=Vl(f),c===null)return;if(r=c.tag,r===5||r===6||r===26||r===27){a=i=c;continue e}f=f.parentNode}}a=a.return}Ks(function(){var g=i,E=fu(l),D=[];e:{var p=Sf.get(e);if(p!==void 0){var S=Gn,X=e;switch(e){case"keypress":if(Yn(l)===0)break e;case"keydown":case"keyup":S=Ch;break;case"focusin":X="focus",S=yu;break;case"focusout":X="blur",S=yu;break;case"beforeblur":case"afterblur":S=yu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":S=Ws;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=gh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=Mh;break;case gf:case pf:case bf:S=xh;break;case xf:S=Uh;break;case"scroll":case"scrollend":S=yh;break;case"wheel":S=Hh;break;case"copy":case"cut":case"paste":S=jh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=Fs;break;case"toggle":case"beforetoggle":S=Yh}var J=(t&4)!==0,_e=!J&&(e==="scroll"||e==="scrollend"),y=J?p!==null?p+"Capture":null:p;J=[];for(var d=g,v;d!==null;){var O=d;if(v=O.stateNode,O=O.tag,O!==5&&O!==26&&O!==27||v===null||y===null||(O=qa(d,y),O!=null&&J.push(yn(d,O,v))),_e)break;d=d.return}0<J.length&&(p=new S(p,X,null,l,E),D.push({event:p,listeners:J}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",p&&l!==su&&(X=l.relatedTarget||l.fromElement)&&(Vl(X)||X[Zl]))break e;if((S||p)&&(p=E.window===E?E:(p=E.ownerDocument)?p.defaultView||p.parentWindow:window,S?(X=l.relatedTarget||l.toElement,S=g,X=X?Vl(X):null,X!==null&&(_e=z(X),J=X.tag,X!==_e||J!==5&&J!==27&&J!==6)&&(X=null)):(S=null,X=g),S!==X)){if(J=Ws,O="onMouseLeave",y="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(J=Fs,O="onPointerLeave",y="onPointerEnter",d="pointer"),_e=S==null?p:Ua(S),v=X==null?p:Ua(X),p=new J(O,d+"leave",S,l,E),p.target=_e,p.relatedTarget=v,O=null,Vl(E)===g&&(J=new J(y,d+"enter",X,l,E),J.target=v,J.relatedTarget=_e,O=J),_e=O,S&&X)t:{for(J=Bm,y=S,d=X,v=0,O=y;O;O=J(O))v++;O=0;for(var K=d;K;K=J(K))O++;for(;0<v-O;)y=J(y),v--;for(;0<O-v;)d=J(d),O--;for(;v--;){if(y===d||d!==null&&y===d.alternate){J=y;break t}y=J(y),d=J(d)}J=null}else J=null;S!==null&&Zr(D,p,S,J,!1),X!==null&&_e!==null&&Zr(D,_e,X,J,!0)}}e:{if(p=g?Ua(g):window,S=p.nodeName&&p.nodeName.toLowerCase(),S==="select"||S==="input"&&p.type==="file")var he=uf;else if(af(p))if(cf)he=kh;else{he=Kh;var L=Vh}else S=p.nodeName,!S||S.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?g&&cu(g.elementType)&&(he=uf):he=Jh;if(he&&(he=he(e,g))){nf(D,he,l,E);break e}L&&L(e,p,g),e==="focusout"&&g&&p.type==="number"&&g.memoizedProps.value!=null&&uu(p,"number",p.value)}switch(L=g?Ua(g):window,e){case"focusin":(af(L)||L.contentEditable==="true")&&(ea=L,Su=g,La=null);break;case"focusout":La=Su=ea=null;break;case"mousedown":ju=!0;break;case"contextmenu":case"mouseup":case"dragend":ju=!1,yf(D,l,E);break;case"selectionchange":if($h)break;case"keydown":case"keyup":yf(D,l,E)}var te;if(gu)e:{switch(e){case"compositionstart":var oe="onCompositionStart";break e;case"compositionend":oe="onCompositionEnd";break e;case"compositionupdate":oe="onCompositionUpdate";break e}oe=void 0}else Pl?tf(e,l)&&(oe="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(oe="onCompositionStart");oe&&(Is&&l.locale!=="ko"&&(Pl||oe!=="onCompositionStart"?oe==="onCompositionEnd"&&Pl&&(te=Js()):(ll=E,du="value"in ll?ll.value:ll.textContent,Pl=!0)),L=Ni(g,oe),0<L.length&&(oe=new $s(oe,e,null,l,E),D.push({event:oe,listeners:L}),te?oe.data=te:(te=lf(l),te!==null&&(oe.data=te)))),(te=Gh?Xh(e,l):Qh(e,l))&&(oe=Ni(g,"onBeforeInput"),0<oe.length&&(L=new $s("onBeforeInput","beforeinput",null,l,E),D.push({event:L,listeners:oe}),L.data=te)),Rm(D,e,g,l,E)}Qr(D,t)})}function yn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Ni(e,t){for(var l=t+"Capture",a=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=qa(e,l),n!=null&&a.unshift(yn(e,n,i)),n=qa(e,t),n!=null&&a.push(yn(e,n,i))),e.tag===3)return a;e=e.return}return[]}function Bm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zr(e,t,l,a,n){for(var i=t._reactName,c=[];l!==null&&l!==a;){var f=l,r=f.alternate,g=f.stateNode;if(f=f.tag,r!==null&&r===a)break;f!==5&&f!==26&&f!==27||g===null||(r=g,n?(g=qa(l,i),g!=null&&c.unshift(yn(l,g,r))):n||(g=qa(l,i),g!=null&&c.push(yn(l,g,r)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var Ym=/\r\n?/g,wm=/\u0000|\uFFFD/g;function Vr(e){return(typeof e=="string"?e:""+e).replace(Ym,`-`).replace(wm,"")}function Kr(e,t){return t=Vr(t),Vr(e)===t}function Ae(e,t,l,a,n,i){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||$l(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&$l(e,""+a);break;case"className":Un(e,"class",a);break;case"tabIndex":Un(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Un(e,l,a);break;case"style":Zs(e,a,i);break;case"data":if(t!=="object"){Un(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(l==="formAction"?(t!=="input"&&Ae(e,t,"name",n.name,n,null),Ae(e,t,"formEncType",n.formEncType,n,null),Ae(e,t,"formMethod",n.formMethod,n,null),Ae(e,t,"formTarget",n.formTarget,n,null)):(Ae(e,t,"encType",n.encType,n,null),Ae(e,t,"method",n.method,n,null),Ae(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Hn(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":ce("beforetoggle",e),ce("toggle",e),Rn(e,"popover",a);break;case"xlinkActuate":Ht(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ht(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ht(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ht(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ht(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ht(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Rn(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=hh.get(l)||l,Rn(e,l,a))}}function Jc(e,t,l,a,n,i){switch(l){case"style":Zs(e,a,i);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof a=="string"?$l(e,a):(typeof a=="number"||typeof a=="bigint")&&$l(e,""+a);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qs.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(n=l.endsWith("Capture"),t=l.slice(2,n?l.length-7:void 0),i=e[lt]||null,i=i!=null?i[l]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof a=="function")){typeof i!="function"&&i!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,n);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):Rn(e,l,a)}}}function Ie(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ce("error",e),ce("load",e);var a=!1,n=!1,i;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];if(c!=null)switch(i){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ae(e,t,i,c,l,null)}}n&&Ae(e,t,"srcSet",l.srcSet,l,null),a&&Ae(e,t,"src",l.src,l,null);return;case"input":ce("invalid",e);var f=i=c=n=null,r=null,g=null;for(a in l)if(l.hasOwnProperty(a)){var E=l[a];if(E!=null)switch(a){case"name":n=E;break;case"type":c=E;break;case"checked":r=E;break;case"defaultChecked":g=E;break;case"value":i=E;break;case"defaultValue":f=E;break;case"children":case"dangerouslySetInnerHTML":if(E!=null)throw Error(o(137,t));break;default:Ae(e,t,a,E,l,null)}}Gs(e,i,f,r,g,c,n,!1);return;case"select":ce("invalid",e),a=c=i=null;for(n in l)if(l.hasOwnProperty(n)&&(f=l[n],f!=null))switch(n){case"value":i=f;break;case"defaultValue":c=f;break;case"multiple":a=f;default:Ae(e,t,n,f,l,null)}t=i,l=c,e.multiple=!!a,t!=null?Wl(e,!!a,t,!1):l!=null&&Wl(e,!!a,l,!0);return;case"textarea":ce("invalid",e),i=n=a=null;for(c in l)if(l.hasOwnProperty(c)&&(f=l[c],f!=null))switch(c){case"value":a=f;break;case"defaultValue":n=f;break;case"children":i=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:Ae(e,t,c,f,l,null)}Qs(e,a,n,i);return;case"option":for(r in l)if(l.hasOwnProperty(r)&&(a=l[r],a!=null))switch(r){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ae(e,t,r,a,l,null)}return;case"dialog":ce("beforetoggle",e),ce("toggle",e),ce("cancel",e),ce("close",e);break;case"iframe":case"object":ce("load",e);break;case"video":case"audio":for(a=0;a<mn.length;a++)ce(mn[a],e);break;case"image":ce("error",e),ce("load",e);break;case"details":ce("toggle",e);break;case"embed":case"source":case"link":ce("error",e),ce("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(g in l)if(l.hasOwnProperty(g)&&(a=l[g],a!=null))switch(g){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ae(e,t,g,a,l,null)}return;default:if(cu(t)){for(E in l)l.hasOwnProperty(E)&&(a=l[E],a!==void 0&&Jc(e,t,E,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Ae(e,t,f,a,l,null))}function Gm(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,c=null,f=null,r=null,g=null,E=null;for(S in l){var D=l[S];if(l.hasOwnProperty(S)&&D!=null)switch(S){case"checked":break;case"value":break;case"defaultValue":r=D;default:a.hasOwnProperty(S)||Ae(e,t,S,null,a,D)}}for(var p in a){var S=a[p];if(D=l[p],a.hasOwnProperty(p)&&(S!=null||D!=null))switch(p){case"type":i=S;break;case"name":n=S;break;case"checked":g=S;break;case"defaultChecked":E=S;break;case"value":c=S;break;case"defaultValue":f=S;break;case"children":case"dangerouslySetInnerHTML":if(S!=null)throw Error(o(137,t));break;default:S!==D&&Ae(e,t,p,S,a,D)}}iu(e,c,f,r,g,E,i,n);return;case"select":S=c=f=p=null;for(i in l)if(r=l[i],l.hasOwnProperty(i)&&r!=null)switch(i){case"value":break;case"multiple":S=r;default:a.hasOwnProperty(i)||Ae(e,t,i,null,a,r)}for(n in a)if(i=a[n],r=l[n],a.hasOwnProperty(n)&&(i!=null||r!=null))switch(n){case"value":p=i;break;case"defaultValue":f=i;break;case"multiple":c=i;default:i!==r&&Ae(e,t,n,i,a,r)}t=f,l=c,a=S,p!=null?Wl(e,!!l,p,!1):!!a!=!!l&&(t!=null?Wl(e,!!l,t,!0):Wl(e,!!l,l?[]:"",!1));return;case"textarea":S=p=null;for(f in l)if(n=l[f],l.hasOwnProperty(f)&&n!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Ae(e,t,f,null,a,n)}for(c in a)if(n=a[c],i=l[c],a.hasOwnProperty(c)&&(n!=null||i!=null))switch(c){case"value":p=n;break;case"defaultValue":S=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(o(91));break;default:n!==i&&Ae(e,t,c,n,a,i)}Xs(e,p,S);return;case"option":for(var X in l)if(p=l[X],l.hasOwnProperty(X)&&p!=null&&!a.hasOwnProperty(X))switch(X){case"selected":e.selected=!1;break;default:Ae(e,t,X,null,a,p)}for(r in a)if(p=a[r],S=l[r],a.hasOwnProperty(r)&&p!==S&&(p!=null||S!=null))switch(r){case"selected":e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Ae(e,t,r,p,a,S)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var J in l)p=l[J],l.hasOwnProperty(J)&&p!=null&&!a.hasOwnProperty(J)&&Ae(e,t,J,null,a,p);for(g in a)if(p=a[g],S=l[g],a.hasOwnProperty(g)&&p!==S&&(p!=null||S!=null))switch(g){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(137,t));break;default:Ae(e,t,g,p,a,S)}return;default:if(cu(t)){for(var _e in l)p=l[_e],l.hasOwnProperty(_e)&&p!==void 0&&!a.hasOwnProperty(_e)&&Jc(e,t,_e,void 0,a,p);for(E in a)p=a[E],S=l[E],!a.hasOwnProperty(E)||p===S||p===void 0&&S===void 0||Jc(e,t,E,p,a,S);return}}for(var y in l)p=l[y],l.hasOwnProperty(y)&&p!=null&&!a.hasOwnProperty(y)&&Ae(e,t,y,null,a,p);for(D in a)p=a[D],S=l[D],!a.hasOwnProperty(D)||p===S||p==null&&S==null||Ae(e,t,D,p,a,S)}function Jr(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var n=l[a],i=n.transferSize,c=n.initiatorType,f=n.duration;if(i&&f&&Jr(c)){for(c=0,f=n.responseEnd,a+=1;a<l.length;a++){var r=l[a],g=r.startTime;if(g>f)break;var E=r.transferSize,D=r.initiatorType;E&&Jr(D)&&(r=r.responseEnd,c+=E*(r<f?1:(f-g)/(r-g)))}if(--a,t+=8*(i+c)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var kc=null,Wc=null;function Di(e){return e.nodeType===9?e:e.ownerDocument}function kr(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Wr(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function $c(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Fc=null;function Qm(){var e=window.event;return e&&e.type==="popstate"?e===Fc?!1:(Fc=e,!0):(Fc=null,!1)}var $r=typeof setTimeout=="function"?setTimeout:void 0,Lm=typeof clearTimeout=="function"?clearTimeout:void 0,Fr=typeof Promise=="function"?Promise:void 0,Zm=typeof queueMicrotask=="function"?queueMicrotask:typeof Fr<"u"?function(e){return Fr.resolve(null).then(e).catch(Vm)}:$r;function Vm(e){setTimeout(function(){throw e})}function bl(e){return e==="head"}function Ir(e,t){var l=t,a=0;do{var n=l.nextSibling;if(e.removeChild(l),n&&n.nodeType===8)if(l=n.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(n),za(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")vn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,vn(l);for(var i=l.firstChild;i;){var c=i.nextSibling,f=i.nodeName;i[Ra]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&i.rel.toLowerCase()==="stylesheet"||l.removeChild(i),i=c}}else l==="body"&&vn(e.ownerDocument.body);l=n}while(l);za(t)}function Pr(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Ic(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ic(l),au(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Km(e,t,l,a){for(;e.nodeType===1;){var n=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Ra])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=zt(e.nextSibling),e===null)break}return null}function Jm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=zt(e.nextSibling),e===null))return null;return e}function ed(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=zt(e.nextSibling),e===null))return null;return e}function Pc(e){return e.data==="$?"||e.data==="$~"}function es(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function km(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function zt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ts=null;function td(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return zt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function ld(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function ad(e,t,l){switch(t=Di(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function vn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);au(e)}var Ot=new Map,nd=new Set;function Mi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pt=N.d;N.d={f:Wm,r:$m,D:Fm,C:Im,L:Pm,m:ey,X:ly,S:ty,M:ay};function Wm(){var e=Pt.f(),t=Ti();return e||t}function $m(e){var t=Kl(e);t!==null&&t.tag===5&&t.type==="form"?So(t):Pt.r(e)}var Ea=typeof document>"u"?null:document;function id(e,t,l){var a=Ea;if(a&&typeof t=="string"&&t){var n=xt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),nd.has(n)||(nd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function Fm(e){Pt.D(e),id("dns-prefetch",e,null)}function Im(e,t){Pt.C(e,t),id("preconnect",e,t)}function Pm(e,t,l){Pt.L(e,t,l);var a=Ea;if(a&&e&&t){var n='link[rel="preload"][as="'+xt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+xt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+xt(l.imageSizes)+'"]')):n+='[href="'+xt(e)+'"]';var i=n;switch(t){case"style":i=Aa(e);break;case"script":i=_a(e)}Ot.has(i)||(e=j({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ot.set(i,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(gn(i))||t==="script"&&a.querySelector(pn(i))||(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function ey(e,t){Pt.m(e,t);var l=Ea;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+xt(a)+'"][href="'+xt(e)+'"]',i=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=_a(e)}if(!Ot.has(i)&&(e=j({rel:"modulepreload",href:e},t),Ot.set(i,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(pn(i)))return}a=l.createElement("link"),Ie(a,"link",e),Ke(a),l.head.appendChild(a)}}}function ty(e,t,l){Pt.S(e,t,l);var a=Ea;if(a&&e){var n=Jl(a).hoistableStyles,i=Aa(e);t=t||"default";var c=n.get(i);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(gn(i)))f.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ot.get(i))&&ls(e,l);var r=c=a.createElement("link");Ke(r),Ie(r,"link",e),r._p=new Promise(function(g,E){r.onload=g,r.onerror=E}),r.addEventListener("load",function(){f.loading|=1}),r.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Ri(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:f},n.set(i,c)}}}function ly(e,t){Pt.X(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),i=a.get(n);i||(i=l.querySelector(pn(n)),i||(e=j({src:e,async:!0},t),(t=Ot.get(n))&&as(e,t),i=l.createElement("script"),Ke(i),Ie(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function ay(e,t){Pt.M(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),i=a.get(n);i||(i=l.querySelector(pn(n)),i||(e=j({src:e,async:!0,type:"module"},t),(t=Ot.get(n))&&as(e,t),i=l.createElement("script"),Ke(i),Ie(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function ud(e,t,l,a){var n=(n=ie.current)?Mi(n):null;if(!n)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Aa(l.href),l=Jl(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Aa(l.href);var i=Jl(n).hoistableStyles,c=i.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,c),(i=n.querySelector(gn(e)))&&!i._p&&(c.instance=i,c.state.loading=5),Ot.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ot.set(e,l),i||ny(n,e,l,c.state))),t&&a===null)throw Error(o(528,""));return c}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_a(l),l=Jl(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Aa(e){return'href="'+xt(e)+'"'}function gn(e){return'link[rel="stylesheet"]['+e+"]"}function cd(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function ny(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Ie(t,"link",l),Ke(t),e.head.appendChild(t))}function _a(e){return'[src="'+xt(e)+'"]'}function pn(e){return"script[async]"+e}function sd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+xt(l.href)+'"]');if(a)return t.instance=a,Ke(a),a;var n=j({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ke(a),Ie(a,"style",n),Ri(a,l.precedence,e),t.instance=a;case"stylesheet":n=Aa(l.href);var i=e.querySelector(gn(n));if(i)return t.state.loading|=4,t.instance=i,Ke(i),i;a=cd(l),(n=Ot.get(n))&&ls(a,n),i=(e.ownerDocument||e).createElement("link"),Ke(i);var c=i;return c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(i,"link",a),t.state.loading|=4,Ri(i,l.precedence,e),t.instance=i;case"script":return i=_a(l.src),(n=e.querySelector(pn(i)))?(t.instance=n,Ke(n),n):(a=l,(n=Ot.get(i))&&(a=j({},l),as(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Ke(n),Ie(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ri(a,l.precedence,e));return t.instance}function Ri(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,i=n,c=0;c<a.length;c++){var f=a[c];if(f.dataset.precedence===t)i=f;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function ls(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function as(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ui=null;function fd(e,t,l){if(Ui===null){var a=new Map,n=Ui=new Map;n.set(l,a)}else n=Ui,a=n.get(l),a||(a=new Map,n.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),n=0;n<l.length;n++){var i=l[n];if(!(i[Ra]||i[ke]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var c=i.getAttribute(t)||"";c=e+c;var f=a.get(c);f?f.push(i):a.set(c,[i])}}return a}function od(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function iy(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function rd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function uy(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Aa(a.href),i=t.querySelector(gn(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=qi.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,Ke(i);return}i=t.ownerDocument||t,a=cd(a),(n=Ot.get(n))&&ls(a,n),i=i.createElement("link"),Ke(i);var c=i;c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(i,"link",a),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=qi.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ns=0;function cy(e,t){return e.stylesheets&&e.count===0&&Bi(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&Bi(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&ns===0&&(ns=62500*Xm());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bi(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>ns?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function qi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hi=null;function Bi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hi=new Map,t.forEach(sy,e),Hi=null,qi.call(e))}function sy(e,t){if(!(t.state.loading&4)){var l=Hi.get(e);if(l)var a=l.get(null);else{l=new Map,Hi.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var c=n[i];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),a=c)}a&&l.set(null,a)}n=t.instance,c=n.getAttribute("data-precedence"),i=l.get(c)||a,i===a&&l.set(null,n),l.set(c,n),this.count++,a=qi.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var bn={$$typeof:le,Provider:null,Consumer:null,_currentValue:w,_currentValue2:w,_threadCount:0};function fy(e,t,l,a,n,i,c,f,r){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pi(0),this.hiddenUpdates=Pi(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=r,this.incompleteTransitions=new Map}function dd(e,t,l,a,n,i,c,f,r,g,E,D){return e=new fy(e,t,l,c,r,g,E,D,f),t=1,i===!0&&(t|=24),i=ht(3,null,null,t),e.current=i,i.stateNode=e,t=Bu(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:a,isDehydrated:l,cache:t},Xu(i),e}function hd(e){return e?(e=aa,e):aa}function md(e,t,l,a,n,i){n=hd(n),a.context===null?a.context=n:a.pendingContext=n,a=sl(t),a.payload={element:l},i=i===void 0?null:i,i!==null&&(a.callback=i),l=fl(e,a,t),l!==null&&(st(l,e,t),$a(l,e,t))}function yd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function is(e,t){yd(e,t),(e=e.alternate)&&yd(e,t)}function vd(e){if(e.tag===13||e.tag===31){var t=Dl(e,67108864);t!==null&&st(t,e,67108864),is(e,67108864)}}function gd(e){if(e.tag===13||e.tag===31){var t=pt();t=eu(t);var l=Dl(e,t);l!==null&&st(l,e,t),is(e,t)}}var Yi=!0;function oy(e,t,l,a){var n=T.T;T.T=null;var i=N.p;try{N.p=2,us(e,t,l,a)}finally{N.p=i,T.T=n}}function ry(e,t,l,a){var n=T.T;T.T=null;var i=N.p;try{N.p=8,us(e,t,l,a)}finally{N.p=i,T.T=n}}function us(e,t,l,a){if(Yi){var n=cs(a);if(n===null)Kc(e,t,a,wi,l),bd(e,a);else if(hy(n,e,t,l,a))a.stopPropagation();else if(bd(e,a),t&4&&-1<dy.indexOf(e)){for(;n!==null;){var i=Kl(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var c=_l(i.pendingLanes);if(c!==0){var f=i;for(f.pendingLanes|=2,f.entangledLanes|=2;c;){var r=1<<31-rt(c);f.entanglements[1]|=r,c&=~r}qt(i),(ye&6)===0&&(Si=ft()+500,hn(0))}}break;case 31:case 13:f=Dl(i,2),f!==null&&st(f,i,2),Ti(),is(i,2)}if(i=cs(a),i===null&&Kc(e,t,a,wi,l),i===n)break;n=i}n!==null&&a.stopPropagation()}else Kc(e,t,a,null,l)}}function cs(e){return e=fu(e),ss(e)}var wi=null;function ss(e){if(wi=null,e=Vl(e),e!==null){var t=z(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=q(t),e!==null)return e;e=null}else if(l===31){if(e=H(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return wi=e,null}function pd(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Fd()){case Es:return 2;case As:return 8;case On:case Id:return 32;case _s:return 268435456;default:return 32}default:return 32}}var fs=!1,xl=null,Sl=null,jl=null,xn=new Map,Sn=new Map,Tl=[],dy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function bd(e,t){switch(e){case"focusin":case"focusout":xl=null;break;case"dragenter":case"dragleave":Sl=null;break;case"mouseover":case"mouseout":jl=null;break;case"pointerover":case"pointerout":xn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sn.delete(t.pointerId)}}function jn(e,t,l,a,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:i,targetContainers:[n]},t!==null&&(t=Kl(t),t!==null&&vd(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function hy(e,t,l,a,n){switch(t){case"focusin":return xl=jn(xl,e,t,l,a,n),!0;case"dragenter":return Sl=jn(Sl,e,t,l,a,n),!0;case"mouseover":return jl=jn(jl,e,t,l,a,n),!0;case"pointerover":var i=n.pointerId;return xn.set(i,jn(xn.get(i)||null,e,t,l,a,n)),!0;case"gotpointercapture":return i=n.pointerId,Sn.set(i,jn(Sn.get(i)||null,e,t,l,a,n)),!0}return!1}function xd(e){var t=Vl(e.target);if(t!==null){var l=z(t);if(l!==null){if(t=l.tag,t===13){if(t=q(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===31){if(t=H(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=cs(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);su=a,l.target.dispatchEvent(a),su=null}else return t=Kl(l),t!==null&&vd(t),e.blockedOn=l,!1;t.shift()}return!0}function Sd(e,t,l){Gi(e)&&l.delete(t)}function my(){fs=!1,xl!==null&&Gi(xl)&&(xl=null),Sl!==null&&Gi(Sl)&&(Sl=null),jl!==null&&Gi(jl)&&(jl=null),xn.forEach(Sd),Sn.forEach(Sd)}function Xi(e,t){e.blockedOn===t&&(e.blockedOn=null,fs||(fs=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,my)))}var Qi=null;function jd(e){Qi!==e&&(Qi=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Qi===e&&(Qi=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],n=e[t+2];if(typeof a!="function"){if(ss(a||l)===null)continue;break}var i=Kl(l);i!==null&&(e.splice(t,3),t-=3,cc(i,{pending:!0,data:n,method:l.method,action:a},a,n))}}))}function za(e){function t(r){return Xi(r,e)}xl!==null&&Xi(xl,e),Sl!==null&&Xi(Sl,e),jl!==null&&Xi(jl,e),xn.forEach(t),Sn.forEach(t);for(var l=0;l<Tl.length;l++){var a=Tl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Tl.length&&(l=Tl[0],l.blockedOn===null);)xd(l),l.blockedOn===null&&Tl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var n=l[a],i=l[a+1],c=n[lt]||null;if(typeof i=="function")c||jd(l);else if(c){var f=null;if(i&&i.hasAttribute("formAction")){if(n=i,c=i[lt]||null)f=c.formAction;else if(ss(n)!==null)continue}else f=c.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),jd(l)}}}function Td(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(c){return n=c})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function os(e){this._internalRoot=e}Li.prototype.render=os.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,a=pt();md(l,a,e,t,null,null)},Li.prototype.unmount=os.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;md(e.current,2,null,e,null,null),Ti(),t[Zl]=null}};function Li(e){this._internalRoot=e}Li.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ds();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Tl.length&&t!==0&&t<Tl[l].priority;l++);Tl.splice(l,0,e),l===0&&xd(e)}};var Ed=x.version;if(Ed!=="19.2.5")throw Error(o(527,Ed,"19.2.5"));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?U(e):null,e=e===null?null:e.stateNode,e};var yy={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zi.isDisabled&&Zi.supportsFiber)try{Na=Zi.inject(yy),ot=Zi}catch{}}return En.createRoot=function(e,t){if(!A(e))throw Error(o(299));var l=!1,a="",n=Do,i=Mo,c=Ro;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dd(e,1,!1,null,null,l,a,null,n,i,c,Td),e[Zl]=t.current,Vc(e),new os(t)},En.hydrateRoot=function(e,t,l){if(!A(e))throw Error(o(299));var a=!1,n="",i=Do,c=Mo,f=Ro,r=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(n=l.identifierPrefix),l.onUncaughtError!==void 0&&(i=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(r=l.formState)),t=dd(e,1,!0,t,l??null,a,n,r,i,c,f,Td),t.context=hd(null),l=t.current,a=pt(),a=eu(a),n=sl(a),n.callback=null,fl(l,n,a),l=a,t.current.lanes=l,Ma(t,l),qt(t),e[Zl]=t.current,Vc(e),new Li(t)},En.version="19.2.5",En}var Ud;function Ay(){if(Ud)return hs.exports;Ud=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(x){console.error(x)}}return s(),hs.exports=Ey(),hs.exports}var _y=Ay();const zy=Gd(_y),Qd="";class An extends Error{constructor(x,b,o){super(x),this.status=b,this.outcome=o}}function Ss(s){return s instanceof An?s.outcome?s.outcome==="unknown":s.status>=500||s.status===408:!0}async function Ce(s,x){const b=await fetch(`${Qd}${s}`,{...x,credentials:"same-origin",headers:{"Content-Type":"application/json",...x==null?void 0:x.headers}});if(!b.ok){const o=await b.json().catch(()=>null);b.status===401&&(window.location.hash="#login");const A=b.status===429?` Wait ${b.headers.get("retry-after")||"60"} seconds before retrying.`:"",z=typeof(o==null?void 0:o.message)=="string"?o.message:typeof(o==null?void 0:o.error)=="string"?o.error:`HTTP ${b.status}`,q=typeof(o==null?void 0:o.next_action)=="string"?` ${o.next_action}`:"",H=(o==null?void 0:o.outcome)==="unknown"||(o==null?void 0:o.outcome)==="failed"?o.outcome:void 0;throw new An(z+q+A,b.status,H)}return b.json()}async function Oy(s){const x=await fetch(`${Qd}${s}`,{credentials:"same-origin"});if(x.status===401)throw window.location.hash="#login",new Error("Unauthorized");if(!x.ok)throw new Error(`HTTP ${x.status}`);return x.text()}const be={oauthRequest:s=>Ce(`/admin/api/oauth-requests/${encodeURIComponent(s)}`),decideOAuthRequest:(s,x,b,o)=>Ce(`/admin/api/oauth-requests/${encodeURIComponent(s)}`,{method:"POST",body:JSON.stringify(o===void 0?{decision:x,csrf:b}:{decision:x,csrf:b,source_id:o})}),login:s=>Ce("/admin/login",{method:"POST",body:JSON.stringify({token:s})}),signOutEverywhere:()=>Ce("/admin/api/sign-out-everywhere",{method:"POST"}),stats:()=>Ce("/admin/api/stats"),health:()=>Ce("/admin/api/health-indicators"),agents:()=>Ce("/admin/api/agents"),agentsSpend:()=>Ce("/admin/api/agents/spend"),sources:()=>Ce("/admin/api/sources"),grantCatalog:()=>Ce("/admin/api/grant-catalog"),clientGrant:s=>Ce(`/admin/api/grants/${encodeURIComponent(s)}`),clientDetails:s=>Ce(`/admin/api/clients/${encodeURIComponent(s)}`),clientSetup:(s,x,b)=>{const o=new URLSearchParams({harness:x});return b&&o.set("flow",b),Ce(`/admin/api/clients/${encodeURIComponent(s)}/setup?${o}`)},clientLifecycle:(s,x)=>Ce(`/admin/api/clients/${encodeURIComponent(s)}/lifecycle`,{method:"POST",body:JSON.stringify(x)}),registerClient:s=>Ce("/admin/api/register-client",{method:"POST",body:JSON.stringify(s)}),recoverClient:(s,x,b)=>Ce("/admin/api/recover-client",{method:"POST",body:JSON.stringify({clientId:s,harness:x,flow:b})}),updateClientGrant:(s,x)=>Ce("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({...x,clientId:s})}),requests:(s=1,x="")=>Ce(`/admin/api/requests?page=${s}${x}`),apiKeys:()=>Ce("/admin/api/api-keys"),createApiKey(s,x){return Ce("/admin/api/api-keys",{method:"POST",body:JSON.stringify({name:s,scopes:x})})},revokeApiKey(s){return Ce("/admin/api/api-keys/revoke",{method:"POST",body:JSON.stringify({id:s})})},updateClientTtl:(s,x)=>Ce("/admin/api/update-client-ttl",{method:"POST",body:JSON.stringify({clientId:s,tokenTtl:x})}),rescopeClient:(s,x,b)=>Ce("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({clientId:s,sourceId:x,federatedRead:b})}),revokeClient:s=>Ce("/admin/api/revoke-client",{method:"POST",body:JSON.stringify({clientId:s})}),calibrationProfile:s=>Ce(`/admin/api/calibration/profile${s?`?holder=${encodeURIComponent(s)}`:""}`),calibrationChart:(s,x)=>Oy(`/admin/api/calibration/charts/${encodeURIComponent(s)}${x?`?holder=${encodeURIComponent(x)}`:""}`),jobsWatch:()=>Ce("/admin/api/jobs/watch")},ps="gbrain.pending-oauth-request",qd=s=>s!==null&&/^[a-f0-9]{64}$/.test(s);function Ki(){const s=new URL(window.location.href).searchParams.get("oauth_request");if(qd(s)){try{window.sessionStorage.setItem(ps,s)}catch{}return s}try{const x=window.sessionStorage.getItem(ps);if(qd(x))return x}catch{}}function Hd(){try{window.sessionStorage.removeItem(ps)}catch{}const s=new URL(window.location.href);s.searchParams.delete("oauth_request"),window.history.replaceState(null,"",s)}function Cy(s,x){const b=x?` --oauth-request ${x}`:"";return`Give me an owner admin login link for ${s}. On the brain host, run gbrain mcp admin login-link --url ${s}${b} using its protected owner credential. Deliver the single-use link privately and do not open it before I do.`}function Ny({onLogin:s}){const[x,b]=R.useState(""),[o,A]=R.useState(""),[z,q]=R.useState(!1),[H,_]=R.useState(!1),[h,U]=R.useState(""),[j,C]=R.useState(),[Y,G]=R.useState(""),[Z,W]=R.useState(0),ae=Ki(),$=j?Cy(j,ae):void 0;R.useEffect(()=>{let ne=!0;const xe=new AbortController,k=setTimeout(()=>xe.abort(),1e4);return C(void 0),G(""),_(!1),fetch("/.well-known/gbrain",{credentials:"omit",redirect:"error",cache:"no-store",signal:xe.signal}).then(async V=>{if(!V.ok)throw new Error("Server discovery is unavailable.");const Se=await V.json();if(typeof(Se==null?void 0:Se.endpoint)!="string")throw new Error("Server discovery has no MCP endpoint.");const je=new URL(Se.endpoint);if(!["https:","http:"].includes(je.protocol)||je.username||je.password||je.search||je.hash||je.pathname!=="/mcp")throw new Error("Server discovery returned an invalid MCP endpoint.");ne&&C(je.toString())}).catch(()=>{ne&&G("The configured MCP endpoint could not be discovered. Ask the brain host administrator to check the server’s configured public URL. You can still sign in with the owner credential below.")}).finally(()=>clearTimeout(k)),()=>{ne=!1,clearTimeout(k),xe.abort()}},[Z]);const le=async ne=>{ne.preventDefault(),A(""),q(!0);try{await be.login(x),b(""),s()}catch(xe){A(xe instanceof An&&xe.status===401?"The owner bootstrap credential was not accepted. An OAuth access token or client secret cannot log into this dashboard. Ask the brain host administrator for a fresh login link.":xe instanceof Error?xe.message:"Could not reach the owner login service. Check the server and retry.")}finally{q(!1)}};return u.jsx("div",{className:"login-page",children:u.jsxs("section",{className:"login-box","aria-labelledby":"owner-login-title",style:{maxWidth:560},children:[u.jsx("h1",{id:"owner-login-title",className:"login-logo",children:"GBrain owner login"}),u.jsx("p",{style:{marginBottom:16},children:"Ask the agent that administers the brain host for a login link. Ordinary MCP clients cannot create owner login links, even with an admin scope."}),ae&&u.jsx("p",{role:"status",style:{marginBottom:16},children:"A client connection is waiting for owner approval. The prompt below preserves that request when you open the login link in another browser or tab."}),$&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"owner-login-prompt",children:"Prompt for the host administrator"}),u.jsx("textarea",{id:"owner-login-prompt",rows:7,readOnly:!0,value:$,style:{fontFamily:"var(--font-mono)",fontSize:12}}),u.jsx("button",{type:"button",className:"btn btn-secondary",style:{marginTop:8},onClick:()=>{U(""),navigator.clipboard.writeText($).then(()=>_(!0)).catch(()=>U("Clipboard unavailable. Select and copy the prompt above."))},children:H?"Prompt copied":"Copy owner login prompt"})]}),!$&&!Y&&u.jsx("p",{role:"status",children:"Discovering the server’s configured MCP endpoint…"}),Y&&u.jsxs("p",{role:"alert",children:[Y," ",u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>W(ne=>ne+1),children:"Retry server discovery"})]}),h&&u.jsx("p",{role:"alert",children:h}),u.jsx("p",{className:"grant-help",style:{margin:"12px 0 20px"},children:"Login links expire after five minutes and can be used once. A client’s PKCE sign-in requests access to memory; owner login approves that request."}),u.jsxs("details",{children:[u.jsx("summary",{style:{cursor:"pointer"},children:"Sign in with the owner bootstrap credential"}),u.jsxs("form",{onSubmit:le,style:{marginTop:12},children:[u.jsx("label",{htmlFor:"owner-bootstrap-token",children:"Owner bootstrap credential"}),u.jsx("input",{id:"owner-bootstrap-token",type:"password",autoComplete:"off",value:x,disabled:z,onChange:ne=>b(ne.target.value)}),u.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%",marginTop:12},disabled:z||!x.trim(),children:z?"Signing in…":"Sign in as owner"}),o&&u.jsx("p",{role:"alert",className:"login-error",children:o})]})]})]})})}function Dy(){const[s,x]=R.useState({connected_agents:0,requests_today:0,active_tokens:0}),[b,o]=R.useState({expiring_soon:0,error_rate:"0%"}),[A,z]=R.useState([]),[q,H]=R.useState("connecting"),_=R.useRef(null);R.useEffect(()=>{be.stats().then(x).catch(()=>{}),be.health().then(o).catch(()=>{});const U=new EventSource("/admin/events",{withCredentials:!0});_.current=U,U.onopen=()=>H("connected"),U.onmessage=C=>{try{const Y=JSON.parse(C.data);z(G=>[Y,...G].slice(0,50))}catch{}},U.onerror=()=>{H("disconnected"),setTimeout(()=>{H("connecting"),U.close()},3e3)};const j=setInterval(()=>{be.stats().then(x).catch(()=>{}),be.health().then(o).catch(()=>{})},3e4);return()=>{U.close(),clearInterval(j)}},[]);const h=U=>{const j=Date.now()-new Date(U).getTime();return j<6e4?`${Math.floor(j/1e3)}s ago`:j<36e5?`${Math.floor(j/6e4)} min ago`:`${Math.floor(j/36e5)}h ago`};return u.jsxs(u.Fragment,{children:[u.jsx("h1",{className:"page-title",children:"Dashboard"}),u.jsxs("div",{style:{display:"flex",gap:24},children:[u.jsxs("div",{style:{flex:1},children:[u.jsxs("div",{className:"metrics",children:[u.jsxs("div",{className:"metric",children:[u.jsx("div",{className:"metric-value",children:s.connected_agents}),u.jsx("div",{className:"metric-label",children:"Connected Agents"})]}),u.jsxs("div",{className:"metric",children:[u.jsx("div",{className:"metric-value",children:s.requests_today}),u.jsx("div",{className:"metric-label",children:"Requests Today"})]}),u.jsxs("div",{className:"metric",children:[u.jsx("div",{className:"metric-value",children:s.active_tokens}),u.jsx("div",{className:"metric-label",children:"Active Tokens"})]})]}),u.jsxs("h2",{className:"section-title",children:["Live Activity",u.jsx("span",{style:{marginLeft:8,fontSize:10,color:q==="connected"?"var(--success)":q==="connecting"?"var(--warning)":"var(--error)"},children:q==="connected"?"● connected":q==="connecting"?"● connecting...":"● disconnected"})]}),u.jsx("div",{className:"feed",children:A.length===0?u.jsx("div",{className:"feed-empty",children:q==="connected"?"No requests yet. Agents will appear when they connect.":"Connecting..."}):u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Agent"}),u.jsx("th",{children:"Operation"}),u.jsx("th",{children:"Scopes"}),u.jsx("th",{children:"Latency"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Time"})]})}),u.jsx("tbody",{children:A.map((U,j)=>u.jsxs("tr",{children:[u.jsx("td",{className:"mono",children:U.agent}),u.jsx("td",{className:"mono",children:U.operation}),u.jsx("td",{children:U.scopes.split(",").map(C=>u.jsx("span",{className:`badge badge-${C.trim()}`,style:{marginRight:4},children:C.trim()},C))}),u.jsxs("td",{className:"mono",children:[U.latency_ms," ms"]}),u.jsx("td",{children:u.jsx("span",{className:`badge badge-${U.status}`,children:U.status})}),u.jsx("td",{style:{color:"var(--text-secondary)"},children:h(U.timestamp)})]},j))})]})})]}),u.jsxs("div",{style:{width:220},children:[u.jsx("h2",{className:"section-title",children:"Token Health"}),u.jsxs("div",{className:"health-panel",children:[u.jsxs("div",{className:"health-row",children:[u.jsx("span",{style:{color:"var(--warning)"},children:"Expiring Soon"}),u.jsx("span",{className:"mono",children:b.expiring_soon})]}),u.jsxs("div",{className:"health-row",children:[u.jsx("span",{style:{color:"var(--error)"},children:"Error Rate"}),u.jsx("span",{className:"mono",children:b.error_rate})]})]})]})]})]})}const Oa=s=>s.split(/[\s,]+/).filter(Boolean);function bs(s){var x,b,o;return{profile:(s==null?void 0:s.profile)??"memory-writer",applyProfile:!s,source:(s==null?void 0:s.sourceId)??"default",reads:(s==null?void 0:s.federatedRead)??["default"],scopes:(s==null?void 0:s.scopes.join(" "))??"",directPrefixes:((x=s==null?void 0:s.boundSlugPrefixes)==null?void 0:x.join(`++`+a.stack}}var $i=Object.prototype.hasOwnProperty,Fi=s.unstable_scheduleCallback,Ii=s.unstable_cancelCallback,Wd=s.unstable_shouldYield,$d=s.unstable_requestPaint,ft=s.unstable_now,Fd=s.unstable_getCurrentPriorityLevel,Es=s.unstable_ImmediatePriority,As=s.unstable_UserBlockingPriority,On=s.unstable_NormalPriority,Id=s.unstable_LowPriority,_s=s.unstable_IdlePriority,Pd=s.log,eh=s.unstable_setDisableYieldValue,Na=null,ot=null;function el(e){if(typeof Pd=="function"&&eh(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(Na,e)}catch{}}var rt=Math.clz32?Math.clz32:ah,th=Math.log,lh=Math.LN2;function ah(e){return e>>>=0,e===0?32:31-(th(e)/lh|0)|0}var Cn=256,Nn=262144,Dn=4194304;function _l(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Mn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,i=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~i,a!==0?n=_l(a):(c&=f,c!==0?n=_l(c):l||(l=f&~e,l!==0&&(n=_l(l))))):(f=a&~i,f!==0?n=_l(f):c!==0?n=_l(c):l||(l=a&~e,l!==0&&(n=_l(l)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:n}function Da(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nh(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zs(){var e=Dn;return Dn<<=1,(Dn&62914560)===0&&(Dn=4194304),e}function Pi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ma(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ih(e,t,l,a,n,i){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var f=e.entanglements,r=e.expirationTimes,g=e.hiddenUpdates;for(l=c&~l;0<l;){var A=31-rt(l),D=1<<A;f[A]=0,r[A]=-1;var p=g[A];if(p!==null)for(g[A]=null,A=0;A<p.length;A++){var j=p[A];j!==null&&(j.lane&=-536870913)}l&=~D}a!==0&&Os(e,a,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(c&~t))}function Os(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-rt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Cs(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-rt(l),n=1<<a;n&t|e[a]&t&&(e[a]|=t),l&=~n}}function Ns(e,t){var l=t&-t;return l=(l&42)!==0?1:eu(l),(l&(e.suspendedLanes|t))!==0?0:l}function eu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ds(){var e=N.p;return e!==0?e:(e=window.event,e===void 0?32:pd(e.type))}function Ms(e,t){var l=N.p;try{return N.p=e,t()}finally{N.p=l}}var tl=Math.random().toString(36).slice(2),ke="__reactFiber$"+tl,lt="__reactProps$"+tl,Zl="__reactContainer$"+tl,lu="__reactEvents$"+tl,uh="__reactListeners$"+tl,ch="__reactHandles$"+tl,Rs="__reactResources$"+tl,Ra="__reactMarker$"+tl;function au(e){delete e[ke],delete e[lt],delete e[lu],delete e[uh],delete e[ch]}function Vl(e){var t=e[ke];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Zl]||l[ke]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=ld(e);e!==null;){if(l=e[ke])return l;e=ld(e)}return t}e=l,l=e.parentNode}return null}function Kl(e){if(e=e[ke]||e[Zl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ua(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Jl(e){var t=e[Rs];return t||(t=e[Rs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ke(e){e[Ra]=!0}var Us=new Set,qs={};function zl(e,t){kl(e,t),kl(e+"Capture",t)}function kl(e,t){for(qs[e]=t,e=0;e<t.length;e++)Us.add(t[e])}var sh=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Hs={},Bs={};function fh(e){return $i.call(Bs,e)?!0:$i.call(Hs,e)?!1:sh.test(e)?Bs[e]=!0:(Hs[e]=!0,!1)}function Rn(e,t,l){if(fh(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Un(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Ht(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function bt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ys(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oh(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var n=a.get,i=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(c){l=""+c,i.call(this,c)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nu(e){if(!e._valueTracker){var t=Ys(e)?"checked":"value";e._valueTracker=oh(e,t,""+e[t])}}function ws(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=Ys(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function qn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var rh=/[\n"\\]/g;function xt(e){return e.replace(rh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function iu(e,t,l,a,n,i,c,f){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+bt(t)):e.value!==""+bt(t)&&(e.value=""+bt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?uu(e,c,bt(t)):l!=null?uu(e,c,bt(l)):a!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+bt(f):e.removeAttribute("name")}function Gs(e,t,l,a,n,i,c,f){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){nu(e);return}l=l!=null?""+bt(l):"",t=t!=null?""+bt(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),nu(e)}function uu(e,t,l){t==="number"&&qn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Wl(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n<l.length;n++)t["$"+l[n]]=!0;for(l=0;l<e.length;l++)n=t.hasOwnProperty("$"+e[l].value),e[l].selected!==n&&(e[l].selected=n),n&&a&&(e[l].defaultSelected=!0)}else{for(l=""+bt(l),t=null,n=0;n<e.length;n++){if(e[n].value===l){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Xs(e,t,l){if(t!=null&&(t=""+bt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+bt(l):""}function Qs(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(o(92));if(Ze(a)){if(1<a.length)throw Error(o(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=bt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),nu(e)}function $l(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var dh=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ls(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||dh.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Zs(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&l[n]!==a&&Ls(e,n,a)}else for(var i in t)t.hasOwnProperty(i)&&Ls(e,i,t[i])}function cu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var hh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),mh=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hn(e){return mh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Bt(){}var su=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fl=null,Il=null;function Vs(e){var t=Kl(e);if(t&&(e=t.stateNode)){var l=e[lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(iu(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+xt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var n=a[lt]||null;if(!n)throw Error(o(90));iu(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&ws(a)}break e;case"textarea":Xs(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Wl(e,!!l.multiple,t,!1)}}}var ou=!1;function Ks(e,t,l){if(ou)return e(t,l);ou=!0;try{var a=e(t);return a}finally{if(ou=!1,(Fl!==null||Il!==null)&&(Ti(),Fl&&(t=Fl,e=Il,Il=Fl=null,Vs(t),e)))for(t=0;t<e.length;t++)Vs(e[t])}}function qa(e,t){var l=e.stateNode;if(l===null)return null;var a=l[lt]||null;if(a===null)return null;l=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(o(231,t,typeof l));return l}var Yt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ru=!1;if(Yt)try{var Ha={};Object.defineProperty(Ha,"passive",{get:function(){ru=!0}}),window.addEventListener("test",Ha,Ha),window.removeEventListener("test",Ha,Ha)}catch{ru=!1}var ll=null,du=null,Bn=null;function Js(){if(Bn)return Bn;var e,t=du,l=t.length,a,n="value"in ll?ll.value:ll.textContent,i=n.length;for(e=0;e<l&&t[e]===n[e];e++);var c=l-e;for(a=1;a<=c&&t[l-a]===n[i-a];a++);return Bn=n.slice(e,1<a?1-a:void 0)}function Yn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function wn(){return!0}function ks(){return!1}function at(e){function t(l,a,n,i,c){this._reactName=l,this._targetInst=n,this.type=a,this.nativeEvent=i,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(i):i[f]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?wn:ks,this.isPropagationStopped=ks,this}return S(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gn=at(Ol),Ba=S({},Ol,{view:0,detail:0}),yh=at(Ba),hu,mu,Ya,Xn=S({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ya&&(Ya&&e.type==="mousemove"?(hu=e.screenX-Ya.screenX,mu=e.screenY-Ya.screenY):mu=hu=0,Ya=e),hu)},movementY:function(e){return"movementY"in e?e.movementY:mu}}),Ws=at(Xn),vh=S({},Xn,{dataTransfer:0}),gh=at(vh),ph=S({},Ba,{relatedTarget:0}),yu=at(ph),bh=S({},Ol,{animationName:0,elapsedTime:0,pseudoElement:0}),xh=at(bh),Sh=S({},Ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jh=at(Sh),Th=S({},Ol,{data:0}),$s=at(Th),Eh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ah={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_h={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_h[e])?!!t[e]:!1}function vu(){return zh}var Oh=S({},Ba,{key:function(e){if(e.key){var t=Eh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ah[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(e){return e.type==="keypress"?Yn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ch=at(Oh),Nh=S({},Xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fs=at(Nh),Dh=S({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),Mh=at(Dh),Rh=S({},Ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uh=at(Rh),qh=S({},Xn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Hh=at(qh),Bh=S({},Ol,{newState:0,oldState:0}),Yh=at(Bh),wh=[9,13,27,32],gu=Yt&&"CompositionEvent"in window,wa=null;Yt&&"documentMode"in document&&(wa=document.documentMode);var Gh=Yt&&"TextEvent"in window&&!wa,Is=Yt&&(!gu||wa&&8<wa&&11>=wa),Ps=" ",ef=!1;function tf(e,t){switch(e){case"keyup":return wh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pl=!1;function Xh(e,t){switch(e){case"compositionend":return lf(t);case"keypress":return t.which!==32?null:(ef=!0,Ps);case"textInput":return e=t.data,e===Ps&&ef?null:e;default:return null}}function Qh(e,t){if(Pl)return e==="compositionend"||!gu&&tf(e,t)?(e=Js(),Bn=du=ll=null,Pl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Is&&t.locale!=="ko"?null:t.data;default:return null}}var Lh={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function af(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lh[e.type]:t==="textarea"}function nf(e,t,l,a){Fl?Il?Il.push(a):Il=[a]:Fl=a,t=Ni(t,"onChange"),0<t.length&&(l=new Gn("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var Ga=null,Xa=null;function Zh(e){Qr(e,0)}function Qn(e){var t=Ua(e);if(ws(t))return e}function uf(e,t){if(e==="change")return t}var cf=!1;if(Yt){var pu;if(Yt){var bu="oninput"in document;if(!bu){var sf=document.createElement("div");sf.setAttribute("oninput","return;"),bu=typeof sf.oninput=="function"}pu=bu}else pu=!1;cf=pu&&(!document.documentMode||9<document.documentMode)}function ff(){Ga&&(Ga.detachEvent("onpropertychange",of),Xa=Ga=null)}function of(e){if(e.propertyName==="value"&&Qn(Xa)){var t=[];nf(t,Xa,e,fu(e)),Ks(Zh,t)}}function Vh(e,t,l){e==="focusin"?(ff(),Ga=t,Xa=l,Ga.attachEvent("onpropertychange",of)):e==="focusout"&&ff()}function Kh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qn(Xa)}function Jh(e,t){if(e==="click")return Qn(t)}function kh(e,t){if(e==="input"||e==="change")return Qn(t)}function Wh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dt=typeof Object.is=="function"?Object.is:Wh;function Qa(e,t){if(dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var n=l[a];if(!$i.call(t,n)||!dt(e[n],t[n]))return!1}return!0}function rf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function df(e,t){var l=rf(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=rf(l)}}function hf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=qn(e.document)}return t}function xu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var $h=Yt&&"documentMode"in document&&11>=document.documentMode,ea=null,Su=null,La=null,ju=!1;function yf(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ju||ea==null||ea!==qn(a)||(a=ea,"selectionStart"in a&&xu(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),La&&Qa(La,a)||(La=a,a=Ni(Su,"onSelect"),0<a.length&&(t=new Gn("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ea)))}function Cl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ta={animationend:Cl("Animation","AnimationEnd"),animationiteration:Cl("Animation","AnimationIteration"),animationstart:Cl("Animation","AnimationStart"),transitionrun:Cl("Transition","TransitionRun"),transitionstart:Cl("Transition","TransitionStart"),transitioncancel:Cl("Transition","TransitionCancel"),transitionend:Cl("Transition","TransitionEnd")},Tu={},vf={};Yt&&(vf=document.createElement("div").style,"AnimationEvent"in window||(delete ta.animationend.animation,delete ta.animationiteration.animation,delete ta.animationstart.animation),"TransitionEvent"in window||delete ta.transitionend.transition);function Nl(e){if(Tu[e])return Tu[e];if(!ta[e])return e;var t=ta[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in vf)return Tu[e]=t[l];return e}var gf=Nl("animationend"),pf=Nl("animationiteration"),bf=Nl("animationstart"),Fh=Nl("transitionrun"),Ih=Nl("transitionstart"),Ph=Nl("transitioncancel"),xf=Nl("transitionend"),Sf=new Map,Eu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Eu.push("scrollEnd");function Ct(e,t){Sf.set(e,t),zl(t,[e])}var Ln=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},St=[],la=0,Au=0;function Zn(){for(var e=la,t=Au=la=0;t<e;){var l=St[t];St[t++]=null;var a=St[t];St[t++]=null;var n=St[t];St[t++]=null;var i=St[t];if(St[t++]=null,a!==null&&n!==null){var c=a.pending;c===null?n.next=n:(n.next=c.next,c.next=n),a.pending=n}i!==0&&jf(l,n,i)}}function Vn(e,t,l,a){St[la++]=e,St[la++]=t,St[la++]=l,St[la++]=a,Au|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function _u(e,t,l,a){return Vn(e,t,l,a),Kn(e)}function Dl(e,t){return Vn(e,null,null,t),Kn(e)}function jf(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var n=!1,i=e.return;i!==null;)i.childLanes|=l,a=i.alternate,a!==null&&(a.childLanes|=l),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-rt(l),e=i.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=l|536870912),i):null}function Kn(e){if(50<dn)throw dn=0,qc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var aa={};function em(e,t,l,a){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ht(e,t,l,a){return new em(e,t,l,a)}function zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wt(e,t){var l=e.alternate;return l===null?(l=ht(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Tf(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Jn(e,t,l,a,n,i){var c=0;if(a=e,typeof e=="function")zu(e)&&(c=1);else if(typeof e=="string")c=iy(e,l,Q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Se:return e=ht(31,l,t,n),e.elementType=Se,e.lanes=i,e;case Z:return Ml(l.children,n,i,t);case W:c=8,n|=24;break;case ae:return e=ht(12,l,t,n|2),e.elementType=ae,e.lanes=i,e;case be:return e=ht(13,l,t,n),e.elementType=be,e.lanes=i,e;case k:return e=ht(19,l,t,n),e.elementType=k,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:c=10;break e;case $:c=9;break e;case ne:c=11;break e;case V:c=14;break e;case xe:c=16,a=null;break e}c=29,l=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=ht(c,l,t,n),t.elementType=e,t.type=a,t.lanes=i,t}function Ml(e,t,l,a){return e=ht(7,e,a,t),e.lanes=l,e}function Ou(e,t,l){return e=ht(6,e,null,t),e.lanes=l,e}function Ef(e){var t=ht(18,null,null,0);return t.stateNode=e,t}function Cu(e,t,l){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Af=new WeakMap;function jt(e,t){if(typeof e=="object"&&e!==null){var l=Af.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Ts(t)},Af.set(e,t),t)}return{value:e,source:t,stack:Ts(t)}}var na=[],ia=0,kn=null,Za=0,Tt=[],Et=0,al=null,Mt=1,Rt="";function Gt(e,t){na[ia++]=Za,na[ia++]=kn,kn=e,Za=t}function _f(e,t,l){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,al=e;var a=Mt;e=Rt;var n=32-rt(a)-1;a&=~(1<<n),l+=1;var i=32-rt(t)+n;if(30<i){var c=n-n%5;i=(a&(1<<c)-1).toString(32),a>>=c,n-=c,Mt=1<<32-rt(t)+n|l<<n|a,Rt=i+e}else Mt=1<<i|l<<n|a,Rt=e}function Nu(e){e.return!==null&&(Gt(e,1),_f(e,1,0))}function Du(e){for(;e===kn;)kn=na[--ia],na[ia]=null,Za=na[--ia],na[ia]=null;for(;e===al;)al=Tt[--Et],Tt[Et]=null,Rt=Tt[--Et],Tt[Et]=null,Mt=Tt[--Et],Tt[Et]=null}function zf(e,t){Tt[Et++]=Mt,Tt[Et++]=Rt,Tt[Et++]=al,Mt=t.id,Rt=t.overflow,al=e}var We=null,De=null,re=!1,nl=null,At=!1,Mu=Error(o(519));function il(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Va(jt(t,e)),Mu}function Of(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[ke]=e,t[lt]=a,l){case"dialog":ce("cancel",t),ce("close",t);break;case"iframe":case"object":case"embed":ce("load",t);break;case"video":case"audio":for(l=0;l<mn.length;l++)ce(mn[l],t);break;case"source":ce("error",t);break;case"img":case"image":case"link":ce("error",t),ce("load",t);break;case"details":ce("toggle",t);break;case"input":ce("invalid",t),Gs(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ce("invalid",t);break;case"textarea":ce("invalid",t),Qs(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||Kr(t.textContent,l)?(a.popover!=null&&(ce("beforetoggle",t),ce("toggle",t)),a.onScroll!=null&&ce("scroll",t),a.onScrollEnd!=null&&ce("scrollend",t),a.onClick!=null&&(t.onclick=Bt),t=!0):t=!1,t||il(e,!0)}function Cf(e){for(We=e.return;We;)switch(We.tag){case 5:case 31:case 13:At=!1;return;case 27:case 3:At=!0;return;default:We=We.return}}function ua(e){if(e!==We)return!1;if(!re)return Cf(e),re=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||$c(e.type,e.memoizedProps)),l=!l),l&&De&&il(e),Cf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=td(e)}else t===27?(t=De,bl(e.type)?(e=ts,ts=null,De=e):De=t):De=We?zt(e.stateNode.nextSibling):null;return!0}function Rl(){De=We=null,re=!1}function Ru(){var e=nl;return e!==null&&(ct===null?ct=e:ct.push.apply(ct,e),nl=null),e}function Va(e){nl===null?nl=[e]:nl.push(e)}var Uu=m(null),Ul=null,Xt=null;function ul(e,t,l){B(Uu,t._currentValue),t._currentValue=l}function Qt(e){e._currentValue=Uu.current,M(Uu)}function qu(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Hu(e,t,l,a){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var c=n.child;i=i.firstContext;e:for(;i!==null;){var f=i;i=n;for(var r=0;r<t.length;r++)if(f.context===t[r]){i.lanes|=l,f=i.alternate,f!==null&&(f.lanes|=l),qu(i.return,l,e),a||(c=null);break e}i=f.next}}else if(n.tag===18){if(c=n.return,c===null)throw Error(o(341));c.lanes|=l,i=c.alternate,i!==null&&(i.lanes|=l),qu(c,l,e),c=null}else c=n.child;if(c!==null)c.return=n;else for(c=n;c!==null;){if(c===e){c=null;break}if(n=c.sibling,n!==null){n.return=c.return,c=n;break}c=c.return}n=c}}function ca(e,t,l,a){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var c=n.alternate;if(c===null)throw Error(o(387));if(c=c.memoizedProps,c!==null){var f=n.type;dt(n.pendingProps.value,c.value)||(e!==null?e.push(f):e=[f])}}else if(n===ve.current){if(c=n.alternate,c===null)throw Error(o(387));c.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(bn):e=[bn])}n=n.return}e!==null&&Hu(t,e,l,a),t.flags|=262144}function Wn(e){for(e=e.firstContext;e!==null;){if(!dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ql(e){Ul=e,Xt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $e(e){return Nf(Ul,e)}function $n(e,t){return Ul===null&&ql(e),Nf(e,t)}function Nf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Xt===null){if(e===null)throw Error(o(308));Xt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xt=Xt.next=t;return l}var tm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},lm=s.unstable_scheduleCallback,am=s.unstable_NormalPriority,Ge={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bu(){return{controller:new tm,data:new Map,refCount:0}}function Ka(e){e.refCount--,e.refCount===0&&lm(am,function(){e.controller.abort()})}var Ja=null,Yu=0,sa=0,fa=null;function nm(e,t){if(Ja===null){var l=Ja=[];Yu=0,sa=Xc(),fa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return Yu++,t.then(Df,Df),t}function Df(){if(--Yu===0&&Ja!==null){fa!==null&&(fa.status="fulfilled");var e=Ja;Ja=null,sa=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function im(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(n){l.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<l.length;n++)(0,l[n])(t)},function(n){for(a.status="rejected",a.reason=n,n=0;n<l.length;n++)(0,l[n])(void 0)}),a}var Mf=E.S;E.S=function(e,t){vr=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&nm(e,t),Mf!==null&&Mf(e,t)};var Hl=m(null);function wu(){var e=Hl.current;return e!==null?e:ze.pooledCache}function Fn(e,t){t===null?B(Hl,Hl.current):B(Hl,t.pool)}function Rf(){var e=wu();return e===null?null:{parent:Ge._currentValue,pool:e}}var oa=Error(o(460)),Gu=Error(o(474)),In=Error(o(542)),Pn={then:function(){}};function Uf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Bt,Bt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e;default:if(typeof t.status=="string")t.then(Bt,Bt);else{if(e=ze,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e}throw Yl=t,oa}}function Bl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Yl=l,oa):l}}var Yl=null;function Hf(){if(Yl===null)throw Error(o(459));var e=Yl;return Yl=null,e}function Bf(e){if(e===oa||e===In)throw Error(o(483))}var ra=null,ka=0;function ei(e){var t=ka;return ka+=1,ra===null&&(ra=[]),qf(ra,e,t)}function Wa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ti(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yf(e){function t(y,d){if(e){var v=y.deletions;v===null?(y.deletions=[d],y.flags|=16):v.push(d)}}function l(y,d){if(!e)return null;for(;d!==null;)t(y,d),d=d.sibling;return null}function a(y){for(var d=new Map;y!==null;)y.key!==null?d.set(y.key,y):d.set(y.index,y),y=y.sibling;return d}function n(y,d){return y=wt(y,d),y.index=0,y.sibling=null,y}function i(y,d,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<d?(y.flags|=67108866,d):v):(y.flags|=67108866,d)):(y.flags|=1048576,d)}function c(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function f(y,d,v,O){return d===null||d.tag!==6?(d=Ou(v,y.mode,O),d.return=y,d):(d=n(d,v),d.return=y,d)}function r(y,d,v,O){var K=v.type;return K===Z?A(y,d,v.props.children,O,v.key):d!==null&&(d.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===xe&&Bl(K)===d.type)?(d=n(d,v.props),Wa(d,v),d.return=y,d):(d=Jn(v.type,v.key,v.props,null,y.mode,O),Wa(d,v),d.return=y,d)}function g(y,d,v,O){return d===null||d.tag!==4||d.stateNode.containerInfo!==v.containerInfo||d.stateNode.implementation!==v.implementation?(d=Cu(v,y.mode,O),d.return=y,d):(d=n(d,v.children||[]),d.return=y,d)}function A(y,d,v,O,K){return d===null||d.tag!==7?(d=Ml(v,y.mode,O,K),d.return=y,d):(d=n(d,v),d.return=y,d)}function D(y,d,v){if(typeof d=="string"&&d!==""||typeof d=="number"||typeof d=="bigint")return d=Ou(""+d,y.mode,v),d.return=y,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Y:return v=Jn(d.type,d.key,d.props,null,y.mode,v),Wa(v,d),v.return=y,v;case G:return d=Cu(d,y.mode,v),d.return=y,d;case xe:return d=Bl(d),D(y,d,v)}if(Ze(d)||de(d))return d=Ml(d,y.mode,v,null),d.return=y,d;if(typeof d.then=="function")return D(y,ei(d),v);if(d.$$typeof===le)return D(y,$n(y,d),v);ti(y,d)}return null}function p(y,d,v,O){var K=d!==null?d.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return K!==null?null:f(y,d,""+v,O);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Y:return v.key===K?r(y,d,v,O):null;case G:return v.key===K?g(y,d,v,O):null;case xe:return v=Bl(v),p(y,d,v,O)}if(Ze(v)||de(v))return K!==null?null:A(y,d,v,O,null);if(typeof v.then=="function")return p(y,d,ei(v),O);if(v.$$typeof===le)return p(y,d,$n(y,v),O);ti(y,v)}return null}function j(y,d,v,O,K){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return y=y.get(v)||null,f(d,y,""+O,K);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case Y:return y=y.get(O.key===null?v:O.key)||null,r(d,y,O,K);case G:return y=y.get(O.key===null?v:O.key)||null,g(d,y,O,K);case xe:return O=Bl(O),j(y,d,v,O,K)}if(Ze(O)||de(O))return y=y.get(v)||null,A(d,y,O,K,null);if(typeof O.then=="function")return j(y,d,v,ei(O),K);if(O.$$typeof===le)return j(y,d,v,$n(d,O),K);ti(d,O)}return null}function X(y,d,v,O){for(var K=null,he=null,L=d,te=d=0,oe=null;L!==null&&te<v.length;te++){L.index>te?(oe=L,L=null):oe=L.sibling;var me=p(y,L,v[te],O);if(me===null){L===null&&(L=oe);break}e&&L&&me.alternate===null&&t(y,L),d=i(me,d,te),he===null?K=me:he.sibling=me,he=me,L=oe}if(te===v.length)return l(y,L),re&&Gt(y,te),K;if(L===null){for(;te<v.length;te++)L=D(y,v[te],O),L!==null&&(d=i(L,d,te),he===null?K=L:he.sibling=L,he=L);return re&&Gt(y,te),K}for(L=a(L);te<v.length;te++)oe=j(L,y,te,v[te],O),oe!==null&&(e&&oe.alternate!==null&&L.delete(oe.key===null?te:oe.key),d=i(oe,d,te),he===null?K=oe:he.sibling=oe,he=oe);return e&&L.forEach(function(El){return t(y,El)}),re&&Gt(y,te),K}function J(y,d,v,O){if(v==null)throw Error(o(151));for(var K=null,he=null,L=d,te=d=0,oe=null,me=v.next();L!==null&&!me.done;te++,me=v.next()){L.index>te?(oe=L,L=null):oe=L.sibling;var El=p(y,L,me.value,O);if(El===null){L===null&&(L=oe);break}e&&L&&El.alternate===null&&t(y,L),d=i(El,d,te),he===null?K=El:he.sibling=El,he=El,L=oe}if(me.done)return l(y,L),re&&Gt(y,te),K;if(L===null){for(;!me.done;te++,me=v.next())me=D(y,me.value,O),me!==null&&(d=i(me,d,te),he===null?K=me:he.sibling=me,he=me);return re&&Gt(y,te),K}for(L=a(L);!me.done;te++,me=v.next())me=j(L,y,te,me.value,O),me!==null&&(e&&me.alternate!==null&&L.delete(me.key===null?te:me.key),d=i(me,d,te),he===null?K=me:he.sibling=me,he=me);return e&&L.forEach(function(vy){return t(y,vy)}),re&&Gt(y,te),K}function Ae(y,d,v,O){if(typeof v=="object"&&v!==null&&v.type===Z&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Y:e:{for(var K=v.key;d!==null;){if(d.key===K){if(K=v.type,K===Z){if(d.tag===7){l(y,d.sibling),O=n(d,v.props.children),O.return=y,y=O;break e}}else if(d.elementType===K||typeof K=="object"&&K!==null&&K.$$typeof===xe&&Bl(K)===d.type){l(y,d.sibling),O=n(d,v.props),Wa(O,v),O.return=y,y=O;break e}l(y,d);break}else t(y,d);d=d.sibling}v.type===Z?(O=Ml(v.props.children,y.mode,O,v.key),O.return=y,y=O):(O=Jn(v.type,v.key,v.props,null,y.mode,O),Wa(O,v),O.return=y,y=O)}return c(y);case G:e:{for(K=v.key;d!==null;){if(d.key===K)if(d.tag===4&&d.stateNode.containerInfo===v.containerInfo&&d.stateNode.implementation===v.implementation){l(y,d.sibling),O=n(d,v.children||[]),O.return=y,y=O;break e}else{l(y,d);break}else t(y,d);d=d.sibling}O=Cu(v,y.mode,O),O.return=y,y=O}return c(y);case xe:return v=Bl(v),Ae(y,d,v,O)}if(Ze(v))return X(y,d,v,O);if(de(v)){if(K=de(v),typeof K!="function")throw Error(o(150));return v=K.call(v),J(y,d,v,O)}if(typeof v.then=="function")return Ae(y,d,ei(v),O);if(v.$$typeof===le)return Ae(y,d,$n(y,v),O);ti(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,d!==null&&d.tag===6?(l(y,d.sibling),O=n(d,v),O.return=y,y=O):(l(y,d),O=Ou(v,y.mode,O),O.return=y,y=O),c(y)):l(y,d)}return function(y,d,v,O){try{ka=0;var K=Ae(y,d,v,O);return ra=null,K}catch(L){if(L===oa||L===In)throw L;var he=ht(29,L,null,y.mode);return he.lanes=O,he.return=y,he}finally{}}}var wl=Yf(!0),wf=Yf(!1),cl=!1;function Xu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function sl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ye&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=Kn(e),jf(e,null,l),t}return Vn(e,a,t,l),Kn(e)}function $a(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Cs(e,l)}}function Lu(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?n=i=c:i=i.next=c,l=l.next}while(l!==null);i===null?n=i=t:i=i.next=t}else n=i=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Zu=!1;function Fa(){if(Zu){var e=fa;if(e!==null)throw e}}function Ia(e,t,l,a){Zu=!1;var n=e.updateQueue;cl=!1;var i=n.firstBaseUpdate,c=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var r=f,g=r.next;r.next=null,c===null?i=g:c.next=g,c=r;var A=e.alternate;A!==null&&(A=A.updateQueue,f=A.lastBaseUpdate,f!==c&&(f===null?A.firstBaseUpdate=g:f.next=g,A.lastBaseUpdate=r))}if(i!==null){var D=n.baseState;c=0,A=g=r=null,f=i;do{var p=f.lane&-536870913,j=p!==f.lane;if(j?(fe&p)===p:(a&p)===p){p!==0&&p===sa&&(Zu=!0),A!==null&&(A=A.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var X=e,J=f;p=t;var Ae=l;switch(J.tag){case 1:if(X=J.payload,typeof X=="function"){D=X.call(Ae,D,p);break e}D=X;break e;case 3:X.flags=X.flags&-65537|128;case 0:if(X=J.payload,p=typeof X=="function"?X.call(Ae,D,p):X,p==null)break e;D=S({},D,p);break e;case 2:cl=!0}}p=f.callback,p!==null&&(e.flags|=64,j&&(e.flags|=8192),j=n.callbacks,j===null?n.callbacks=[p]:j.push(p))}else j={lane:p,tag:f.tag,payload:f.payload,callback:f.callback,next:null},A===null?(g=A=j,r=D):A=A.next=j,c|=p;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;j=f,f=j.next,j.next=null,n.lastBaseUpdate=j,n.shared.pending=null}}while(!0);A===null&&(r=D),n.baseState=r,n.firstBaseUpdate=g,n.lastBaseUpdate=A,i===null&&(n.shared.lanes=0),ml|=c,e.lanes=c,e.memoizedState=D}}function Gf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Xf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Gf(l[e],t)}var da=m(null),li=m(0);function Qf(e,t){e=Ft,B(li,e),B(da,t),Ft=e|t.baseLanes}function Vu(){B(li,Ft),B(da,da.current)}function Ku(){Ft=li.current,M(da),M(li)}var mt=m(null),_t=null;function ol(e){var t=e.alternate;B(Be,Be.current&1),B(mt,e),_t===null&&(t===null||da.current!==null||t.memoizedState!==null)&&(_t=e)}function Ju(e){B(Be,Be.current),B(mt,e),_t===null&&(_t=e)}function Lf(e){e.tag===22?(B(Be,Be.current),B(mt,e),_t===null&&(_t=e)):rl()}function rl(){B(Be,Be.current),B(mt,mt.current)}function yt(e){M(mt),_t===e&&(_t=null),M(Be)}var Be=m(0);function ai(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Pc(l)||es(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Lt=0,ee=null,Te=null,Xe=null,ni=!1,ha=!1,Gl=!1,ii=0,Pa=0,ma=null,um=0;function Ue(){throw Error(o(321))}function ku(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!dt(e[l],t[l]))return!1;return!0}function Wu(e,t,l,a,n,i){return Lt=i,ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?zo:oc,Gl=!1,i=l(a,n),Gl=!1,ha&&(i=Vf(t,l,a,n)),Zf(e),i}function Zf(e){E.H=ln;var t=Te!==null&&Te.next!==null;if(Lt=0,Xe=Te=ee=null,ni=!1,Pa=0,ma=null,t)throw Error(o(300));e===null||Qe||(e=e.dependencies,e!==null&&Wn(e)&&(Qe=!0))}function Vf(e,t,l,a){ee=e;var n=0;do{if(ha&&(ma=null),Pa=0,ha=!1,25<=n)throw Error(o(301));if(n+=1,Xe=Te=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}E.H=Oo,i=t(l,a)}while(ha);return i}function cm(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?en(t):t,e=e.useState()[0],(Te!==null?Te.memoizedState:null)!==e&&(ee.flags|=1024),t}function $u(){var e=ii!==0;return ii=0,e}function Fu(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Iu(e){if(ni){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ni=!1}Lt=0,Xe=Te=ee=null,ha=!1,Pa=ii=0,ma=null}function tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ye(){if(Te===null){var e=ee.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=Xe===null?ee.memoizedState:Xe.next;if(t!==null)Xe=t,Te=e;else{if(e===null)throw ee.alternate===null?Error(o(467)):Error(o(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Xe===null?ee.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function ui(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function en(e){var t=Pa;return Pa+=1,ma===null&&(ma=[]),e=qf(ma,e,t),t=ee,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?zo:oc),e}function ci(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return en(e);if(e.$$typeof===le)return $e(e)}throw Error(o(438,String(e)))}function Pu(e){var t=null,l=ee.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=ee.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=ui(),ee.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=se;return t.index++,l}function Zt(e,t){return typeof t=="function"?t(e):t}function si(e){var t=Ye();return ec(t,Te,e)}function ec(e,t,l){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=l;var n=e.baseQueue,i=a.pending;if(i!==null){if(n!==null){var c=n.next;n.next=i.next,i.next=c}t.baseQueue=n=i,a.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var f=c=null,r=null,g=t,A=!1;do{var D=g.lane&-536870913;if(D!==g.lane?(fe&D)===D:(Lt&D)===D){var p=g.revertLane;if(p===0)r!==null&&(r=r.next={lane:0,revertLane:0,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null}),D===sa&&(A=!0);else if((Lt&p)===p){g=g.next,p===sa&&(A=!0);continue}else D={lane:0,revertLane:g.revertLane,gesture:null,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=D,c=i):r=r.next=D,ee.lanes|=p,ml|=p;D=g.action,Gl&&l(i,D),i=g.hasEagerState?g.eagerState:l(i,D)}else p={lane:D,revertLane:g.revertLane,gesture:g.gesture,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null},r===null?(f=r=p,c=i):r=r.next=p,ee.lanes|=D,ml|=D;g=g.next}while(g!==null&&g!==t);if(r===null?c=i:r.next=f,!dt(i,e.memoizedState)&&(Qe=!0,A&&(l=fa,l!==null)))throw l;e.memoizedState=i,e.baseState=c,e.baseQueue=r,a.lastRenderedState=i}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function tc(e){var t=Ye(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var a=l.dispatch,n=l.pending,i=t.memoizedState;if(n!==null){l.pending=null;var c=n=n.next;do i=e(i,c.action),c=c.next;while(c!==n);dt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),l.lastRenderedState=i}return[i,a]}function Kf(e,t,l){var a=ee,n=Ye(),i=re;if(i){if(l===void 0)throw Error(o(407));l=l()}else l=t();var c=!dt((Te||n).memoizedState,l);if(c&&(n.memoizedState=l,Qe=!0),n=n.queue,nc(Wf.bind(null,a,n,e),[e]),n.getSnapshot!==t||c||Xe!==null&&Xe.memoizedState.tag&1){if(a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,n,l,t),null),ze===null)throw Error(o(349));i||(Lt&127)!==0||Jf(a,t,l)}return l}function Jf(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ee.updateQueue,t===null?(t=ui(),ee.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function kf(e,t,l,a){t.value=l,t.getSnapshot=a,$f(t)&&Ff(e)}function Wf(e,t,l){return l(function(){$f(t)&&Ff(e)})}function $f(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!dt(e,l)}catch{return!0}}function Ff(e){var t=Dl(e,2);t!==null&&st(t,e,2)}function lc(e){var t=tt();if(typeof e=="function"){var l=e;if(e=l(),Gl){el(!0);try{l()}finally{el(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:e},t}function If(e,t,l,a){return e.baseState=l,ec(e,Te,typeof a=="function"?a:Zt)}function sm(e,t,l,a,n){if(ri(e))throw Error(o(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){i.listeners.push(c)}};E.T!==null?l(!0):i.isTransition=!1,a(i),l=t.pending,l===null?(i.next=t.pending=i,Pf(t,i)):(i.next=l.next,t.pending=l.next=i)}}function Pf(e,t){var l=t.action,a=t.payload,n=e.state;if(t.isTransition){var i=E.T,c={};E.T=c;try{var f=l(n,a),r=E.S;r!==null&&r(c,f),eo(e,t,f)}catch(g){ac(e,t,g)}finally{i!==null&&c.types!==null&&(i.types=c.types),E.T=i}}else try{i=l(n,a),eo(e,t,i)}catch(g){ac(e,t,g)}}function eo(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){to(e,t,a)},function(a){return ac(e,t,a)}):to(e,t,l)}function to(e,t,l){t.status="fulfilled",t.value=l,lo(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Pf(e,l)))}function ac(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,lo(t),t=t.next;while(t!==a)}e.action=null}function lo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ao(e,t){return t}function no(e,t){if(re){var l=ze.formState;if(l!==null){e:{var a=ee;if(re){if(De){t:{for(var n=De,i=At;n.nodeType!==8;){if(!i){n=null;break t}if(n=zt(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){De=zt(n.nextSibling),a=n.data==="F!";break e}}il(a)}a=!1}a&&(t=l[0])}}return l=tt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:t},l.queue=a,l=Eo.bind(null,ee,a),a.dispatch=l,a=lc(!1),i=fc.bind(null,ee,!1,a.queue),a=tt(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,l=sm.bind(null,ee,n,i,l),n.dispatch=l,a.memoizedState=e,[t,l,!1]}function io(e){var t=Ye();return uo(t,Te,e)}function uo(e,t,l){if(t=ec(e,t,ao)[0],e=si(Zt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=en(t)}catch(c){throw c===oa?In:c}else a=t;t=Ye();var n=t.queue,i=n.dispatch;return l!==t.memoizedState&&(ee.flags|=2048,ya(9,{destroy:void 0},fm.bind(null,n,l),null)),[a,i,e]}function fm(e,t){e.action=t}function co(e){var t=Ye(),l=Te;if(l!==null)return uo(t,l,e);Ye(),t=t.memoizedState,l=Ye();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function ya(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=ee.updateQueue,t===null&&(t=ui(),ee.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function so(){return Ye().memoizedState}function fi(e,t,l,a){var n=tt();ee.flags|=e,n.memoizedState=ya(1|t,{destroy:void 0},l,a===void 0?null:a)}function oi(e,t,l,a){var n=Ye();a=a===void 0?null:a;var i=n.memoizedState.inst;Te!==null&&a!==null&&ku(a,Te.memoizedState.deps)?n.memoizedState=ya(t,i,l,a):(ee.flags|=e,n.memoizedState=ya(1|t,i,l,a))}function fo(e,t){fi(8390656,8,e,t)}function nc(e,t){oi(2048,8,e,t)}function om(e){ee.flags|=4;var t=ee.updateQueue;if(t===null)t=ui(),ee.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function oo(e){var t=Ye().memoizedState;return om({ref:t,nextImpl:e}),function(){if((ye&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ro(e,t){return oi(4,2,e,t)}function ho(e,t){return oi(4,4,e,t)}function mo(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yo(e,t,l){l=l!=null?l.concat([e]):null,oi(4,4,mo.bind(null,t,e),l)}function ic(){}function vo(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&ku(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function go(e,t){var l=Ye();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&ku(t,a[1]))return a[0];if(a=e(),Gl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a}function uc(e,t,l){return l===void 0||(Lt&1073741824)!==0&&(fe&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=pr(),ee.lanes|=e,ml|=e,l)}function po(e,t,l,a){return dt(l,t)?l:da.current!==null?(e=uc(e,l,a),dt(e,t)||(Qe=!0),e):(Lt&42)===0||(Lt&1073741824)!==0&&(fe&261930)===0?(Qe=!0,e.memoizedState=l):(e=pr(),ee.lanes|=e,ml|=e,t)}function bo(e,t,l,a,n){var i=N.p;N.p=i!==0&&8>i?i:8;var c=E.T,f={};E.T=f,fc(e,!1,t,l);try{var r=n(),g=E.S;if(g!==null&&g(f,r),r!==null&&typeof r=="object"&&typeof r.then=="function"){var A=im(r,a);tn(e,t,A,pt(e))}else tn(e,t,a,pt(e))}catch(D){tn(e,t,{then:function(){},status:"rejected",reason:D},pt())}finally{N.p=i,c!==null&&f.types!==null&&(c.types=f.types),E.T=c}}function rm(){}function cc(e,t,l,a){if(e.tag!==5)throw Error(o(476));var n=xo(e).queue;bo(e,n,t,w,l===null?rm:function(){return So(e),l(a)})}function xo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:w,baseState:w,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:w},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function So(e){var t=xo(e);t.next===null&&(t=e.alternate.memoizedState),tn(e,t.next.queue,{},pt())}function sc(){return $e(bn)}function jo(){return Ye().memoizedState}function To(){return Ye().memoizedState}function dm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=pt();e=sl(l);var a=fl(t,e,l);a!==null&&(st(a,t,l),$a(a,t,l)),t={cache:Bu()},e.payload=t;return}t=t.return}}function hm(e,t,l){var a=pt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ri(e)?Ao(t,l):(l=_u(e,t,l,a),l!==null&&(st(l,e,a),_o(l,t,a)))}function Eo(e,t,l){var a=pt();tn(e,t,l,a)}function tn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ri(e))Ao(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var c=t.lastRenderedState,f=i(c,l);if(n.hasEagerState=!0,n.eagerState=f,dt(f,c))return Vn(e,t,n,0),ze===null&&Zn(),!1}catch{}finally{}if(l=_u(e,t,n,a),l!==null)return st(l,e,a),_o(l,t,a),!0}return!1}function fc(e,t,l,a){if(a={lane:2,revertLane:Xc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ri(e)){if(t)throw Error(o(479))}else t=_u(e,l,a,2),t!==null&&st(t,e,2)}function ri(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function Ao(e,t){ha=ni=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function _o(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Cs(e,l)}}var ln={readContext:$e,use:ci,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useLayoutEffect:Ue,useInsertionEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useSyncExternalStore:Ue,useId:Ue,useHostTransitionStatus:Ue,useFormState:Ue,useActionState:Ue,useOptimistic:Ue,useMemoCache:Ue,useCacheRefresh:Ue};ln.useEffectEvent=Ue;var zo={readContext:$e,use:ci,useCallback:function(e,t){return tt().memoizedState=[e,t===void 0?null:t],e},useContext:$e,useEffect:fo,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,fi(4194308,4,mo.bind(null,t,e),l)},useLayoutEffect:function(e,t){return fi(4194308,4,e,t)},useInsertionEffect:function(e,t){fi(4,2,e,t)},useMemo:function(e,t){var l=tt();t=t===void 0?null:t;var a=e();if(Gl){el(!0);try{e()}finally{el(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=tt();if(l!==void 0){var n=l(t);if(Gl){el(!0);try{l(t)}finally{el(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=hm.bind(null,ee,e),[a.memoizedState,e]},useRef:function(e){var t=tt();return e={current:e},t.memoizedState=e},useState:function(e){e=lc(e);var t=e.queue,l=Eo.bind(null,ee,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:ic,useDeferredValue:function(e,t){var l=tt();return uc(l,e,t)},useTransition:function(){var e=lc(!1);return e=bo.bind(null,ee,e.queue,!0,!1),tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ee,n=tt();if(re){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),ze===null)throw Error(o(349));(fe&127)!==0||Jf(a,t,l)}n.memoizedState=l;var i={value:l,getSnapshot:t};return n.queue=i,fo(Wf.bind(null,a,i,e),[e]),a.flags|=2048,ya(9,{destroy:void 0},kf.bind(null,a,i,l,t),null),l},useId:function(){var e=tt(),t=ze.identifierPrefix;if(re){var l=Rt,a=Mt;l=(a&~(1<<32-rt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ii++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=um++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:sc,useFormState:no,useActionState:no,useOptimistic:function(e){var t=tt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=fc.bind(null,ee,!0,l),l.dispatch=t,[e,t]},useMemoCache:Pu,useCacheRefresh:function(){return tt().memoizedState=dm.bind(null,ee)},useEffectEvent:function(e){var t=tt(),l={impl:e};return t.memoizedState=l,function(){if((ye&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},oc={readContext:$e,use:ci,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:si,useRef:so,useState:function(){return si(Zt)},useDebugValue:ic,useDeferredValue:function(e,t){var l=Ye();return po(l,Te.memoizedState,e,t)},useTransition:function(){var e=si(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:io,useActionState:io,useOptimistic:function(e,t){var l=Ye();return If(l,Te,e,t)},useMemoCache:Pu,useCacheRefresh:To};oc.useEffectEvent=oo;var Oo={readContext:$e,use:ci,useCallback:vo,useContext:$e,useEffect:nc,useImperativeHandle:yo,useInsertionEffect:ro,useLayoutEffect:ho,useMemo:go,useReducer:tc,useRef:so,useState:function(){return tc(Zt)},useDebugValue:ic,useDeferredValue:function(e,t){var l=Ye();return Te===null?uc(l,e,t):po(l,Te.memoizedState,e,t)},useTransition:function(){var e=tc(Zt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:Kf,useId:jo,useHostTransitionStatus:sc,useFormState:co,useActionState:co,useOptimistic:function(e,t){var l=Ye();return Te!==null?If(l,Te,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Pu,useCacheRefresh:To};Oo.useEffectEvent=oo;function rc(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:S({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var dc={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=pt(),n=sl(a);n.tag=1,n.payload=t,l!=null&&(n.callback=l),t=fl(e,n,a),t!==null&&(st(t,e,a),$a(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=pt(),a=sl(l);a.tag=2,t!=null&&(a.callback=t),t=fl(e,a,l),t!==null&&(st(t,e,l),$a(t,e,l))}};function Co(e,t,l,a,n,i,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,i,c):t.prototype&&t.prototype.isPureReactComponent?!Qa(l,a)||!Qa(n,i):!0}function No(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&dc.enqueueReplaceState(t,t.state,null)}function Xl(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=S({},l));for(var n in e)l[n]===void 0&&(l[n]=e[n])}return l}function Do(e){Ln(e)}function Mo(e){console.error(e)}function Ro(e){Ln(e)}function di(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Uo(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function hc(e,t,l){return l=sl(l),l.tag=3,l.payload={element:null},l.callback=function(){di(e,t)},l}function qo(e){return e=sl(e),e.tag=3,e}function Ho(e,t,l,a){var n=l.type.getDerivedStateFromError;if(typeof n=="function"){var i=a.value;e.payload=function(){return n(i)},e.callback=function(){Uo(t,l,a)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){Uo(t,l,a),typeof n!="function"&&(yl===null?yl=new Set([this]):yl.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function mm(e,t,l,a,n){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&ca(t,l,n,!0),l=mt.current,l!==null){switch(l.tag){case 31:case 13:return _t===null?Ei():l.alternate===null&&qe===0&&(qe=3),l.flags&=-257,l.flags|=65536,l.lanes=n,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),Yc(e,a,n)),!1;case 22:return l.flags|=65536,a===Pn?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),Yc(e,a,n)),!1}throw Error(o(435,l.tag))}return Yc(e,a,n),Ei(),!1}if(re)return t=mt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==Mu&&(e=Error(o(422),{cause:a}),Va(jt(e,l)))):(a!==Mu&&(t=Error(o(423),{cause:a}),Va(jt(t,l))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=jt(a,l),n=hc(e.stateNode,a,n),Lu(e,n),qe!==4&&(qe=2)),!1;var i=Error(o(520),{cause:a});if(i=jt(i,l),rn===null?rn=[i]:rn.push(i),qe!==4&&(qe=2),t===null)return!0;a=jt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=n&-n,l.lanes|=e,e=hc(l.stateNode,a,e),Lu(l,e),!1;case 1:if(t=l.type,i=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(yl===null||!yl.has(i))))return l.flags|=65536,n&=-n,l.lanes|=n,n=qo(n),Ho(n,e,l,a),Lu(l,n),!1}l=l.return}while(l!==null);return!1}var mc=Error(o(461)),Qe=!1;function Fe(e,t,l,a){t.child=e===null?wf(t,null,l,a):wl(t,e.child,l,a)}function Bo(e,t,l,a,n){l=l.render;var i=t.ref;if("ref"in a){var c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}else c=a;return ql(t),a=Wu(e,t,l,c,i,n),f=$u(),e!==null&&!Qe?(Fu(e,t,n),Vt(e,t,n)):(re&&f&&Nu(t),t.flags|=1,Fe(e,t,a,n),t.child)}function Yo(e,t,l,a,n){if(e===null){var i=l.type;return typeof i=="function"&&!zu(i)&&i.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=i,wo(e,t,i,a,n)):(e=Jn(l.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!jc(e,n)){var c=i.memoizedProps;if(l=l.compare,l=l!==null?l:Qa,l(c,a)&&e.ref===t.ref)return Vt(e,t,n)}return t.flags|=1,e=wt(i,a),e.ref=t.ref,e.return=t,t.child=e}function wo(e,t,l,a,n){if(e!==null){var i=e.memoizedProps;if(Qa(i,a)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=a=i,jc(e,n))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,Vt(e,t,n)}return yc(e,t,l,a,n)}function Go(e,t,l,a){var n=a.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|l:l,e!==null){for(a=t.child=e.child,n=0;a!==null;)n=n|a.lanes|a.childLanes,a=a.sibling;a=n&~i}else a=0,t.child=null;return Xo(e,t,i,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fn(t,i!==null?i.cachePool:null),i!==null?Qf(t,i):Vu(),Lf(t);else return a=t.lanes=536870912,Xo(e,t,i!==null?i.baseLanes|l:l,l,a)}else i!==null?(Fn(t,i.cachePool),Qf(t,i),rl(),t.memoizedState=null):(e!==null&&Fn(t,null),Vu(),rl());return Fe(e,t,n,l),t.child}function an(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xo(e,t,l,a,n){var i=wu();return i=i===null?null:{parent:Ge._currentValue,pool:i},t.memoizedState={baseLanes:l,cachePool:i},e!==null&&Fn(t,null),Vu(),Lf(t),e!==null&&ca(e,t,a,!0),t.childLanes=n,null}function hi(e,t){return t=yi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qo(e,t,l){return wl(t,e.child,null,l),e=hi(t,t.pendingProps),e.flags|=2,yt(t),t.memoizedState=null,e}function ym(e,t,l){var a=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(re){if(a.mode==="hidden")return e=hi(t,a),t.lanes=536870912,an(null,e);if(Ju(t),(e=De)?(e=ed(e,At),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw il(t);return t.lanes=536870912,null}return hi(t,a)}var i=e.memoizedState;if(i!==null){var c=i.dehydrated;if(Ju(t),n)if(t.flags&256)t.flags&=-257,t=Qo(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Qe||ca(e,t,l,!1),n=(l&e.childLanes)!==0,Qe||n){if(a=ze,a!==null&&(c=Ns(a,l),c!==0&&c!==i.retryLane))throw i.retryLane=c,Dl(e,c),st(a,e,c),mc;Ei(),t=Qo(e,t,l)}else e=i.treeContext,De=zt(c.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=hi(t,a),t.flags|=4096;return t}return e=wt(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mi(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function yc(e,t,l,a,n){return ql(t),l=Wu(e,t,l,a,void 0,n),a=$u(),e!==null&&!Qe?(Fu(e,t,n),Vt(e,t,n)):(re&&a&&Nu(t),t.flags|=1,Fe(e,t,l,n),t.child)}function Lo(e,t,l,a,n,i){return ql(t),t.updateQueue=null,l=Vf(t,a,l,n),Zf(e),a=$u(),e!==null&&!Qe?(Fu(e,t,i),Vt(e,t,i)):(re&&a&&Nu(t),t.flags|=1,Fe(e,t,l,i),t.child)}function Zo(e,t,l,a,n){if(ql(t),t.stateNode===null){var i=aa,c=l.contextType;typeof c=="object"&&c!==null&&(i=$e(c)),i=new l(a,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=dc,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=a,i.state=t.memoizedState,i.refs={},Xu(t),c=l.contextType,i.context=typeof c=="object"&&c!==null?$e(c):aa,i.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(rc(t,l,c,a),i.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(c=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),c!==i.state&&dc.enqueueReplaceState(i,i.state,null),Ia(t,a,i,n),Fa(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){i=t.stateNode;var f=t.memoizedProps,r=Xl(l,f);i.props=r;var g=i.context,A=l.contextType;c=aa,typeof A=="object"&&A!==null&&(c=$e(A));var D=l.getDerivedStateFromProps;A=typeof D=="function"||typeof i.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,A||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(f||g!==c)&&No(t,i,a,c),cl=!1;var p=t.memoizedState;i.state=p,Ia(t,a,i,n),Fa(),g=t.memoizedState,f||p!==g||cl?(typeof D=="function"&&(rc(t,l,D,a),g=t.memoizedState),(r=cl||Co(t,l,r,a,p,g,c))?(A||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=g),i.props=a,i.state=g,i.context=c,a=r):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{i=t.stateNode,Qu(e,t),c=t.memoizedProps,A=Xl(l,c),i.props=A,D=t.pendingProps,p=i.context,g=l.contextType,r=aa,typeof g=="object"&&g!==null&&(r=$e(g)),f=l.getDerivedStateFromProps,(g=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(c!==D||p!==r)&&No(t,i,a,r),cl=!1,p=t.memoizedState,i.state=p,Ia(t,a,i,n),Fa();var j=t.memoizedState;c!==D||p!==j||cl||e!==null&&e.dependencies!==null&&Wn(e.dependencies)?(typeof f=="function"&&(rc(t,l,f,a),j=t.memoizedState),(A=cl||Co(t,l,A,a,p,j,r)||e!==null&&e.dependencies!==null&&Wn(e.dependencies))?(g||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(a,j,r),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(a,j,r)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=j),i.props=a,i.state=j,i.context=r,a=A):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),a=!1)}return i=a,mi(e,t),a=(t.flags&128)!==0,i||a?(i=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&a?(t.child=wl(t,e.child,null,n),t.child=wl(t,null,l,n)):Fe(e,t,l,n),t.memoizedState=i.state,e=t.child):e=Vt(e,t,n),e}function Vo(e,t,l,a){return Rl(),t.flags|=256,Fe(e,t,l,a),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:Rf()}}function pc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=gt),e}function Ko(e,t,l){var a=t.pendingProps,n=!1,i=(t.flags&128)!==0,c;if((c=i)||(c=e!==null&&e.memoizedState===null?!1:(Be.current&2)!==0),c&&(n=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(re){if(n?ol(t):rl(),(e=De)?(e=ed(e,At),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:al!==null?{id:Mt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,We=t,De=null)):e=null,e===null)throw il(t);return es(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,n?(rl(),n=t.mode,f=yi({mode:"hidden",children:f},n),a=Ml(a,n,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,an(null,a)):(ol(t),bc(t,f))}var r=e.memoizedState;if(r!==null&&(f=r.dehydrated,f!==null)){if(i)t.flags&256?(ol(t),t.flags&=-257,t=xc(e,t,l)):t.memoizedState!==null?(rl(),t.child=e.child,t.flags|=128,t=null):(rl(),f=a.fallback,n=t.mode,a=yi({mode:"visible",children:a.children},n),f=Ml(f,n,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,wl(t,e.child,null,l),a=t.child,a.memoizedState=gc(l),a.childLanes=pc(e,c,l),t.memoizedState=vc,t=an(null,a));else if(ol(t),es(f)){if(c=f.nextSibling&&f.nextSibling.dataset,c)var g=c.dgst;c=g,a=Error(o(419)),a.stack="",a.digest=c,Va({value:a,source:null,stack:null}),t=xc(e,t,l)}else if(Qe||ca(e,t,l,!1),c=(l&e.childLanes)!==0,Qe||c){if(c=ze,c!==null&&(a=Ns(c,l),a!==0&&a!==r.retryLane))throw r.retryLane=a,Dl(e,a),st(c,e,a),mc;Pc(f)||Ei(),t=xc(e,t,l)}else Pc(f)?(t.flags|=192,t.child=e.child,t=null):(e=r.treeContext,De=zt(f.nextSibling),We=t,re=!0,nl=null,At=!1,e!==null&&zf(t,e),t=bc(t,a.children),t.flags|=4096);return t}return n?(rl(),f=a.fallback,n=t.mode,r=e.child,g=r.sibling,a=wt(r,{mode:"hidden",children:a.children}),a.subtreeFlags=r.subtreeFlags&65011712,g!==null?f=wt(g,f):(f=Ml(f,n,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,an(null,a),a=t.child,f=e.child.memoizedState,f===null?f=gc(l):(n=f.cachePool,n!==null?(r=Ge._currentValue,n=n.parent!==r?{parent:r,pool:r}:n):n=Rf(),f={baseLanes:f.baseLanes|l,cachePool:n}),a.memoizedState=f,a.childLanes=pc(e,c,l),t.memoizedState=vc,an(e.child,a)):(ol(t),l=e.child,e=l.sibling,l=wt(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function bc(e,t){return t=yi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yi(e,t){return e=ht(22,e,null,t),e.lanes=0,e}function xc(e,t,l){return wl(t,e.child,null,l),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jo(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),qu(e.return,t,l)}function Sc(e,t,l,a,n,i){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:n,treeForkCount:i}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=l,c.tailMode=n,c.treeForkCount=i)}function ko(e,t,l){var a=t.pendingProps,n=a.revealOrder,i=a.tail;a=a.children;var c=Be.current,f=(c&2)!==0;if(f?(c=c&1|2,t.flags|=128):c&=1,B(Be,c),Fe(e,t,a,l),a=re?Za:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jo(e,l,t);else if(e.tag===19)Jo(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(l=t.child,n=null;l!==null;)e=l.alternate,e!==null&&ai(e)===null&&(n=l),l=l.sibling;l=n,l===null?(n=t.child,t.child=null):(n=l.sibling,l.sibling=null),Sc(t,!1,n,l,i,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&ai(e)===null){t.child=n;break}e=n.sibling,n.sibling=l,l=n,n=e}Sc(t,!0,l,null,i,a);break;case"together":Sc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Vt(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),ml|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(ca(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=wt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=wt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wn(e)))}function vm(e,t,l){switch(t.tag){case 3:et(t,t.stateNode.containerInfo),ul(t,Ge,e.memoizedState.cache),Rl();break;case 27:case 5:Ca(t);break;case 4:et(t,t.stateNode.containerInfo);break;case 10:ul(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ju(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ol(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Ko(e,t,l):(ol(t),e=Vt(e,t,l),e!==null?e.sibling:null);ol(t);break;case 19:var n=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(ca(e,t,l,!1),a=(l&t.childLanes)!==0),n){if(a)return ko(e,t,l);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),B(Be,Be.current),a)break;return null;case 22:return t.lanes=0,Go(e,t,l,t.pendingProps);case 24:ul(t,Ge,e.memoizedState.cache)}return Vt(e,t,l)}function Wo(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!jc(e,l)&&(t.flags&128)===0)return Qe=!1,vm(e,t,l);Qe=(e.flags&131072)!==0}else Qe=!1,re&&(t.flags&1048576)!==0&&_f(t,Za,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Bl(t.elementType),t.type=e,typeof e=="function")zu(e)?(a=Xl(e,a),t.tag=1,t=Zo(null,t,e,a,l)):(t.tag=0,t=yc(null,t,e,a,l));else{if(e!=null){var n=e.$$typeof;if(n===ne){t.tag=11,t=Bo(null,t,e,a,l);break e}else if(n===V){t.tag=14,t=Yo(null,t,e,a,l);break e}}throw t=Ne(e)||e,Error(o(306,t,""))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,n=Xl(a,t.pendingProps),Zo(e,t,a,n,l);case 3:e:{if(et(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var i=t.memoizedState;n=i.element,Qu(e,t),Ia(t,a,null,l);var c=t.memoizedState;if(a=c.cache,ul(t,Ge,a),a!==i.cache&&Hu(t,[Ge],l,!0),Fa(),a=c.element,i.isDehydrated)if(i={element:a,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Vo(e,t,a,l);break e}else if(a!==n){n=jt(Error(o(424)),t),Va(n),t=Vo(e,t,a,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(De=zt(e.firstChild),We=t,re=!0,nl=null,At=!0,l=wf(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Rl(),a===n){t=Vt(e,t,l);break e}Fe(e,t,a,l)}t=t.child}return t;case 26:return mi(e,t),e===null?(l=ud(t.type,null,t.pendingProps,null))?t.memoizedState=l:re||(l=t.type,e=t.pendingProps,a=Di(ie.current).createElement(l),a[ke]=t,a[lt]=e,Ie(a,l,e),Ke(a),t.stateNode=a):t.memoizedState=ud(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ca(t),e===null&&re&&(a=t.stateNode=ad(t.type,t.pendingProps,ie.current),We=t,At=!0,n=De,bl(t.type)?(ts=n,De=zt(a.firstChild)):De=n),Fe(e,t,t.pendingProps.children,l),mi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&re&&((n=a=De)&&(a=Km(a,t.type,t.pendingProps,At),a!==null?(t.stateNode=a,We=t,De=zt(a.firstChild),At=!1,n=!0):n=!1),n||il(t)),Ca(t),n=t.type,i=t.pendingProps,c=e!==null?e.memoizedProps:null,a=i.children,$c(n,i)?a=null:c!==null&&$c(n,c)&&(t.flags|=32),t.memoizedState!==null&&(n=Wu(e,t,cm,null,null,l),bn._currentValue=n),mi(e,t),Fe(e,t,a,l),t.child;case 6:return e===null&&re&&((e=l=De)&&(l=Jm(l,t.pendingProps,At),l!==null?(t.stateNode=l,We=t,De=null,e=!0):e=!1),e||il(t)),null;case 13:return Ko(e,t,l);case 4:return et(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=wl(t,null,a,l):Fe(e,t,a,l),t.child;case 11:return Bo(e,t,t.type,t.pendingProps,l);case 7:return Fe(e,t,t.pendingProps,l),t.child;case 8:return Fe(e,t,t.pendingProps.children,l),t.child;case 12:return Fe(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,ul(t,t.type,a.value),Fe(e,t,a.children,l),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,ql(t),n=$e(n),a=a(n),t.flags|=1,Fe(e,t,a,l),t.child;case 14:return Yo(e,t,t.type,t.pendingProps,l);case 15:return wo(e,t,t.type,t.pendingProps,l);case 19:return ko(e,t,l);case 31:return ym(e,t,l);case 22:return Go(e,t,l,t.pendingProps);case 24:return ql(t),a=$e(Ge),e===null?(n=wu(),n===null&&(n=ze,i=Bu(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=l),n=i),t.memoizedState={parent:a,cache:n},Xu(t),ul(t,Ge,n)):((e.lanes&l)!==0&&(Qu(e,t),Ia(t,null,null,l),Fa()),n=e.memoizedState,i=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),ul(t,Ge,a)):(a=i.cache,ul(t,Ge,a),a!==n.cache&&Hu(t,[Ge],l,!0))),Fe(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Kt(e){e.flags|=4}function Tc(e,t,l,a,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(jr())e.flags|=8192;else throw Yl=Pn,Gu}else e.flags&=-16777217}function $o(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rd(t))if(jr())e.flags|=8192;else throw Yl=Pn,Gu}function vi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zs():536870912,e.lanes|=t,ba|=t)}function nn(e,t){if(!re)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function gm(e,t,l){var a=t.pendingProps;switch(Du(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return Me(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Qt(Ge),He(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ua(t)?Kt(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ru())),Me(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(Kt(t),i!==null?(Me(t),$o(t,i)):(Me(t),Tc(t,n,null,a,l))):i?i!==e.memoizedState?(Kt(t),Me(t),$o(t,i)):(Me(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Kt(t),Me(t),Tc(t,n,e,a,l)),null;case 27:if(zn(t),l=ie.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}e=Q.current,ua(t)?Of(t):(e=ad(n,a,l),t.stateNode=e,Kt(t))}return Me(t),null;case 5:if(zn(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Me(t),null}if(i=Q.current,ua(t))Of(t);else{var c=Di(ie.current);switch(i){case 1:i=c.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=c.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=c.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}i[ke]=t,i[lt]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=i;e:switch(Ie(i,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Kt(t)}}return Me(t),Tc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Kt(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=ie.current,ua(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=We,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[ke]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Kr(e.nodeValue,l)),e||il(t,!0)}else e=Di(e).createTextNode(a),e[ke]=t,t.stateNode=e}return Me(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=ua(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),e=!1}else l=Ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(yt(t),t):(yt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Me(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ua(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[ke]=t}else Rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),n=!1}else n=Ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(yt(t),t):(yt(t),null)}return yt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),vi(t,t.updateQueue),Me(t),null);case 4:return He(),e===null&&Vc(t.stateNode.containerInfo),Me(t),null;case 10:return Qt(t.type),Me(t),null;case 19:if(M(Be),a=t.memoizedState,a===null)return Me(t),null;if(n=(t.flags&128)!==0,i=a.rendering,i===null)if(n)nn(a,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=ai(e),i!==null){for(t.flags|=128,nn(a,!1),e=i.updateQueue,t.updateQueue=e,vi(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Tf(l,e),l=l.sibling;return B(Be,Be.current&1|2),re&&Gt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ft()>Si&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304)}else{if(!n)if(e=ai(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,vi(t,e),nn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!re)return Me(t),null}else 2*ft()-a.renderingStartTime>Si&&l!==536870912&&(t.flags|=128,n=!0,nn(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ft(),e.sibling=null,l=Be.current,B(Be,n?l&1|2:l&1),re&&Gt(t,a.treeForkCount),e):(Me(t),null);case 22:case 23:return yt(t),Ku(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),l=t.updateQueue,l!==null&&vi(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&M(Hl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Qt(Ge),Me(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function pm(e,t){switch(Du(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qt(Ge),He(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return zn(t),null;case 31:if(t.memoizedState!==null){if(yt(t),t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return M(Be),null;case 4:return He(),null;case 10:return Qt(t.type),null;case 22:case 23:return yt(t),Ku(),e!==null&&M(Hl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qt(Ge),null;case 25:return null;default:return null}}function Fo(e,t){switch(Du(t),t.tag){case 3:Qt(Ge),He();break;case 26:case 27:case 5:zn(t);break;case 4:He();break;case 31:t.memoizedState!==null&&yt(t);break;case 13:yt(t);break;case 19:M(Be);break;case 10:Qt(t.type);break;case 22:case 23:yt(t),Ku(),e!==null&&M(Hl);break;case 24:Qt(Ge)}}function un(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var i=l.create,c=l.inst;a=i(),c.destroy=a}l=l.next}while(l!==n)}}catch(f){pe(t,t.return,f)}}function dl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){var c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,n=t;var r=l,g=f;try{g()}catch(A){pe(n,r,A)}}}a=a.next}while(a!==i)}}catch(A){pe(t,t.return,A)}}function Io(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Xf(t,l)}catch(a){pe(e,e.return,a)}}}function Po(e,t,l){l.props=Xl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){pe(e,t,a)}}function cn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){pe(e,t,n)}}function Ut(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){pe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){pe(e,t,n)}else l.current=null}function er(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){pe(e,e.return,n)}}function Ec(e,t,l){try{var a=e.stateNode;Gm(a,e.type,l,t),a[lt]=t}catch(n){pe(e,e.return,n)}}function tr(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bl(e.type)||e.tag===4}function Ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tr(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&bl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _c(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Bt));else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(_c(e,t,l),e=e.sibling;e!==null;)_c(e,t,l),e=e.sibling}function gi(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&bl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(gi(e,t,l),e=e.sibling;e!==null;)gi(e,t,l),e=e.sibling}function lr(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ie(t,a,l),t[ke]=e,t[lt]=l}catch(i){pe(e,e.return,i)}}var Jt=!1,Le=!1,zc=!1,ar=typeof WeakSet=="function"?WeakSet:Set,Je=null;function bm(e,t){if(e=e.containerInfo,kc=Yi,e=mf(e),xu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var c=0,f=-1,r=-1,g=0,A=0,D=e,p=null;t:for(;;){for(var j;D!==l||n!==0&&D.nodeType!==3||(f=c+n),D!==i||a!==0&&D.nodeType!==3||(r=c+a),D.nodeType===3&&(c+=D.nodeValue.length),(j=D.firstChild)!==null;)p=D,D=j;for(;;){if(D===e)break t;if(p===l&&++g===n&&(f=c),p===i&&++A===a&&(r=c),(j=D.nextSibling)!==null)break;D=p,p=D.parentNode}D=j}l=f===-1||r===-1?null:{start:f,end:r}}else l=null}l=l||{start:0,end:0}}else l=null;for(Wc={focusedElem:e,selectionRange:l},Yi=!1,Je=t;Je!==null;)if(t=Je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Je=e;else for(;Je!==null;){switch(t=Je,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)n=e[l],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,l=t,n=i.memoizedProps,i=i.memoizedState,a=l.stateNode;try{var X=Xl(l.type,n);e=a.getSnapshotBeforeUpdate(X,i),a.__reactInternalSnapshotBeforeUpdate=e}catch(J){pe(l,l.return,J)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Ic(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ic(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Je=e;break}Je=t.return}}function nr(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Wt(e,l),a&4&&un(5,l);break;case 1:if(Wt(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){pe(l,l.return,c)}else{var n=Xl(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){pe(l,l.return,c)}}a&64&&Io(l),a&512&&cn(l,l.return);break;case 3:if(Wt(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Xf(e,t)}catch(c){pe(l,l.return,c)}}break;case 27:t===null&&a&4&&lr(l);case 26:case 5:Wt(e,l),t===null&&a&4&&er(l),a&512&&cn(l,l.return);break;case 12:Wt(e,l);break;case 31:Wt(e,l),a&4&&cr(e,l);break;case 13:Wt(e,l),a&4&&sr(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Om.bind(null,l),km(e,l))));break;case 22:if(a=l.memoizedState!==null||Jt,!a){t=t!==null&&t.memoizedState!==null||Le,n=Jt;var i=Le;Jt=a,(Le=t)&&!i?$t(e,l,(l.subtreeFlags&8772)!==0):Wt(e,l),Jt=n,Le=i}break;case 30:break;default:Wt(e,l)}}function ir(e){var t=e.alternate;t!==null&&(e.alternate=null,ir(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&au(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Re=null,nt=!1;function kt(e,t,l){for(l=l.child;l!==null;)ur(e,t,l),l=l.sibling}function ur(e,t,l){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(Na,l)}catch{}switch(l.tag){case 26:Le||Ut(l,t),kt(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Le||Ut(l,t);var a=Re,n=nt;bl(l.type)&&(Re=l.stateNode,nt=!1),kt(e,t,l),vn(l.stateNode),Re=a,nt=n;break;case 5:Le||Ut(l,t);case 6:if(a=Re,n=nt,Re=null,kt(e,t,l),Re=a,nt=n,Re!==null)if(nt)try{(Re.nodeType===9?Re.body:Re.nodeName==="HTML"?Re.ownerDocument.body:Re).removeChild(l.stateNode)}catch(i){pe(l,t,i)}else try{Re.removeChild(l.stateNode)}catch(i){pe(l,t,i)}break;case 18:Re!==null&&(nt?(e=Re,Ir(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),za(e)):Ir(Re,l.stateNode));break;case 4:a=Re,n=nt,Re=l.stateNode.containerInfo,nt=!0,kt(e,t,l),Re=a,nt=n;break;case 0:case 11:case 14:case 15:dl(2,l,t),Le||dl(4,l,t),kt(e,t,l);break;case 1:Le||(Ut(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Po(l,t,a)),kt(e,t,l);break;case 21:kt(e,t,l);break;case 22:Le=(a=Le)||l.memoizedState!==null,kt(e,t,l),Le=a;break;default:kt(e,t,l)}}function cr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{za(e)}catch(l){pe(t,t.return,l)}}}function sr(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{za(e)}catch(l){pe(t,t.return,l)}}function xm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ar),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ar),t;default:throw Error(o(435,e.tag))}}function pi(e,t){var l=xm(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var n=Cm.bind(null,e,a);a.then(n,n)}})}function it(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var n=l[a],i=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(bl(f.type)){Re=f.stateNode,nt=!1;break e}break;case 5:Re=f.stateNode,nt=!1;break e;case 3:case 4:Re=f.stateNode.containerInfo,nt=!0;break e}f=f.return}if(Re===null)throw Error(o(160));ur(i,c,n),Re=null,nt=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fr(t,e),t=t.sibling}var Nt=null;function fr(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:it(t,e),ut(e),a&4&&(dl(3,e,e.return),un(3,e),dl(5,e,e.return));break;case 1:it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),a&64&&Jt&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var n=Nt;if(it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),a&4){var i=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":i=n.getElementsByTagName("title")[0],(!i||i[Ra]||i[ke]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(a),n.head.insertBefore(i,n.querySelector("head > title"))),Ie(i,a,l),i[ke]=e,Ke(i),a=i;break e;case"link":var c=fd("link","href",n).get(a+(l.href||""));if(c){for(var f=0;f<c.length;f++)if(i=c[f],i.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&i.getAttribute("rel")===(l.rel==null?null:l.rel)&&i.getAttribute("title")===(l.title==null?null:l.title)&&i.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(f,1);break t}}i=n.createElement(a),Ie(i,a,l),n.head.appendChild(i);break;case"meta":if(c=fd("meta","content",n).get(a+(l.content||""))){for(f=0;f<c.length;f++)if(i=c[f],i.getAttribute("content")===(l.content==null?null:""+l.content)&&i.getAttribute("name")===(l.name==null?null:l.name)&&i.getAttribute("property")===(l.property==null?null:l.property)&&i.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&i.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(f,1);break t}}i=n.createElement(a),Ie(i,a,l),n.head.appendChild(i);break;default:throw Error(o(468,a))}i[ke]=e,Ke(i),a=i}e.stateNode=a}else od(n,e.type,e.stateNode);else e.stateNode=sd(n,a,e.memoizedProps);else i!==a?(i===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):i.count--,a===null?od(n,e.type,e.stateNode):sd(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Ec(e,e.memoizedProps,l.memoizedProps)}break;case 27:it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),l!==null&&a&4&&Ec(e,e.memoizedProps,l.memoizedProps);break;case 5:if(it(t,e),ut(e),a&512&&(Le||l===null||Ut(l,l.return)),e.flags&32){n=e.stateNode;try{$l(n,"")}catch(X){pe(e,e.return,X)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,Ec(e,n,l!==null?l.memoizedProps:n)),a&1024&&(zc=!0);break;case 6:if(it(t,e),ut(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(X){pe(e,e.return,X)}}break;case 3:if(Ui=null,n=Nt,Nt=Mi(t.containerInfo),it(t,e),Nt=n,ut(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{za(t.containerInfo)}catch(X){pe(e,e.return,X)}zc&&(zc=!1,or(e));break;case 4:a=Nt,Nt=Mi(e.stateNode.containerInfo),it(t,e),ut(e),Nt=a;break;case 12:it(t,e),ut(e);break;case 31:it(t,e),ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pi(e,a)));break;case 13:it(t,e),ut(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(xi=ft()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pi(e,a)));break;case 22:n=e.memoizedState!==null;var r=l!==null&&l.memoizedState!==null,g=Jt,A=Le;if(Jt=g||n,Le=A||r,it(t,e),Le=A,Jt=g,ut(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(l===null||r||Jt||Le||Ql(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){r=l=t;try{if(i=r.stateNode,n)c=i.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{f=r.stateNode;var D=r.memoizedProps.style,p=D!=null&&D.hasOwnProperty("display")?D.display:null;f.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(X){pe(r,r.return,X)}}}else if(t.tag===6){if(l===null){r=t;try{r.stateNode.nodeValue=n?"":r.memoizedProps}catch(X){pe(r,r.return,X)}}}else if(t.tag===18){if(l===null){r=t;try{var j=r.stateNode;n?Pr(j,!0):Pr(r.stateNode,!1)}catch(X){pe(r,r.return,X)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,pi(e,l))));break;case 19:it(t,e),ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pi(e,a)));break;case 30:break;case 21:break;default:it(t,e),ut(e)}}function ut(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(tr(a)){l=a;break}a=a.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var n=l.stateNode,i=Ac(e);gi(e,i,n);break;case 5:var c=l.stateNode;l.flags&32&&($l(c,""),l.flags&=-33);var f=Ac(e);gi(e,f,c);break;case 3:case 4:var r=l.stateNode.containerInfo,g=Ac(e);_c(e,g,r);break;default:throw Error(o(161))}}catch(A){pe(e,e.return,A)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function or(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;or(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wt(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nr(e,t.alternate,t),t=t.sibling}function Ql(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:dl(4,t,t.return),Ql(t);break;case 1:Ut(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Po(t,t.return,l),Ql(t);break;case 27:vn(t.stateNode);case 26:case 5:Ut(t,t.return),Ql(t);break;case 22:t.memoizedState===null&&Ql(t);break;case 30:Ql(t);break;default:Ql(t)}e=e.sibling}}function $t(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,n=e,i=t,c=i.flags;switch(i.tag){case 0:case 11:case 15:$t(n,i,l),un(4,i);break;case 1:if($t(n,i,l),a=i,n=a.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(g){pe(a,a.return,g)}if(a=i,n=a.updateQueue,n!==null){var f=a.stateNode;try{var r=n.shared.hiddenCallbacks;if(r!==null)for(n.shared.hiddenCallbacks=null,n=0;n<r.length;n++)Gf(r[n],f)}catch(g){pe(a,a.return,g)}}l&&c&64&&Io(i),cn(i,i.return);break;case 27:lr(i);case 26:case 5:$t(n,i,l),l&&a===null&&c&4&&er(i),cn(i,i.return);break;case 12:$t(n,i,l);break;case 31:$t(n,i,l),l&&c&4&&cr(n,i);break;case 13:$t(n,i,l),l&&c&4&&sr(n,i);break;case 22:i.memoizedState===null&&$t(n,i,l),cn(i,i.return);break;case 30:break;default:$t(n,i,l)}t=t.sibling}}function Oc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Ka(l))}function Cc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e))}function Dt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rr(e,t,l,a),t=t.sibling}function rr(e,t,l,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Dt(e,t,l,a),n&2048&&un(9,t);break;case 1:Dt(e,t,l,a);break;case 3:Dt(e,t,l,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ka(e)));break;case 12:if(n&2048){Dt(e,t,l,a),e=t.stateNode;try{var i=t.memoizedProps,c=i.id,f=i.onPostCommit;typeof f=="function"&&f(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(r){pe(t,t.return,r)}}else Dt(e,t,l,a);break;case 31:Dt(e,t,l,a);break;case 13:Dt(e,t,l,a);break;case 23:break;case 22:i=t.stateNode,c=t.alternate,t.memoizedState!==null?i._visibility&2?Dt(e,t,l,a):sn(e,t):i._visibility&2?Dt(e,t,l,a):(i._visibility|=2,va(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Oc(c,t);break;case 24:Dt(e,t,l,a),n&2048&&Cc(t.alternate,t);break;default:Dt(e,t,l,a)}}function va(e,t,l,a,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,c=t,f=l,r=a,g=c.flags;switch(c.tag){case 0:case 11:case 15:va(i,c,f,r,n),un(8,c);break;case 23:break;case 22:var A=c.stateNode;c.memoizedState!==null?A._visibility&2?va(i,c,f,r,n):sn(i,c):(A._visibility|=2,va(i,c,f,r,n)),n&&g&2048&&Oc(c.alternate,c);break;case 24:va(i,c,f,r,n),n&&g&2048&&Cc(c.alternate,c);break;default:va(i,c,f,r,n)}t=t.sibling}}function sn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,n=a.flags;switch(a.tag){case 22:sn(l,a),n&2048&&Oc(a.alternate,a);break;case 24:sn(l,a),n&2048&&Cc(a.alternate,a);break;default:sn(l,a)}t=t.sibling}}var fn=8192;function ga(e,t,l){if(e.subtreeFlags&fn)for(e=e.child;e!==null;)dr(e,t,l),e=e.sibling}function dr(e,t,l){switch(e.tag){case 26:ga(e,t,l),e.flags&fn&&e.memoizedState!==null&&uy(l,Nt,e.memoizedState,e.memoizedProps);break;case 5:ga(e,t,l);break;case 3:case 4:var a=Nt;Nt=Mi(e.stateNode.containerInfo),ga(e,t,l),Nt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=fn,fn=16777216,ga(e,t,l),fn=a):ga(e,t,l));break;default:ga(e,t,l)}}function hr(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function on(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)mr(e),e=e.sibling}function mr(e){switch(e.tag){case 0:case 11:case 15:on(e),e.flags&2048&&dl(9,e,e.return);break;case 3:on(e);break;case 12:on(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,bi(e)):on(e);break;default:on(e)}}function bi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Je=a,yr(a,e)}hr(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:dl(8,t,t.return),bi(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,bi(t));break;default:bi(t)}e=e.sibling}}function yr(e,t){for(;Je!==null;){var l=Je;switch(l.tag){case 0:case 11:case 15:dl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ka(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,Je=a;else e:for(l=e;Je!==null;){a=Je;var n=a.sibling,i=a.return;if(ir(a),a===l){Je=null;break e}if(n!==null){n.return=i,Je=n;break e}Je=i}}}var Sm={getCacheForType:function(e){var t=$e(Ge),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return $e(Ge).controller.signal}},jm=typeof WeakMap=="function"?WeakMap:Map,ye=0,ze=null,ue=null,fe=0,ge=0,vt=null,hl=!1,pa=!1,Nc=!1,Ft=0,qe=0,ml=0,Ll=0,Dc=0,gt=0,ba=0,rn=null,ct=null,Mc=!1,xi=0,vr=0,Si=1/0,ji=null,yl=null,Ve=0,vl=null,xa=null,It=0,Rc=0,Uc=null,gr=null,dn=0,qc=null;function pt(){return(ye&2)!==0&&fe!==0?fe&-fe:E.T!==null?Xc():Ds()}function pr(){if(gt===0)if((fe&536870912)===0||re){var e=Nn;Nn<<=1,(Nn&3932160)===0&&(Nn=262144),gt=e}else gt=536870912;return e=mt.current,e!==null&&(e.flags|=32),gt}function st(e,t,l){(e===ze&&(ge===2||ge===9)||e.cancelPendingCommit!==null)&&(Sa(e,0),gl(e,fe,gt,!1)),Ma(e,l),((ye&2)===0||e!==ze)&&(e===ze&&((ye&2)===0&&(Ll|=l),qe===4&&gl(e,fe,gt,!1)),qt(e))}function br(e,t,l){if((ye&6)!==0)throw Error(o(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Da(e,t),n=a?Am(e,t):Bc(e,t,!0),i=a;do{if(n===0){pa&&!a&&gl(e,t,0,!1);break}else{if(l=e.current.alternate,i&&!Tm(l)){n=Bc(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var f=e;n=rn;var r=f.current.memoizedState.isDehydrated;if(r&&(Sa(f,c).flags|=256),c=Bc(f,c,!1),c!==2){if(Nc&&!r){f.errorRecoveryDisabledLanes|=i,Ll|=i,n=4;break e}i=ct,ct=n,i!==null&&(ct===null?ct=i:ct.push.apply(ct,i))}n=c}if(i=!1,n!==2)continue}}if(n===1){Sa(e,0),gl(e,t,0,!0);break}e:{switch(a=e,i=n,i){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:gl(a,t,gt,!hl);break e;case 2:ct=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(n=xi+300-ft(),10<n)){if(gl(a,t,gt,!hl),Mn(a,0,!0)!==0)break e;It=t,a.timeoutHandle=$r(xr.bind(null,a,l,ct,ji,Mc,t,gt,Ll,ba,hl,i,"Throttled",-0,0),n);break e}xr(a,l,ct,ji,Mc,t,gt,Ll,ba,hl,i,null,-0,0)}}break}while(!0);qt(e)}function xr(e,t,l,a,n,i,c,f,r,g,A,D,p,j){if(e.timeoutHandle=-1,D=t.subtreeFlags,D&8192||(D&16785408)===16785408){D={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bt},dr(t,i,D);var X=(i&62914560)===i?xi-ft():(i&4194048)===i?vr-ft():0;if(X=cy(D,X),X!==null){It=i,e.cancelPendingCommit=X(Or.bind(null,e,t,i,l,a,n,c,f,r,A,D,null,p,j)),gl(e,i,c,!g);return}}Or(e,t,i,l,a,n,c,f,r)}function Tm(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var n=l[a],i=n.getSnapshot;n=n.value;try{if(!dt(i(),n))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gl(e,t,l,a){t&=~Dc,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var i=31-rt(n),c=1<<i;a[i]=-1,n&=~c}l!==0&&Os(e,l,t)}function Ti(){return(ye&6)===0?(hn(0),!1):!0}function Hc(){if(ue!==null){if(ge===0)var e=ue.return;else e=ue,Xt=Ul=null,Iu(e),ra=null,ka=0,e=ue;for(;e!==null;)Fo(e.alternate,e),e=e.return;ue=null}}function Sa(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Lm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),It=0,Hc(),ze=e,ue=l=wt(e.current,null),fe=t,ge=0,vt=null,hl=!1,pa=Da(e,t),Nc=!1,ba=gt=Dc=Ll=ml=qe=0,ct=rn=null,Mc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-rt(a),i=1<<n;t|=e[n],a&=~i}return Ft=t,Zn(),l}function Sr(e,t){ee=null,E.H=ln,t===oa||t===In?(t=Hf(),ge=3):t===Gu?(t=Hf(),ge=4):ge=t===mc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,vt=t,ue===null&&(qe=1,di(e,jt(t,e.current)))}function jr(){var e=mt.current;return e===null?!0:(fe&4194048)===fe?_t===null:(fe&62914560)===fe||(fe&536870912)!==0?e===_t:!1}function Tr(){var e=E.H;return E.H=ln,e===null?ln:e}function Er(){var e=E.A;return E.A=Sm,e}function Ei(){qe=4,hl||(fe&4194048)!==fe&&mt.current!==null||(pa=!0),(ml&134217727)===0&&(Ll&134217727)===0||ze===null||gl(ze,fe,gt,!1)}function Bc(e,t,l){var a=ye;ye|=2;var n=Tr(),i=Er();(ze!==e||fe!==t)&&(ji=null,Sa(e,t)),t=!1;var c=qe;e:do try{if(ge!==0&&ue!==null){var f=ue,r=vt;switch(ge){case 8:Hc(),c=6;break e;case 3:case 2:case 9:case 6:mt.current===null&&(t=!0);var g=ge;if(ge=0,vt=null,ja(e,f,r,g),l&&pa){c=0;break e}break;default:g=ge,ge=0,vt=null,ja(e,f,r,g)}}Em(),c=qe;break}catch(A){Sr(e,A)}while(!0);return t&&e.shellSuspendCounter++,Xt=Ul=null,ye=a,E.H=n,E.A=i,ue===null&&(ze=null,fe=0,Zn()),c}function Em(){for(;ue!==null;)Ar(ue)}function Am(e,t){var l=ye;ye|=2;var a=Tr(),n=Er();ze!==e||fe!==t?(ji=null,Si=ft()+500,Sa(e,t)):pa=Da(e,t);e:do try{if(ge!==0&&ue!==null){t=ue;var i=vt;t:switch(ge){case 1:ge=0,vt=null,ja(e,t,i,1);break;case 2:case 9:if(Uf(i)){ge=0,vt=null,_r(t);break}t=function(){ge!==2&&ge!==9||ze!==e||(ge=7),qt(e)},i.then(t,t);break e;case 3:ge=7;break e;case 4:ge=5;break e;case 7:Uf(i)?(ge=0,vt=null,_r(t)):(ge=0,vt=null,ja(e,t,i,7));break;case 5:var c=null;switch(ue.tag){case 26:c=ue.memoizedState;case 5:case 27:var f=ue;if(c?rd(c):f.stateNode.complete){ge=0,vt=null;var r=f.sibling;if(r!==null)ue=r;else{var g=f.return;g!==null?(ue=g,Ai(g)):ue=null}break t}}ge=0,vt=null,ja(e,t,i,5);break;case 6:ge=0,vt=null,ja(e,t,i,6);break;case 8:Hc(),qe=6;break e;default:throw Error(o(462))}}_m();break}catch(A){Sr(e,A)}while(!0);return Xt=Ul=null,E.H=a,E.A=n,ye=l,ue!==null?0:(ze=null,fe=0,Zn(),qe)}function _m(){for(;ue!==null&&!Wd();)Ar(ue)}function Ar(e){var t=Wo(e.alternate,e,Ft);e.memoizedProps=e.pendingProps,t===null?Ai(e):ue=t}function _r(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Lo(l,t,t.pendingProps,t.type,void 0,fe);break;case 11:t=Lo(l,t,t.pendingProps,t.type.render,t.ref,fe);break;case 5:Iu(t);default:Fo(l,t),t=ue=Tf(t,Ft),t=Wo(l,t,Ft)}e.memoizedProps=e.pendingProps,t===null?Ai(e):ue=t}function ja(e,t,l,a){Xt=Ul=null,Iu(t),ra=null,ka=0;var n=t.return;try{if(mm(e,n,t,l,fe)){qe=1,di(e,jt(l,e.current)),ue=null;return}}catch(i){if(n!==null)throw ue=n,i;qe=1,di(e,jt(l,e.current)),ue=null;return}t.flags&32768?(re||a===1?e=!0:pa||(fe&536870912)!==0?e=!1:(hl=e=!0,(a===2||a===9||a===3||a===6)&&(a=mt.current,a!==null&&a.tag===13&&(a.flags|=16384))),zr(t,e)):Ai(t)}function Ai(e){var t=e;do{if((t.flags&32768)!==0){zr(t,hl);return}e=t.return;var l=gm(t.alternate,t,Ft);if(l!==null){ue=l;return}if(t=t.sibling,t!==null){ue=t;return}ue=t=e}while(t!==null);qe===0&&(qe=5)}function zr(e,t){do{var l=pm(e.alternate,e);if(l!==null){l.flags&=32767,ue=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ue=e;return}ue=e=l}while(e!==null);qe=6,ue=null}function Or(e,t,l,a,n,i,c,f,r){e.cancelPendingCommit=null;do _i();while(Ve!==0);if((ye&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(i=t.lanes|t.childLanes,i|=Au,ih(e,l,i,c,f,r),e===ze&&(ue=ze=null,fe=0),xa=t,vl=e,It=l,Rc=i,Uc=n,gr=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Nm(On,function(){return Rr(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=E.T,E.T=null,n=N.p,N.p=2,c=ye,ye|=4;try{bm(e,t,l)}finally{ye=c,N.p=n,E.T=a}}Ve=1,Cr(),Nr(),Dr()}}function Cr(){if(Ve===1){Ve=0;var e=vl,t=xa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=E.T,E.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{fr(t,e);var i=Wc,c=mf(e.containerInfo),f=i.focusedElem,r=i.selectionRange;if(c!==f&&f&&f.ownerDocument&&hf(f.ownerDocument.documentElement,f)){if(r!==null&&xu(f)){var g=r.start,A=r.end;if(A===void 0&&(A=g),"selectionStart"in f)f.selectionStart=g,f.selectionEnd=Math.min(A,f.value.length);else{var D=f.ownerDocument||document,p=D&&D.defaultView||window;if(p.getSelection){var j=p.getSelection(),X=f.textContent.length,J=Math.min(r.start,X),Ae=r.end===void 0?J:Math.min(r.end,X);!j.extend&&J>Ae&&(c=Ae,Ae=J,J=c);var y=df(f,J),d=df(f,Ae);if(y&&d&&(j.rangeCount!==1||j.anchorNode!==y.node||j.anchorOffset!==y.offset||j.focusNode!==d.node||j.focusOffset!==d.offset)){var v=D.createRange();v.setStart(y.node,y.offset),j.removeAllRanges(),J>Ae?(j.addRange(v),j.extend(d.node,d.offset)):(v.setEnd(d.node,d.offset),j.addRange(v))}}}}for(D=[],j=f;j=j.parentNode;)j.nodeType===1&&D.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<D.length;f++){var O=D[f];O.element.scrollLeft=O.left,O.element.scrollTop=O.top}}Yi=!!kc,Wc=kc=null}finally{ye=n,N.p=a,E.T=l}}e.current=t,Ve=2}}function Nr(){if(Ve===2){Ve=0;var e=vl,t=xa,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=E.T,E.T=null;var a=N.p;N.p=2;var n=ye;ye|=4;try{nr(e,t.alternate,t)}finally{ye=n,N.p=a,E.T=l}}Ve=3}}function Dr(){if(Ve===4||Ve===3){Ve=0,$d();var e=vl,t=xa,l=It,a=gr;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ve=5:(Ve=0,xa=vl=null,Mr(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(yl=null),tu(l),t=t.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(Na,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=E.T,n=N.p,N.p=2,E.T=null;try{for(var i=e.onRecoverableError,c=0;c<a.length;c++){var f=a[c];i(f.value,{componentStack:f.stack})}}finally{E.T=t,N.p=n}}(It&3)!==0&&_i(),qt(e),n=e.pendingLanes,(l&261930)!==0&&(n&42)!==0?e===qc?dn++:(dn=0,qc=e):dn=0,hn(0)}}function Mr(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ka(t)))}function _i(){return Cr(),Nr(),Dr(),Rr()}function Rr(){if(Ve!==5)return!1;var e=vl,t=Rc;Rc=0;var l=tu(It),a=E.T,n=N.p;try{N.p=32>l?32:l,E.T=null,l=Uc,Uc=null;var i=vl,c=It;if(Ve=0,xa=vl=null,It=0,(ye&6)!==0)throw Error(o(331));var f=ye;if(ye|=4,mr(i.current),rr(i,i.current,c,l),ye=f,hn(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(Na,i)}catch{}return!0}finally{N.p=n,E.T=a,Mr(e,t)}}function Ur(e,t,l){t=jt(l,t),t=hc(e.stateNode,t,2),e=fl(e,t,2),e!==null&&(Ma(e,2),qt(e))}function pe(e,t,l){if(e.tag===3)Ur(e,e,l);else for(;t!==null;){if(t.tag===3){Ur(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(yl===null||!yl.has(a))){e=jt(l,e),l=qo(2),a=fl(t,l,2),a!==null&&(Ho(l,a,t,e),Ma(a,2),qt(a));break}}t=t.return}}function Yc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new jm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Nc=!0,n.add(l),e=zm.bind(null,e,t,l),t.then(e,e))}function zm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,ze===e&&(fe&l)===l&&(qe===4||qe===3&&(fe&62914560)===fe&&300>ft()-xi?(ye&2)===0&&Sa(e,0):Dc|=l,ba===fe&&(ba=0)),qt(e)}function qr(e,t){t===0&&(t=zs()),e=Dl(e,t),e!==null&&(Ma(e,t),qt(e))}function Om(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),qr(e,l)}function Cm(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),qr(e,l)}function Nm(e,t){return Fi(e,t)}var zi=null,Ta=null,wc=!1,Oi=!1,Gc=!1,pl=0;function qt(e){e!==Ta&&e.next===null&&(Ta===null?zi=Ta=e:Ta=Ta.next=e),Oi=!0,wc||(wc=!0,Mm())}function hn(e,t){if(!Gc&&Oi){Gc=!0;do for(var l=!1,a=zi;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var i=0;else{var c=a.suspendedLanes,f=a.pingedLanes;i=(1<<31-rt(42|e)+1)-1,i&=n&~(c&~f),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,wr(a,i))}else i=fe,i=Mn(a,a===ze?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Da(a,i)||(l=!0,wr(a,i));a=a.next}while(l);Gc=!1}}function Dm(){Hr()}function Hr(){Oi=wc=!1;var e=0;pl!==0&&Qm()&&(e=pl);for(var t=ft(),l=null,a=zi;a!==null;){var n=a.next,i=Br(a,t);i===0?(a.next=null,l===null?zi=n:l.next=n,n===null&&(Ta=l)):(l=a,(e!==0||(i&3)!==0)&&(Oi=!0)),a=n}Ve!==0&&Ve!==5||hn(e),pl!==0&&(pl=0)}function Br(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var c=31-rt(i),f=1<<c,r=n[c];r===-1?((f&l)===0||(f&a)!==0)&&(n[c]=nh(f,t)):r<=t&&(e.expiredLanes|=f),i&=~f}if(t=ze,l=fe,l=Mn(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(ge===2||ge===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Ii(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Da(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Ii(a),tu(l)){case 2:case 8:l=As;break;case 32:l=On;break;case 268435456:l=_s;break;default:l=On}return a=Yr.bind(null,e),l=Fi(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Ii(a),e.callbackPriority=2,e.callbackNode=null,2}function Yr(e,t){if(Ve!==0&&Ve!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(_i()&&e.callbackNode!==l)return null;var a=fe;return a=Mn(e,e===ze?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(br(e,a,t),Br(e,ft()),e.callbackNode!=null&&e.callbackNode===l?Yr.bind(null,e):null)}function wr(e,t){if(_i())return null;br(e,t,!0)}function Mm(){Zm(function(){(ye&6)!==0?Fi(Es,Dm):Hr()})}function Xc(){if(pl===0){var e=sa;e===0&&(e=Cn,Cn<<=1,(Cn&261888)===0&&(Cn=256)),pl=e}return pl}function Gr(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Hn(""+e)}function Xr(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Rm(e,t,l,a,n){if(t==="submit"&&l&&l.stateNode===n){var i=Gr((n[lt]||null).action),c=a.submitter;c&&(t=(t=c[lt]||null)?Gr(t.formAction):c.getAttribute("formAction"),t!==null&&(i=t,c=null));var f=new Gn("action","action",null,a,n);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(pl!==0){var r=c?Xr(n,c):new FormData(n);cc(l,{pending:!0,data:r,method:n.method,action:i},null,r)}}else typeof i=="function"&&(f.preventDefault(),r=c?Xr(n,c):new FormData(n),cc(l,{pending:!0,data:r,method:n.method,action:i},i,r))},currentTarget:n}]})}}for(var Qc=0;Qc<Eu.length;Qc++){var Lc=Eu[Qc],Um=Lc.toLowerCase(),qm=Lc[0].toUpperCase()+Lc.slice(1);Ct(Um,"on"+qm)}Ct(gf,"onAnimationEnd"),Ct(pf,"onAnimationIteration"),Ct(bf,"onAnimationStart"),Ct("dblclick","onDoubleClick"),Ct("focusin","onFocus"),Ct("focusout","onBlur"),Ct(Fh,"onTransitionRun"),Ct(Ih,"onTransitionStart"),Ct(Ph,"onTransitionCancel"),Ct(xf,"onTransitionEnd"),kl("onMouseEnter",["mouseout","mouseover"]),kl("onMouseLeave",["mouseout","mouseover"]),kl("onPointerEnter",["pointerout","pointerover"]),kl("onPointerLeave",["pointerout","pointerover"]),zl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zl("onBeforeInput",["compositionend","keypress","textInput","paste"]),zl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Hm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mn));function Qr(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],n=a.event;a=a.listeners;e:{var i=void 0;if(t)for(var c=a.length-1;0<=c;c--){var f=a[c],r=f.instance,g=f.currentTarget;if(f=f.listener,r!==i&&n.isPropagationStopped())break e;i=f,n.currentTarget=g;try{i(n)}catch(A){Ln(A)}n.currentTarget=null,i=r}else for(c=0;c<a.length;c++){if(f=a[c],r=f.instance,g=f.currentTarget,f=f.listener,r!==i&&n.isPropagationStopped())break e;i=f,n.currentTarget=g;try{i(n)}catch(A){Ln(A)}n.currentTarget=null,i=r}}}}function ce(e,t){var l=t[lu];l===void 0&&(l=t[lu]=new Set);var a=e+"__bubble";l.has(a)||(Lr(t,e,2,!1),l.add(a))}function Zc(e,t,l){var a=0;t&&(a|=4),Lr(l,e,a,t)}var Ci="_reactListening"+Math.random().toString(36).slice(2);function Vc(e){if(!e[Ci]){e[Ci]=!0,Us.forEach(function(l){l!=="selectionchange"&&(Hm.has(l)||Zc(l,!1,e),Zc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ci]||(t[Ci]=!0,Zc("selectionchange",!1,t))}}function Lr(e,t,l,a){switch(pd(t)){case 2:var n=oy;break;case 8:n=ry;break;default:n=us}l=n.bind(null,t,l,e),n=void 0,!ru||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,l,{capture:!0,passive:n}):e.addEventListener(t,l,!0):n!==void 0?e.addEventListener(t,l,{passive:n}):e.addEventListener(t,l,!1)}function Kc(e,t,l,a,n){var i=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var c=a.tag;if(c===3||c===4){var f=a.stateNode.containerInfo;if(f===n)break;if(c===4)for(c=a.return;c!==null;){var r=c.tag;if((r===3||r===4)&&c.stateNode.containerInfo===n)return;c=c.return}for(;f!==null;){if(c=Vl(f),c===null)return;if(r=c.tag,r===5||r===6||r===26||r===27){a=i=c;continue e}f=f.parentNode}}a=a.return}Ks(function(){var g=i,A=fu(l),D=[];e:{var p=Sf.get(e);if(p!==void 0){var j=Gn,X=e;switch(e){case"keypress":if(Yn(l)===0)break e;case"keydown":case"keyup":j=Ch;break;case"focusin":X="focus",j=yu;break;case"focusout":X="blur",j=yu;break;case"beforeblur":case"afterblur":j=yu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":j=Ws;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=gh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=Mh;break;case gf:case pf:case bf:j=xh;break;case xf:j=Uh;break;case"scroll":case"scrollend":j=yh;break;case"wheel":j=Hh;break;case"copy":case"cut":case"paste":j=jh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=Fs;break;case"toggle":case"beforetoggle":j=Yh}var J=(t&4)!==0,Ae=!J&&(e==="scroll"||e==="scrollend"),y=J?p!==null?p+"Capture":null:p;J=[];for(var d=g,v;d!==null;){var O=d;if(v=O.stateNode,O=O.tag,O!==5&&O!==26&&O!==27||v===null||y===null||(O=qa(d,y),O!=null&&J.push(yn(d,O,v))),Ae)break;d=d.return}0<J.length&&(p=new j(p,X,null,l,A),D.push({event:p,listeners:J}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",j=e==="mouseout"||e==="pointerout",p&&l!==su&&(X=l.relatedTarget||l.fromElement)&&(Vl(X)||X[Zl]))break e;if((j||p)&&(p=A.window===A?A:(p=A.ownerDocument)?p.defaultView||p.parentWindow:window,j?(X=l.relatedTarget||l.toElement,j=g,X=X?Vl(X):null,X!==null&&(Ae=_(X),J=X.tag,X!==Ae||J!==5&&J!==27&&J!==6)&&(X=null)):(j=null,X=g),j!==X)){if(J=Ws,O="onMouseLeave",y="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(J=Fs,O="onPointerLeave",y="onPointerEnter",d="pointer"),Ae=j==null?p:Ua(j),v=X==null?p:Ua(X),p=new J(O,d+"leave",j,l,A),p.target=Ae,p.relatedTarget=v,O=null,Vl(A)===g&&(J=new J(y,d+"enter",X,l,A),J.target=v,J.relatedTarget=Ae,O=J),Ae=O,j&&X)t:{for(J=Bm,y=j,d=X,v=0,O=y;O;O=J(O))v++;O=0;for(var K=d;K;K=J(K))O++;for(;0<v-O;)y=J(y),v--;for(;0<O-v;)d=J(d),O--;for(;v--;){if(y===d||d!==null&&y===d.alternate){J=y;break t}y=J(y),d=J(d)}J=null}else J=null;j!==null&&Zr(D,p,j,J,!1),X!==null&&Ae!==null&&Zr(D,Ae,X,J,!0)}}e:{if(p=g?Ua(g):window,j=p.nodeName&&p.nodeName.toLowerCase(),j==="select"||j==="input"&&p.type==="file")var he=uf;else if(af(p))if(cf)he=kh;else{he=Kh;var L=Vh}else j=p.nodeName,!j||j.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?g&&cu(g.elementType)&&(he=uf):he=Jh;if(he&&(he=he(e,g))){nf(D,he,l,A);break e}L&&L(e,p,g),e==="focusout"&&g&&p.type==="number"&&g.memoizedProps.value!=null&&uu(p,"number",p.value)}switch(L=g?Ua(g):window,e){case"focusin":(af(L)||L.contentEditable==="true")&&(ea=L,Su=g,La=null);break;case"focusout":La=Su=ea=null;break;case"mousedown":ju=!0;break;case"contextmenu":case"mouseup":case"dragend":ju=!1,yf(D,l,A);break;case"selectionchange":if($h)break;case"keydown":case"keyup":yf(D,l,A)}var te;if(gu)e:{switch(e){case"compositionstart":var oe="onCompositionStart";break e;case"compositionend":oe="onCompositionEnd";break e;case"compositionupdate":oe="onCompositionUpdate";break e}oe=void 0}else Pl?tf(e,l)&&(oe="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(oe="onCompositionStart");oe&&(Is&&l.locale!=="ko"&&(Pl||oe!=="onCompositionStart"?oe==="onCompositionEnd"&&Pl&&(te=Js()):(ll=A,du="value"in ll?ll.value:ll.textContent,Pl=!0)),L=Ni(g,oe),0<L.length&&(oe=new $s(oe,e,null,l,A),D.push({event:oe,listeners:L}),te?oe.data=te:(te=lf(l),te!==null&&(oe.data=te)))),(te=Gh?Xh(e,l):Qh(e,l))&&(oe=Ni(g,"onBeforeInput"),0<oe.length&&(L=new $s("onBeforeInput","beforeinput",null,l,A),D.push({event:L,listeners:oe}),L.data=te)),Rm(D,e,g,l,A)}Qr(D,t)})}function yn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Ni(e,t){for(var l=t+"Capture",a=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=qa(e,l),n!=null&&a.unshift(yn(e,n,i)),n=qa(e,t),n!=null&&a.push(yn(e,n,i))),e.tag===3)return a;e=e.return}return[]}function Bm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zr(e,t,l,a,n){for(var i=t._reactName,c=[];l!==null&&l!==a;){var f=l,r=f.alternate,g=f.stateNode;if(f=f.tag,r!==null&&r===a)break;f!==5&&f!==26&&f!==27||g===null||(r=g,n?(g=qa(l,i),g!=null&&c.unshift(yn(l,g,r))):n||(g=qa(l,i),g!=null&&c.push(yn(l,g,r)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var Ym=/\r\n?/g,wm=/\u0000|\uFFFD/g;function Vr(e){return(typeof e=="string"?e:""+e).replace(Ym,`++`).replace(wm,"")}function Kr(e,t){return t=Vr(t),Vr(e)===t}function Ee(e,t,l,a,n,i){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||$l(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&$l(e,""+a);break;case"className":Un(e,"class",a);break;case"tabIndex":Un(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Un(e,l,a);break;case"style":Zs(e,a,i);break;case"data":if(t!=="object"){Un(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(l==="formAction"?(t!=="input"&&Ee(e,t,"name",n.name,n,null),Ee(e,t,"formEncType",n.formEncType,n,null),Ee(e,t,"formMethod",n.formMethod,n,null),Ee(e,t,"formTarget",n.formTarget,n,null)):(Ee(e,t,"encType",n.encType,n,null),Ee(e,t,"method",n.method,n,null),Ee(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Hn(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Hn(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":ce("beforetoggle",e),ce("toggle",e),Rn(e,"popover",a);break;case"xlinkActuate":Ht(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ht(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ht(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ht(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ht(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ht(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ht(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Rn(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=hh.get(l)||l,Rn(e,l,a))}}function Jc(e,t,l,a,n,i){switch(l){case"style":Zs(e,a,i);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof a=="string"?$l(e,a):(typeof a=="number"||typeof a=="bigint")&&$l(e,""+a);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Bt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qs.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(n=l.endsWith("Capture"),t=l.slice(2,n?l.length-7:void 0),i=e[lt]||null,i=i!=null?i[l]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof a=="function")){typeof i!="function"&&i!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,n);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):Rn(e,l,a)}}}function Ie(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ce("error",e),ce("load",e);var a=!1,n=!1,i;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];if(c!=null)switch(i){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ee(e,t,i,c,l,null)}}n&&Ee(e,t,"srcSet",l.srcSet,l,null),a&&Ee(e,t,"src",l.src,l,null);return;case"input":ce("invalid",e);var f=i=c=n=null,r=null,g=null;for(a in l)if(l.hasOwnProperty(a)){var A=l[a];if(A!=null)switch(a){case"name":n=A;break;case"type":c=A;break;case"checked":r=A;break;case"defaultChecked":g=A;break;case"value":i=A;break;case"defaultValue":f=A;break;case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(o(137,t));break;default:Ee(e,t,a,A,l,null)}}Gs(e,i,f,r,g,c,n,!1);return;case"select":ce("invalid",e),a=c=i=null;for(n in l)if(l.hasOwnProperty(n)&&(f=l[n],f!=null))switch(n){case"value":i=f;break;case"defaultValue":c=f;break;case"multiple":a=f;default:Ee(e,t,n,f,l,null)}t=i,l=c,e.multiple=!!a,t!=null?Wl(e,!!a,t,!1):l!=null&&Wl(e,!!a,l,!0);return;case"textarea":ce("invalid",e),i=n=a=null;for(c in l)if(l.hasOwnProperty(c)&&(f=l[c],f!=null))switch(c){case"value":a=f;break;case"defaultValue":n=f;break;case"children":i=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:Ee(e,t,c,f,l,null)}Qs(e,a,n,i);return;case"option":for(r in l)if(l.hasOwnProperty(r)&&(a=l[r],a!=null))switch(r){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ee(e,t,r,a,l,null)}return;case"dialog":ce("beforetoggle",e),ce("toggle",e),ce("cancel",e),ce("close",e);break;case"iframe":case"object":ce("load",e);break;case"video":case"audio":for(a=0;a<mn.length;a++)ce(mn[a],e);break;case"image":ce("error",e),ce("load",e);break;case"details":ce("toggle",e);break;case"embed":case"source":case"link":ce("error",e),ce("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(g in l)if(l.hasOwnProperty(g)&&(a=l[g],a!=null))switch(g){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ee(e,t,g,a,l,null)}return;default:if(cu(t)){for(A in l)l.hasOwnProperty(A)&&(a=l[A],a!==void 0&&Jc(e,t,A,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Ee(e,t,f,a,l,null))}function Gm(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,c=null,f=null,r=null,g=null,A=null;for(j in l){var D=l[j];if(l.hasOwnProperty(j)&&D!=null)switch(j){case"checked":break;case"value":break;case"defaultValue":r=D;default:a.hasOwnProperty(j)||Ee(e,t,j,null,a,D)}}for(var p in a){var j=a[p];if(D=l[p],a.hasOwnProperty(p)&&(j!=null||D!=null))switch(p){case"type":i=j;break;case"name":n=j;break;case"checked":g=j;break;case"defaultChecked":A=j;break;case"value":c=j;break;case"defaultValue":f=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(o(137,t));break;default:j!==D&&Ee(e,t,p,j,a,D)}}iu(e,c,f,r,g,A,i,n);return;case"select":j=c=f=p=null;for(i in l)if(r=l[i],l.hasOwnProperty(i)&&r!=null)switch(i){case"value":break;case"multiple":j=r;default:a.hasOwnProperty(i)||Ee(e,t,i,null,a,r)}for(n in a)if(i=a[n],r=l[n],a.hasOwnProperty(n)&&(i!=null||r!=null))switch(n){case"value":p=i;break;case"defaultValue":f=i;break;case"multiple":c=i;default:i!==r&&Ee(e,t,n,i,a,r)}t=f,l=c,a=j,p!=null?Wl(e,!!l,p,!1):!!a!=!!l&&(t!=null?Wl(e,!!l,t,!0):Wl(e,!!l,l?[]:"",!1));return;case"textarea":j=p=null;for(f in l)if(n=l[f],l.hasOwnProperty(f)&&n!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Ee(e,t,f,null,a,n)}for(c in a)if(n=a[c],i=l[c],a.hasOwnProperty(c)&&(n!=null||i!=null))switch(c){case"value":p=n;break;case"defaultValue":j=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(o(91));break;default:n!==i&&Ee(e,t,c,n,a,i)}Xs(e,p,j);return;case"option":for(var X in l)if(p=l[X],l.hasOwnProperty(X)&&p!=null&&!a.hasOwnProperty(X))switch(X){case"selected":e.selected=!1;break;default:Ee(e,t,X,null,a,p)}for(r in a)if(p=a[r],j=l[r],a.hasOwnProperty(r)&&p!==j&&(p!=null||j!=null))switch(r){case"selected":e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Ee(e,t,r,p,a,j)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var J in l)p=l[J],l.hasOwnProperty(J)&&p!=null&&!a.hasOwnProperty(J)&&Ee(e,t,J,null,a,p);for(g in a)if(p=a[g],j=l[g],a.hasOwnProperty(g)&&p!==j&&(p!=null||j!=null))switch(g){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(137,t));break;default:Ee(e,t,g,p,a,j)}return;default:if(cu(t)){for(var Ae in l)p=l[Ae],l.hasOwnProperty(Ae)&&p!==void 0&&!a.hasOwnProperty(Ae)&&Jc(e,t,Ae,void 0,a,p);for(A in a)p=a[A],j=l[A],!a.hasOwnProperty(A)||p===j||p===void 0&&j===void 0||Jc(e,t,A,p,a,j);return}}for(var y in l)p=l[y],l.hasOwnProperty(y)&&p!=null&&!a.hasOwnProperty(y)&&Ee(e,t,y,null,a,p);for(D in a)p=a[D],j=l[D],!a.hasOwnProperty(D)||p===j||p==null&&j==null||Ee(e,t,D,p,a,j)}function Jr(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var n=l[a],i=n.transferSize,c=n.initiatorType,f=n.duration;if(i&&f&&Jr(c)){for(c=0,f=n.responseEnd,a+=1;a<l.length;a++){var r=l[a],g=r.startTime;if(g>f)break;var A=r.transferSize,D=r.initiatorType;A&&Jr(D)&&(r=r.responseEnd,c+=A*(r<f?1:(f-g)/(r-g)))}if(--a,t+=8*(i+c)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var kc=null,Wc=null;function Di(e){return e.nodeType===9?e:e.ownerDocument}function kr(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Wr(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function $c(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Fc=null;function Qm(){var e=window.event;return e&&e.type==="popstate"?e===Fc?!1:(Fc=e,!0):(Fc=null,!1)}var $r=typeof setTimeout=="function"?setTimeout:void 0,Lm=typeof clearTimeout=="function"?clearTimeout:void 0,Fr=typeof Promise=="function"?Promise:void 0,Zm=typeof queueMicrotask=="function"?queueMicrotask:typeof Fr<"u"?function(e){return Fr.resolve(null).then(e).catch(Vm)}:$r;function Vm(e){setTimeout(function(){throw e})}function bl(e){return e==="head"}function Ir(e,t){var l=t,a=0;do{var n=l.nextSibling;if(e.removeChild(l),n&&n.nodeType===8)if(l=n.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(n),za(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")vn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,vn(l);for(var i=l.firstChild;i;){var c=i.nextSibling,f=i.nodeName;i[Ra]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&i.rel.toLowerCase()==="stylesheet"||l.removeChild(i),i=c}}else l==="body"&&vn(e.ownerDocument.body);l=n}while(l);za(t)}function Pr(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Ic(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ic(l),au(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Km(e,t,l,a){for(;e.nodeType===1;){var n=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Ra])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=zt(e.nextSibling),e===null)break}return null}function Jm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=zt(e.nextSibling),e===null))return null;return e}function ed(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=zt(e.nextSibling),e===null))return null;return e}function Pc(e){return e.data==="$?"||e.data==="$~"}function es(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function km(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function zt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ts=null;function td(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return zt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function ld(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function ad(e,t,l){switch(t=Di(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function vn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);au(e)}var Ot=new Map,nd=new Set;function Mi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pt=N.d;N.d={f:Wm,r:$m,D:Fm,C:Im,L:Pm,m:ey,X:ly,S:ty,M:ay};function Wm(){var e=Pt.f(),t=Ti();return e||t}function $m(e){var t=Kl(e);t!==null&&t.tag===5&&t.type==="form"?So(t):Pt.r(e)}var Ea=typeof document>"u"?null:document;function id(e,t,l){var a=Ea;if(a&&typeof t=="string"&&t){var n=xt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),nd.has(n)||(nd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function Fm(e){Pt.D(e),id("dns-prefetch",e,null)}function Im(e,t){Pt.C(e,t),id("preconnect",e,t)}function Pm(e,t,l){Pt.L(e,t,l);var a=Ea;if(a&&e&&t){var n='link[rel="preload"][as="'+xt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+xt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+xt(l.imageSizes)+'"]')):n+='[href="'+xt(e)+'"]';var i=n;switch(t){case"style":i=Aa(e);break;case"script":i=_a(e)}Ot.has(i)||(e=S({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ot.set(i,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(gn(i))||t==="script"&&a.querySelector(pn(i))||(t=a.createElement("link"),Ie(t,"link",e),Ke(t),a.head.appendChild(t)))}}function ey(e,t){Pt.m(e,t);var l=Ea;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+xt(a)+'"][href="'+xt(e)+'"]',i=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=_a(e)}if(!Ot.has(i)&&(e=S({rel:"modulepreload",href:e},t),Ot.set(i,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(pn(i)))return}a=l.createElement("link"),Ie(a,"link",e),Ke(a),l.head.appendChild(a)}}}function ty(e,t,l){Pt.S(e,t,l);var a=Ea;if(a&&e){var n=Jl(a).hoistableStyles,i=Aa(e);t=t||"default";var c=n.get(i);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(gn(i)))f.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ot.get(i))&&ls(e,l);var r=c=a.createElement("link");Ke(r),Ie(r,"link",e),r._p=new Promise(function(g,A){r.onload=g,r.onerror=A}),r.addEventListener("load",function(){f.loading|=1}),r.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Ri(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:f},n.set(i,c)}}}function ly(e,t){Pt.X(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),i=a.get(n);i||(i=l.querySelector(pn(n)),i||(e=S({src:e,async:!0},t),(t=Ot.get(n))&&as(e,t),i=l.createElement("script"),Ke(i),Ie(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function ay(e,t){Pt.M(e,t);var l=Ea;if(l&&e){var a=Jl(l).hoistableScripts,n=_a(e),i=a.get(n);i||(i=l.querySelector(pn(n)),i||(e=S({src:e,async:!0,type:"module"},t),(t=Ot.get(n))&&as(e,t),i=l.createElement("script"),Ke(i),Ie(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function ud(e,t,l,a){var n=(n=ie.current)?Mi(n):null;if(!n)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Aa(l.href),l=Jl(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Aa(l.href);var i=Jl(n).hoistableStyles,c=i.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,c),(i=n.querySelector(gn(e)))&&!i._p&&(c.instance=i,c.state.loading=5),Ot.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ot.set(e,l),i||ny(n,e,l,c.state))),t&&a===null)throw Error(o(528,""));return c}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_a(l),l=Jl(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Aa(e){return'href="'+xt(e)+'"'}function gn(e){return'link[rel="stylesheet"]['+e+"]"}function cd(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function ny(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Ie(t,"link",l),Ke(t),e.head.appendChild(t))}function _a(e){return'[src="'+xt(e)+'"]'}function pn(e){return"script[async]"+e}function sd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+xt(l.href)+'"]');if(a)return t.instance=a,Ke(a),a;var n=S({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ke(a),Ie(a,"style",n),Ri(a,l.precedence,e),t.instance=a;case"stylesheet":n=Aa(l.href);var i=e.querySelector(gn(n));if(i)return t.state.loading|=4,t.instance=i,Ke(i),i;a=cd(l),(n=Ot.get(n))&&ls(a,n),i=(e.ownerDocument||e).createElement("link"),Ke(i);var c=i;return c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(i,"link",a),t.state.loading|=4,Ri(i,l.precedence,e),t.instance=i;case"script":return i=_a(l.src),(n=e.querySelector(pn(i)))?(t.instance=n,Ke(n),n):(a=l,(n=Ot.get(i))&&(a=S({},l),as(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Ke(n),Ie(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ri(a,l.precedence,e));return t.instance}function Ri(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,i=n,c=0;c<a.length;c++){var f=a[c];if(f.dataset.precedence===t)i=f;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function ls(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function as(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ui=null;function fd(e,t,l){if(Ui===null){var a=new Map,n=Ui=new Map;n.set(l,a)}else n=Ui,a=n.get(l),a||(a=new Map,n.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),n=0;n<l.length;n++){var i=l[n];if(!(i[Ra]||i[ke]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var c=i.getAttribute(t)||"";c=e+c;var f=a.get(c);f?f.push(i):a.set(c,[i])}}return a}function od(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function iy(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function rd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function uy(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Aa(a.href),i=t.querySelector(gn(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=qi.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,Ke(i);return}i=t.ownerDocument||t,a=cd(a),(n=Ot.get(n))&&ls(a,n),i=i.createElement("link"),Ke(i);var c=i;c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ie(i,"link",a),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=qi.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ns=0;function cy(e,t){return e.stylesheets&&e.count===0&&Bi(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&Bi(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&ns===0&&(ns=62500*Xm());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bi(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>ns?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function qi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hi=null;function Bi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hi=new Map,t.forEach(sy,e),Hi=null,qi.call(e))}function sy(e,t){if(!(t.state.loading&4)){var l=Hi.get(e);if(l)var a=l.get(null);else{l=new Map,Hi.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var c=n[i];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),a=c)}a&&l.set(null,a)}n=t.instance,c=n.getAttribute("data-precedence"),i=l.get(c)||a,i===a&&l.set(null,n),l.set(c,n),this.count++,a=qi.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var bn={$$typeof:le,Provider:null,Consumer:null,_currentValue:w,_currentValue2:w,_threadCount:0};function fy(e,t,l,a,n,i,c,f,r){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pi(0),this.hiddenUpdates=Pi(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=r,this.incompleteTransitions=new Map}function dd(e,t,l,a,n,i,c,f,r,g,A,D){return e=new fy(e,t,l,c,r,g,A,D,f),t=1,i===!0&&(t|=24),i=ht(3,null,null,t),e.current=i,i.stateNode=e,t=Bu(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:a,isDehydrated:l,cache:t},Xu(i),e}function hd(e){return e?(e=aa,e):aa}function md(e,t,l,a,n,i){n=hd(n),a.context===null?a.context=n:a.pendingContext=n,a=sl(t),a.payload={element:l},i=i===void 0?null:i,i!==null&&(a.callback=i),l=fl(e,a,t),l!==null&&(st(l,e,t),$a(l,e,t))}function yd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function is(e,t){yd(e,t),(e=e.alternate)&&yd(e,t)}function vd(e){if(e.tag===13||e.tag===31){var t=Dl(e,67108864);t!==null&&st(t,e,67108864),is(e,67108864)}}function gd(e){if(e.tag===13||e.tag===31){var t=pt();t=eu(t);var l=Dl(e,t);l!==null&&st(l,e,t),is(e,t)}}var Yi=!0;function oy(e,t,l,a){var n=E.T;E.T=null;var i=N.p;try{N.p=2,us(e,t,l,a)}finally{N.p=i,E.T=n}}function ry(e,t,l,a){var n=E.T;E.T=null;var i=N.p;try{N.p=8,us(e,t,l,a)}finally{N.p=i,E.T=n}}function us(e,t,l,a){if(Yi){var n=cs(a);if(n===null)Kc(e,t,a,wi,l),bd(e,a);else if(hy(n,e,t,l,a))a.stopPropagation();else if(bd(e,a),t&4&&-1<dy.indexOf(e)){for(;n!==null;){var i=Kl(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var c=_l(i.pendingLanes);if(c!==0){var f=i;for(f.pendingLanes|=2,f.entangledLanes|=2;c;){var r=1<<31-rt(c);f.entanglements[1]|=r,c&=~r}qt(i),(ye&6)===0&&(Si=ft()+500,hn(0))}}break;case 31:case 13:f=Dl(i,2),f!==null&&st(f,i,2),Ti(),is(i,2)}if(i=cs(a),i===null&&Kc(e,t,a,wi,l),i===n)break;n=i}n!==null&&a.stopPropagation()}else Kc(e,t,a,null,l)}}function cs(e){return e=fu(e),ss(e)}var wi=null;function ss(e){if(wi=null,e=Vl(e),e!==null){var t=_(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=q(t),e!==null)return e;e=null}else if(l===31){if(e=H(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return wi=e,null}function pd(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Fd()){case Es:return 2;case As:return 8;case On:case Id:return 32;case _s:return 268435456;default:return 32}default:return 32}}var fs=!1,xl=null,Sl=null,jl=null,xn=new Map,Sn=new Map,Tl=[],dy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function bd(e,t){switch(e){case"focusin":case"focusout":xl=null;break;case"dragenter":case"dragleave":Sl=null;break;case"mouseover":case"mouseout":jl=null;break;case"pointerover":case"pointerout":xn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sn.delete(t.pointerId)}}function jn(e,t,l,a,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:i,targetContainers:[n]},t!==null&&(t=Kl(t),t!==null&&vd(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function hy(e,t,l,a,n){switch(t){case"focusin":return xl=jn(xl,e,t,l,a,n),!0;case"dragenter":return Sl=jn(Sl,e,t,l,a,n),!0;case"mouseover":return jl=jn(jl,e,t,l,a,n),!0;case"pointerover":var i=n.pointerId;return xn.set(i,jn(xn.get(i)||null,e,t,l,a,n)),!0;case"gotpointercapture":return i=n.pointerId,Sn.set(i,jn(Sn.get(i)||null,e,t,l,a,n)),!0}return!1}function xd(e){var t=Vl(e.target);if(t!==null){var l=_(t);if(l!==null){if(t=l.tag,t===13){if(t=q(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===31){if(t=H(l),t!==null){e.blockedOn=t,Ms(e.priority,function(){gd(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=cs(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);su=a,l.target.dispatchEvent(a),su=null}else return t=Kl(l),t!==null&&vd(t),e.blockedOn=l,!1;t.shift()}return!0}function Sd(e,t,l){Gi(e)&&l.delete(t)}function my(){fs=!1,xl!==null&&Gi(xl)&&(xl=null),Sl!==null&&Gi(Sl)&&(Sl=null),jl!==null&&Gi(jl)&&(jl=null),xn.forEach(Sd),Sn.forEach(Sd)}function Xi(e,t){e.blockedOn===t&&(e.blockedOn=null,fs||(fs=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,my)))}var Qi=null;function jd(e){Qi!==e&&(Qi=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Qi===e&&(Qi=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],n=e[t+2];if(typeof a!="function"){if(ss(a||l)===null)continue;break}var i=Kl(l);i!==null&&(e.splice(t,3),t-=3,cc(i,{pending:!0,data:n,method:l.method,action:a},a,n))}}))}function za(e){function t(r){return Xi(r,e)}xl!==null&&Xi(xl,e),Sl!==null&&Xi(Sl,e),jl!==null&&Xi(jl,e),xn.forEach(t),Sn.forEach(t);for(var l=0;l<Tl.length;l++){var a=Tl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Tl.length&&(l=Tl[0],l.blockedOn===null);)xd(l),l.blockedOn===null&&Tl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var n=l[a],i=l[a+1],c=n[lt]||null;if(typeof i=="function")c||jd(l);else if(c){var f=null;if(i&&i.hasAttribute("formAction")){if(n=i,c=i[lt]||null)f=c.formAction;else if(ss(n)!==null)continue}else f=c.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),jd(l)}}}function Td(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(c){return n=c})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function os(e){this._internalRoot=e}Li.prototype.render=os.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,a=pt();md(l,a,e,t,null,null)},Li.prototype.unmount=os.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;md(e.current,2,null,e,null,null),Ti(),t[Zl]=null}};function Li(e){this._internalRoot=e}Li.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ds();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Tl.length&&t!==0&&t<Tl[l].priority;l++);Tl.splice(l,0,e),l===0&&xd(e)}};var Ed=x.version;if(Ed!=="19.2.5")throw Error(o(527,Ed,"19.2.5"));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?U(e):null,e=e===null?null:e.stateNode,e};var yy={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zi.isDisabled&&Zi.supportsFiber)try{Na=Zi.inject(yy),ot=Zi}catch{}}return En.createRoot=function(e,t){if(!T(e))throw Error(o(299));var l=!1,a="",n=Do,i=Mo,c=Ro;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dd(e,1,!1,null,null,l,a,null,n,i,c,Td),e[Zl]=t.current,Vc(e),new os(t)},En.hydrateRoot=function(e,t,l){if(!T(e))throw Error(o(299));var a=!1,n="",i=Do,c=Mo,f=Ro,r=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(n=l.identifierPrefix),l.onUncaughtError!==void 0&&(i=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(r=l.formState)),t=dd(e,1,!0,t,l??null,a,n,r,i,c,f,Td),t.context=hd(null),l=t.current,a=pt(),a=eu(a),n=sl(a),n.callback=null,fl(l,n,a),l=a,t.current.lanes=l,Ma(t,l),qt(t),e[Zl]=t.current,Vc(e),new Li(t)},En.version="19.2.5",En}var Ud;function Ay(){if(Ud)return hs.exports;Ud=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(x){console.error(x)}}return s(),hs.exports=Ey(),hs.exports}var _y=Ay();const zy=Gd(_y),Qd="";class An extends Error{constructor(x,b,o){super(x),this.status=b,this.outcome=o}}function Ss(s){return s instanceof An?s.outcome?s.outcome==="unknown":s.status>=500||s.status===408:!0}async function Ce(s,x){const b=await fetch(`${Qd}${s}`,{...x,credentials:"same-origin",headers:{"Content-Type":"application/json",...x==null?void 0:x.headers}});if(!b.ok){const o=await b.json().catch(()=>null);b.status===401&&(window.location.hash="#login");const T=b.status===429?` Wait ${b.headers.get("retry-after")||"60"} seconds before retrying.`:"",_=typeof(o==null?void 0:o.message)=="string"?o.message:typeof(o==null?void 0:o.error)=="string"?o.error:`HTTP ${b.status}`,q=typeof(o==null?void 0:o.next_action)=="string"?` ${o.next_action}`:"",H=(o==null?void 0:o.outcome)==="unknown"||(o==null?void 0:o.outcome)==="failed"?o.outcome:void 0;throw new An(_+q+T,b.status,H)}return b.json()}async function Oy(s){const x=await fetch(`${Qd}${s}`,{credentials:"same-origin"});if(x.status===401)throw window.location.hash="#login",new Error("Unauthorized");if(!x.ok)throw new Error(`HTTP ${x.status}`);return x.text()}const Oe={oauthRequest:s=>Ce(`/admin/api/oauth-requests/${encodeURIComponent(s)}`),decideOAuthRequest:(s,x,b,o)=>Ce(`/admin/api/oauth-requests/${encodeURIComponent(s)}`,{method:"POST",body:JSON.stringify(o===void 0?{decision:x,csrf:b}:{decision:x,csrf:b,source_id:o})}),login:s=>Ce("/admin/login",{method:"POST",body:JSON.stringify({token:s})}),signOutEverywhere:()=>Ce("/admin/api/sign-out-everywhere",{method:"POST"}),stats:()=>Ce("/admin/api/stats"),health:()=>Ce("/admin/api/health-indicators"),agents:()=>Ce("/admin/api/agents"),agentsSpend:()=>Ce("/admin/api/agents/spend"),sources:()=>Ce("/admin/api/sources"),grantCatalog:()=>Ce("/admin/api/grant-catalog"),clientGrant:s=>Ce(`/admin/api/grants/${encodeURIComponent(s)}`),clientDetails:s=>Ce(`/admin/api/clients/${encodeURIComponent(s)}`),clientSetup:(s,x,b)=>{const o=new URLSearchParams({harness:x});return b&&o.set("flow",b),Ce(`/admin/api/clients/${encodeURIComponent(s)}/setup?${o}`)},clientLifecycle:(s,x)=>Ce(`/admin/api/clients/${encodeURIComponent(s)}/lifecycle`,{method:"POST",body:JSON.stringify(x)}),registerClient:s=>Ce("/admin/api/register-client",{method:"POST",body:JSON.stringify(s)}),recoverClient:(s,x,b)=>Ce("/admin/api/recover-client",{method:"POST",body:JSON.stringify({clientId:s,harness:x,flow:b})}),updateClientGrant:(s,x)=>Ce("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({...x,clientId:s})}),requests:(s=1,x="")=>Ce(`/admin/api/requests?page=${s}${x}`),apiKeys:()=>Ce("/admin/api/api-keys"),createApiKey(s,x){return Ce("/admin/api/api-keys",{method:"POST",body:JSON.stringify({name:s,scopes:x})})},revokeApiKey(s){return Ce("/admin/api/api-keys/revoke",{method:"POST",body:JSON.stringify({id:s})})},updateClientTtl:(s,x)=>Ce("/admin/api/update-client-ttl",{method:"POST",body:JSON.stringify({clientId:s,tokenTtl:x})}),rescopeClient:(s,x,b)=>Ce("/admin/api/rescope-client",{method:"POST",body:JSON.stringify({clientId:s,sourceId:x,federatedRead:b})}),revokeClient:s=>Ce("/admin/api/revoke-client",{method:"POST",body:JSON.stringify({clientId:s})}),calibrationProfile:s=>Ce(`/admin/api/calibration/profile${s?`?holder=${encodeURIComponent(s)}`:""}`),calibrationChart:(s,x)=>Oy(`/admin/api/calibration/charts/${encodeURIComponent(s)}${x?`?holder=${encodeURIComponent(x)}`:""}`),jobsWatch:()=>Ce("/admin/api/jobs/watch")},ps="gbrain.pending-oauth-request",qd=s=>s!==null&&/^[a-f0-9]{64}$/.test(s);function Ki(){const s=new URL(window.location.href).searchParams.get("oauth_request");if(qd(s)){try{window.sessionStorage.setItem(ps,s)}catch{}return s}try{const x=window.sessionStorage.getItem(ps);if(qd(x))return x}catch{}}function Hd(){try{window.sessionStorage.removeItem(ps)}catch{}const s=new URL(window.location.href);s.searchParams.delete("oauth_request"),window.history.replaceState(null,"",s)}function Cy(s,x){const b=x?` --oauth-request ${x}`:"";return`Give me an owner admin login link for ${s}. On the brain host, run gbrain mcp admin login-link --url ${s}${b} using its protected owner credential. Deliver the single-use link privately and do not open it before I do.`}function Ny({onLogin:s}){const[x,b]=R.useState(""),[o,T]=R.useState(""),[_,q]=R.useState(!1),[H,z]=R.useState(!1),[h,U]=R.useState(""),[S,C]=R.useState(),[Y,G]=R.useState(""),[Z,W]=R.useState(0),ae=Ki(),$=S?Cy(S,ae):void 0;R.useEffect(()=>{let ne=!0;const be=new AbortController,k=setTimeout(()=>be.abort(),1e4);return C(void 0),G(""),z(!1),fetch("/.well-known/gbrain",{credentials:"omit",redirect:"error",cache:"no-store",signal:be.signal}).then(async V=>{if(!V.ok)throw new Error("Server discovery is unavailable.");const xe=await V.json();if(typeof(xe==null?void 0:xe.endpoint)!="string")throw new Error("Server discovery has no MCP endpoint.");const Se=new URL(xe.endpoint);if(!["https:","http:"].includes(Se.protocol)||Se.username||Se.password||Se.search||Se.hash||Se.pathname!=="/mcp")throw new Error("Server discovery returned an invalid MCP endpoint.");ne&&C(Se.toString())}).catch(()=>{ne&&G("The configured MCP endpoint could not be discovered. Ask the brain host administrator to check the server’s configured public URL. You can still sign in with the owner credential below.")}).finally(()=>clearTimeout(k)),()=>{ne=!1,clearTimeout(k),be.abort()}},[Z]);const le=async ne=>{ne.preventDefault(),T(""),q(!0);try{await Oe.login(x),b(""),s()}catch(be){T(be instanceof An&&be.status===401?"The owner bootstrap credential was not accepted. An OAuth access token or client secret cannot log into this dashboard. Ask the brain host administrator for a fresh login link.":be instanceof Error?be.message:"Could not reach the owner login service. Check the server and retry.")}finally{q(!1)}};return u.jsx("div",{className:"login-page",children:u.jsxs("section",{className:"login-box","aria-labelledby":"owner-login-title",style:{maxWidth:560},children:[u.jsx("h1",{id:"owner-login-title",className:"login-logo",children:"GBrain owner login"}),u.jsx("p",{style:{marginBottom:16},children:"Ask the agent that administers the brain host for a login link. Ordinary MCP clients cannot create owner login links, even with an admin scope."}),ae&&u.jsx("p",{role:"status",style:{marginBottom:16},children:"A client connection is waiting for owner approval. The prompt below preserves that request when you open the login link in another browser or tab."}),$&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"owner-login-prompt",children:"Prompt for the host administrator"}),u.jsx("textarea",{id:"owner-login-prompt",rows:7,readOnly:!0,value:$,style:{fontFamily:"var(--font-mono)",fontSize:12}}),u.jsx("button",{type:"button",className:"btn btn-secondary",style:{marginTop:8},onClick:()=>{U(""),navigator.clipboard.writeText($).then(()=>z(!0)).catch(()=>U("Clipboard unavailable. Select and copy the prompt above."))},children:H?"Prompt copied":"Copy owner login prompt"})]}),!$&&!Y&&u.jsx("p",{role:"status",children:"Discovering the server’s configured MCP endpoint…"}),Y&&u.jsxs("p",{role:"alert",children:[Y," ",u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>W(ne=>ne+1),children:"Retry server discovery"})]}),h&&u.jsx("p",{role:"alert",children:h}),u.jsx("p",{className:"grant-help",style:{margin:"12px 0 20px"},children:"Login links expire after five minutes and can be used once. A client’s PKCE sign-in requests access to memory; owner login approves that request."}),u.jsxs("details",{children:[u.jsx("summary",{style:{cursor:"pointer"},children:"Sign in with the owner bootstrap credential"}),u.jsxs("form",{onSubmit:le,style:{marginTop:12},children:[u.jsx("label",{htmlFor:"owner-bootstrap-token",children:"Owner bootstrap credential"}),u.jsx("input",{id:"owner-bootstrap-token",type:"password",autoComplete:"off",value:x,disabled:_,onChange:ne=>b(ne.target.value)}),u.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%",marginTop:12},disabled:_||!x.trim(),children:_?"Signing in…":"Sign in as owner"}),o&&u.jsx("p",{role:"alert",className:"login-error",children:o})]})]})]})})}function Dy(s,x,b,o=globalThis){let T=null;const _=()=>{T!==null&&(o.clearInterval(T),T=null)},q=()=>{T===null&&(T=o.setInterval(s,x))},H=()=>{if(b.hidden){_();return}s(),q()};return b.addEventListener("visibilitychange",H),b.hidden||q(),()=>{b.removeEventListener("visibilitychange",H),_()}}function My(){const[s,x]=R.useState({connected_agents:0,requests_today:0,active_tokens:0}),[b,o]=R.useState({expiring_soon:0,error_rate:"0%"}),[T,_]=R.useState([]),[q,H]=R.useState("connecting"),z=R.useRef(null);R.useEffect(()=>{const U=()=>{Oe.stats().then(x).catch(()=>{}),Oe.health().then(o).catch(()=>{})};U();const S=new EventSource("/admin/events",{withCredentials:!0});z.current=S,S.onopen=()=>H("connected"),S.onmessage=Y=>{try{const G=JSON.parse(Y.data);_(Z=>[G,...Z].slice(0,50))}catch{}},S.onerror=()=>{H("disconnected"),setTimeout(()=>{H("connecting"),S.close()},3e3)};const C=Dy(U,3e4,document);return()=>{S.close(),C()}},[]);const h=U=>{const S=Date.now()-new Date(U).getTime();return S<6e4?`${Math.floor(S/1e3)}s ago`:S<36e5?`${Math.floor(S/6e4)} min ago`:`${Math.floor(S/36e5)}h ago`};return u.jsxs(u.Fragment,{children:[u.jsx("h1",{className:"page-title",children:"Dashboard"}),u.jsxs("div",{style:{display:"flex",gap:24},children:[u.jsxs("div",{style:{flex:1},children:[u.jsxs("div",{className:"metrics",children:[u.jsxs("div",{className:"metric",children:[u.jsx("div",{className:"metric-value",children:s.connected_agents}),u.jsx("div",{className:"metric-label",children:"Connected Agents"})]}),u.jsxs("div",{className:"metric",children:[u.jsx("div",{className:"metric-value",children:s.requests_today}),u.jsx("div",{className:"metric-label",children:"Requests Today"})]}),u.jsxs("div",{className:"metric",children:[u.jsx("div",{className:"metric-value",children:s.active_tokens}),u.jsx("div",{className:"metric-label",children:"Active Tokens"})]})]}),u.jsxs("h2",{className:"section-title",children:["Live Activity",u.jsx("span",{style:{marginLeft:8,fontSize:10,color:q==="connected"?"var(--success)":q==="connecting"?"var(--warning)":"var(--error)"},children:q==="connected"?"● connected":q==="connecting"?"● connecting...":"● disconnected"})]}),u.jsx("div",{className:"feed",children:T.length===0?u.jsx("div",{className:"feed-empty",children:q==="connected"?"No requests yet. Agents will appear when they connect.":"Connecting..."}):u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Agent"}),u.jsx("th",{children:"Operation"}),u.jsx("th",{children:"Scopes"}),u.jsx("th",{children:"Latency"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Time"})]})}),u.jsx("tbody",{children:T.map((U,S)=>u.jsxs("tr",{children:[u.jsx("td",{className:"mono",children:U.agent}),u.jsx("td",{className:"mono",children:U.operation}),u.jsx("td",{children:U.scopes.split(",").map(C=>u.jsx("span",{className:`badge badge-${C.trim()}`,style:{marginRight:4},children:C.trim()},C))}),u.jsxs("td",{className:"mono",children:[U.latency_ms," ms"]}),u.jsx("td",{children:u.jsx("span",{className:`badge badge-${U.status}`,children:U.status})}),u.jsx("td",{style:{color:"var(--text-secondary)"},children:h(U.timestamp)})]},S))})]})})]}),u.jsxs("div",{style:{width:220},children:[u.jsx("h2",{className:"section-title",children:"Token Health"}),u.jsxs("div",{className:"health-panel",children:[u.jsxs("div",{className:"health-row",children:[u.jsx("span",{style:{color:"var(--warning)"},children:"Expiring Soon"}),u.jsx("span",{className:"mono",children:b.expiring_soon})]}),u.jsxs("div",{className:"health-row",children:[u.jsx("span",{style:{color:"var(--error)"},children:"Error Rate"}),u.jsx("span",{className:"mono",children:b.error_rate})]})]})]})]})]})}const Oa=s=>s.split(/[\s,]+/).filter(Boolean);function bs(s){var x,b,o;return{profile:(s==null?void 0:s.profile)??"memory-writer",applyProfile:!s,source:(s==null?void 0:s.sourceId)??"default",reads:(s==null?void 0:s.federatedRead)??["default"],scopes:(s==null?void 0:s.scopes.join(" "))??"",directPrefixes:((x=s==null?void 0:s.boundSlugPrefixes)==null?void 0:x.join(``))??"",tools:(s==null?void 0:s.boundTools)??[],namespace:(s==null?void 0:s.delegatedNamespace)??"job",delegatedPrefixes:((b=s==null?void 0:s.delegatedSlugPrefixes)==null?void 0:b.join(``))??"",concurrency:String((s==null?void 0:s.boundMaxConcurrent)??1),budget:(s==null?void 0:s.budgetUsdPerDay)??"unlimited",ttl:s?String(s.tokenTtlSeconds??0):"3600",surface:(s==null?void 0:s.surface)??"starter",operationSnapshot:((o=s==null?void 0:s.allowedOperations)==null?void 0:o.join(`- `))??"",editOperations:!1}}function Ld(s){const x=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile);return{...s.applyProfile?{profile:s.profile}:{},sourceId:s.source,federatedRead:s.reads,boundSlugPrefixes:s.directPrefixes.trim()?Oa(s.directPrefixes):null,...s.scopes.trim()?{scopes:Oa(s.scopes)}:{},...s.editOperations?{allowedOperations:Oa(s.operationSnapshot)}:{},...x?{boundTools:s.tools,boundSourceId:s.source,delegatedNamespace:s.namespace,delegatedSlugPrefixes:s.namespace==="job"?null:Oa(s.delegatedPrefixes)}:{},boundMaxConcurrent:Number(s.concurrency),budgetUsdPerDay:s.budget==="unlimited"?null:s.budget,tokenTtl:s.ttl==="0"?null:Number(s.ttl),surface:s.surface==="default"?null:s.surface}}function Zd(s){return{...s.profile?{profile:s.profile}:{},scopes:s.scopes,sourceId:s.sourceId,federatedRead:s.federatedRead,boundSlugPrefixes:s.boundSlugPrefixes,allowedOperations:s.allowedOperations,boundTools:s.boundTools,boundSourceId:s.boundSourceId,boundBrainId:s.boundBrainId,delegatedNamespace:s.delegatedNamespace,delegatedSlugPrefixes:s.delegatedSlugPrefixes,boundMaxConcurrent:s.boundMaxConcurrent,budgetUsdPerDay:s.budgetUsdPerDay,tokenTtlSeconds:s.tokenTtlSeconds,surface:s.surface}}function Vd({draft:s,setDraft:x,sources:b,catalog:o,existing:j=!1}){const A=(d,R)=>x({...s,[d]:R}),q=new Set(b.map(d=>d.id)),H=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile),_={marginBottom:14};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:_,children:[u.jsx("label",{htmlFor:"grant-profile",children:"Permission profile"}),u.jsx("select",{id:"grant-profile",value:s.profile,onChange:d=>x({...s,profile:d.target.value,applyProfile:!0,scopes:"",editOperations:!1,surface:["operator","full"].includes(d.target.value)?"full":"starter"}),children:o.profiles.map(d=>u.jsx("option",{children:d},d))}),u.jsx("p",{className:"grant-help",children:"Memory writer lets this agent recall, save, correct, and withdraw memory. Delegating profiles also allow selected server tools to run jobs."}),j&&u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.applyProfile,onChange:d=>A("applyProfile",d.target.checked)}),"Apply this profile's current operation snapshot"]})]}),u.jsxs("div",{style:_,children:[u.jsx("label",{htmlFor:"grant-source",children:"Primary / write source"}),u.jsxs("select",{id:"grant-source",value:s.source,onChange:d=>A("source",d.target.value),children:[!q.has(s.source)&&u.jsxs("option",{value:s.source,children:[s.source," · unavailable"]}),b.map(d=>u.jsxs("option",{value:d.id,children:[d.name," (",d.id,")"]},d.id))]})]}),u.jsxs("fieldset",{style:{border:0,padding:0,margin:"0 0 14px"},children:[u.jsx("legend",{children:"Readable sources"}),[...b,...s.reads.filter(d=>!q.has(d)).map(d=>({id:d,name:`${d} · unavailable`}))].map(d=>u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.reads.includes(d.id),onChange:R=>A("reads",R.target.checked?[...s.reads,d.id]:s.reads.filter(z=>z!==d.id))}),d.name]},d.id))]}),u.jsxs("div",{style:_,children:[u.jsx("label",{htmlFor:"grant-direct-prefixes",children:"Direct write prefixes (one per line)"}),u.jsx("textarea",{id:"grant-direct-prefixes",rows:2,value:s.directPrefixes,onChange:d=>A("directPrefixes",d.target.value),placeholder:"work-example/"}),u.jsx("p",{className:"grant-help",children:"Blank grants the whole primary source. Coding agent requires an explicit prefix."})]}),H&&u.jsxs("fieldset",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[u.jsx("legend",{children:"Delegated jobs"}),u.jsx("p",{className:"grant-help",children:"Choose every tool explicitly. Jobs stay in the primary source; existing jobs retain their original limits."}),u.jsx("div",{className:"checkbox-group",style:{maxHeight:180,overflowY:"auto"},children:[...new Set([...o.delegatedTools,...s.tools])].map(d=>u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.tools.includes(d),onChange:R=>A("tools",R.target.checked?[...s.tools,d]:s.tools.filter(z=>z!==d))}),d,o.delegatedTools.includes(d)?"":" · unavailable"]},d))}),u.jsx("label",{htmlFor:"grant-namespace",children:"Delegated write namespace"}),u.jsxs("select",{id:"grant-namespace",value:s.namespace,onChange:d=>A("namespace",d.target.value),children:[u.jsx("option",{value:"job",children:"Each job's own wiki/agents/ directory"}),u.jsx("option",{value:"prefixes",children:"Explicit prefixes"})]}),s.namespace==="prefixes"&&u.jsx("textarea",{"aria-label":"Delegated prefixes",rows:2,value:s.delegatedPrefixes,onChange:d=>A("delegatedPrefixes",d.target.value),placeholder:"work-example/"})]}),u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12,..._},children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"grant-concurrency",children:"Concurrent jobs"}),u.jsx("input",{id:"grant-concurrency",type:"number",min:1,step:1,value:s.concurrency,onChange:d=>A("concurrency",d.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"grant-budget",children:"Daily delegated spend (USD)"}),u.jsx("input",{id:"grant-budget",value:s.budget,onChange:d=>A("budget",d.target.value),placeholder:"unlimited"}),u.jsx("p",{className:"grant-help",children:"Use unlimited for no spending cap, or an amount such as 2.50."})]})]}),u.jsxs("div",{style:_,children:[u.jsx("label",{htmlFor:"grant-ttl",children:"Future access token lifetime (seconds)"}),u.jsx("input",{id:"grant-ttl",type:"number",min:0,max:7776e3,step:1,value:s.ttl,onChange:d=>A("ttl",d.target.value)}),u.jsx("p",{className:"grant-help",children:"Renewable: 3600 (1 hour). Static bearer: 2592000 (30 days). 0 uses the server default. Existing tokens keep their expiry."})]}),u.jsxs("details",{style:_,children:[u.jsx("summary",{children:"Advanced permissions"}),u.jsx("label",{htmlFor:"grant-scopes",children:"Scope override"}),u.jsx("input",{id:"grant-scopes",value:s.scopes,onChange:d=>A("scopes",d.target.value),placeholder:"Use profile scopes"}),u.jsx("p",{className:"grant-help",children:"Scopes allow eligible brain operations. Admin does not grant owner dashboard access or delegation."}),u.jsx("label",{htmlFor:"grant-surface",children:"Visible tool catalog"}),u.jsx("select",{id:"grant-surface",value:s.surface,onChange:d=>A("surface",d.target.value),children:["verbs","starter","full","default"].map(d=>u.jsx("option",{children:d},d))}),u.jsx("p",{className:"grant-help",children:"Full shows all eligible tools; it does not grant additional authority."}),u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.editOperations,onChange:d=>A("editOperations",d.target.checked)}),"Replace operation authority snapshot"]}),s.editOperations&&u.jsxs(u.Fragment,{children:[u.jsx("textarea",{"aria-label":"Allowed operations",rows:5,value:s.operationSnapshot,onChange:d=>A("operationSnapshot",d.target.value)}),u.jsx("p",{className:"grant-help",children:"One operation name per line. An empty list denies every operation, including delegated tools."})]})]})]})}const Ry=[["Profile","profile"],["Scopes","scopes"],["Write source","sourceId"],["Readable sources","federatedRead"],["Direct prefixes","boundSlugPrefixes"],["Visible catalog","surface"],["Operation authority","allowedOperations"],["Delegated tools","boundTools"],["Delegated source","boundSourceId"],["Delegated brain","boundBrainId"],["Delegated namespace","delegatedNamespace"],["Delegated prefixes","delegatedSlugPrefixes"],["Concurrent jobs","boundMaxConcurrent"],["Daily USD cap","budgetUsdPerDay"],["Future token TTL","tokenTtlSeconds"]];function Uy(s,x){return s===null?x==="budgetUsdPerDay"?"Unlimited":x==="allowedOperations"?"Legacy scope-based catalog":"Unset":Array.isArray(s)?s.join(", ")||"(none)":String(s)}function Bd({grant:s,field:x}){const b=s[x];return x==="allowedOperations"&&Array.isArray(b)&&b.length>8?u.jsxs("details",{children:[u.jsxs("summary",{children:[b.length," operations · inspect list"]}),u.jsx("div",{style:{maxHeight:160,overflowY:"auto",marginTop:8},children:b.join(", ")})]}):u.jsx(u.Fragment,{children:Uy(b,x)})}function Kd({preview:s}){return u.jsxs("div",{"aria-live":"polite",style:{margin:"16px 0"},children:[u.jsx("h3",{children:"Review permissions"}),u.jsx("div",{style:{overflowX:"auto"},children:u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Permission"}),s.before&&u.jsx("th",{children:"Current"}),u.jsx("th",{children:"Proposed"})]})}),u.jsx("tbody",{children:Ry.filter(([,x])=>!s.before||JSON.stringify(s.before[x])!==JSON.stringify(s.after[x])).map(([x,b])=>u.jsxs("tr",{children:[u.jsx("th",{children:x}),s.before&&u.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:200},children:u.jsx(Bd,{grant:s.before,field:b})}),u.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:280},children:u.jsx(Bd,{grant:s.after,field:b})})]},b))})]})}),u.jsx("p",{className:"grant-help",children:s.tokenImplications})]})}function qy({clientId:s,sources:x,sourcesReady:b=!0,onRescoped:o}){const[j,A]=U.useState(),[q,H]=U.useState(),[_,d]=U.useState(),[R,z]=U.useState(),[M,Q]=U.useState(""),[G,Z]=U.useState(!1),[W,ae]=U.useState(!1),[$,le]=U.useState(!1),ne=async(k=!1)=>{Z(!0),ae(!1);try{const[V,xe]=await Promise.all([Oe.clientGrant(s),Oe.grantCatalog()]);A(V.grant),H(bs(V.grant)),d(xe),z(void 0),Q(""),le(!1),k&&o(V.grant)}finally{Z(!1)}};U.useEffect(()=>{ne().catch(k=>Q(k.message))},[s]);const be=async()=>{if(!(!q||!j||!b||$)){Z(!0),Q(""),ae(!1);try{const k=await Oe.updateClientGrant(s,{...R?Zd(R.after):Ld(q),expectedRevision:j.revision,dryRun:!R});R?(A(k.after),H(bs(k.after)),z(void 0),ae(!0),o(k.after)):z(k)}catch(k){const V=!!R&&Ss(k);le(V||k instanceof An&&k.status===409),z(void 0),Q(`${k instanceof Error?k.message:"Grant update failed."}${V?" The change may have completed. Reload the current grant before editing permissions again.":""}`)}finally{Z(!1)}}};return u.jsxs("section",{children:[u.jsx("div",{className:"section-title",children:"Permissions"}),j&&u.jsxs("p",{className:"grant-help",children:["Revision ",j.revision,". Review source access, direct tools, and delegated work independently."]}),j&&u.jsx(Hy,{clientId:s,revision:j.revision}),!!(j!=null&&j.repairReasons.length)&&u.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:["Delegation needs repair: ",j.repairReasons.join(", "),". Review and explicitly grant the missing bindings below."]}),!b&&u.jsx("p",{role:"alert",children:"Current sources are unavailable. Retry sources before editing permissions."}),u.jsx("fieldset",{disabled:G||!b||$,style:{border:0,padding:0},children:q&&_&&u.jsx(Vd,{draft:q,catalog:_,sources:x,existing:!0,setDraft:k=>{H(k),z(void 0),ae(!1)}})}),M&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[M," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:G,onClick:()=>void ne(!0).catch(k=>Q(k.message)),children:"Reload current grant"})]}),R&&u.jsx(Kd,{preview:R}),W&&u.jsx("p",{role:"status",children:"Permissions saved. Credentials are unchanged."}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:G||!q||!_||!b||$,onClick:()=>void be(),children:G?"Checking…":R?"Apply reviewed changes":"Preview changes"})]})}function Hy({clientId:s,revision:x}){const[b,o]=U.useState(),[j,A]=U.useState(!1);return U.useEffect(()=>{let q=!0;const H=()=>void Oe.agentsSpend().then(d=>{q&&(o(d.find(R=>R.client_id===s)),A(!1))}).catch(()=>{q&&A(!0)});H();const _=setInterval(H,2e4);return()=>{q=!1,clearInterval(_)}},[s,x]),j?u.jsx("p",{role:"status",children:"Delegated spend is unavailable. Reload to check before starting more work."}):b?u.jsxs("div",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[u.jsx("strong",{children:"Delegated work"}),u.jsxs("p",{children:[b.inflight_count," unfinished jobs · Daily cap: ",b.cap_usd_per_day===null?"Unlimited":`$${b.cap_usd_per_day.toFixed(2)}`]}),u.jsxs("p",{className:"grant-help",children:["Recorded today: $",(b.spent_cents_today/100).toFixed(2),". Known outstanding reservations: $",(b.pending_cents/100).toFixed(2),", including overdue calls from earlier days."]}),b.unknown_count>0&&u.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:[b.unknown_count," unresolved calls have an unknown cost. The known amounts above do not bound total liability; a finite cap refuses further calls until reconciliation."]})]}):null}function By(s,x){const b=URL.createObjectURL(new Blob([JSON.stringify(s,null,2)],{type:"application/json"})),o=document.createElement("a");o.href=b,o.download=x,o.click(),URL.revokeObjectURL(b)}function Jd({clientId:s,grantTypes:x,revoked:b=!1,grantRevision:o}){const[j,A]=U.useState("generic"),q=x.includes("authorization_code")&&x.includes("client_credentials"),[H,_]=U.useState(q?"":x.includes("authorization_code")?"authorization-code":"client-credentials"),[d,R]=U.useState(),[z,M]=U.useState(),[Q,G]=U.useState([]),[Z,W]=U.useState(""),[ae,$]=U.useState(!1),[le,ne]=U.useState(!1),[be,k]=U.useState(!1),[V,xe]=U.useState(0);U.useEffect(()=>{if(b)return;let se=!0;if(M(void 0),G([]),W(""),ne(!1),k(!1),!!H)return Promise.all([Oe.clientSetup(s,j,H),Oe.grantCatalog()]).then(([F,de])=>{se&&(M(F.setup),G(F.instructions),R(de))}).catch(F=>{se&&W(F instanceof Error?F.message:"Setup instructions are unavailable.")}),()=>{se=!1}},[s,j,H,b,o,V]);const Se=async()=>{if(z){$(!0),W("");try{const se=await Oe.recoverClient(s,j,H),F=H==="authorization-code"?se.oauthSetup:se.credentials;if(!F)throw new Error("No matching setup file was returned. Ask the host administrator to inspect this client’s credential delivery.");By(F,`${s}-${H==="authorization-code"?"oauth-setup":"credentials"}.json`),ne(!0)}catch(se){W(se instanceof Error?se.message:"Download failed. Existing permissions are unchanged.")}finally{$(!1)}}};return u.jsxs("section",{"aria-labelledby":"client-setup-title",children:[u.jsx("h3",{id:"client-setup-title",className:"section-title",children:"Set up this client"}),b?u.jsx("p",{children:"This client is revoked. Register a new client to connect another harness."}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"grant-help",children:"Registration grants access. Configure the intended harness, then verify an actual memory round trip there."}),u.jsx("label",{htmlFor:"setup-harness",children:"Harness"}),u.jsxs("select",{id:"setup-harness",value:j,onChange:se=>A(se.target.value),disabled:ae,children:[!d&&u.jsx("option",{value:"generic",children:"Generic MCP client"}),d==null?void 0:d.harnesses.map(se=>u.jsx("option",{value:se.id,children:se.label},se.id))]}),q&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"setup-flow",children:"Connection flow"}),u.jsxs("select",{id:"setup-flow",value:H,onChange:se=>_(se.target.value),disabled:ae,children:[u.jsx("option",{value:"",children:"Choose the flow supported by your harness"}),u.jsx("option",{value:"authorization-code",children:"Browser sign-in with PKCE"}),u.jsx("option",{value:"client-credentials",children:"Machine credentials"})]})]}),z&&u.jsxs(u.Fragment,{children:[u.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[u.jsx("dt",{children:"MCP URL"}),u.jsx("dd",{children:u.jsx("code",{children:z.mcp_url})}),u.jsx("dt",{children:"OAuth issuer"}),u.jsx("dd",{children:u.jsx("code",{children:z.issuer_url})}),u.jsx("dt",{children:"Client ID"}),u.jsx("dd",{children:u.jsx("code",{children:z.client.client_id})}),u.jsx("dt",{children:"Scopes"}),u.jsx("dd",{children:z.scopes.join(" ")||"None"}),u.jsx("dt",{children:"Authentication"}),u.jsx("dd",{children:z.client.token_endpoint_auth_method==="none"?"Public client — PKCE, no client secret":z.client.token_endpoint_auth_method}),z.flow==="authorization-code"&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Redirect URIs"}),u.jsx("dd",{children:z.client.redirect_uris.map(se=>u.jsx("div",{children:u.jsx("code",{children:se})},se))})]})]}),u.jsx("ol",{children:Q.map((se,F)=>u.jsx("li",{style:{marginBottom:8,overflowWrap:"anywhere"},children:se},F))}),u.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:16},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(Q.join(`- `)).then(()=>k(!0)).catch(()=>W("Clipboard unavailable. Select and copy the instructions above."))},children:be?"Instructions copied":"Copy setup instructions"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:ae,onClick:()=>void Se(),children:ae?"Preparing download…":z.flow==="authorization-code"?"Download OAuth setup":"Download credentials"})]}),u.jsx("p",{className:"grant-help",children:"Keep downloaded files private. Set permissions to 0600 on the target computer. A setup download does not verify the harness."})]}),!H&&u.jsx("p",{role:"status",children:"This client supports both flows. Choose one before requesting setup instructions."}),H&&!z&&!Z&&u.jsx("p",{role:"status",children:"Loading setup instructions…"}),le&&u.jsx("p",{role:"status",children:"Setup file delivered to your browser. Harness verification is still required."}),Z&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[Z," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:ae,onClick:()=>xe(se=>se+1),children:"Retry setup"})]})]})]})}const gs={"invalidate-tokens":"Invalidate tokens",revoke:"Revoke client",delete:"Delete client"};function Yy({clientId:s,name:x,revoked:b,onChanged:o,onBusyChange:j}){const[A,q]=U.useState(),[H,_]=U.useState(!1),[d,R]=U.useState(""),[z,M]=U.useState(!1),Q=async Z=>{_(!0),R(""),q(void 0);try{q(await Oe.clientLifecycle(s,{action:Z,dryRun:!0}))}catch(W){R(W instanceof Error?W.message:"Could not preview this action. Retry after checking the client.")}finally{_(!1)}},G=async()=>{if(A){_(!0),j==null||j(!0),R("");try{await Oe.clientLifecycle(s,{action:A.action,dryRun:!1,yes:!0,expectedRevision:A.before.revision}),o()}catch(Z){const W=Ss(Z);R(`${Z instanceof Error?Z.message:"Request failed."} ${W?"The action may have completed. Reload the client and inspect its current state before requesting another action.":"The request was refused. Review a fresh preview before applying an action."}`),M(W),q(void 0)}finally{_(!1),j==null||j(!1)}}};return u.jsxs("section",{"aria-labelledby":"client-lifecycle-title",style:{marginTop:28},children:[u.jsx("h3",{id:"client-lifecycle-title",className:"section-title",children:"Client access"}),u.jsx("p",{className:"grant-help",children:"Invalidating tokens keeps the client and its secret. Revoking ends access and keeps a visible registration. Deleting removes the registration. Memory and audit history remain."}),!A&&u.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["invalidate-tokens","revoke","delete"].filter(Z=>!b||Z==="delete").map(Z=>u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H||z,onClick:()=>void Q(Z),children:gs[Z]},Z))}),A&&u.jsxs("div",{"aria-live":"polite",style:{border:"1px solid var(--border)",padding:16},children:[u.jsxs("h4",{style:{margin:"0 0 12px"},children:[gs[A.action],": ",x]}),u.jsxs("p",{children:[u.jsx("code",{children:s})," · Revision ",A.before.revision]}),u.jsx("ul",{children:(Array.isArray(A.consequences)?A.consequences:[A.consequences]).map((Z,W)=>u.jsx("li",{children:Z},W))}),u.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H,onClick:()=>q(void 0),children:"Cancel"}),u.jsx("button",{type:"button",className:"btn btn-danger",disabled:H,onClick:()=>void G(),children:H?"Applying…":`Confirm ${gs[A.action].toLowerCase()}`})]})]}),d&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[d," ",z&&u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:o,children:"Reload client list"})]})]})}function _n({title:s,titleId:x,children:b,onClose:o,busy:j=!1,drawer:A=!1}){const q=U.useRef(null),H=U.useRef(o);H.current=o;const _=U.useRef(j);_.current=j;const[d]=U.useState(()=>document.activeElement instanceof HTMLElement?document.activeElement:null);return U.useEffect(()=>{const R=q.current;if(!R)return;(R.querySelector("[data-autofocus]")??R).focus();const z=M=>{if(M.key==="Escape"&&(M.preventDefault(),_.current||H.current()),M.key!=="Tab")return;const Q=[...R.querySelectorAll('button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], summary, [tabindex="0"]')].filter(W=>W.getClientRects().length>0&&!W.closest("fieldset:disabled")),G=Q[0],Z=Q[Q.length-1];if(!G){M.preventDefault(),R.focus();return}M.shiftKey&&(document.activeElement===G||document.activeElement===R)?(M.preventDefault(),Z.focus()):!M.shiftKey&&(document.activeElement===Z||document.activeElement===R)&&(M.preventDefault(),G.focus())};return R.addEventListener("keydown",z),()=>{R.removeEventListener("keydown",z),d!=null&&d.isConnected&&d.focus()}},[d]),u.jsx("div",{className:A?"drawer-overlay":"modal-overlay",onClick:()=>{j||o()},children:u.jsxs("div",{ref:q,role:"dialog","aria-modal":"true","aria-labelledby":x,"aria-busy":j,tabIndex:-1,className:A?"drawer":"modal",onClick:R=>R.stopPropagation(),style:A?{width:"min(640px, 95vw)"}:{maxWidth:760,width:"92vw",minWidth:0,maxHeight:"90vh",overflowY:"auto"},children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16,alignItems:"start",marginBottom:20},children:[u.jsx("h2",{id:x,className:"modal-title",style:{margin:0},children:s}),u.jsx("button",{type:"button",className:"btn btn-secondary","aria-label":`Close ${s}`,disabled:j,onClick:o,children:"Close"})]}),b]})})}function Gy(s){const x=s.kind!=="machine",b=x?s.redirectUris.split(`- `).map(o=>o.trim()).filter(Boolean):[];if(x&&!b.length)throw new Error("Enter the exact redirect URI from your MCP client settings, one per line.");for(const o of b)try{new URL(o)}catch{throw new Error("Each redirect URI must be a complete URI. Copy it exactly from your MCP client settings.")}return{grantTypes:x?["authorization_code","refresh_token"]:["client_credentials"],redirectUris:b,tokenEndpointAuthMethod:s.kind==="public-pkce"?"none":s.kind==="machine"?"client_secret_post":s.confidentialMethod}}function wy(s){const x=Math.floor((Date.now()-s.getTime())/1e3);return x<60?"just now":x<3600?Math.floor(x/60)+"m ago":x<86400?Math.floor(x/3600)+"h ago":Math.floor(x/86400)+"d ago"}function Xy(){const[s,x]=U.useState([]),[b,o]=U.useState([]),[j,A]=U.useState(!1),[q,H]=U.useState(!1),[_,d]=U.useState(""),[R,z]=U.useState(""),[M,Q]=U.useState(!0),[G,Z]=U.useState(!0),[W,ae]=U.useState(!1),[$,le]=U.useState(!1),[ne,be]=U.useState(),[k,V]=U.useState(),[xe,Se]=U.useState(!1),[se,F]=U.useState(),de=U.useRef(0),Ge=U.useRef(0),Ce=async()=>{const N=++de.current;Q(!0);try{const Y=await Oe.agents();if(N!==de.current)return;x(Y),A(!0),d("")}catch(Y){N===de.current&&d(Y instanceof Error?Y.message:"Clients are unavailable.")}finally{N===de.current&&Q(!1)}},Ze=async()=>{const N=++Ge.current;Z(!0);try{const Y=await Oe.sources();if(N!==Ge.current)return;o(Y),H(!0),z("")}catch(Y){N===Ge.current&&(H(!1),z(Y instanceof Error?Y.message:"Sources are unavailable."))}finally{N===Ge.current&&Z(!1)}};U.useEffect(()=>(Ce(),Ze(),()=>{de.current++,Ge.current++}),[]);const T=s.filter(N=>!W||N.status!=="revoked");return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12,flexWrap:"wrap",alignItems:"center",marginBottom:24},children:[u.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Agents"}),u.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:W,onChange:N=>ae(N.target.checked)}),"Hide revoked"]}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:M,onClick:()=>void Ce(),children:"Refresh clients"}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Se(!0),children:"+ API Key"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:!q||!b.length||G,onClick:()=>le(!0),children:"+ OAuth Client"})]})]}),u.jsx("p",{className:"grant-help",style:{marginBottom:16},children:"Owner administration uses this dashboard’s login. An OAuth client’s admin scope allows eligible brain operations; it does not open this dashboard."}),_&&u.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:[j?"Showing previously loaded clients. ":"Could not load clients. ",_," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:M,onClick:()=>void Ce(),children:"Retry clients"})]}),R&&u.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:["Could not load current sources. Registration and permission changes are unavailable. ",R," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:G,onClick:()=>void Ze(),children:"Retry sources"})]}),!R&&!q&&u.jsx("p",{role:"status",children:"Loading sources before registration…"}),q&&!b.length&&u.jsx("p",{role:"status",children:"No active sources are available. Add or unarchive a source on the host before registering a client."}),!j&&!_&&u.jsx("p",{role:"status",children:"Loading clients…"}),j&&!s.length&&u.jsx("p",{style:{textAlign:"center",padding:48},children:"No clients registered. Register a client to grant access to a harness."}),j&&s.length>0&&!T.length&&u.jsx("p",{style:{textAlign:"center",padding:48},children:"All clients are revoked. Uncheck “Hide revoked” to view them."}),T.length>0&&u.jsxs("div",{style:{overflowX:"auto"},children:[u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Name"}),u.jsx("th",{children:"Type"}),u.jsx("th",{children:"Scopes"}),u.jsx("th",{children:"Sources"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Requests"}),u.jsx("th",{children:"Last used"})]})}),u.jsx("tbody",{children:T.map(N=>u.jsxs("tr",{onClick:()=>V(N),style:{cursor:"pointer"},children:[u.jsx("td",{children:u.jsx("button",{type:"button",className:"client-name-button",onClick:Y=>{Y.stopPropagation(),V(N)},children:N.name||N.client_name})}),u.jsx("td",{children:u.jsx("span",{className:"badge "+(N.auth_type==="oauth"?"badge-read":"badge-write"),children:N.auth_type==="oauth"?"OAuth":"API key"})}),u.jsx("td",{children:(N.scope||"").split(" ").filter(Boolean).map(Y=>u.jsx("span",{className:"badge badge-"+Y,style:{marginRight:4},children:Y},Y))}),u.jsx("td",{children:N.auth_type==="oauth"?(N.source_id||"none")+" · "+(N.federated_read||[]).length+" readable":"Unscoped"}),u.jsx("td",{children:u.jsx("span",{className:"badge "+(N.status==="active"?"badge-success":"badge-danger"),children:N.status})}),u.jsxs("td",{children:[N.requests_today||0,u.jsxs("span",{style:{color:"var(--text-muted)"},children:[" / ",N.total_requests||0]})]}),u.jsx("td",{children:N.last_used_at?wy(new Date(N.last_used_at)):"Never"})]},N.auth_type+":"+N.id))})]}),u.jsxs("p",{className:"grant-help",style:{marginTop:12},children:[s.filter(N=>N.status==="active").length," active / ",s.length," total"]})]}),$&&u.jsx(Qy,{sources:b,sourcesReady:q,onClose:()=>le(!1),onRegistered:N=>{le(!1),be(N),Ce()}}),ne&&u.jsxs(_n,{title:"Client registered",titleId:"registered-client-title",onClose:()=>be(void 0),children:[u.jsxs("p",{role:"status",style:{marginBottom:16},children:[ne.name," is registered. Its harness connection has not been verified."]}),u.jsx(Jd,{clientId:ne.clientId,grantTypes:ne.grantTypes})]}),k&&u.jsx(Ly,{agent:k,sources:b,sourcesReady:q,onClose:()=>V(void 0),onChanged:()=>{V(void 0),Ce()},onRescoped:N=>{V(Y=>Y&&{...Y,source_id:N.sourceId,federated_read:N.federatedRead,scope:N.scopes.join(" "),token_ttl:N.tokenTtlSeconds}),Ce()}},k.id),xe&&u.jsx(Vy,{onClose:()=>Se(!1),onCreated:N=>{Se(!1),F(N),Ce()}}),se&&u.jsx(Ky,{token:se,onClose:()=>F(void 0)})]})}function Qy({sources:s,sourcesReady:x,onClose:b,onRegistered:o}){const[j,A]=U.useState(""),[q,H]=U.useState(()=>bs()),[_,d]=U.useState({kind:"machine",redirectUris:"",confidentialMethod:"client_secret_post"}),[R,z]=U.useState(),[M,Q]=U.useState(""),[G,Z]=U.useState(),[W,ae]=U.useState(!1),[$,le]=U.useState(""),[ne,be]=U.useState(),[k,V]=U.useState(!1),xe=()=>{Q(""),Oe.grantCatalog().then(z).catch(F=>Q(F instanceof Error?F.message:"Permission catalog unavailable."))};U.useEffect(xe,[]);const Se=F=>{d(F),Z(void 0)},se=async F=>{if(F.preventDefault(),!(!x||!R||k)){if(!j.trim()){le("Enter a client name.");return}ae(!0),le("");try{const de=(G==null?void 0:G.oauth)??Gy(_),Ge=(G==null?void 0:G.name)??j.trim(),Ce=await Oe.registerClient({...G?Zd(G.grant.after):Ld(q),...de,name:Ge,dryRun:!G});G?o({clientId:Ce.clientId,name:Ge,grantTypes:de.grantTypes}):Z({grant:Ce,oauth:de,name:Ge})}catch(de){le(de instanceof Error?de.message:"Registration failed.");const Ge=!!G&&Ss(de);if(V(Ge),G&&(Ge||de instanceof An&&de.status===409))try{const Ce=(await Oe.agents()).filter(Ze=>Ze.auth_type==="oauth"&&Ze.status==="active"&&(Ze.name||Ze.client_name)===G.name);Ce.length===1&&(be({clientId:Ce[0].id||Ce[0].client_id,name:G.name,grantTypes:Ce[0].grant_types}),V(!0))}catch{}Z(void 0)}finally{ae(!1)}}};return u.jsx(_n,{title:"Register OAuth client",titleId:"register-client-title",onClose:b,busy:W,children:u.jsxs("form",{onSubmit:se,children:[u.jsxs("fieldset",{disabled:W||k,style:{border:0,padding:0},children:[u.jsx("label",{htmlFor:"agent-name",children:"Client name"}),u.jsx("input",{id:"agent-name","data-autofocus":!0,value:j,placeholder:"agent-example",onChange:F=>{A(F.target.value),Z(void 0)}}),u.jsx("label",{htmlFor:"oauth-connection-kind",style:{marginTop:16},children:"Connection type"}),u.jsxs("select",{id:"oauth-connection-kind",value:_.kind,onChange:F=>Se({..._,kind:F.target.value}),children:[u.jsx("option",{value:"machine",children:"Machine credentials"}),u.jsx("option",{value:"public-pkce",children:"Browser sign-in: public client with PKCE"}),u.jsx("option",{value:"confidential-pkce",children:"Browser sign-in: confidential client with PKCE"})]}),u.jsx("p",{className:"grant-help",children:"Choose the method required by your MCP client. Browser sign-in requires the owner’s approval. Public clients use PKCE without a client secret."}),_.kind!=="machine"&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"oauth-redirect-uris",children:"Exact redirect URIs (one per line)"}),u.jsx("textarea",{id:"oauth-redirect-uris",rows:3,value:_.redirectUris,onChange:F=>Se({..._,redirectUris:F.target.value}),placeholder:"https://client.example.com/oauth/callback"}),u.jsx("p",{className:"grant-help",children:"Copy these from the client’s OAuth settings. Keep the complete path and query. GBrain uses S256 PKCE."})]}),_.kind==="confidential-pkce"&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"oauth-client-auth",children:"Client secret authentication"}),u.jsxs("select",{id:"oauth-client-auth",value:_.confidentialMethod,onChange:F=>Se({..._,confidentialMethod:F.target.value}),children:[u.jsx("option",{value:"client_secret_post",children:"client_secret_post (request body)"}),u.jsx("option",{value:"client_secret_basic",children:"client_secret_basic (HTTP Basic)"})]})]}),_.kind==="machine"&&u.jsx("p",{className:"grant-help",children:"Machine handoffs use client_secret_post to renew their access tokens."}),u.jsx("div",{style:{marginTop:24},children:R&&u.jsx(Vd,{draft:q,setDraft:F=>{H(F),Z(void 0)},catalog:R,sources:s})})]}),M&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[M," ",u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:xe,children:"Retry permissions"})]}),!x&&u.jsx("p",{role:"alert",children:"Current sources are unavailable. Close this form and retry sources before registration."}),G&&u.jsxs(u.Fragment,{children:[u.jsx(Kd,{preview:G.grant}),u.jsxs("div",{"aria-live":"polite",children:[u.jsx("h3",{children:"Review connection"}),u.jsxs("dl",{className:"oauth-consent-details",children:[u.jsx("dt",{children:"Client name"}),u.jsx("dd",{children:G.name}),u.jsx("dt",{children:"Grant types"}),u.jsx("dd",{children:G.oauth.grantTypes.join(", ")}),u.jsx("dt",{children:"Authentication"}),u.jsx("dd",{children:G.oauth.tokenEndpointAuthMethod}),G.oauth.redirectUris.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Exact redirect URIs"}),u.jsx("dd",{children:G.oauth.redirectUris.map(F=>u.jsx("div",{children:u.jsx("code",{children:F})},F))})]})]})]})]}),$&&u.jsx("p",{role:"alert",style:{color:"var(--error)",margin:"16px 0"},children:$}),ne&&u.jsxs("div",{role:"status",children:[u.jsxs("p",{children:["A client named ",ne.name," is registered. Open its setup instructions and recover its existing download."]}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>o(ne),children:"Open existing client setup"})]}),k&&!ne&&u.jsx("p",{role:"status",children:"Registration may have completed. Close this form and refresh clients before trying again. No automatic retry was made."}),u.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"flex-end",marginTop:20},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:b,children:"Cancel"}),u.jsx("button",{type:"submit",className:"btn btn-primary",disabled:W||!R||!x||k,children:W?"Checking…":G?"Register with reviewed permissions":"Preview permissions"})]})]})})}function Ly({agent:s,sources:x,sourcesReady:b,onClose:o,onChanged:j,onRescoped:A}){const q=s.id||s.client_id||"",H=s.name||s.client_name||q,[_,d]=U.useState(),[R,z]=U.useState(""),[M,Q]=U.useState(0),[G,Z]=U.useState(!1),[W,ae]=U.useState(!1);return U.useEffect(()=>{if(s.auth_type!=="oauth")return;let $=!0;return z(""),Oe.clientDetails(q).then(le=>{$&&d(le)}).catch(le=>{$&&z(le instanceof Error?le.message:"Client details unavailable.")}),()=>{$=!1}},[q,s.auth_type,M]),u.jsxs(_n,{title:H,titleId:"client-details-title",onClose:o,drawer:!0,busy:W,children:[u.jsx("span",{className:"badge "+(s.status==="active"?"badge-success":"badge-danger"),children:s.status}),u.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[u.jsx("dt",{children:"Client ID"}),u.jsx("dd",{children:u.jsx("code",{children:q})}),u.jsx("dt",{children:"Scopes"}),u.jsx("dd",{children:s.scope||"None"}),u.jsx("dt",{children:"Registered"}),u.jsx("dd",{children:new Date(s.created_at).toLocaleString()}),u.jsx("dt",{children:"Token lifetime"}),u.jsx("dd",{children:s.token_ttl?s.token_ttl+" seconds":"Server default (future tokens)"}),_&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Grant types"}),u.jsx("dd",{children:_.client.grant_types.join(", ")}),u.jsx("dt",{children:"Authentication"}),u.jsx("dd",{children:_.client.token_endpoint_auth_method})]})]}),s.auth_type==="oauth"?u.jsxs(u.Fragment,{children:[R&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[R," ",u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Q($=>$+1),children:"Retry client details"})]}),!_&&!R&&u.jsx("p",{role:"status",children:"Loading client details…"}),_&&u.jsxs(u.Fragment,{children:[u.jsx(Jd,{clientId:q,grantTypes:_.client.grant_types,revoked:s.status==="revoked",grantRevision:_.grant.revision}),s.status==="active"&&u.jsxs("details",{style:{marginTop:24},children:[u.jsx("summary",{style:{cursor:"pointer",fontWeight:600},children:"Edit access levels"}),u.jsx(qy,{clientId:q,sources:x,sourcesReady:b,onRescoped:$=>{d(le=>le&&{...le,grant:$}),A($)}})]}),u.jsx(Yy,{clientId:q,name:H,revoked:s.status==="revoked",onChanged:j,onBusyChange:ae})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("h3",{className:"section-title",children:"API key"}),u.jsx("p",{children:"Use this key as a bearer token in a client that supports static authentication. Its value is available only in the original private handoff."}),s.status==="active"&&u.jsxs("div",{style:{marginTop:20},children:[G?u.jsxs(u.Fragment,{children:[u.jsxs("p",{children:["Revoke the API key ",H," (",q,")? Only this key stops working. Memory remains."]}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:()=>Z(!1),children:"Cancel"})," ",u.jsx("button",{type:"button",className:"btn btn-danger",disabled:W,onClick:()=>{ae(!0),Oe.revokeApiKey(q).then(j).catch($=>z($ instanceof Error?$.message:"Revoke failed. Refresh the client list before retrying.")).finally(()=>ae(!1))},children:"Confirm revoke"})]}):u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Z(!0),children:"Revoke API key"}),R&&u.jsx("p",{role:"alert",children:R})]})]})]})}const Zy=[{id:"read",label:"Read",help:"Search and read memory."},{id:"write",label:"Write",help:"Add and edit memory."},{id:"admin",label:"Admin",help:"Brain administration operations. Grant only to fully trusted clients."}];function Vy({onClose:s,onCreated:x}){const[b,o]=U.useState(""),[j,A]=U.useState(!1),[q,H]=U.useState(""),[_,d]=U.useState(["read","write"]),R=async z=>{if(z.preventDefault(),!b.trim()){H("Enter a key name.");return}if(_.length===0){H("Choose at least one access level.");return}A(!0),H("");try{const M=await Oe.createApiKey(b.trim(),_);x({name:M.name,token:M.token})}catch(M){H(M instanceof Error?M.message:"Key creation failed. Inspect the clients list before retrying.")}finally{A(!1)}};return u.jsx(_n,{title:"Create API key",titleId:"create-api-key-title",onClose:s,busy:j,children:u.jsxs("form",{onSubmit:R,children:[u.jsx("p",{className:"grant-help",children:"API keys default to read and write. Admin is granted only when you check it. Choose an OAuth client for per-source or per-operation access. This key cannot log into the owner dashboard."}),u.jsx("label",{htmlFor:"api-key-name",children:"Key name"}),u.jsx("input",{id:"api-key-name","data-autofocus":!0,value:b,maxLength:128,disabled:j,onChange:z=>o(z.target.value)}),u.jsxs("fieldset",{style:{marginTop:16},children:[u.jsx("legend",{children:"Access levels"}),Zy.map(z=>u.jsxs("label",{style:{display:"block"},children:[u.jsx("input",{type:"checkbox",checked:_.includes(z.id),disabled:j,onChange:M=>d(Q=>M.target.checked?[...Q,z.id]:Q.filter(G=>G!==z.id))})," ",z.label," ",u.jsx("span",{className:"grant-help",children:z.help})]},z.id))]}),q&&u.jsx("p",{role:"alert",children:q}),u.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:20},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:j,onClick:s,children:"Cancel"}),u.jsx("button",{type:"submit",className:"btn btn-primary",disabled:j,children:j?"Creating…":"Create key"})]})]})})}function Ky({token:s,onClose:x}){const[b,o]=U.useState(!1),[j,A]=U.useState("");return u.jsxs(_n,{title:"API key created",titleId:"api-key-created-title",onClose:x,children:[u.jsx("p",{children:s.name}),u.jsx("label",{htmlFor:"new-api-key",children:"Bearer token"}),u.jsx("textarea",{id:"new-api-key",rows:3,readOnly:!0,value:s.token}),u.jsx("p",{className:"grant-help",children:"Save this token privately now. It will not be shown again. A key’s creation does not verify your harness connection."}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(s.token).then(()=>o(!0)).catch(()=>A("Clipboard unavailable. Select and copy the token above."))},children:b?"Copied":"Copy token"}),j&&u.jsx("p",{role:"alert",children:j}),u.jsx("button",{type:"button",className:"btn btn-primary",style:{marginLeft:12},onClick:x,children:"Done"})]})}function Jy(){const[s,x]=U.useState({rows:[],total:0,page:1,pages:1}),[b,o]=U.useState(1),[j,A]=U.useState("all"),[q,H]=U.useState(null);U.useEffect(()=>{_(b)},[b,j]);const _=M=>{const Q=j!=="all"?`&agent=${encodeURIComponent(j)}`:"";Oe.requests(M,Q).then(x).catch(()=>{})},d=M=>{const Q=Date.now()-new Date(M).getTime();return Q<6e4?`${Math.floor(Q/1e3)}s ago`:Q<36e5?`${Math.floor(Q/6e4)} min ago`:Q<864e5?`${Math.floor(Q/36e5)}h ago`:new Date(M).toLocaleDateString()},R=M=>{if(!M)return null;const{query:Q,slug:G,partial:Z,limit:W,...ae}=M,$=[];return Q&&$.push(`"${Q}"`),G&&$.push(G),Z&&$.push(`~${Z}`),W&&$.push(`limit=${W}`),Object.keys(ae).length>0&&$.push(`+${Object.keys(ae).length} params`),$.join(" ")},z=new Map;return s.rows.forEach(M=>{M.token_name&&z.set(M.token_name,M.agent_name||M.token_name)}),u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[u.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Request Log"}),u.jsxs("select",{value:j,onChange:M=>{A(M.target.value),o(1)},style:{background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:6,padding:"4px 8px",fontSize:13},children:[u.jsx("option",{value:"all",children:"All agents"}),[...z.entries()].map(([M,Q])=>u.jsx("option",{value:M,children:Q},M))]})]}),s.rows.length===0?u.jsx("div",{style:{textAlign:"center",padding:48,color:"var(--text-muted)"},children:"No requests yet."}):u.jsxs(u.Fragment,{children:[u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Time"}),u.jsx("th",{children:"Agent"}),u.jsx("th",{children:"Operation"}),u.jsx("th",{children:"Params"}),u.jsx("th",{children:"Latency"}),u.jsx("th",{children:"Status"})]})}),u.jsx("tbody",{children:s.rows.map(M=>u.jsxs(Xd.Fragment,{children:[u.jsxs("tr",{onClick:()=>H(q===M.id?null:M.id),style:{cursor:"pointer"},children:[u.jsx("td",{style:{color:"var(--text-secondary)",whiteSpace:"nowrap"},children:d(M.created_at)}),u.jsx("td",{children:u.jsx("a",{style:{color:"var(--text-link, #88aaff)",cursor:"pointer",textDecoration:"none",fontWeight:500},onClick:Q=>{Q.stopPropagation(),A(M.token_name),o(1)},children:M.agent_name||M.token_name})}),u.jsx("td",{className:"mono",children:M.operation}),u.jsx("td",{style:{color:"var(--text-secondary)",fontSize:12,maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(M.params)}),u.jsxs("td",{className:"mono",children:[M.latency_ms,"ms"]}),u.jsx("td",{children:u.jsx("span",{className:`badge badge-${M.status}`,children:M.status})})]}),q===M.id&&u.jsx("tr",{children:u.jsx("td",{colSpan:6,style:{background:"var(--bg-secondary, #0f0f1a)",padding:16},children:u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"100px 1fr",gap:"6px 12px",fontSize:13},children:[u.jsx("span",{style:{color:"var(--text-muted)"},children:"Time"}),u.jsx("span",{children:new Date(M.created_at).toLocaleString()}),u.jsx("span",{style:{color:"var(--text-muted)"},children:"Agent"}),u.jsx("span",{className:"mono",children:M.token_name}),u.jsx("span",{style:{color:"var(--text-muted)"},children:"Operation"}),u.jsx("span",{className:"mono",children:M.operation}),u.jsx("span",{style:{color:"var(--text-muted)"},children:"Latency"}),u.jsxs("span",{children:[M.latency_ms,"ms"]}),M.params&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--text-muted)"},children:"Params"}),u.jsx("pre",{className:"mono",style:{margin:0,whiteSpace:"pre-wrap",fontSize:12},children:JSON.stringify(M.params,null,2)})]}),M.error_message&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:"Error"}),u.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:M.error_message})]})]})})})]},M.id))})]}),u.jsxs("div",{className:"pagination",children:[u.jsxs("span",{children:["Page ",s.page," of ",s.pages," (",s.total," total)"]}),u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx("button",{disabled:s.page<=1,onClick:()=>o(M=>M-1),children:"Previous"}),u.jsx("button",{disabled:s.page>=s.pages,onClick:()=>o(M=>M+1),children:"Next"})]})]})]})]})}function ky({markup:s}){return u.jsx("div",{style:{width:"100%",overflow:"auto"},dangerouslySetInnerHTML:{__html:s}})}function Vi({type:s,ariaLabel:x}){const[b,o]=U.useState(""),[j,A]=U.useState("");return U.useEffect(()=>{let q=!1;return Oe.calibrationChart(s).then(H=>{q||o(H)}).catch(H=>{q||A(H.message??"fetch failed")}),()=>{q=!0}},[s]),j?u.jsxs("div",{style:{padding:16,color:"var(--error)"},role:"alert",children:[x,": ",j]}):b?u.jsx(ky,{markup:b}):u.jsxs("div",{style:{padding:16,color:"var(--text-muted)"},children:[x," loading..."]})}function Wy(){const[s,x]=U.useState(null),[b,o]=U.useState(!0),[j,A]=U.useState("");if(U.useEffect(()=>{Oe.calibrationProfile().then(_=>{x(_),o(!1)}).catch(_=>{A(_.message??"fetch failed"),o(!1)})},[]),b)return u.jsx("div",{style:{padding:24,color:"var(--text-secondary)"},children:"Loading calibration profile…"});if(j)return u.jsxs("div",{style:{padding:24,color:"var(--error)"},role:"alert",children:["Could not load calibration profile: ",j]});if(!s)return u.jsxs("div",{style:{padding:24,maxWidth:700},children:[u.jsx("h1",{style:{marginBottom:16},children:"Calibration"}),u.jsx("p",{style:{color:"var(--text-secondary)"},children:"No calibration profile yet. Builds after 5+ resolved takes."}),u.jsx("pre",{style:{background:"var(--bg-secondary)",padding:12,borderRadius:4,color:"var(--text-primary)",marginTop:12,fontFamily:"var(--font-mono)"},children:"gbrain dream --phase calibration_profile"})]});const q=new Date(s.generated_at),H=Math.floor((Date.now()-q.getTime())/(1e3*60*60*24));return u.jsxs("div",{style:{padding:32,maxWidth:720},children:[u.jsx("h1",{style:{marginBottom:8},children:"Calibration"}),u.jsxs("div",{style:{color:"var(--text-muted)",fontSize:13,marginBottom:24},children:["Holder: ",s.holder," · ","Updated ",H===0?"today":`${H}d ago`,s.published&&" · published",s.grade_completion<.9&&` · ~${Math.round(s.grade_completion*100)}% graded`,!s.voice_gate_passed&&" · voice gate fell back to template"]}),u.jsx("section",{style:{marginBottom:32},children:u.jsx(Vi,{type:"brier-trend",ariaLabel:"Brier trend"})}),u.jsxs("section",{style:{marginBottom:32},children:[u.jsx("h2",{style:{fontSize:14,color:"var(--text-secondary)",marginBottom:12,fontWeight:400},children:"Pattern statements"}),u.jsx(Vi,{type:"pattern-statements",ariaLabel:"Pattern statements"})]}),u.jsx("section",{style:{marginBottom:32},children:u.jsx(Vi,{type:"domain-bars",ariaLabel:"Per-domain accuracy"})}),u.jsx("section",{style:{marginBottom:32},children:u.jsx(Vi,{type:"abandoned-threads",ariaLabel:"Abandoned threads"})}),s.active_bias_tags.length>0&&u.jsxs("section",{style:{marginBottom:32,color:"var(--text-muted)",fontSize:13},children:["Active bias tags: ",s.active_bias_tags.join(", ")]})]})}function $y(s){return s===0?"var(--accent-success, #2ea043)":s>=100?"var(--accent-danger, #f85149)":"var(--accent-warn, #d29922)"}function Yd(s){return`$${(s/100).toFixed(2)}`}function Fy(){const[s,x]=U.useState(null),[b,o]=U.useState(null);if(U.useEffect(()=>{let A=!0,q=null;const H=async()=>{try{const _=await Oe.jobsWatch();A&&(x(_),o(null))}catch(_){A&&o(_ instanceof Error?_.message:String(_))}A&&(q=setTimeout(H,1e3))};return H(),()=>{A=!1,q&&clearTimeout(q)}},[]),b)return u.jsxs("div",{style:{padding:24,color:"var(--accent-danger, #f85149)"},children:[u.jsx("h2",{children:"Jobs Watch — error"}),u.jsx("pre",{style:{whiteSpace:"pre-wrap"},children:b})]});if(!s)return u.jsx("div",{style:{padding:24,color:"var(--text-muted, #777)"},children:"Loading jobs watch…"});const j=new Date(s.ts_ms).toLocaleTimeString();return u.jsxs("div",{style:{padding:24,fontFamily:'var(--font-mono, "JetBrains Mono", monospace)'},children:[u.jsxs("h1",{style:{fontSize:18,marginBottom:4},children:["Jobs Watch",u.jsxs("span",{style:{marginLeft:12,color:"var(--text-muted, #777)",fontSize:12,fontWeight:"normal"},children:["updated ",j]})]}),u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Queue"}),u.jsxs("div",{children:["waiting=",u.jsx("b",{children:s.queue_health.waiting})," ","active=",u.jsx("b",{children:s.queue_health.active})," ","stalled=",u.jsx("b",{style:{color:s.queue_health.stalled>0?"var(--accent-warn, #d29922)":void 0},children:s.queue_health.stalled})]})]}),s.by_type.length>0&&u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"By type (24h)"}),u.jsxs("table",{style:{borderCollapse:"collapse"},children:[u.jsx("thead",{children:u.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[u.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"name"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"total"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"done"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"fail"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"dead"})]})}),u.jsx("tbody",{children:s.by_type.slice(0,6).map(A=>u.jsxs("tr",{children:[u.jsx("td",{style:{padding:"4px 12px 4px 0"},children:A.name}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:A.total}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:A.completed}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:A.failed}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:A.dead})]},A.name))})]})]}),u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Lease pressure (1h)"}),u.jsxs("div",{style:{color:$y(s.lease_pressure_1h)},children:[s.lease_pressure_1h," bounce",s.lease_pressure_1h===1?"":"s"]})]}),s.top_errors.length>0&&u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Top errors (24h)"}),u.jsx("table",{style:{borderCollapse:"collapse"},children:u.jsx("tbody",{children:s.top_errors.slice(0,5).map(A=>u.jsxs("tr",{children:[u.jsxs("td",{style:{textAlign:"right",padding:"4px 12px 4px 0",color:"var(--text-muted, #777)"},children:[A.count,"×"]}),u.jsx("td",{style:{padding:"4px 12px 4px 0"},children:A.cluster})]},A.cluster))})})]}),s.budget_owners.length>0&&u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Budget owners"}),u.jsxs("table",{style:{borderCollapse:"collapse"},children:[u.jsx("thead",{children:u.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[u.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"owner"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"spent"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"remaining"})]})}),u.jsx("tbody",{children:s.budget_owners.slice(0,5).map(A=>u.jsxs("tr",{children:[u.jsx("td",{style:{padding:"4px 12px 4px 0"},children:A.owner_id}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(A.total_spent_cents)}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(A.remaining_cents)})]},A.owner_id))})]})]})]})}function Iy(){var H,_;const[s,x]=U.useState(),[b,o]=U.useState(""),[j,A]=U.useState(!1);U.useEffect(()=>{let d=!0;const R=Ki();if(!R){o("No pending authorization request. Restart the connection from your client.");return}return Oe.oauthRequest(R).then(z=>{d&&x(z)}).catch(z=>{d&&o(z.message)}),()=>{d=!1}},[]);const q=async d=>{if(!(!s||j)){A(!0),o("");try{const R=await Oe.decideOAuthRequest(s.id,d,s.csrf);Hd(),window.location.assign(R.redirectUrl)}catch(R){o(R instanceof Error?R.message:"Approval failed. Restart the connection from your client."),x(void 0),A(!1)}}};return u.jsxs("section",{"aria-labelledby":"consent-title",style:{maxWidth:760},children:[u.jsx("h1",{id:"consent-title",children:"Approve client access"}),u.jsx("p",{style:{color:"var(--text-secondary)",margin:"16px 0"},children:"Only approve a connection you initiated. These permissions let the client act on your brain."}),b&&u.jsx("div",{role:"alert",className:"login-error",style:{marginBottom:16},children:b}),!s&&!b&&u.jsx("p",{role:"status",children:"Loading authorization request…"}),s&&u.jsxs(u.Fragment,{children:[u.jsxs("dl",{className:"oauth-consent-details",children:[u.jsx("dt",{children:"Client"}),u.jsx("dd",{children:s.clientName}),u.jsx("dt",{children:"Client ID"}),u.jsx("dd",{children:u.jsx("code",{children:s.clientId})}),u.jsx("dt",{children:"Redirect destination"}),u.jsx("dd",{children:u.jsx("code",{children:s.redirectUri})}),u.jsx("dt",{children:"Permissions"}),u.jsx("dd",{children:s.scopes.length?s.scopes.map(d=>u.jsx("span",{className:`badge ${d.includes("admin")?"badge-error":""}`,style:{marginRight:8},children:d},d)):"No permissions"}),u.jsx("dt",{children:"Administrative brain operations"}),u.jsx("dd",{children:s.scopes.some(d=>d==="admin")?"Eligible operations within the grant below. This does not grant owner dashboard access.":s.scopes.some(d=>d.endsWith("_admin"))?"The named administrative brain operations. This does not grant owner dashboard access.":"None"}),u.jsx("dt",{children:"Allowed operations"}),u.jsx("dd",{children:s.allowedOperations===null?"All operations permitted by these scopes and the server policy":s.allowedOperations.join(", ")||"None"}),u.jsx("dt",{children:"Write paths"}),u.jsx("dd",{children:s.boundSlugPrefixes===null?"Within the granted source":s.boundSlugPrefixes.join(", ")||"None"}),s.scopes.includes("agent")&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Delegated tools"}),u.jsx("dd",{children:((H=s.delegatedTools)==null?void 0:H.join(", "))||"None"}),u.jsx("dt",{children:"Delegated write paths"}),u.jsx("dd",{children:s.delegatedNamespace==="job"?"A separate namespace for each job":((_=s.delegatedSlugPrefixes)==null?void 0:_.join(", "))||"None"})]}),u.jsx("dt",{children:"Write source"}),u.jsx("dd",{children:s.sourceId??"Not configured"}),u.jsx("dt",{children:"Read sources"}),u.jsx("dd",{children:s.allowedSources.length?s.allowedSources.join(", "):s.sourceId??"Not configured"}),u.jsx("dt",{children:"Resource"}),u.jsx("dd",{children:u.jsx("code",{children:s.resource??"No resource binding requested"})}),u.jsx("dt",{children:"Request expires"}),u.jsx("dd",{children:new Date(s.expiresAt).toLocaleTimeString()})]}),u.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:24},children:[u.jsx("button",{className:"btn",disabled:j,onClick:()=>q("deny"),children:"Deny"}),u.jsx("button",{className:"btn btn-primary",disabled:j,onClick:()=>q("approve"),children:j?"Completing request…":"Approve access"})]})]}),b&&u.jsx("button",{className:"btn",onClick:()=>{Hd(),window.location.hash="agents"},children:"Return to agents"})]})}function Gd(){const s=window.location.hash.replace("#","")||"dashboard";return Ki()&&s==="dashboard"?"oauth-consent":["login","dashboard","agents","log","calibration","jobs","oauth-consent"].includes(s)?s:"dashboard"}function Py(){const[s,x]=U.useState(Gd);U.useEffect(()=>{const j=()=>x(Gd());return window.addEventListener("hashchange",j),()=>window.removeEventListener("hashchange",j)},[]);const b=j=>{window.location.hash=j,x(j)};if(s==="login")return u.jsx(Cy,{onLogin:()=>b(Ki()?"oauth-consent":"dashboard")});const o=async()=>{if(confirm("Sign out every active admin session, including other browsers and tabs? Each one will need to re-authenticate via a fresh magic link.")){try{await Oe.signOutEverywhere()}catch{}b("login")}};return u.jsxs("div",{className:"app",children:[u.jsxs("nav",{className:"sidebar",children:[u.jsx("div",{className:"sidebar-logo",children:"GBrain"}),u.jsxs("div",{className:"sidebar-nav",children:[u.jsx("a",{className:`nav-item ${s==="dashboard"?"active":""}`,onClick:()=>b("dashboard"),children:"Dashboard"}),u.jsx("a",{className:`nav-item ${s==="agents"?"active":""}`,onClick:()=>b("agents"),children:"Agents"}),u.jsx("a",{className:`nav-item ${s==="log"?"active":""}`,onClick:()=>b("log"),children:"Request Log"}),u.jsx("a",{className:`nav-item ${s==="calibration"?"active":""}`,onClick:()=>b("calibration"),children:"Calibration"}),u.jsx("a",{className:`nav-item ${s==="jobs"?"active":""}`,onClick:()=>b("jobs"),children:"Jobs Watch"})]}),u.jsx("div",{style:{marginTop:"auto",padding:"16px 12px",borderTop:"1px solid var(--border)"},children:u.jsx("button",{onClick:o,style:{background:"transparent",border:"1px solid var(--border)",color:"var(--text-secondary)",padding:"6px 10px",borderRadius:6,fontSize:12,cursor:"pointer",width:"100%"},title:"Revoke every active admin session — every browser, every tab",children:"Sign out everywhere"})})]}),u.jsxs("main",{className:"main",children:[s==="dashboard"&&u.jsx(My,{}),s==="agents"&&u.jsx(Xy,{}),s==="log"&&u.jsx(Jy,{}),s==="calibration"&&u.jsx(Wy,{}),s==="jobs"&&u.jsx(Fy,{}),s==="oauth-consent"&&u.jsx(Iy,{})]})]})}zy.createRoot(document.getElementById("root")).render(u.jsx(Xd.StrictMode,{children:u.jsx(Py,{})}));-`))??"",editOperations:!1}}function Ld(s){const x=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile);return{...s.applyProfile?{profile:s.profile}:{},sourceId:s.source,federatedRead:s.reads,boundSlugPrefixes:s.directPrefixes.trim()?Oa(s.directPrefixes):null,...s.scopes.trim()?{scopes:Oa(s.scopes)}:{},...s.editOperations?{allowedOperations:Oa(s.operationSnapshot)}:{},...x?{boundTools:s.tools,boundSourceId:s.source,delegatedNamespace:s.namespace,delegatedSlugPrefixes:s.namespace==="job"?null:Oa(s.delegatedPrefixes)}:{},boundMaxConcurrent:Number(s.concurrency),budgetUsdPerDay:s.budget==="unlimited"?null:s.budget,tokenTtl:s.ttl==="0"?null:Number(s.ttl),surface:s.surface==="default"?null:s.surface}}function Zd(s){return{...s.profile?{profile:s.profile}:{},scopes:s.scopes,sourceId:s.sourceId,federatedRead:s.federatedRead,boundSlugPrefixes:s.boundSlugPrefixes,allowedOperations:s.allowedOperations,boundTools:s.boundTools,boundSourceId:s.boundSourceId,boundBrainId:s.boundBrainId,delegatedNamespace:s.delegatedNamespace,delegatedSlugPrefixes:s.delegatedSlugPrefixes,boundMaxConcurrent:s.boundMaxConcurrent,budgetUsdPerDay:s.budgetUsdPerDay,tokenTtlSeconds:s.tokenTtlSeconds,surface:s.surface}}function Vd({draft:s,setDraft:x,sources:b,catalog:o,existing:A=!1}){const z=(h,U)=>x({...s,[h]:U}),q=new Set(b.map(h=>h.id)),H=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile),_={marginBottom:14};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:_,children:[u.jsx("label",{htmlFor:"grant-profile",children:"Permission profile"}),u.jsx("select",{id:"grant-profile",value:s.profile,onChange:h=>x({...s,profile:h.target.value,applyProfile:!0,scopes:"",editOperations:!1,surface:["operator","full"].includes(h.target.value)?"full":"starter"}),children:o.profiles.map(h=>u.jsx("option",{children:h},h))}),u.jsx("p",{className:"grant-help",children:"Memory writer lets this agent recall, save, correct, and withdraw memory. Delegating profiles also allow selected server tools to run jobs."}),A&&u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.applyProfile,onChange:h=>z("applyProfile",h.target.checked)}),"Apply this profile's current operation snapshot"]})]}),u.jsxs("div",{style:_,children:[u.jsx("label",{htmlFor:"grant-source",children:"Primary / write source"}),u.jsxs("select",{id:"grant-source",value:s.source,onChange:h=>z("source",h.target.value),children:[!q.has(s.source)&&u.jsxs("option",{value:s.source,children:[s.source," · unavailable"]}),b.map(h=>u.jsxs("option",{value:h.id,children:[h.name," (",h.id,")"]},h.id))]})]}),u.jsxs("fieldset",{style:{border:0,padding:0,margin:"0 0 14px"},children:[u.jsx("legend",{children:"Readable sources"}),[...b,...s.reads.filter(h=>!q.has(h)).map(h=>({id:h,name:`${h} · unavailable`}))].map(h=>u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.reads.includes(h.id),onChange:U=>z("reads",U.target.checked?[...s.reads,h.id]:s.reads.filter(j=>j!==h.id))}),h.name]},h.id))]}),u.jsxs("div",{style:_,children:[u.jsx("label",{htmlFor:"grant-direct-prefixes",children:"Direct write prefixes (one per line)"}),u.jsx("textarea",{id:"grant-direct-prefixes",rows:2,value:s.directPrefixes,onChange:h=>z("directPrefixes",h.target.value),placeholder:"work-example/"}),u.jsx("p",{className:"grant-help",children:"Blank grants the whole primary source. Coding agent requires an explicit prefix."})]}),H&&u.jsxs("fieldset",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[u.jsx("legend",{children:"Delegated jobs"}),u.jsx("p",{className:"grant-help",children:"Choose every tool explicitly. Jobs stay in the primary source; existing jobs retain their original limits."}),u.jsx("div",{className:"checkbox-group",style:{maxHeight:180,overflowY:"auto"},children:[...new Set([...o.delegatedTools,...s.tools])].map(h=>u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.tools.includes(h),onChange:U=>z("tools",U.target.checked?[...s.tools,h]:s.tools.filter(j=>j!==h))}),h,o.delegatedTools.includes(h)?"":" · unavailable"]},h))}),u.jsx("label",{htmlFor:"grant-namespace",children:"Delegated write namespace"}),u.jsxs("select",{id:"grant-namespace",value:s.namespace,onChange:h=>z("namespace",h.target.value),children:[u.jsx("option",{value:"job",children:"Each job's own wiki/agents/ directory"}),u.jsx("option",{value:"prefixes",children:"Explicit prefixes"})]}),s.namespace==="prefixes"&&u.jsx("textarea",{"aria-label":"Delegated prefixes",rows:2,value:s.delegatedPrefixes,onChange:h=>z("delegatedPrefixes",h.target.value),placeholder:"work-example/"})]}),u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12,..._},children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"grant-concurrency",children:"Concurrent jobs"}),u.jsx("input",{id:"grant-concurrency",type:"number",min:1,step:1,value:s.concurrency,onChange:h=>z("concurrency",h.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"grant-budget",children:"Daily delegated spend (USD)"}),u.jsx("input",{id:"grant-budget",value:s.budget,onChange:h=>z("budget",h.target.value),placeholder:"unlimited"}),u.jsx("p",{className:"grant-help",children:"Use unlimited for no spending cap, or an amount such as 2.50."})]})]}),u.jsxs("div",{style:_,children:[u.jsx("label",{htmlFor:"grant-ttl",children:"Future access token lifetime (seconds)"}),u.jsx("input",{id:"grant-ttl",type:"number",min:0,max:7776e3,step:1,value:s.ttl,onChange:h=>z("ttl",h.target.value)}),u.jsx("p",{className:"grant-help",children:"Renewable: 3600 (1 hour). Static bearer: 2592000 (30 days). 0 uses the server default. Existing tokens keep their expiry."})]}),u.jsxs("details",{style:_,children:[u.jsx("summary",{children:"Advanced permissions"}),u.jsx("label",{htmlFor:"grant-scopes",children:"Scope override"}),u.jsx("input",{id:"grant-scopes",value:s.scopes,onChange:h=>z("scopes",h.target.value),placeholder:"Use profile scopes"}),u.jsx("p",{className:"grant-help",children:"Scopes allow eligible brain operations. Admin does not grant owner dashboard access or delegation."}),u.jsx("label",{htmlFor:"grant-surface",children:"Visible tool catalog"}),u.jsx("select",{id:"grant-surface",value:s.surface,onChange:h=>z("surface",h.target.value),children:["verbs","starter","full","default"].map(h=>u.jsx("option",{children:h},h))}),u.jsx("p",{className:"grant-help",children:"Full shows all eligible tools; it does not grant additional authority."}),u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.editOperations,onChange:h=>z("editOperations",h.target.checked)}),"Replace operation authority snapshot"]}),s.editOperations&&u.jsxs(u.Fragment,{children:[u.jsx("textarea",{"aria-label":"Allowed operations",rows:5,value:s.operationSnapshot,onChange:h=>z("operationSnapshot",h.target.value)}),u.jsx("p",{className:"grant-help",children:"One operation name per line. An empty list denies every operation, including delegated tools."})]})]})]})}const My=[["Profile","profile"],["Scopes","scopes"],["Write source","sourceId"],["Readable sources","federatedRead"],["Direct prefixes","boundSlugPrefixes"],["Visible catalog","surface"],["Operation authority","allowedOperations"],["Delegated tools","boundTools"],["Delegated source","boundSourceId"],["Delegated brain","boundBrainId"],["Delegated namespace","delegatedNamespace"],["Delegated prefixes","delegatedSlugPrefixes"],["Concurrent jobs","boundMaxConcurrent"],["Daily USD cap","budgetUsdPerDay"],["Future token TTL","tokenTtlSeconds"]];function Ry(s,x){return s===null?x==="budgetUsdPerDay"?"Unlimited":x==="allowedOperations"?"Legacy scope-based catalog":"Unset":Array.isArray(s)?s.join(", ")||"(none)":String(s)}function Bd({grant:s,field:x}){const b=s[x];return x==="allowedOperations"&&Array.isArray(b)&&b.length>8?u.jsxs("details",{children:[u.jsxs("summary",{children:[b.length," operations · inspect list"]}),u.jsx("div",{style:{maxHeight:160,overflowY:"auto",marginTop:8},children:b.join(", ")})]}):u.jsx(u.Fragment,{children:Ry(b,x)})}function Kd({preview:s}){return u.jsxs("div",{"aria-live":"polite",style:{margin:"16px 0"},children:[u.jsx("h3",{children:"Review permissions"}),u.jsx("div",{style:{overflowX:"auto"},children:u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Permission"}),s.before&&u.jsx("th",{children:"Current"}),u.jsx("th",{children:"Proposed"})]})}),u.jsx("tbody",{children:My.filter(([,x])=>!s.before||JSON.stringify(s.before[x])!==JSON.stringify(s.after[x])).map(([x,b])=>u.jsxs("tr",{children:[u.jsx("th",{children:x}),s.before&&u.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:200},children:u.jsx(Bd,{grant:s.before,field:b})}),u.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:280},children:u.jsx(Bd,{grant:s.after,field:b})})]},b))})]})}),u.jsx("p",{className:"grant-help",children:s.tokenImplications})]})}function Uy({clientId:s,sources:x,sourcesReady:b=!0,onRescoped:o}){const[A,z]=R.useState(),[q,H]=R.useState(),[_,h]=R.useState(),[U,j]=R.useState(),[C,Y]=R.useState(""),[G,Z]=R.useState(!1),[W,ae]=R.useState(!1),[$,le]=R.useState(!1),ne=async(k=!1)=>{Z(!0),ae(!1);try{const[V,Se]=await Promise.all([be.clientGrant(s),be.grantCatalog()]);z(V.grant),H(bs(V.grant)),h(Se),j(void 0),Y(""),le(!1),k&&o(V.grant)}finally{Z(!1)}};R.useEffect(()=>{ne().catch(k=>Y(k.message))},[s]);const xe=async()=>{if(!(!q||!A||!b||$)){Z(!0),Y(""),ae(!1);try{const k=await be.updateClientGrant(s,{...U?Zd(U.after):Ld(q),expectedRevision:A.revision,dryRun:!U});U?(z(k.after),H(bs(k.after)),j(void 0),ae(!0),o(k.after)):j(k)}catch(k){const V=!!U&&Ss(k);le(V||k instanceof An&&k.status===409),j(void 0),Y(`${k instanceof Error?k.message:"Grant update failed."}${V?" The change may have completed. Reload the current grant before editing permissions again.":""}`)}finally{Z(!1)}}};return u.jsxs("section",{children:[u.jsx("div",{className:"section-title",children:"Permissions"}),A&&u.jsxs("p",{className:"grant-help",children:["Revision ",A.revision,". Review source access, direct tools, and delegated work independently."]}),A&&u.jsx(qy,{clientId:s,revision:A.revision}),!!(A!=null&&A.repairReasons.length)&&u.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:["Delegation needs repair: ",A.repairReasons.join(", "),". Review and explicitly grant the missing bindings below."]}),!b&&u.jsx("p",{role:"alert",children:"Current sources are unavailable. Retry sources before editing permissions."}),u.jsx("fieldset",{disabled:G||!b||$,style:{border:0,padding:0},children:q&&_&&u.jsx(Vd,{draft:q,catalog:_,sources:x,existing:!0,setDraft:k=>{H(k),j(void 0),ae(!1)}})}),C&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[C," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:G,onClick:()=>void ne(!0).catch(k=>Y(k.message)),children:"Reload current grant"})]}),U&&u.jsx(Kd,{preview:U}),W&&u.jsx("p",{role:"status",children:"Permissions saved. Credentials are unchanged."}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:G||!q||!_||!b||$,onClick:()=>void xe(),children:G?"Checking…":U?"Apply reviewed changes":"Preview changes"})]})}function qy({clientId:s,revision:x}){const[b,o]=R.useState(),[A,z]=R.useState(!1);return R.useEffect(()=>{let q=!0;const H=()=>void be.agentsSpend().then(h=>{q&&(o(h.find(U=>U.client_id===s)),z(!1))}).catch(()=>{q&&z(!0)});H();const _=setInterval(H,2e4);return()=>{q=!1,clearInterval(_)}},[s,x]),A?u.jsx("p",{role:"status",children:"Delegated spend is unavailable. Reload to check before starting more work."}):b?u.jsxs("div",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[u.jsx("strong",{children:"Delegated work"}),u.jsxs("p",{children:[b.inflight_count," unfinished jobs · Daily cap: ",b.cap_usd_per_day===null?"Unlimited":`$${b.cap_usd_per_day.toFixed(2)}`]}),u.jsxs("p",{className:"grant-help",children:["Recorded today: $",(b.spent_cents_today/100).toFixed(2),". Known outstanding reservations: $",(b.pending_cents/100).toFixed(2),", including overdue calls from earlier days."]}),b.unknown_count>0&&u.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:[b.unknown_count," unresolved calls have an unknown cost. The known amounts above do not bound total liability; a finite cap refuses further calls until reconciliation."]})]}):null}function Hy(s,x){const b=URL.createObjectURL(new Blob([JSON.stringify(s,null,2)],{type:"application/json"})),o=document.createElement("a");o.href=b,o.download=x,o.click(),URL.revokeObjectURL(b)}function Jd({clientId:s,grantTypes:x,revoked:b=!1,grantRevision:o}){const[A,z]=R.useState("generic"),q=x.includes("authorization_code")&&x.includes("client_credentials"),[H,_]=R.useState(q?"":x.includes("authorization_code")?"authorization-code":"client-credentials"),[h,U]=R.useState(),[j,C]=R.useState(),[Y,G]=R.useState([]),[Z,W]=R.useState(""),[ae,$]=R.useState(!1),[le,ne]=R.useState(!1),[xe,k]=R.useState(!1),[V,Se]=R.useState(0);R.useEffect(()=>{if(b)return;let se=!0;if(C(void 0),G([]),W(""),ne(!1),k(!1),!!H)return Promise.all([be.clientSetup(s,A,H),be.grantCatalog()]).then(([F,de])=>{se&&(C(F.setup),G(F.instructions),U(de))}).catch(F=>{se&&W(F instanceof Error?F.message:"Setup instructions are unavailable.")}),()=>{se=!1}},[s,A,H,b,o,V]);const je=async()=>{if(j){$(!0),W("");try{const se=await be.recoverClient(s,A,H),F=H==="authorization-code"?se.oauthSetup:se.credentials;if(!F)throw new Error("No matching setup file was returned. Ask the host administrator to inspect this client’s credential delivery.");Hy(F,`${s}-${H==="authorization-code"?"oauth-setup":"credentials"}.json`),ne(!0)}catch(se){W(se instanceof Error?se.message:"Download failed. Existing permissions are unchanged.")}finally{$(!1)}}};return u.jsxs("section",{"aria-labelledby":"client-setup-title",children:[u.jsx("h3",{id:"client-setup-title",className:"section-title",children:"Set up this client"}),b?u.jsx("p",{children:"This client is revoked. Register a new client to connect another harness."}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"grant-help",children:"Registration grants access. Configure the intended harness, then verify an actual memory round trip there."}),u.jsx("label",{htmlFor:"setup-harness",children:"Harness"}),u.jsxs("select",{id:"setup-harness",value:A,onChange:se=>z(se.target.value),disabled:ae,children:[!h&&u.jsx("option",{value:"generic",children:"Generic MCP client"}),h==null?void 0:h.harnesses.map(se=>u.jsx("option",{value:se.id,children:se.label},se.id))]}),q&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"setup-flow",children:"Connection flow"}),u.jsxs("select",{id:"setup-flow",value:H,onChange:se=>_(se.target.value),disabled:ae,children:[u.jsx("option",{value:"",children:"Choose the flow supported by your harness"}),u.jsx("option",{value:"authorization-code",children:"Browser sign-in with PKCE"}),u.jsx("option",{value:"client-credentials",children:"Machine credentials"})]})]}),j&&u.jsxs(u.Fragment,{children:[u.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[u.jsx("dt",{children:"MCP URL"}),u.jsx("dd",{children:u.jsx("code",{children:j.mcp_url})}),u.jsx("dt",{children:"OAuth issuer"}),u.jsx("dd",{children:u.jsx("code",{children:j.issuer_url})}),u.jsx("dt",{children:"Client ID"}),u.jsx("dd",{children:u.jsx("code",{children:j.client.client_id})}),u.jsx("dt",{children:"Scopes"}),u.jsx("dd",{children:j.scopes.join(" ")||"None"}),u.jsx("dt",{children:"Authentication"}),u.jsx("dd",{children:j.client.token_endpoint_auth_method==="none"?"Public client — PKCE, no client secret":j.client.token_endpoint_auth_method}),j.flow==="authorization-code"&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Redirect URIs"}),u.jsx("dd",{children:j.client.redirect_uris.map(se=>u.jsx("div",{children:u.jsx("code",{children:se})},se))})]})]}),u.jsx("ol",{children:Y.map((se,F)=>u.jsx("li",{style:{marginBottom:8,overflowWrap:"anywhere"},children:se},F))}),u.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:16},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(Y.join(`-`)).then(()=>k(!0)).catch(()=>W("Clipboard unavailable. Select and copy the instructions above."))},children:xe?"Instructions copied":"Copy setup instructions"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:ae,onClick:()=>void je(),children:ae?"Preparing download…":j.flow==="authorization-code"?"Download OAuth setup":"Download credentials"})]}),u.jsx("p",{className:"grant-help",children:"Keep downloaded files private. Set permissions to 0600 on the target computer. A setup download does not verify the harness."})]}),!H&&u.jsx("p",{role:"status",children:"This client supports both flows. Choose one before requesting setup instructions."}),H&&!j&&!Z&&u.jsx("p",{role:"status",children:"Loading setup instructions…"}),le&&u.jsx("p",{role:"status",children:"Setup file delivered to your browser. Harness verification is still required."}),Z&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[Z," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:ae,onClick:()=>Se(se=>se+1),children:"Retry setup"})]})]})]})}const gs={"invalidate-tokens":"Invalidate tokens",revoke:"Revoke client",delete:"Delete client"};function By({clientId:s,name:x,revoked:b,onChanged:o,onBusyChange:A}){const[z,q]=R.useState(),[H,_]=R.useState(!1),[h,U]=R.useState(""),[j,C]=R.useState(!1),Y=async Z=>{_(!0),U(""),q(void 0);try{q(await be.clientLifecycle(s,{action:Z,dryRun:!0}))}catch(W){U(W instanceof Error?W.message:"Could not preview this action. Retry after checking the client.")}finally{_(!1)}},G=async()=>{if(z){_(!0),A==null||A(!0),U("");try{await be.clientLifecycle(s,{action:z.action,dryRun:!1,yes:!0,expectedRevision:z.before.revision}),o()}catch(Z){const W=Ss(Z);U(`${Z instanceof Error?Z.message:"Request failed."} ${W?"The action may have completed. Reload the client and inspect its current state before requesting another action.":"The request was refused. Review a fresh preview before applying an action."}`),C(W),q(void 0)}finally{_(!1),A==null||A(!1)}}};return u.jsxs("section",{"aria-labelledby":"client-lifecycle-title",style:{marginTop:28},children:[u.jsx("h3",{id:"client-lifecycle-title",className:"section-title",children:"Client access"}),u.jsx("p",{className:"grant-help",children:"Invalidating tokens keeps the client and its secret. Revoking ends access and keeps a visible registration. Deleting removes the registration. Memory and audit history remain."}),!z&&u.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["invalidate-tokens","revoke","delete"].filter(Z=>!b||Z==="delete").map(Z=>u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H||j,onClick:()=>void Y(Z),children:gs[Z]},Z))}),z&&u.jsxs("div",{"aria-live":"polite",style:{border:"1px solid var(--border)",padding:16},children:[u.jsxs("h4",{style:{margin:"0 0 12px"},children:[gs[z.action],": ",x]}),u.jsxs("p",{children:[u.jsx("code",{children:s})," · Revision ",z.before.revision]}),u.jsx("ul",{children:(Array.isArray(z.consequences)?z.consequences:[z.consequences]).map((Z,W)=>u.jsx("li",{children:Z},W))}),u.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H,onClick:()=>q(void 0),children:"Cancel"}),u.jsx("button",{type:"button",className:"btn btn-danger",disabled:H,onClick:()=>void G(),children:H?"Applying…":`Confirm ${gs[z.action].toLowerCase()}`})]})]}),h&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[h," ",j&&u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:o,children:"Reload client list"})]})]})}function _n({title:s,titleId:x,children:b,onClose:o,busy:A=!1,drawer:z=!1}){const q=R.useRef(null),H=R.useRef(o);H.current=o;const _=R.useRef(A);_.current=A;const[h]=R.useState(()=>document.activeElement instanceof HTMLElement?document.activeElement:null);return R.useEffect(()=>{const U=q.current;if(!U)return;(U.querySelector("[data-autofocus]")??U).focus();const j=C=>{if(C.key==="Escape"&&(C.preventDefault(),_.current||H.current()),C.key!=="Tab")return;const Y=[...U.querySelectorAll('button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], summary, [tabindex="0"]')].filter(W=>W.getClientRects().length>0&&!W.closest("fieldset:disabled")),G=Y[0],Z=Y[Y.length-1];if(!G){C.preventDefault(),U.focus();return}C.shiftKey&&(document.activeElement===G||document.activeElement===U)?(C.preventDefault(),Z.focus()):!C.shiftKey&&(document.activeElement===Z||document.activeElement===U)&&(C.preventDefault(),G.focus())};return U.addEventListener("keydown",j),()=>{U.removeEventListener("keydown",j),h!=null&&h.isConnected&&h.focus()}},[h]),u.jsx("div",{className:z?"drawer-overlay":"modal-overlay",onClick:()=>{A||o()},children:u.jsxs("div",{ref:q,role:"dialog","aria-modal":"true","aria-labelledby":x,"aria-busy":A,tabIndex:-1,className:z?"drawer":"modal",onClick:U=>U.stopPropagation(),style:z?{width:"min(640px, 95vw)"}:{maxWidth:760,width:"92vw",minWidth:0,maxHeight:"90vh",overflowY:"auto"},children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16,alignItems:"start",marginBottom:20},children:[u.jsx("h2",{id:x,className:"modal-title",style:{margin:0},children:s}),u.jsx("button",{type:"button",className:"btn btn-secondary","aria-label":`Close ${s}`,disabled:A,onClick:o,children:"Close"})]}),b]})})}function Yy(s){const x=s.kind!=="machine",b=x?s.redirectUris.split(`-`).map(o=>o.trim()).filter(Boolean):[];if(x&&!b.length)throw new Error("Enter the exact redirect URI from your MCP client settings, one per line.");for(const o of b)try{new URL(o)}catch{throw new Error("Each redirect URI must be a complete URI. Copy it exactly from your MCP client settings.")}return{grantTypes:x?["authorization_code","refresh_token"]:["client_credentials"],redirectUris:b,tokenEndpointAuthMethod:s.kind==="public-pkce"?"none":s.kind==="machine"?"client_secret_post":s.confidentialMethod}}function wy(s){const x=Math.floor((Date.now()-s.getTime())/1e3);return x<60?"just now":x<3600?Math.floor(x/60)+"m ago":x<86400?Math.floor(x/3600)+"h ago":Math.floor(x/86400)+"d ago"}function Gy(){const[s,x]=R.useState([]),[b,o]=R.useState([]),[A,z]=R.useState(!1),[q,H]=R.useState(!1),[_,h]=R.useState(""),[U,j]=R.useState(""),[C,Y]=R.useState(!0),[G,Z]=R.useState(!0),[W,ae]=R.useState(!1),[$,le]=R.useState(!1),[ne,xe]=R.useState(),[k,V]=R.useState(),[Se,je]=R.useState(!1),[se,F]=R.useState(),de=R.useRef(0),we=R.useRef(0),Ne=async()=>{const N=++de.current;Y(!0);try{const w=await be.agents();if(N!==de.current)return;x(w),z(!0),h("")}catch(w){N===de.current&&h(w instanceof Error?w.message:"Clients are unavailable.")}finally{N===de.current&&Y(!1)}},Ze=async()=>{const N=++we.current;Z(!0);try{const w=await be.sources();if(N!==we.current)return;o(w),H(!0),j("")}catch(w){N===we.current&&(H(!1),j(w instanceof Error?w.message:"Sources are unavailable."))}finally{N===we.current&&Z(!1)}};R.useEffect(()=>(Ne(),Ze(),()=>{de.current++,we.current++}),[]);const T=s.filter(N=>!W||N.status!=="revoked");return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12,flexWrap:"wrap",alignItems:"center",marginBottom:24},children:[u.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Agents"}),u.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:W,onChange:N=>ae(N.target.checked)}),"Hide revoked"]}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:C,onClick:()=>void Ne(),children:"Refresh clients"}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>je(!0),children:"+ API Key"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:!q||!b.length||G,onClick:()=>le(!0),children:"+ OAuth Client"})]})]}),u.jsx("p",{className:"grant-help",style:{marginBottom:16},children:"Owner administration uses this dashboard’s login. An OAuth client’s admin scope allows eligible brain operations; it does not open this dashboard."}),_&&u.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:[A?"Showing previously loaded clients. ":"Could not load clients. ",_," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:C,onClick:()=>void Ne(),children:"Retry clients"})]}),U&&u.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:["Could not load current sources. Registration and permission changes are unavailable. ",U," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:G,onClick:()=>void Ze(),children:"Retry sources"})]}),!U&&!q&&u.jsx("p",{role:"status",children:"Loading sources before registration…"}),q&&!b.length&&u.jsx("p",{role:"status",children:"No active sources are available. Add or unarchive a source on the host before registering a client."}),!A&&!_&&u.jsx("p",{role:"status",children:"Loading clients…"}),A&&!s.length&&u.jsx("p",{style:{textAlign:"center",padding:48},children:"No clients registered. Register a client to grant access to a harness."}),A&&s.length>0&&!T.length&&u.jsx("p",{style:{textAlign:"center",padding:48},children:"All clients are revoked. Uncheck “Hide revoked” to view them."}),T.length>0&&u.jsxs("div",{style:{overflowX:"auto"},children:[u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Name"}),u.jsx("th",{children:"Type"}),u.jsx("th",{children:"Scopes"}),u.jsx("th",{children:"Sources"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Requests"}),u.jsx("th",{children:"Last used"})]})}),u.jsx("tbody",{children:T.map(N=>u.jsxs("tr",{onClick:()=>V(N),style:{cursor:"pointer"},children:[u.jsx("td",{children:u.jsx("button",{type:"button",className:"client-name-button",onClick:w=>{w.stopPropagation(),V(N)},children:N.name||N.client_name})}),u.jsx("td",{children:u.jsx("span",{className:"badge "+(N.auth_type==="oauth"?"badge-read":"badge-write"),children:N.auth_type==="oauth"?"OAuth":"API key"})}),u.jsx("td",{children:(N.scope||"").split(" ").filter(Boolean).map(w=>u.jsx("span",{className:"badge badge-"+w,style:{marginRight:4},children:w},w))}),u.jsx("td",{children:N.auth_type==="oauth"?(N.source_id||"none")+" · "+(N.federated_read||[]).length+" readable":"Unscoped"}),u.jsx("td",{children:u.jsx("span",{className:"badge "+(N.status==="active"?"badge-success":"badge-danger"),children:N.status})}),u.jsxs("td",{children:[N.requests_today||0,u.jsxs("span",{style:{color:"var(--text-muted)"},children:[" / ",N.total_requests||0]})]}),u.jsx("td",{children:N.last_used_at?wy(new Date(N.last_used_at)):"Never"})]},N.auth_type+":"+N.id))})]}),u.jsxs("p",{className:"grant-help",style:{marginTop:12},children:[s.filter(N=>N.status==="active").length," active / ",s.length," total"]})]}),$&&u.jsx(Xy,{sources:b,sourcesReady:q,onClose:()=>le(!1),onRegistered:N=>{le(!1),xe(N),Ne()}}),ne&&u.jsxs(_n,{title:"Client registered",titleId:"registered-client-title",onClose:()=>xe(void 0),children:[u.jsxs("p",{role:"status",style:{marginBottom:16},children:[ne.name," is registered. Its harness connection has not been verified."]}),u.jsx(Jd,{clientId:ne.clientId,grantTypes:ne.grantTypes})]}),k&&u.jsx(Qy,{agent:k,sources:b,sourcesReady:q,onClose:()=>V(void 0),onChanged:()=>{V(void 0),Ne()},onRescoped:N=>{V(w=>w&&{...w,source_id:N.sourceId,federated_read:N.federatedRead,scope:N.scopes.join(" "),token_ttl:N.tokenTtlSeconds}),Ne()}},k.id),Se&&u.jsx(Zy,{onClose:()=>je(!1),onCreated:N=>{je(!1),F(N),Ne()}}),se&&u.jsx(Vy,{token:se,onClose:()=>F(void 0)})]})}function Xy({sources:s,sourcesReady:x,onClose:b,onRegistered:o}){const[A,z]=R.useState(""),[q,H]=R.useState(()=>bs()),[_,h]=R.useState({kind:"machine",redirectUris:"",confidentialMethod:"client_secret_post"}),[U,j]=R.useState(),[C,Y]=R.useState(""),[G,Z]=R.useState(),[W,ae]=R.useState(!1),[$,le]=R.useState(""),[ne,xe]=R.useState(),[k,V]=R.useState(!1),Se=()=>{Y(""),be.grantCatalog().then(j).catch(F=>Y(F instanceof Error?F.message:"Permission catalog unavailable."))};R.useEffect(Se,[]);const je=F=>{h(F),Z(void 0)},se=async F=>{if(F.preventDefault(),!(!x||!U||k)){if(!A.trim()){le("Enter a client name.");return}ae(!0),le("");try{const de=(G==null?void 0:G.oauth)??Yy(_),we=(G==null?void 0:G.name)??A.trim(),Ne=await be.registerClient({...G?Zd(G.grant.after):Ld(q),...de,name:we,dryRun:!G});G?o({clientId:Ne.clientId,name:we,grantTypes:de.grantTypes}):Z({grant:Ne,oauth:de,name:we})}catch(de){le(de instanceof Error?de.message:"Registration failed.");const we=!!G&&Ss(de);if(V(we),G&&(we||de instanceof An&&de.status===409))try{const Ne=(await be.agents()).filter(Ze=>Ze.auth_type==="oauth"&&Ze.status==="active"&&(Ze.name||Ze.client_name)===G.name);Ne.length===1&&(xe({clientId:Ne[0].id||Ne[0].client_id,name:G.name,grantTypes:Ne[0].grant_types}),V(!0))}catch{}Z(void 0)}finally{ae(!1)}}};return u.jsx(_n,{title:"Register OAuth client",titleId:"register-client-title",onClose:b,busy:W,children:u.jsxs("form",{onSubmit:se,children:[u.jsxs("fieldset",{disabled:W||k,style:{border:0,padding:0},children:[u.jsx("label",{htmlFor:"agent-name",children:"Client name"}),u.jsx("input",{id:"agent-name","data-autofocus":!0,value:A,placeholder:"agent-example",onChange:F=>{z(F.target.value),Z(void 0)}}),u.jsx("label",{htmlFor:"oauth-connection-kind",style:{marginTop:16},children:"Connection type"}),u.jsxs("select",{id:"oauth-connection-kind",value:_.kind,onChange:F=>je({..._,kind:F.target.value}),children:[u.jsx("option",{value:"machine",children:"Machine credentials"}),u.jsx("option",{value:"public-pkce",children:"Browser sign-in: public client with PKCE"}),u.jsx("option",{value:"confidential-pkce",children:"Browser sign-in: confidential client with PKCE"})]}),u.jsx("p",{className:"grant-help",children:"Choose the method required by your MCP client. Browser sign-in requires the owner’s approval. Public clients use PKCE without a client secret."}),_.kind!=="machine"&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"oauth-redirect-uris",children:"Exact redirect URIs (one per line)"}),u.jsx("textarea",{id:"oauth-redirect-uris",rows:3,value:_.redirectUris,onChange:F=>je({..._,redirectUris:F.target.value}),placeholder:"https://client.example.com/oauth/callback"}),u.jsx("p",{className:"grant-help",children:"Copy these from the client’s OAuth settings. Keep the complete path and query. GBrain uses S256 PKCE."})]}),_.kind==="confidential-pkce"&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"oauth-client-auth",children:"Client secret authentication"}),u.jsxs("select",{id:"oauth-client-auth",value:_.confidentialMethod,onChange:F=>je({..._,confidentialMethod:F.target.value}),children:[u.jsx("option",{value:"client_secret_post",children:"client_secret_post (request body)"}),u.jsx("option",{value:"client_secret_basic",children:"client_secret_basic (HTTP Basic)"})]})]}),_.kind==="machine"&&u.jsx("p",{className:"grant-help",children:"Machine handoffs use client_secret_post to renew their access tokens."}),u.jsx("div",{style:{marginTop:24},children:U&&u.jsx(Vd,{draft:q,setDraft:F=>{H(F),Z(void 0)},catalog:U,sources:s})})]}),C&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[C," ",u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:Se,children:"Retry permissions"})]}),!x&&u.jsx("p",{role:"alert",children:"Current sources are unavailable. Close this form and retry sources before registration."}),G&&u.jsxs(u.Fragment,{children:[u.jsx(Kd,{preview:G.grant}),u.jsxs("div",{"aria-live":"polite",children:[u.jsx("h3",{children:"Review connection"}),u.jsxs("dl",{className:"oauth-consent-details",children:[u.jsx("dt",{children:"Client name"}),u.jsx("dd",{children:G.name}),u.jsx("dt",{children:"Grant types"}),u.jsx("dd",{children:G.oauth.grantTypes.join(", ")}),u.jsx("dt",{children:"Authentication"}),u.jsx("dd",{children:G.oauth.tokenEndpointAuthMethod}),G.oauth.redirectUris.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Exact redirect URIs"}),u.jsx("dd",{children:G.oauth.redirectUris.map(F=>u.jsx("div",{children:u.jsx("code",{children:F})},F))})]})]})]})]}),$&&u.jsx("p",{role:"alert",style:{color:"var(--error)",margin:"16px 0"},children:$}),ne&&u.jsxs("div",{role:"status",children:[u.jsxs("p",{children:["A client named ",ne.name," is registered. Open its setup instructions and recover its existing download."]}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>o(ne),children:"Open existing client setup"})]}),k&&!ne&&u.jsx("p",{role:"status",children:"Registration may have completed. Close this form and refresh clients before trying again. No automatic retry was made."}),u.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"flex-end",marginTop:20},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:b,children:"Cancel"}),u.jsx("button",{type:"submit",className:"btn btn-primary",disabled:W||!U||!x||k,children:W?"Checking…":G?"Register with reviewed permissions":"Preview permissions"})]})]})})}function Qy({agent:s,sources:x,sourcesReady:b,onClose:o,onChanged:A,onRescoped:z}){const q=s.id||s.client_id||"",H=s.name||s.client_name||q,[_,h]=R.useState(),[U,j]=R.useState(""),[C,Y]=R.useState(0),[G,Z]=R.useState(!1),[W,ae]=R.useState(!1);return R.useEffect(()=>{if(s.auth_type!=="oauth")return;let $=!0;return j(""),be.clientDetails(q).then(le=>{$&&h(le)}).catch(le=>{$&&j(le instanceof Error?le.message:"Client details unavailable.")}),()=>{$=!1}},[q,s.auth_type,C]),u.jsxs(_n,{title:H,titleId:"client-details-title",onClose:o,drawer:!0,busy:W,children:[u.jsx("span",{className:"badge "+(s.status==="active"?"badge-success":"badge-danger"),children:s.status}),u.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[u.jsx("dt",{children:"Client ID"}),u.jsx("dd",{children:u.jsx("code",{children:q})}),u.jsx("dt",{children:"Scopes"}),u.jsx("dd",{children:s.scope||"None"}),u.jsx("dt",{children:"Registered"}),u.jsx("dd",{children:new Date(s.created_at).toLocaleString()}),u.jsx("dt",{children:"Token lifetime"}),u.jsx("dd",{children:s.token_ttl?s.token_ttl+" seconds":"Server default (future tokens)"}),_&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Grant types"}),u.jsx("dd",{children:_.client.grant_types.join(", ")}),u.jsx("dt",{children:"Authentication"}),u.jsx("dd",{children:_.client.token_endpoint_auth_method})]})]}),s.auth_type==="oauth"?u.jsxs(u.Fragment,{children:[U&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[U," ",u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Y($=>$+1),children:"Retry client details"})]}),!_&&!U&&u.jsx("p",{role:"status",children:"Loading client details…"}),_&&u.jsxs(u.Fragment,{children:[u.jsx(Jd,{clientId:q,grantTypes:_.client.grant_types,revoked:s.status==="revoked",grantRevision:_.grant.revision}),s.status==="active"&&u.jsxs("details",{style:{marginTop:24},children:[u.jsx("summary",{style:{cursor:"pointer",fontWeight:600},children:"Edit access levels"}),u.jsx(Uy,{clientId:q,sources:x,sourcesReady:b,onRescoped:$=>{h(le=>le&&{...le,grant:$}),z($)}})]}),u.jsx(By,{clientId:q,name:H,revoked:s.status==="revoked",onChanged:A,onBusyChange:ae})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("h3",{className:"section-title",children:"API key"}),u.jsx("p",{children:"Use this key as a bearer token in a client that supports static authentication. Its value is available only in the original private handoff."}),s.status==="active"&&u.jsxs("div",{style:{marginTop:20},children:[G?u.jsxs(u.Fragment,{children:[u.jsxs("p",{children:["Revoke the API key ",H," (",q,")? Only this key stops working. Memory remains."]}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:()=>Z(!1),children:"Cancel"})," ",u.jsx("button",{type:"button",className:"btn btn-danger",disabled:W,onClick:()=>{ae(!0),be.revokeApiKey(q).then(A).catch($=>j($ instanceof Error?$.message:"Revoke failed. Refresh the client list before retrying.")).finally(()=>ae(!1))},children:"Confirm revoke"})]}):u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Z(!0),children:"Revoke API key"}),U&&u.jsx("p",{role:"alert",children:U})]})]})]})}const Ly=[{id:"read",label:"Read",help:"Search and read memory."},{id:"write",label:"Write",help:"Add and edit memory."},{id:"admin",label:"Admin",help:"Brain administration operations. Grant only to fully trusted clients."}];function Zy({onClose:s,onCreated:x}){const[b,o]=R.useState(""),[A,z]=R.useState(!1),[q,H]=R.useState(""),[_,h]=R.useState(["read","write"]),U=async j=>{if(j.preventDefault(),!b.trim()){H("Enter a key name.");return}if(_.length===0){H("Choose at least one access level.");return}z(!0),H("");try{const C=await be.createApiKey(b.trim(),_);x({name:C.name,token:C.token})}catch(C){H(C instanceof Error?C.message:"Key creation failed. Inspect the clients list before retrying.")}finally{z(!1)}};return u.jsx(_n,{title:"Create API key",titleId:"create-api-key-title",onClose:s,busy:A,children:u.jsxs("form",{onSubmit:U,children:[u.jsx("p",{className:"grant-help",children:"API keys default to read and write. Admin is granted only when you check it. Choose an OAuth client for per-source or per-operation access. This key cannot log into the owner dashboard."}),u.jsx("label",{htmlFor:"api-key-name",children:"Key name"}),u.jsx("input",{id:"api-key-name","data-autofocus":!0,value:b,maxLength:128,disabled:A,onChange:j=>o(j.target.value)}),u.jsxs("fieldset",{style:{marginTop:16},children:[u.jsx("legend",{children:"Access levels"}),Ly.map(j=>u.jsxs("label",{style:{display:"block"},children:[u.jsx("input",{type:"checkbox",checked:_.includes(j.id),disabled:A,onChange:C=>h(Y=>C.target.checked?[...Y,j.id]:Y.filter(G=>G!==j.id))})," ",j.label," ",u.jsx("span",{className:"grant-help",children:j.help})]},j.id))]}),q&&u.jsx("p",{role:"alert",children:q}),u.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:20},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:A,onClick:s,children:"Cancel"}),u.jsx("button",{type:"submit",className:"btn btn-primary",disabled:A,children:A?"Creating…":"Create key"})]})]})})}function Vy({token:s,onClose:x}){const[b,o]=R.useState(!1),[A,z]=R.useState("");return u.jsxs(_n,{title:"API key created",titleId:"api-key-created-title",onClose:x,children:[u.jsx("p",{children:s.name}),u.jsx("label",{htmlFor:"new-api-key",children:"Bearer token"}),u.jsx("textarea",{id:"new-api-key",rows:3,readOnly:!0,value:s.token}),u.jsx("p",{className:"grant-help",children:"Save this token privately now. It will not be shown again. A key’s creation does not verify your harness connection."}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(s.token).then(()=>o(!0)).catch(()=>z("Clipboard unavailable. Select and copy the token above."))},children:b?"Copied":"Copy token"}),A&&u.jsx("p",{role:"alert",children:A}),u.jsx("button",{type:"button",className:"btn btn-primary",style:{marginLeft:12},onClick:x,children:"Done"})]})}function Ky(){const[s,x]=R.useState({rows:[],total:0,page:1,pages:1}),[b,o]=R.useState(1),[A,z]=R.useState("all"),[q,H]=R.useState(null);R.useEffect(()=>{_(b)},[b,A]);const _=C=>{const Y=A!=="all"?`&agent=${encodeURIComponent(A)}`:"";be.requests(C,Y).then(x).catch(()=>{})},h=C=>{const Y=Date.now()-new Date(C).getTime();return Y<6e4?`${Math.floor(Y/1e3)}s ago`:Y<36e5?`${Math.floor(Y/6e4)} min ago`:Y<864e5?`${Math.floor(Y/36e5)}h ago`:new Date(C).toLocaleDateString()},U=C=>{if(!C)return null;const{query:Y,slug:G,partial:Z,limit:W,...ae}=C,$=[];return Y&&$.push(`"${Y}"`),G&&$.push(G),Z&&$.push(`~${Z}`),W&&$.push(`limit=${W}`),Object.keys(ae).length>0&&$.push(`+${Object.keys(ae).length} params`),$.join(" ")},j=new Map;return s.rows.forEach(C=>{C.token_name&&j.set(C.token_name,C.agent_name||C.token_name)}),u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[u.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Request Log"}),u.jsxs("select",{value:A,onChange:C=>{z(C.target.value),o(1)},style:{background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:6,padding:"4px 8px",fontSize:13},children:[u.jsx("option",{value:"all",children:"All agents"}),[...j.entries()].map(([C,Y])=>u.jsx("option",{value:C,children:Y},C))]})]}),s.rows.length===0?u.jsx("div",{style:{textAlign:"center",padding:48,color:"var(--text-muted)"},children:"No requests yet."}):u.jsxs(u.Fragment,{children:[u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Time"}),u.jsx("th",{children:"Agent"}),u.jsx("th",{children:"Operation"}),u.jsx("th",{children:"Params"}),u.jsx("th",{children:"Latency"}),u.jsx("th",{children:"Status"})]})}),u.jsx("tbody",{children:s.rows.map(C=>u.jsxs(Xd.Fragment,{children:[u.jsxs("tr",{onClick:()=>H(q===C.id?null:C.id),style:{cursor:"pointer"},children:[u.jsx("td",{style:{color:"var(--text-secondary)",whiteSpace:"nowrap"},children:h(C.created_at)}),u.jsx("td",{children:u.jsx("a",{style:{color:"var(--text-link, #88aaff)",cursor:"pointer",textDecoration:"none",fontWeight:500},onClick:Y=>{Y.stopPropagation(),z(C.token_name),o(1)},children:C.agent_name||C.token_name})}),u.jsx("td",{className:"mono",children:C.operation}),u.jsx("td",{style:{color:"var(--text-secondary)",fontSize:12,maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:U(C.params)}),u.jsxs("td",{className:"mono",children:[C.latency_ms,"ms"]}),u.jsx("td",{children:u.jsx("span",{className:`badge badge-${C.status}`,children:C.status})})]}),q===C.id&&u.jsx("tr",{children:u.jsx("td",{colSpan:6,style:{background:"var(--bg-secondary, #0f0f1a)",padding:16},children:u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"100px 1fr",gap:"6px 12px",fontSize:13},children:[u.jsx("span",{style:{color:"var(--text-muted)"},children:"Time"}),u.jsx("span",{children:new Date(C.created_at).toLocaleString()}),u.jsx("span",{style:{color:"var(--text-muted)"},children:"Agent"}),u.jsx("span",{className:"mono",children:C.token_name}),u.jsx("span",{style:{color:"var(--text-muted)"},children:"Operation"}),u.jsx("span",{className:"mono",children:C.operation}),u.jsx("span",{style:{color:"var(--text-muted)"},children:"Latency"}),u.jsxs("span",{children:[C.latency_ms,"ms"]}),C.params&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--text-muted)"},children:"Params"}),u.jsx("pre",{className:"mono",style:{margin:0,whiteSpace:"pre-wrap",fontSize:12},children:JSON.stringify(C.params,null,2)})]}),C.error_message&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:"Error"}),u.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:C.error_message})]})]})})})]},C.id))})]}),u.jsxs("div",{className:"pagination",children:[u.jsxs("span",{children:["Page ",s.page," of ",s.pages," (",s.total," total)"]}),u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx("button",{disabled:s.page<=1,onClick:()=>o(C=>C-1),children:"Previous"}),u.jsx("button",{disabled:s.page>=s.pages,onClick:()=>o(C=>C+1),children:"Next"})]})]})]})]})}function Jy({markup:s}){return u.jsx("div",{style:{width:"100%",overflow:"auto"},dangerouslySetInnerHTML:{__html:s}})}function Vi({type:s,ariaLabel:x}){const[b,o]=R.useState(""),[A,z]=R.useState("");return R.useEffect(()=>{let q=!1;return be.calibrationChart(s).then(H=>{q||o(H)}).catch(H=>{q||z(H.message??"fetch failed")}),()=>{q=!0}},[s]),A?u.jsxs("div",{style:{padding:16,color:"var(--error)"},role:"alert",children:[x,": ",A]}):b?u.jsx(Jy,{markup:b}):u.jsxs("div",{style:{padding:16,color:"var(--text-muted)"},children:[x," loading..."]})}function ky(){const[s,x]=R.useState(null),[b,o]=R.useState(!0),[A,z]=R.useState("");if(R.useEffect(()=>{be.calibrationProfile().then(_=>{x(_),o(!1)}).catch(_=>{z(_.message??"fetch failed"),o(!1)})},[]),b)return u.jsx("div",{style:{padding:24,color:"var(--text-secondary)"},children:"Loading calibration profile…"});if(A)return u.jsxs("div",{style:{padding:24,color:"var(--error)"},role:"alert",children:["Could not load calibration profile: ",A]});if(!s)return u.jsxs("div",{style:{padding:24,maxWidth:700},children:[u.jsx("h1",{style:{marginBottom:16},children:"Calibration"}),u.jsx("p",{style:{color:"var(--text-secondary)"},children:"No calibration profile yet. Builds after 5+ resolved takes."}),u.jsx("pre",{style:{background:"var(--bg-secondary)",padding:12,borderRadius:4,color:"var(--text-primary)",marginTop:12,fontFamily:"var(--font-mono)"},children:"gbrain dream --phase calibration_profile"})]});const q=new Date(s.generated_at),H=Math.floor((Date.now()-q.getTime())/(1e3*60*60*24));return u.jsxs("div",{style:{padding:32,maxWidth:720},children:[u.jsx("h1",{style:{marginBottom:8},children:"Calibration"}),u.jsxs("div",{style:{color:"var(--text-muted)",fontSize:13,marginBottom:24},children:["Holder: ",s.holder," · ","Updated ",H===0?"today":`${H}d ago`,s.published&&" · published",s.grade_completion<.9&&` · ~${Math.round(s.grade_completion*100)}% graded`,!s.voice_gate_passed&&" · voice gate fell back to template"]}),u.jsx("section",{style:{marginBottom:32},children:u.jsx(Vi,{type:"brier-trend",ariaLabel:"Brier trend"})}),u.jsxs("section",{style:{marginBottom:32},children:[u.jsx("h2",{style:{fontSize:14,color:"var(--text-secondary)",marginBottom:12,fontWeight:400},children:"Pattern statements"}),u.jsx(Vi,{type:"pattern-statements",ariaLabel:"Pattern statements"})]}),u.jsx("section",{style:{marginBottom:32},children:u.jsx(Vi,{type:"domain-bars",ariaLabel:"Per-domain accuracy"})}),u.jsx("section",{style:{marginBottom:32},children:u.jsx(Vi,{type:"abandoned-threads",ariaLabel:"Abandoned threads"})}),s.active_bias_tags.length>0&&u.jsxs("section",{style:{marginBottom:32,color:"var(--text-muted)",fontSize:13},children:["Active bias tags: ",s.active_bias_tags.join(", ")]})]})}function Wy(s){return s===0?"var(--accent-success, #2ea043)":s>=100?"var(--accent-danger, #f85149)":"var(--accent-warn, #d29922)"}function Yd(s){return`$${(s/100).toFixed(2)}`}function $y(){const[s,x]=R.useState(null),[b,o]=R.useState(null);if(R.useEffect(()=>{let z=!0,q=null;const H=async()=>{try{const _=await be.jobsWatch();z&&(x(_),o(null))}catch(_){z&&o(_ instanceof Error?_.message:String(_))}z&&(q=setTimeout(H,1e3))};return H(),()=>{z=!1,q&&clearTimeout(q)}},[]),b)return u.jsxs("div",{style:{padding:24,color:"var(--accent-danger, #f85149)"},children:[u.jsx("h2",{children:"Jobs Watch — error"}),u.jsx("pre",{style:{whiteSpace:"pre-wrap"},children:b})]});if(!s)return u.jsx("div",{style:{padding:24,color:"var(--text-muted, #777)"},children:"Loading jobs watch…"});const A=new Date(s.ts_ms).toLocaleTimeString();return u.jsxs("div",{style:{padding:24,fontFamily:'var(--font-mono, "JetBrains Mono", monospace)'},children:[u.jsxs("h1",{style:{fontSize:18,marginBottom:4},children:["Jobs Watch",u.jsxs("span",{style:{marginLeft:12,color:"var(--text-muted, #777)",fontSize:12,fontWeight:"normal"},children:["updated ",A]})]}),u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Queue"}),u.jsxs("div",{children:["waiting=",u.jsx("b",{children:s.queue_health.waiting})," ","active=",u.jsx("b",{children:s.queue_health.active})," ","stalled=",u.jsx("b",{style:{color:s.queue_health.stalled>0?"var(--accent-warn, #d29922)":void 0},children:s.queue_health.stalled})]})]}),s.by_type.length>0&&u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"By type (24h)"}),u.jsxs("table",{style:{borderCollapse:"collapse"},children:[u.jsx("thead",{children:u.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[u.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"name"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"total"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"done"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"fail"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"dead"})]})}),u.jsx("tbody",{children:s.by_type.slice(0,6).map(z=>u.jsxs("tr",{children:[u.jsx("td",{style:{padding:"4px 12px 4px 0"},children:z.name}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:z.total}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:z.completed}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:z.failed}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:z.dead})]},z.name))})]})]}),u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Lease pressure (1h)"}),u.jsxs("div",{style:{color:Wy(s.lease_pressure_1h)},children:[s.lease_pressure_1h," bounce",s.lease_pressure_1h===1?"":"s"]})]}),s.top_errors.length>0&&u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Top errors (24h)"}),u.jsx("table",{style:{borderCollapse:"collapse"},children:u.jsx("tbody",{children:s.top_errors.slice(0,5).map(z=>u.jsxs("tr",{children:[u.jsxs("td",{style:{textAlign:"right",padding:"4px 12px 4px 0",color:"var(--text-muted, #777)"},children:[z.count,"×"]}),u.jsx("td",{style:{padding:"4px 12px 4px 0"},children:z.cluster})]},z.cluster))})})]}),s.budget_owners.length>0&&u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Budget owners"}),u.jsxs("table",{style:{borderCollapse:"collapse"},children:[u.jsx("thead",{children:u.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[u.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"owner"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"spent"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"remaining"})]})}),u.jsx("tbody",{children:s.budget_owners.slice(0,5).map(z=>u.jsxs("tr",{children:[u.jsx("td",{style:{padding:"4px 12px 4px 0"},children:z.owner_id}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(z.total_spent_cents)}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(z.remaining_cents)})]},z.owner_id))})]})]})]})}function Fy(){var h,U;const[s,x]=R.useState(),[b,o]=R.useState(""),[A,z]=R.useState(!1),[q,H]=R.useState("");R.useEffect(()=>{let j=!0;const C=Ki();if(!C){o("No pending authorization request. Restart the connection from your client.");return}return be.oauthRequest(C).then(Y=>{j&&(x(Y),H(Y.sourceId??""))}).catch(Y=>{j&&o(Y.message)}),()=>{j=!1}},[]);const _=async j=>{if(!(!s||A)){z(!0),o("");try{const C=j==="approve"&&s.sourceChoice.editable&&q!==s.sourceId?q:void 0,Y=await be.decideOAuthRequest(s.id,j,s.csrf,C);Hd(),window.location.assign(Y.redirectUrl)}catch(C){o(C instanceof Error?C.message:"Approval failed. Restart the connection from your client."),x(void 0),z(!1)}}};return u.jsxs("section",{"aria-labelledby":"consent-title",style:{maxWidth:760},children:[u.jsx("h1",{id:"consent-title",children:"Approve client access"}),u.jsx("p",{style:{color:"var(--text-secondary)",margin:"16px 0"},children:"Only approve a connection you initiated. These permissions let the client act on your brain."}),b&&u.jsx("div",{role:"alert",className:"login-error",style:{marginBottom:16},children:b}),!s&&!b&&u.jsx("p",{role:"status",children:"Loading authorization request…"}),s&&u.jsxs(u.Fragment,{children:[u.jsxs("dl",{className:"oauth-consent-details",children:[u.jsx("dt",{children:"Client"}),u.jsx("dd",{children:s.clientName}),u.jsx("dt",{children:"Client ID"}),u.jsx("dd",{children:u.jsx("code",{children:s.clientId})}),u.jsx("dt",{children:"Redirect destination"}),u.jsx("dd",{children:u.jsx("code",{children:s.redirectUri})}),u.jsx("dt",{children:"Permissions"}),u.jsx("dd",{children:s.scopes.length?s.scopes.map(j=>u.jsx("span",{className:`badge ${j.includes("admin")?"badge-error":""}`,style:{marginRight:8},children:j},j)):"No permissions"}),u.jsx("dt",{children:"Administrative brain operations"}),u.jsx("dd",{children:s.scopes.some(j=>j==="admin")?"Eligible operations within the grant below. This does not grant owner dashboard access.":s.scopes.some(j=>j.endsWith("_admin"))?"The named administrative brain operations. This does not grant owner dashboard access.":"None"}),u.jsx("dt",{children:"Allowed operations"}),u.jsx("dd",{children:s.allowedOperations===null?"All operations permitted by these scopes and the server policy":s.allowedOperations.join(", ")||"None"}),u.jsx("dt",{children:"Write paths"}),u.jsx("dd",{children:s.boundSlugPrefixes===null?"Within the granted source":s.boundSlugPrefixes.join(", ")||"None"}),s.scopes.includes("agent")&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Delegated tools"}),u.jsx("dd",{children:((h=s.delegatedTools)==null?void 0:h.join(", "))||"None"}),u.jsx("dt",{children:"Delegated write paths"}),u.jsx("dd",{children:s.delegatedNamespace==="job"?"A separate namespace for each job":((U=s.delegatedSlugPrefixes)==null?void 0:U.join(", "))||"None"})]}),s.sourceChoice.editable?u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:u.jsx("label",{htmlFor:"consent-source",children:"Write source"})}),u.jsxs("dd",{children:[u.jsx("select",{id:"consent-source",value:q,disabled:A,onChange:j=>H(j.target.value),children:s.sourceChoice.options.map(j=>u.jsx("option",{value:j.id,children:j.name===j.id?j.id:`${j.name} (${j.id})`},j.id))}),u.jsxs("div",{style:{color:"var(--text-secondary)",marginTop:4},children:["This client reads and writes only this source. Change it later on the Agents page or with ",u.jsx("code",{children:"gbrain auth rescope --client"}),"."]})]}),u.jsx("dt",{children:"Read sources"}),u.jsx("dd",{children:q})]}):u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Write source"}),u.jsx("dd",{children:s.sourceId??"Not configured"}),u.jsx("dt",{children:"Read sources"}),u.jsx("dd",{children:s.allowedSources.length?s.allowedSources.join(", "):s.sourceId??"Not configured"})]}),u.jsx("dt",{children:"Resource"}),u.jsx("dd",{children:u.jsx("code",{children:s.resource??"No resource binding requested"})}),u.jsx("dt",{children:"Request expires"}),u.jsx("dd",{children:new Date(s.expiresAt).toLocaleTimeString()})]}),u.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:24},children:[u.jsx("button",{className:"btn",disabled:A,onClick:()=>_("deny"),children:"Deny"}),u.jsx("button",{className:"btn btn-primary",disabled:A,onClick:()=>_("approve"),children:A?"Completing request…":"Approve access"})]})]}),b&&u.jsx("button",{className:"btn",onClick:()=>{Hd(),window.location.hash="agents"},children:"Return to agents"})]})}function wd(){const s=window.location.hash.replace("#","")||"dashboard";return Ki()&&s==="dashboard"?"oauth-consent":["login","dashboard","agents","log","calibration","jobs","oauth-consent"].includes(s)?s:"dashboard"}function Iy(){const[s,x]=R.useState(wd);R.useEffect(()=>{const A=()=>x(wd());return window.addEventListener("hashchange",A),()=>window.removeEventListener("hashchange",A)},[]);const b=A=>{window.location.hash=A,x(A)};if(s==="login")return u.jsx(Ny,{onLogin:()=>b(Ki()?"oauth-consent":"dashboard")});const o=async()=>{if(confirm("Sign out every active admin session, including other browsers and tabs? Each one will need to re-authenticate via a fresh magic link.")){try{await be.signOutEverywhere()}catch{}b("login")}};return u.jsxs("div",{className:"app",children:[u.jsxs("nav",{className:"sidebar",children:[u.jsx("div",{className:"sidebar-logo",children:"GBrain"}),u.jsxs("div",{className:"sidebar-nav",children:[u.jsx("a",{className:`nav-item ${s==="dashboard"?"active":""}`,onClick:()=>b("dashboard"),children:"Dashboard"}),u.jsx("a",{className:`nav-item ${s==="agents"?"active":""}`,onClick:()=>b("agents"),children:"Agents"}),u.jsx("a",{className:`nav-item ${s==="log"?"active":""}`,onClick:()=>b("log"),children:"Request Log"}),u.jsx("a",{className:`nav-item ${s==="calibration"?"active":""}`,onClick:()=>b("calibration"),children:"Calibration"}),u.jsx("a",{className:`nav-item ${s==="jobs"?"active":""}`,onClick:()=>b("jobs"),children:"Jobs Watch"})]}),u.jsx("div",{style:{marginTop:"auto",padding:"16px 12px",borderTop:"1px solid var(--border)"},children:u.jsx("button",{onClick:o,style:{background:"transparent",border:"1px solid var(--border)",color:"var(--text-secondary)",padding:"6px 10px",borderRadius:6,fontSize:12,cursor:"pointer",width:"100%"},title:"Revoke every active admin session — every browser, every tab",children:"Sign out everywhere"})})]}),u.jsxs("main",{className:"main",children:[s==="dashboard"&&u.jsx(Dy,{}),s==="agents"&&u.jsx(Gy,{}),s==="log"&&u.jsx(Ky,{}),s==="calibration"&&u.jsx(ky,{}),s==="jobs"&&u.jsx($y,{}),s==="oauth-consent"&&u.jsx(Fy,{})]})]})}zy.createRoot(document.getElementById("root")).render(u.jsx(Xd.StrictMode,{children:u.jsx(Iy,{})}));++`))??"",editOperations:!1}}function Ld(s){const x=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile);return{...s.applyProfile?{profile:s.profile}:{},sourceId:s.source,federatedRead:s.reads,boundSlugPrefixes:s.directPrefixes.trim()?Oa(s.directPrefixes):null,...s.scopes.trim()?{scopes:Oa(s.scopes)}:{},...s.editOperations?{allowedOperations:Oa(s.operationSnapshot)}:{},...x?{boundTools:s.tools,boundSourceId:s.source,delegatedNamespace:s.namespace,delegatedSlugPrefixes:s.namespace==="job"?null:Oa(s.delegatedPrefixes)}:{},boundMaxConcurrent:Number(s.concurrency),budgetUsdPerDay:s.budget==="unlimited"?null:s.budget,tokenTtl:s.ttl==="0"?null:Number(s.ttl),surface:s.surface==="default"?null:s.surface}}function Zd(s){return{...s.profile?{profile:s.profile}:{},scopes:s.scopes,sourceId:s.sourceId,federatedRead:s.federatedRead,boundSlugPrefixes:s.boundSlugPrefixes,allowedOperations:s.allowedOperations,boundTools:s.boundTools,boundSourceId:s.boundSourceId,boundBrainId:s.boundBrainId,delegatedNamespace:s.delegatedNamespace,delegatedSlugPrefixes:s.delegatedSlugPrefixes,boundMaxConcurrent:s.boundMaxConcurrent,budgetUsdPerDay:s.budgetUsdPerDay,tokenTtlSeconds:s.tokenTtlSeconds,surface:s.surface}}function Vd({draft:s,setDraft:x,sources:b,catalog:o,existing:T=!1}){const _=(h,U)=>x({...s,[h]:U}),q=new Set(b.map(h=>h.id)),H=s.scopes?Oa(s.scopes).includes("agent"):["full","delegating-agent"].includes(s.profile),z={marginBottom:14};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:z,children:[u.jsx("label",{htmlFor:"grant-profile",children:"Permission profile"}),u.jsx("select",{id:"grant-profile",value:s.profile,onChange:h=>x({...s,profile:h.target.value,applyProfile:!0,scopes:"",editOperations:!1,surface:["operator","full"].includes(h.target.value)?"full":"starter"}),children:o.profiles.map(h=>u.jsx("option",{children:h},h))}),u.jsx("p",{className:"grant-help",children:"Memory writer lets this agent recall, save, correct, and withdraw memory. Delegating profiles also allow selected server tools to run jobs."}),T&&u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.applyProfile,onChange:h=>_("applyProfile",h.target.checked)}),"Apply this profile's current operation snapshot"]})]}),u.jsxs("div",{style:z,children:[u.jsx("label",{htmlFor:"grant-source",children:"Primary / write source"}),u.jsxs("select",{id:"grant-source",value:s.source,onChange:h=>_("source",h.target.value),children:[!q.has(s.source)&&u.jsxs("option",{value:s.source,children:[s.source," · unavailable"]}),b.map(h=>u.jsxs("option",{value:h.id,children:[h.name," (",h.id,")"]},h.id))]})]}),u.jsxs("fieldset",{style:{border:0,padding:0,margin:"0 0 14px"},children:[u.jsx("legend",{children:"Readable sources"}),[...b,...s.reads.filter(h=>!q.has(h)).map(h=>({id:h,name:`${h} · unavailable`}))].map(h=>u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.reads.includes(h.id),onChange:U=>_("reads",U.target.checked?[...s.reads,h.id]:s.reads.filter(S=>S!==h.id))}),h.name]},h.id))]}),u.jsxs("div",{style:z,children:[u.jsx("label",{htmlFor:"grant-direct-prefixes",children:"Direct write prefixes (one per line)"}),u.jsx("textarea",{id:"grant-direct-prefixes",rows:2,value:s.directPrefixes,onChange:h=>_("directPrefixes",h.target.value),placeholder:"work-example/"}),u.jsx("p",{className:"grant-help",children:"Blank grants the whole primary source. Coding agent requires an explicit prefix."})]}),H&&u.jsxs("fieldset",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[u.jsx("legend",{children:"Delegated jobs"}),u.jsx("p",{className:"grant-help",children:"Choose every tool explicitly. Jobs stay in the primary source; existing jobs retain their original limits."}),u.jsx("div",{className:"checkbox-group",style:{maxHeight:180,overflowY:"auto"},children:[...new Set([...o.delegatedTools,...s.tools])].map(h=>u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.tools.includes(h),onChange:U=>_("tools",U.target.checked?[...s.tools,h]:s.tools.filter(S=>S!==h))}),h,o.delegatedTools.includes(h)?"":" · unavailable"]},h))}),u.jsx("label",{htmlFor:"grant-namespace",children:"Delegated write namespace"}),u.jsxs("select",{id:"grant-namespace",value:s.namespace,onChange:h=>_("namespace",h.target.value),children:[u.jsx("option",{value:"job",children:"Each job's own wiki/agents/ directory"}),u.jsx("option",{value:"prefixes",children:"Explicit prefixes"})]}),s.namespace==="prefixes"&&u.jsx("textarea",{"aria-label":"Delegated prefixes",rows:2,value:s.delegatedPrefixes,onChange:h=>_("delegatedPrefixes",h.target.value),placeholder:"work-example/"})]}),u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12,...z},children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"grant-concurrency",children:"Concurrent jobs"}),u.jsx("input",{id:"grant-concurrency",type:"number",min:1,step:1,value:s.concurrency,onChange:h=>_("concurrency",h.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"grant-budget",children:"Daily delegated spend (USD)"}),u.jsx("input",{id:"grant-budget",value:s.budget,onChange:h=>_("budget",h.target.value),placeholder:"unlimited"}),u.jsx("p",{className:"grant-help",children:"Use unlimited for no spending cap, or an amount such as 2.50."})]})]}),u.jsxs("div",{style:z,children:[u.jsx("label",{htmlFor:"grant-ttl",children:"Future access token lifetime (seconds)"}),u.jsx("input",{id:"grant-ttl",type:"number",min:0,max:7776e3,step:1,value:s.ttl,onChange:h=>_("ttl",h.target.value)}),u.jsx("p",{className:"grant-help",children:"Renewable: 3600 (1 hour). Static bearer: 2592000 (30 days). 0 uses the server default. Existing tokens keep their expiry."})]}),u.jsxs("details",{style:z,children:[u.jsx("summary",{children:"Advanced permissions"}),u.jsx("label",{htmlFor:"grant-scopes",children:"Scope override"}),u.jsx("input",{id:"grant-scopes",value:s.scopes,onChange:h=>_("scopes",h.target.value),placeholder:"Use profile scopes"}),u.jsx("p",{className:"grant-help",children:"Scopes allow eligible brain operations. Admin does not grant owner dashboard access or delegation."}),u.jsx("label",{htmlFor:"grant-surface",children:"Visible tool catalog"}),u.jsx("select",{id:"grant-surface",value:s.surface,onChange:h=>_("surface",h.target.value),children:["verbs","starter","full","default"].map(h=>u.jsx("option",{children:h},h))}),u.jsx("p",{className:"grant-help",children:"Full shows all eligible tools; it does not grant additional authority."}),u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:s.editOperations,onChange:h=>_("editOperations",h.target.checked)}),"Replace operation authority snapshot"]}),s.editOperations&&u.jsxs(u.Fragment,{children:[u.jsx("textarea",{"aria-label":"Allowed operations",rows:5,value:s.operationSnapshot,onChange:h=>_("operationSnapshot",h.target.value)}),u.jsx("p",{className:"grant-help",children:"One operation name per line. An empty list denies every operation, including delegated tools."})]})]})]})}const Ry=[["Profile","profile"],["Scopes","scopes"],["Write source","sourceId"],["Readable sources","federatedRead"],["Direct prefixes","boundSlugPrefixes"],["Visible catalog","surface"],["Operation authority","allowedOperations"],["Delegated tools","boundTools"],["Delegated source","boundSourceId"],["Delegated brain","boundBrainId"],["Delegated namespace","delegatedNamespace"],["Delegated prefixes","delegatedSlugPrefixes"],["Concurrent jobs","boundMaxConcurrent"],["Daily USD cap","budgetUsdPerDay"],["Future token TTL","tokenTtlSeconds"]];function Uy(s,x){return s===null?x==="budgetUsdPerDay"?"Unlimited":x==="allowedOperations"?"Legacy scope-based catalog":"Unset":Array.isArray(s)?s.join(", ")||"(none)":String(s)}function Bd({grant:s,field:x}){const b=s[x];return x==="allowedOperations"&&Array.isArray(b)&&b.length>8?u.jsxs("details",{children:[u.jsxs("summary",{children:[b.length," operations · inspect list"]}),u.jsx("div",{style:{maxHeight:160,overflowY:"auto",marginTop:8},children:b.join(", ")})]}):u.jsx(u.Fragment,{children:Uy(b,x)})}function Kd({preview:s}){return u.jsxs("div",{"aria-live":"polite",style:{margin:"16px 0"},children:[u.jsx("h3",{children:"Review permissions"}),u.jsx("div",{style:{overflowX:"auto"},children:u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Permission"}),s.before&&u.jsx("th",{children:"Current"}),u.jsx("th",{children:"Proposed"})]})}),u.jsx("tbody",{children:Ry.filter(([,x])=>!s.before||JSON.stringify(s.before[x])!==JSON.stringify(s.after[x])).map(([x,b])=>u.jsxs("tr",{children:[u.jsx("th",{children:x}),s.before&&u.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:200},children:u.jsx(Bd,{grant:s.before,field:b})}),u.jsx("td",{style:{overflowWrap:"anywhere",maxWidth:280},children:u.jsx(Bd,{grant:s.after,field:b})})]},b))})]})}),u.jsx("p",{className:"grant-help",children:s.tokenImplications})]})}function qy({clientId:s,sources:x,sourcesReady:b=!0,onRescoped:o}){const[T,_]=R.useState(),[q,H]=R.useState(),[z,h]=R.useState(),[U,S]=R.useState(),[C,Y]=R.useState(""),[G,Z]=R.useState(!1),[W,ae]=R.useState(!1),[$,le]=R.useState(!1),ne=async(k=!1)=>{Z(!0),ae(!1);try{const[V,xe]=await Promise.all([Oe.clientGrant(s),Oe.grantCatalog()]);_(V.grant),H(bs(V.grant)),h(xe),S(void 0),Y(""),le(!1),k&&o(V.grant)}finally{Z(!1)}};R.useEffect(()=>{ne().catch(k=>Y(k.message))},[s]);const be=async()=>{if(!(!q||!T||!b||$)){Z(!0),Y(""),ae(!1);try{const k=await Oe.updateClientGrant(s,{...U?Zd(U.after):Ld(q),expectedRevision:T.revision,dryRun:!U});U?(_(k.after),H(bs(k.after)),S(void 0),ae(!0),o(k.after)):S(k)}catch(k){const V=!!U&&Ss(k);le(V||k instanceof An&&k.status===409),S(void 0),Y(`${k instanceof Error?k.message:"Grant update failed."}${V?" The change may have completed. Reload the current grant before editing permissions again.":""}`)}finally{Z(!1)}}};return u.jsxs("section",{children:[u.jsx("div",{className:"section-title",children:"Permissions"}),T&&u.jsxs("p",{className:"grant-help",children:["Revision ",T.revision,". Review source access, direct tools, and delegated work independently."]}),T&&u.jsx(Hy,{clientId:s,revision:T.revision}),!!(T!=null&&T.repairReasons.length)&&u.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:["Delegation needs repair: ",T.repairReasons.join(", "),". Review and explicitly grant the missing bindings below."]}),!b&&u.jsx("p",{role:"alert",children:"Current sources are unavailable. Retry sources before editing permissions."}),u.jsx("fieldset",{disabled:G||!b||$,style:{border:0,padding:0},children:q&&z&&u.jsx(Vd,{draft:q,catalog:z,sources:x,existing:!0,setDraft:k=>{H(k),S(void 0),ae(!1)}})}),C&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[C," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:G,onClick:()=>void ne(!0).catch(k=>Y(k.message)),children:"Reload current grant"})]}),U&&u.jsx(Kd,{preview:U}),W&&u.jsx("p",{role:"status",children:"Permissions saved. Credentials are unchanged."}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:G||!q||!z||!b||$,onClick:()=>void be(),children:G?"Checking…":U?"Apply reviewed changes":"Preview changes"})]})}function Hy({clientId:s,revision:x}){const[b,o]=R.useState(),[T,_]=R.useState(!1);return R.useEffect(()=>{let q=!0;const H=()=>void Oe.agentsSpend().then(h=>{q&&(o(h.find(U=>U.client_id===s)),_(!1))}).catch(()=>{q&&_(!0)});H();const z=setInterval(H,2e4);return()=>{q=!1,clearInterval(z)}},[s,x]),T?u.jsx("p",{role:"status",children:"Delegated spend is unavailable. Reload to check before starting more work."}):b?u.jsxs("div",{style:{border:"1px solid var(--border)",padding:12,marginBottom:14},children:[u.jsx("strong",{children:"Delegated work"}),u.jsxs("p",{children:[b.inflight_count," unfinished jobs · Daily cap: ",b.cap_usd_per_day===null?"Unlimited":`$${b.cap_usd_per_day.toFixed(2)}`]}),u.jsxs("p",{className:"grant-help",children:["Recorded today: $",(b.spent_cents_today/100).toFixed(2),". Known outstanding reservations: $",(b.pending_cents/100).toFixed(2),", including overdue calls from earlier days."]}),b.unknown_count>0&&u.jsxs("p",{role:"status",style:{color:"var(--warning)"},children:[b.unknown_count," unresolved calls have an unknown cost. The known amounts above do not bound total liability; a finite cap refuses further calls until reconciliation."]})]}):null}function By(s,x){const b=URL.createObjectURL(new Blob([JSON.stringify(s,null,2)],{type:"application/json"})),o=document.createElement("a");o.href=b,o.download=x,o.click(),URL.revokeObjectURL(b)}function Jd({clientId:s,grantTypes:x,revoked:b=!1,grantRevision:o}){const[T,_]=R.useState("generic"),q=x.includes("authorization_code")&&x.includes("client_credentials"),[H,z]=R.useState(q?"":x.includes("authorization_code")?"authorization-code":"client-credentials"),[h,U]=R.useState(),[S,C]=R.useState(),[Y,G]=R.useState([]),[Z,W]=R.useState(""),[ae,$]=R.useState(!1),[le,ne]=R.useState(!1),[be,k]=R.useState(!1),[V,xe]=R.useState(0);R.useEffect(()=>{if(b)return;let se=!0;if(C(void 0),G([]),W(""),ne(!1),k(!1),!!H)return Promise.all([Oe.clientSetup(s,T,H),Oe.grantCatalog()]).then(([F,de])=>{se&&(C(F.setup),G(F.instructions),U(de))}).catch(F=>{se&&W(F instanceof Error?F.message:"Setup instructions are unavailable.")}),()=>{se=!1}},[s,T,H,b,o,V]);const Se=async()=>{if(S){$(!0),W("");try{const se=await Oe.recoverClient(s,T,H),F=H==="authorization-code"?se.oauthSetup:se.credentials;if(!F)throw new Error("No matching setup file was returned. Ask the host administrator to inspect this client’s credential delivery.");By(F,`${s}-${H==="authorization-code"?"oauth-setup":"credentials"}.json`),ne(!0)}catch(se){W(se instanceof Error?se.message:"Download failed. Existing permissions are unchanged.")}finally{$(!1)}}};return u.jsxs("section",{"aria-labelledby":"client-setup-title",children:[u.jsx("h3",{id:"client-setup-title",className:"section-title",children:"Set up this client"}),b?u.jsx("p",{children:"This client is revoked. Register a new client to connect another harness."}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"grant-help",children:"Registration grants access. Configure the intended harness, then verify an actual memory round trip there."}),u.jsx("label",{htmlFor:"setup-harness",children:"Harness"}),u.jsxs("select",{id:"setup-harness",value:T,onChange:se=>_(se.target.value),disabled:ae,children:[!h&&u.jsx("option",{value:"generic",children:"Generic MCP client"}),h==null?void 0:h.harnesses.map(se=>u.jsx("option",{value:se.id,children:se.label},se.id))]}),q&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"setup-flow",children:"Connection flow"}),u.jsxs("select",{id:"setup-flow",value:H,onChange:se=>z(se.target.value),disabled:ae,children:[u.jsx("option",{value:"",children:"Choose the flow supported by your harness"}),u.jsx("option",{value:"authorization-code",children:"Browser sign-in with PKCE"}),u.jsx("option",{value:"client-credentials",children:"Machine credentials"})]})]}),S&&u.jsxs(u.Fragment,{children:[u.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[u.jsx("dt",{children:"MCP URL"}),u.jsx("dd",{children:u.jsx("code",{children:S.mcp_url})}),u.jsx("dt",{children:"OAuth issuer"}),u.jsx("dd",{children:u.jsx("code",{children:S.issuer_url})}),u.jsx("dt",{children:"Client ID"}),u.jsx("dd",{children:u.jsx("code",{children:S.client.client_id})}),u.jsx("dt",{children:"Scopes"}),u.jsx("dd",{children:S.scopes.join(" ")||"None"}),u.jsx("dt",{children:"Authentication"}),u.jsx("dd",{children:S.client.token_endpoint_auth_method==="none"?"Public client — PKCE, no client secret":S.client.token_endpoint_auth_method}),S.flow==="authorization-code"&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Redirect URIs"}),u.jsx("dd",{children:S.client.redirect_uris.map(se=>u.jsx("div",{children:u.jsx("code",{children:se})},se))})]})]}),u.jsx("ol",{children:Y.map((se,F)=>u.jsx("li",{style:{marginBottom:8,overflowWrap:"anywhere"},children:se},F))}),u.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:16},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(Y.join(`++`)).then(()=>k(!0)).catch(()=>W("Clipboard unavailable. Select and copy the instructions above."))},children:be?"Instructions copied":"Copy setup instructions"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:ae,onClick:()=>void Se(),children:ae?"Preparing download…":S.flow==="authorization-code"?"Download OAuth setup":"Download credentials"})]}),u.jsx("p",{className:"grant-help",children:"Keep downloaded files private. Set permissions to 0600 on the target computer. A setup download does not verify the harness."})]}),!H&&u.jsx("p",{role:"status",children:"This client supports both flows. Choose one before requesting setup instructions."}),H&&!S&&!Z&&u.jsx("p",{role:"status",children:"Loading setup instructions…"}),le&&u.jsx("p",{role:"status",children:"Setup file delivered to your browser. Harness verification is still required."}),Z&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[Z," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:ae,onClick:()=>xe(se=>se+1),children:"Retry setup"})]})]})]})}const gs={"invalidate-tokens":"Invalidate tokens",revoke:"Revoke client",delete:"Delete client"};function Yy({clientId:s,name:x,revoked:b,onChanged:o,onBusyChange:T}){const[_,q]=R.useState(),[H,z]=R.useState(!1),[h,U]=R.useState(""),[S,C]=R.useState(!1),Y=async Z=>{z(!0),U(""),q(void 0);try{q(await Oe.clientLifecycle(s,{action:Z,dryRun:!0}))}catch(W){U(W instanceof Error?W.message:"Could not preview this action. Retry after checking the client.")}finally{z(!1)}},G=async()=>{if(_){z(!0),T==null||T(!0),U("");try{await Oe.clientLifecycle(s,{action:_.action,dryRun:!1,yes:!0,expectedRevision:_.before.revision}),o()}catch(Z){const W=Ss(Z);U(`${Z instanceof Error?Z.message:"Request failed."} ${W?"The action may have completed. Reload the client and inspect its current state before requesting another action.":"The request was refused. Review a fresh preview before applying an action."}`),C(W),q(void 0)}finally{z(!1),T==null||T(!1)}}};return u.jsxs("section",{"aria-labelledby":"client-lifecycle-title",style:{marginTop:28},children:[u.jsx("h3",{id:"client-lifecycle-title",className:"section-title",children:"Client access"}),u.jsx("p",{className:"grant-help",children:"Invalidating tokens keeps the client and its secret. Revoking ends access and keeps a visible registration. Deleting removes the registration. Memory and audit history remain."}),!_&&u.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["invalidate-tokens","revoke","delete"].filter(Z=>!b||Z==="delete").map(Z=>u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H||S,onClick:()=>void Y(Z),children:gs[Z]},Z))}),_&&u.jsxs("div",{"aria-live":"polite",style:{border:"1px solid var(--border)",padding:16},children:[u.jsxs("h4",{style:{margin:"0 0 12px"},children:[gs[_.action],": ",x]}),u.jsxs("p",{children:[u.jsx("code",{children:s})," · Revision ",_.before.revision]}),u.jsx("ul",{children:(Array.isArray(_.consequences)?_.consequences:[_.consequences]).map((Z,W)=>u.jsx("li",{children:Z},W))}),u.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:H,onClick:()=>q(void 0),children:"Cancel"}),u.jsx("button",{type:"button",className:"btn btn-danger",disabled:H,onClick:()=>void G(),children:H?"Applying…":`Confirm ${gs[_.action].toLowerCase()}`})]})]}),h&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[h," ",S&&u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:o,children:"Reload client list"})]})]})}function _n({title:s,titleId:x,children:b,onClose:o,busy:T=!1,drawer:_=!1}){const q=R.useRef(null),H=R.useRef(o);H.current=o;const z=R.useRef(T);z.current=T;const[h]=R.useState(()=>document.activeElement instanceof HTMLElement?document.activeElement:null);return R.useEffect(()=>{const U=q.current;if(!U)return;(U.querySelector("[data-autofocus]")??U).focus();const S=C=>{if(C.key==="Escape"&&(C.preventDefault(),z.current||H.current()),C.key!=="Tab")return;const Y=[...U.querySelectorAll('button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], summary, [tabindex="0"]')].filter(W=>W.getClientRects().length>0&&!W.closest("fieldset:disabled")),G=Y[0],Z=Y[Y.length-1];if(!G){C.preventDefault(),U.focus();return}C.shiftKey&&(document.activeElement===G||document.activeElement===U)?(C.preventDefault(),Z.focus()):!C.shiftKey&&(document.activeElement===Z||document.activeElement===U)&&(C.preventDefault(),G.focus())};return U.addEventListener("keydown",S),()=>{U.removeEventListener("keydown",S),h!=null&&h.isConnected&&h.focus()}},[h]),u.jsx("div",{className:_?"drawer-overlay":"modal-overlay",onClick:()=>{T||o()},children:u.jsxs("div",{ref:q,role:"dialog","aria-modal":"true","aria-labelledby":x,"aria-busy":T,tabIndex:-1,className:_?"drawer":"modal",onClick:U=>U.stopPropagation(),style:_?{width:"min(640px, 95vw)"}:{maxWidth:760,width:"92vw",minWidth:0,maxHeight:"90vh",overflowY:"auto"},children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16,alignItems:"start",marginBottom:20},children:[u.jsx("h2",{id:x,className:"modal-title",style:{margin:0},children:s}),u.jsx("button",{type:"button",className:"btn btn-secondary","aria-label":`Close ${s}`,disabled:T,onClick:o,children:"Close"})]}),b]})})}function wy(s){const x=s.kind!=="machine",b=x?s.redirectUris.split(`++`).map(o=>o.trim()).filter(Boolean):[];if(x&&!b.length)throw new Error("Enter the exact redirect URI from your MCP client settings, one per line.");for(const o of b)try{new URL(o)}catch{throw new Error("Each redirect URI must be a complete URI. Copy it exactly from your MCP client settings.")}return{grantTypes:x?["authorization_code","refresh_token"]:["client_credentials"],redirectUris:b,tokenEndpointAuthMethod:s.kind==="public-pkce"?"none":s.kind==="machine"?"client_secret_post":s.confidentialMethod}}function Gy(s){const x=Math.floor((Date.now()-s.getTime())/1e3);return x<60?"just now":x<3600?Math.floor(x/60)+"m ago":x<86400?Math.floor(x/3600)+"h ago":Math.floor(x/86400)+"d ago"}function Xy(){const[s,x]=R.useState([]),[b,o]=R.useState([]),[T,_]=R.useState(!1),[q,H]=R.useState(!1),[z,h]=R.useState(""),[U,S]=R.useState(""),[C,Y]=R.useState(!0),[G,Z]=R.useState(!0),[W,ae]=R.useState(!1),[$,le]=R.useState(!1),[ne,be]=R.useState(),[k,V]=R.useState(),[xe,Se]=R.useState(!1),[se,F]=R.useState(),de=R.useRef(0),we=R.useRef(0),Ne=async()=>{const N=++de.current;Y(!0);try{const w=await Oe.agents();if(N!==de.current)return;x(w),_(!0),h("")}catch(w){N===de.current&&h(w instanceof Error?w.message:"Clients are unavailable.")}finally{N===de.current&&Y(!1)}},Ze=async()=>{const N=++we.current;Z(!0);try{const w=await Oe.sources();if(N!==we.current)return;o(w),H(!0),S("")}catch(w){N===we.current&&(H(!1),S(w instanceof Error?w.message:"Sources are unavailable."))}finally{N===we.current&&Z(!1)}};R.useEffect(()=>(Ne(),Ze(),()=>{de.current++,we.current++}),[]);const E=s.filter(N=>!W||N.status!=="revoked");return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12,flexWrap:"wrap",alignItems:"center",marginBottom:24},children:[u.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Agents"}),u.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[u.jsxs("label",{className:"checkbox-label",children:[u.jsx("input",{type:"checkbox",checked:W,onChange:N=>ae(N.target.checked)}),"Hide revoked"]}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:C,onClick:()=>void Ne(),children:"Refresh clients"}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Se(!0),children:"+ API Key"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:!q||!b.length||G,onClick:()=>le(!0),children:"+ OAuth Client"})]})]}),u.jsx("p",{className:"grant-help",style:{marginBottom:16},children:"Owner administration uses this dashboard’s login. An OAuth client’s admin scope allows eligible brain operations; it does not open this dashboard."}),z&&u.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:[T?"Showing previously loaded clients. ":"Could not load clients. ",z," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:C,onClick:()=>void Ne(),children:"Retry clients"})]}),U&&u.jsxs("p",{role:"alert",style:{marginBottom:16,color:"var(--error)"},children:["Could not load current sources. Registration and permission changes are unavailable. ",U," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:G,onClick:()=>void Ze(),children:"Retry sources"})]}),!U&&!q&&u.jsx("p",{role:"status",children:"Loading sources before registration…"}),q&&!b.length&&u.jsx("p",{role:"status",children:"No active sources are available. Add or unarchive a source on the host before registering a client."}),!T&&!z&&u.jsx("p",{role:"status",children:"Loading clients…"}),T&&!s.length&&u.jsx("p",{style:{textAlign:"center",padding:48},children:"No clients registered. Register a client to grant access to a harness."}),T&&s.length>0&&!E.length&&u.jsx("p",{style:{textAlign:"center",padding:48},children:"All clients are revoked. Uncheck “Hide revoked” to view them."}),E.length>0&&u.jsxs("div",{style:{overflowX:"auto"},children:[u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Name"}),u.jsx("th",{children:"Type"}),u.jsx("th",{children:"Scopes"}),u.jsx("th",{children:"Sources"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Requests"}),u.jsx("th",{children:"Last used"})]})}),u.jsx("tbody",{children:E.map(N=>u.jsxs("tr",{onClick:()=>V(N),style:{cursor:"pointer"},children:[u.jsx("td",{children:u.jsx("button",{type:"button",className:"client-name-button",onClick:w=>{w.stopPropagation(),V(N)},children:N.name||N.client_name})}),u.jsx("td",{children:u.jsx("span",{className:"badge "+(N.auth_type==="oauth"?"badge-read":"badge-write"),children:N.auth_type==="oauth"?"OAuth":"API key"})}),u.jsx("td",{children:(N.scope||"").split(" ").filter(Boolean).map(w=>u.jsx("span",{className:"badge badge-"+w,style:{marginRight:4},children:w},w))}),u.jsx("td",{children:N.auth_type==="oauth"?(N.source_id||"none")+" · "+(N.federated_read||[]).length+" readable":"Unscoped"}),u.jsx("td",{children:u.jsx("span",{className:"badge "+(N.status==="active"?"badge-success":"badge-danger"),children:N.status})}),u.jsxs("td",{children:[N.requests_today||0,u.jsxs("span",{style:{color:"var(--text-muted)"},children:[" / ",N.total_requests||0]})]}),u.jsx("td",{children:N.last_used_at?Gy(new Date(N.last_used_at)):"Never"})]},N.auth_type+":"+N.id))})]}),u.jsxs("p",{className:"grant-help",style:{marginTop:12},children:[s.filter(N=>N.status==="active").length," active / ",s.length," total"]})]}),$&&u.jsx(Qy,{sources:b,sourcesReady:q,onClose:()=>le(!1),onRegistered:N=>{le(!1),be(N),Ne()}}),ne&&u.jsxs(_n,{title:"Client registered",titleId:"registered-client-title",onClose:()=>be(void 0),children:[u.jsxs("p",{role:"status",style:{marginBottom:16},children:[ne.name," is registered. Its harness connection has not been verified."]}),u.jsx(Jd,{clientId:ne.clientId,grantTypes:ne.grantTypes})]}),k&&u.jsx(Ly,{agent:k,sources:b,sourcesReady:q,onClose:()=>V(void 0),onChanged:()=>{V(void 0),Ne()},onRescoped:N=>{V(w=>w&&{...w,source_id:N.sourceId,federated_read:N.federatedRead,scope:N.scopes.join(" "),token_ttl:N.tokenTtlSeconds}),Ne()}},k.id),xe&&u.jsx(Vy,{onClose:()=>Se(!1),onCreated:N=>{Se(!1),F(N),Ne()}}),se&&u.jsx(Ky,{token:se,onClose:()=>F(void 0)})]})}function Qy({sources:s,sourcesReady:x,onClose:b,onRegistered:o}){const[T,_]=R.useState(""),[q,H]=R.useState(()=>bs()),[z,h]=R.useState({kind:"machine",redirectUris:"",confidentialMethod:"client_secret_post"}),[U,S]=R.useState(),[C,Y]=R.useState(""),[G,Z]=R.useState(),[W,ae]=R.useState(!1),[$,le]=R.useState(""),[ne,be]=R.useState(),[k,V]=R.useState(!1),xe=()=>{Y(""),Oe.grantCatalog().then(S).catch(F=>Y(F instanceof Error?F.message:"Permission catalog unavailable."))};R.useEffect(xe,[]);const Se=F=>{h(F),Z(void 0)},se=async F=>{if(F.preventDefault(),!(!x||!U||k)){if(!T.trim()){le("Enter a client name.");return}ae(!0),le("");try{const de=(G==null?void 0:G.oauth)??wy(z),we=(G==null?void 0:G.name)??T.trim(),Ne=await Oe.registerClient({...G?Zd(G.grant.after):Ld(q),...de,name:we,dryRun:!G});G?o({clientId:Ne.clientId,name:we,grantTypes:de.grantTypes}):Z({grant:Ne,oauth:de,name:we})}catch(de){le(de instanceof Error?de.message:"Registration failed.");const we=!!G&&Ss(de);if(V(we),G&&(we||de instanceof An&&de.status===409))try{const Ne=(await Oe.agents()).filter(Ze=>Ze.auth_type==="oauth"&&Ze.status==="active"&&(Ze.name||Ze.client_name)===G.name);Ne.length===1&&(be({clientId:Ne[0].id||Ne[0].client_id,name:G.name,grantTypes:Ne[0].grant_types}),V(!0))}catch{}Z(void 0)}finally{ae(!1)}}};return u.jsx(_n,{title:"Register OAuth client",titleId:"register-client-title",onClose:b,busy:W,children:u.jsxs("form",{onSubmit:se,children:[u.jsxs("fieldset",{disabled:W||k,style:{border:0,padding:0},children:[u.jsx("label",{htmlFor:"agent-name",children:"Client name"}),u.jsx("input",{id:"agent-name","data-autofocus":!0,value:T,placeholder:"agent-example",onChange:F=>{_(F.target.value),Z(void 0)}}),u.jsx("label",{htmlFor:"oauth-connection-kind",style:{marginTop:16},children:"Connection type"}),u.jsxs("select",{id:"oauth-connection-kind",value:z.kind,onChange:F=>Se({...z,kind:F.target.value}),children:[u.jsx("option",{value:"machine",children:"Machine credentials"}),u.jsx("option",{value:"public-pkce",children:"Browser sign-in: public client with PKCE"}),u.jsx("option",{value:"confidential-pkce",children:"Browser sign-in: confidential client with PKCE"})]}),u.jsx("p",{className:"grant-help",children:"Choose the method required by your MCP client. Browser sign-in requires the owner’s approval. Public clients use PKCE without a client secret."}),z.kind!=="machine"&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"oauth-redirect-uris",children:"Exact redirect URIs (one per line)"}),u.jsx("textarea",{id:"oauth-redirect-uris",rows:3,value:z.redirectUris,onChange:F=>Se({...z,redirectUris:F.target.value}),placeholder:"https://client.example.com/oauth/callback"}),u.jsx("p",{className:"grant-help",children:"Copy these from the client’s OAuth settings. Keep the complete path and query. GBrain uses S256 PKCE."})]}),z.kind==="confidential-pkce"&&u.jsxs(u.Fragment,{children:[u.jsx("label",{htmlFor:"oauth-client-auth",children:"Client secret authentication"}),u.jsxs("select",{id:"oauth-client-auth",value:z.confidentialMethod,onChange:F=>Se({...z,confidentialMethod:F.target.value}),children:[u.jsx("option",{value:"client_secret_post",children:"client_secret_post (request body)"}),u.jsx("option",{value:"client_secret_basic",children:"client_secret_basic (HTTP Basic)"})]})]}),z.kind==="machine"&&u.jsx("p",{className:"grant-help",children:"Machine handoffs use client_secret_post to renew their access tokens."}),u.jsx("div",{style:{marginTop:24},children:U&&u.jsx(Vd,{draft:q,setDraft:F=>{H(F),Z(void 0)},catalog:U,sources:s})})]}),C&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[C," ",u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:xe,children:"Retry permissions"})]}),!x&&u.jsx("p",{role:"alert",children:"Current sources are unavailable. Close this form and retry sources before registration."}),G&&u.jsxs(u.Fragment,{children:[u.jsx(Kd,{preview:G.grant}),u.jsxs("div",{"aria-live":"polite",children:[u.jsx("h3",{children:"Review connection"}),u.jsxs("dl",{className:"oauth-consent-details",children:[u.jsx("dt",{children:"Client name"}),u.jsx("dd",{children:G.name}),u.jsx("dt",{children:"Grant types"}),u.jsx("dd",{children:G.oauth.grantTypes.join(", ")}),u.jsx("dt",{children:"Authentication"}),u.jsx("dd",{children:G.oauth.tokenEndpointAuthMethod}),G.oauth.redirectUris.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Exact redirect URIs"}),u.jsx("dd",{children:G.oauth.redirectUris.map(F=>u.jsx("div",{children:u.jsx("code",{children:F})},F))})]})]})]})]}),$&&u.jsx("p",{role:"alert",style:{color:"var(--error)",margin:"16px 0"},children:$}),ne&&u.jsxs("div",{role:"status",children:[u.jsxs("p",{children:["A client named ",ne.name," is registered. Open its setup instructions and recover its existing download."]}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>o(ne),children:"Open existing client setup"})]}),k&&!ne&&u.jsx("p",{role:"status",children:"Registration may have completed. Close this form and refresh clients before trying again. No automatic retry was made."}),u.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"flex-end",marginTop:20},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:b,children:"Cancel"}),u.jsx("button",{type:"submit",className:"btn btn-primary",disabled:W||!U||!x||k,children:W?"Checking…":G?"Register with reviewed permissions":"Preview permissions"})]})]})})}function Ly({agent:s,sources:x,sourcesReady:b,onClose:o,onChanged:T,onRescoped:_}){const q=s.id||s.client_id||"",H=s.name||s.client_name||q,[z,h]=R.useState(),[U,S]=R.useState(""),[C,Y]=R.useState(0),[G,Z]=R.useState(!1),[W,ae]=R.useState(!1);return R.useEffect(()=>{if(s.auth_type!=="oauth")return;let $=!0;return S(""),Oe.clientDetails(q).then(le=>{$&&h(le)}).catch(le=>{$&&S(le instanceof Error?le.message:"Client details unavailable.")}),()=>{$=!1}},[q,s.auth_type,C]),u.jsxs(_n,{title:H,titleId:"client-details-title",onClose:o,drawer:!0,busy:W,children:[u.jsx("span",{className:"badge "+(s.status==="active"?"badge-success":"badge-danger"),children:s.status}),u.jsxs("dl",{className:"oauth-consent-details",style:{marginTop:16},children:[u.jsx("dt",{children:"Client ID"}),u.jsx("dd",{children:u.jsx("code",{children:q})}),u.jsx("dt",{children:"Scopes"}),u.jsx("dd",{children:s.scope||"None"}),u.jsx("dt",{children:"Registered"}),u.jsx("dd",{children:new Date(s.created_at).toLocaleString()}),u.jsx("dt",{children:"Token lifetime"}),u.jsx("dd",{children:s.token_ttl?s.token_ttl+" seconds":"Server default (future tokens)"}),z&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Grant types"}),u.jsx("dd",{children:z.client.grant_types.join(", ")}),u.jsx("dt",{children:"Authentication"}),u.jsx("dd",{children:z.client.token_endpoint_auth_method})]})]}),s.auth_type==="oauth"?u.jsxs(u.Fragment,{children:[U&&u.jsxs("p",{role:"alert",style:{color:"var(--error)"},children:[U," ",u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Y($=>$+1),children:"Retry client details"})]}),!z&&!U&&u.jsx("p",{role:"status",children:"Loading client details…"}),z&&u.jsxs(u.Fragment,{children:[u.jsx(Jd,{clientId:q,grantTypes:z.client.grant_types,revoked:s.status==="revoked",grantRevision:z.grant.revision}),s.status==="active"&&u.jsxs("details",{style:{marginTop:24},children:[u.jsx("summary",{style:{cursor:"pointer",fontWeight:600},children:"Edit access levels"}),u.jsx(qy,{clientId:q,sources:x,sourcesReady:b,onRescoped:$=>{h(le=>le&&{...le,grant:$}),_($)}})]}),u.jsx(Yy,{clientId:q,name:H,revoked:s.status==="revoked",onChanged:T,onBusyChange:ae})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("h3",{className:"section-title",children:"API key"}),u.jsx("p",{children:"Use this key as a bearer token in a client that supports static authentication. Its value is available only in the original private handoff."}),s.status==="active"&&u.jsxs("div",{style:{marginTop:20},children:[G?u.jsxs(u.Fragment,{children:[u.jsxs("p",{children:["Revoke the API key ",H," (",q,")? Only this key stops working. Memory remains."]}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:W,onClick:()=>Z(!1),children:"Cancel"})," ",u.jsx("button",{type:"button",className:"btn btn-danger",disabled:W,onClick:()=>{ae(!0),Oe.revokeApiKey(q).then(T).catch($=>S($ instanceof Error?$.message:"Revoke failed. Refresh the client list before retrying.")).finally(()=>ae(!1))},children:"Confirm revoke"})]}):u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>Z(!0),children:"Revoke API key"}),U&&u.jsx("p",{role:"alert",children:U})]})]})]})}const Zy=[{id:"read",label:"Read",help:"Search and read memory."},{id:"write",label:"Write",help:"Add and edit memory."},{id:"admin",label:"Admin",help:"Brain administration operations. Grant only to fully trusted clients."}];function Vy({onClose:s,onCreated:x}){const[b,o]=R.useState(""),[T,_]=R.useState(!1),[q,H]=R.useState(""),[z,h]=R.useState(["read","write"]),U=async S=>{if(S.preventDefault(),!b.trim()){H("Enter a key name.");return}if(z.length===0){H("Choose at least one access level.");return}_(!0),H("");try{const C=await Oe.createApiKey(b.trim(),z);x({name:C.name,token:C.token})}catch(C){H(C instanceof Error?C.message:"Key creation failed. Inspect the clients list before retrying.")}finally{_(!1)}};return u.jsx(_n,{title:"Create API key",titleId:"create-api-key-title",onClose:s,busy:T,children:u.jsxs("form",{onSubmit:U,children:[u.jsx("p",{className:"grant-help",children:"API keys default to read and write. Admin is granted only when you check it. Choose an OAuth client for per-source or per-operation access. This key cannot log into the owner dashboard."}),u.jsx("label",{htmlFor:"api-key-name",children:"Key name"}),u.jsx("input",{id:"api-key-name","data-autofocus":!0,value:b,maxLength:128,disabled:T,onChange:S=>o(S.target.value)}),u.jsxs("fieldset",{style:{marginTop:16},children:[u.jsx("legend",{children:"Access levels"}),Zy.map(S=>u.jsxs("label",{style:{display:"block"},children:[u.jsx("input",{type:"checkbox",checked:z.includes(S.id),disabled:T,onChange:C=>h(Y=>C.target.checked?[...Y,S.id]:Y.filter(G=>G!==S.id))})," ",S.label," ",u.jsx("span",{className:"grant-help",children:S.help})]},S.id))]}),q&&u.jsx("p",{role:"alert",children:q}),u.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:20},children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:T,onClick:s,children:"Cancel"}),u.jsx("button",{type:"submit",className:"btn btn-primary",disabled:T,children:T?"Creating…":"Create key"})]})]})})}function Ky({token:s,onClose:x}){const[b,o]=R.useState(!1),[T,_]=R.useState("");return u.jsxs(_n,{title:"API key created",titleId:"api-key-created-title",onClose:x,children:[u.jsx("p",{children:s.name}),u.jsx("label",{htmlFor:"new-api-key",children:"Bearer token"}),u.jsx("textarea",{id:"new-api-key",rows:3,readOnly:!0,value:s.token}),u.jsx("p",{className:"grant-help",children:"Save this token privately now. It will not be shown again. A key’s creation does not verify your harness connection."}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{navigator.clipboard.writeText(s.token).then(()=>o(!0)).catch(()=>_("Clipboard unavailable. Select and copy the token above."))},children:b?"Copied":"Copy token"}),T&&u.jsx("p",{role:"alert",children:T}),u.jsx("button",{type:"button",className:"btn btn-primary",style:{marginLeft:12},onClick:x,children:"Done"})]})}function Jy(){const[s,x]=R.useState({rows:[],total:0,page:1,pages:1}),[b,o]=R.useState(1),[T,_]=R.useState("all"),[q,H]=R.useState(null);R.useEffect(()=>{z(b)},[b,T]);const z=C=>{const Y=T!=="all"?`&agent=${encodeURIComponent(T)}`:"";Oe.requests(C,Y).then(x).catch(()=>{})},h=C=>{const Y=Date.now()-new Date(C).getTime();return Y<6e4?`${Math.floor(Y/1e3)}s ago`:Y<36e5?`${Math.floor(Y/6e4)} min ago`:Y<864e5?`${Math.floor(Y/36e5)}h ago`:new Date(C).toLocaleDateString()},U=C=>{if(!C)return null;const{query:Y,slug:G,partial:Z,limit:W,...ae}=C,$=[];return Y&&$.push(`"${Y}"`),G&&$.push(G),Z&&$.push(`~${Z}`),W&&$.push(`limit=${W}`),Object.keys(ae).length>0&&$.push(`+${Object.keys(ae).length} params`),$.join(" ")},S=new Map;return s.rows.forEach(C=>{C.token_name&&S.set(C.token_name,C.agent_name||C.token_name)}),u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[u.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Request Log"}),u.jsxs("select",{value:T,onChange:C=>{_(C.target.value),o(1)},style:{background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:6,padding:"4px 8px",fontSize:13},children:[u.jsx("option",{value:"all",children:"All agents"}),[...S.entries()].map(([C,Y])=>u.jsx("option",{value:C,children:Y},C))]})]}),s.rows.length===0?u.jsx("div",{style:{textAlign:"center",padding:48,color:"var(--text-muted)"},children:"No requests yet."}):u.jsxs(u.Fragment,{children:[u.jsxs("table",{children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Time"}),u.jsx("th",{children:"Agent"}),u.jsx("th",{children:"Operation"}),u.jsx("th",{children:"Params"}),u.jsx("th",{children:"Latency"}),u.jsx("th",{children:"Status"})]})}),u.jsx("tbody",{children:s.rows.map(C=>u.jsxs(Xd.Fragment,{children:[u.jsxs("tr",{onClick:()=>H(q===C.id?null:C.id),style:{cursor:"pointer"},children:[u.jsx("td",{style:{color:"var(--text-secondary)",whiteSpace:"nowrap"},children:h(C.created_at)}),u.jsx("td",{children:u.jsx("a",{style:{color:"var(--text-link, #88aaff)",cursor:"pointer",textDecoration:"none",fontWeight:500},onClick:Y=>{Y.stopPropagation(),_(C.token_name),o(1)},children:C.agent_name||C.token_name})}),u.jsx("td",{className:"mono",children:C.operation}),u.jsx("td",{style:{color:"var(--text-secondary)",fontSize:12,maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:U(C.params)}),u.jsxs("td",{className:"mono",children:[C.latency_ms,"ms"]}),u.jsx("td",{children:u.jsx("span",{className:`badge badge-${C.status}`,children:C.status})})]}),q===C.id&&u.jsx("tr",{children:u.jsx("td",{colSpan:6,style:{background:"var(--bg-secondary, #0f0f1a)",padding:16},children:u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"100px 1fr",gap:"6px 12px",fontSize:13},children:[u.jsx("span",{style:{color:"var(--text-muted)"},children:"Time"}),u.jsx("span",{children:new Date(C.created_at).toLocaleString()}),u.jsx("span",{style:{color:"var(--text-muted)"},children:"Agent"}),u.jsx("span",{className:"mono",children:C.token_name}),u.jsx("span",{style:{color:"var(--text-muted)"},children:"Operation"}),u.jsx("span",{className:"mono",children:C.operation}),u.jsx("span",{style:{color:"var(--text-muted)"},children:"Latency"}),u.jsxs("span",{children:[C.latency_ms,"ms"]}),C.params&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--text-muted)"},children:"Params"}),u.jsx("pre",{className:"mono",style:{margin:0,whiteSpace:"pre-wrap",fontSize:12},children:JSON.stringify(C.params,null,2)})]}),C.error_message&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:"Error"}),u.jsx("span",{style:{color:"var(--error, #ff6b6b)"},children:C.error_message})]})]})})})]},C.id))})]}),u.jsxs("div",{className:"pagination",children:[u.jsxs("span",{children:["Page ",s.page," of ",s.pages," (",s.total," total)"]}),u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx("button",{disabled:s.page<=1,onClick:()=>o(C=>C-1),children:"Previous"}),u.jsx("button",{disabled:s.page>=s.pages,onClick:()=>o(C=>C+1),children:"Next"})]})]})]})]})}function ky({markup:s}){return u.jsx("div",{style:{width:"100%",overflow:"auto"},dangerouslySetInnerHTML:{__html:s}})}function Vi({type:s,ariaLabel:x}){const[b,o]=R.useState(""),[T,_]=R.useState("");return R.useEffect(()=>{let q=!1;return Oe.calibrationChart(s).then(H=>{q||o(H)}).catch(H=>{q||_(H.message??"fetch failed")}),()=>{q=!0}},[s]),T?u.jsxs("div",{style:{padding:16,color:"var(--error)"},role:"alert",children:[x,": ",T]}):b?u.jsx(ky,{markup:b}):u.jsxs("div",{style:{padding:16,color:"var(--text-muted)"},children:[x," loading..."]})}function Wy(){const[s,x]=R.useState(null),[b,o]=R.useState(!0),[T,_]=R.useState("");if(R.useEffect(()=>{Oe.calibrationProfile().then(z=>{x(z),o(!1)}).catch(z=>{_(z.message??"fetch failed"),o(!1)})},[]),b)return u.jsx("div",{style:{padding:24,color:"var(--text-secondary)"},children:"Loading calibration profile…"});if(T)return u.jsxs("div",{style:{padding:24,color:"var(--error)"},role:"alert",children:["Could not load calibration profile: ",T]});if(!s)return u.jsxs("div",{style:{padding:24,maxWidth:700},children:[u.jsx("h1",{style:{marginBottom:16},children:"Calibration"}),u.jsx("p",{style:{color:"var(--text-secondary)"},children:"No calibration profile yet. Builds after 5+ resolved takes."}),u.jsx("pre",{style:{background:"var(--bg-secondary)",padding:12,borderRadius:4,color:"var(--text-primary)",marginTop:12,fontFamily:"var(--font-mono)"},children:"gbrain dream --phase calibration_profile"})]});const q=new Date(s.generated_at),H=Math.floor((Date.now()-q.getTime())/(1e3*60*60*24));return u.jsxs("div",{style:{padding:32,maxWidth:720},children:[u.jsx("h1",{style:{marginBottom:8},children:"Calibration"}),u.jsxs("div",{style:{color:"var(--text-muted)",fontSize:13,marginBottom:24},children:["Holder: ",s.holder," · ","Updated ",H===0?"today":`${H}d ago`,s.published&&" · published",s.grade_completion<.9&&` · ~${Math.round(s.grade_completion*100)}% graded`,!s.voice_gate_passed&&" · voice gate fell back to template"]}),u.jsx("section",{style:{marginBottom:32},children:u.jsx(Vi,{type:"brier-trend",ariaLabel:"Brier trend"})}),u.jsxs("section",{style:{marginBottom:32},children:[u.jsx("h2",{style:{fontSize:14,color:"var(--text-secondary)",marginBottom:12,fontWeight:400},children:"Pattern statements"}),u.jsx(Vi,{type:"pattern-statements",ariaLabel:"Pattern statements"})]}),u.jsx("section",{style:{marginBottom:32},children:u.jsx(Vi,{type:"domain-bars",ariaLabel:"Per-domain accuracy"})}),u.jsx("section",{style:{marginBottom:32},children:u.jsx(Vi,{type:"abandoned-threads",ariaLabel:"Abandoned threads"})}),s.active_bias_tags.length>0&&u.jsxs("section",{style:{marginBottom:32,color:"var(--text-muted)",fontSize:13},children:["Active bias tags: ",s.active_bias_tags.join(", ")]})]})}function $y(s){return s===0?"var(--accent-success, #2ea043)":s>=100?"var(--accent-danger, #f85149)":"var(--accent-warn, #d29922)"}function Yd(s){return`$${(s/100).toFixed(2)}`}function Fy(){const[s,x]=R.useState(null),[b,o]=R.useState(null);if(R.useEffect(()=>{let _=!0,q=null;const H=async()=>{try{const z=await Oe.jobsWatch();_&&(x(z),o(null))}catch(z){_&&o(z instanceof Error?z.message:String(z))}_&&(q=setTimeout(H,1e3))};return H(),()=>{_=!1,q&&clearTimeout(q)}},[]),b)return u.jsxs("div",{style:{padding:24,color:"var(--accent-danger, #f85149)"},children:[u.jsx("h2",{children:"Jobs Watch — error"}),u.jsx("pre",{style:{whiteSpace:"pre-wrap"},children:b})]});if(!s)return u.jsx("div",{style:{padding:24,color:"var(--text-muted, #777)"},children:"Loading jobs watch…"});const T=new Date(s.ts_ms).toLocaleTimeString();return u.jsxs("div",{style:{padding:24,fontFamily:'var(--font-mono, "JetBrains Mono", monospace)'},children:[u.jsxs("h1",{style:{fontSize:18,marginBottom:4},children:["Jobs Watch",u.jsxs("span",{style:{marginLeft:12,color:"var(--text-muted, #777)",fontSize:12,fontWeight:"normal"},children:["updated ",T]})]}),u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Queue"}),u.jsxs("div",{children:["waiting=",u.jsx("b",{children:s.queue_health.waiting})," ","active=",u.jsx("b",{children:s.queue_health.active})," ","stalled=",u.jsx("b",{style:{color:s.queue_health.stalled>0?"var(--accent-warn, #d29922)":void 0},children:s.queue_health.stalled})]})]}),s.by_type.length>0&&u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"By type (24h)"}),u.jsxs("table",{style:{borderCollapse:"collapse"},children:[u.jsx("thead",{children:u.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[u.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"name"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"total"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"done"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"fail"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"dead"})]})}),u.jsx("tbody",{children:s.by_type.slice(0,6).map(_=>u.jsxs("tr",{children:[u.jsx("td",{style:{padding:"4px 12px 4px 0"},children:_.name}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.total}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.completed}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.failed}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:_.dead})]},_.name))})]})]}),u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Lease pressure (1h)"}),u.jsxs("div",{style:{color:$y(s.lease_pressure_1h)},children:[s.lease_pressure_1h," bounce",s.lease_pressure_1h===1?"":"s"]})]}),s.top_errors.length>0&&u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Top errors (24h)"}),u.jsx("table",{style:{borderCollapse:"collapse"},children:u.jsx("tbody",{children:s.top_errors.slice(0,5).map(_=>u.jsxs("tr",{children:[u.jsxs("td",{style:{textAlign:"right",padding:"4px 12px 4px 0",color:"var(--text-muted, #777)"},children:[_.count,"×"]}),u.jsx("td",{style:{padding:"4px 12px 4px 0"},children:_.cluster})]},_.cluster))})})]}),s.budget_owners.length>0&&u.jsxs("section",{style:{marginTop:24},children:[u.jsx("h2",{style:{fontSize:14,marginBottom:8},children:"Budget owners"}),u.jsxs("table",{style:{borderCollapse:"collapse"},children:[u.jsx("thead",{children:u.jsxs("tr",{style:{color:"var(--text-muted, #777)",fontSize:12},children:[u.jsx("th",{style:{textAlign:"left",padding:"4px 12px 4px 0"},children:"owner"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"spent"}),u.jsx("th",{style:{textAlign:"right",padding:"4px 12px"},children:"remaining"})]})}),u.jsx("tbody",{children:s.budget_owners.slice(0,5).map(_=>u.jsxs("tr",{children:[u.jsx("td",{style:{padding:"4px 12px 4px 0"},children:_.owner_id}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(_.total_spent_cents)}),u.jsx("td",{style:{textAlign:"right",padding:"4px 12px"},children:Yd(_.remaining_cents)})]},_.owner_id))})]})]})]})}function Iy(){var h,U;const[s,x]=R.useState(),[b,o]=R.useState(""),[T,_]=R.useState(!1),[q,H]=R.useState("");R.useEffect(()=>{let S=!0;const C=Ki();if(!C){o("No pending authorization request. Restart the connection from your client.");return}return Oe.oauthRequest(C).then(Y=>{S&&(x(Y),H(Y.sourceId??""))}).catch(Y=>{S&&o(Y.message)}),()=>{S=!1}},[]);const z=async S=>{if(!(!s||T)){_(!0),o("");try{const C=S==="approve"&&s.sourceChoice.editable&&q!==s.sourceId?q:void 0,Y=await Oe.decideOAuthRequest(s.id,S,s.csrf,C);Hd(),window.location.assign(Y.redirectUrl)}catch(C){o(C instanceof Error?C.message:"Approval failed. Restart the connection from your client."),x(void 0),_(!1)}}};return u.jsxs("section",{"aria-labelledby":"consent-title",style:{maxWidth:760},children:[u.jsx("h1",{id:"consent-title",children:"Approve client access"}),u.jsx("p",{style:{color:"var(--text-secondary)",margin:"16px 0"},children:"Only approve a connection you initiated. These permissions let the client act on your brain."}),b&&u.jsx("div",{role:"alert",className:"login-error",style:{marginBottom:16},children:b}),!s&&!b&&u.jsx("p",{role:"status",children:"Loading authorization request…"}),s&&u.jsxs(u.Fragment,{children:[u.jsxs("dl",{className:"oauth-consent-details",children:[u.jsx("dt",{children:"Client"}),u.jsx("dd",{children:s.clientName}),u.jsx("dt",{children:"Client ID"}),u.jsx("dd",{children:u.jsx("code",{children:s.clientId})}),u.jsx("dt",{children:"Redirect destination"}),u.jsx("dd",{children:u.jsx("code",{children:s.redirectUri})}),u.jsx("dt",{children:"Permissions"}),u.jsx("dd",{children:s.scopes.length?s.scopes.map(S=>u.jsx("span",{className:`badge ${S.includes("admin")?"badge-error":""}`,style:{marginRight:8},children:S},S)):"No permissions"}),u.jsx("dt",{children:"Administrative brain operations"}),u.jsx("dd",{children:s.scopes.some(S=>S==="admin")?"Eligible operations within the grant below. This does not grant owner dashboard access.":s.scopes.some(S=>S.endsWith("_admin"))?"The named administrative brain operations. This does not grant owner dashboard access.":"None"}),u.jsx("dt",{children:"Allowed operations"}),u.jsx("dd",{children:s.allowedOperations===null?"All operations permitted by these scopes and the server policy":s.allowedOperations.join(", ")||"None"}),u.jsx("dt",{children:"Write paths"}),u.jsx("dd",{children:s.boundSlugPrefixes===null?"Within the granted source":s.boundSlugPrefixes.join(", ")||"None"}),s.scopes.includes("agent")&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Delegated tools"}),u.jsx("dd",{children:((h=s.delegatedTools)==null?void 0:h.join(", "))||"None"}),u.jsx("dt",{children:"Delegated write paths"}),u.jsx("dd",{children:s.delegatedNamespace==="job"?"A separate namespace for each job":((U=s.delegatedSlugPrefixes)==null?void 0:U.join(", "))||"None"})]}),s.sourceChoice.editable?u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:u.jsx("label",{htmlFor:"consent-source",children:"Write source"})}),u.jsxs("dd",{children:[u.jsx("select",{id:"consent-source",value:q,disabled:T,onChange:S=>H(S.target.value),children:s.sourceChoice.options.map(S=>u.jsx("option",{value:S.id,children:S.name===S.id?S.id:`${S.name} (${S.id})`},S.id))}),u.jsxs("div",{style:{color:"var(--text-secondary)",marginTop:4},children:["This client reads and writes only this source. Change it later on the Agents page or with ",u.jsx("code",{children:"gbrain auth rescope --client"}),"."]})]}),u.jsx("dt",{children:"Read sources"}),u.jsx("dd",{children:q})]}):u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Write source"}),u.jsx("dd",{children:s.sourceId??"Not configured"}),u.jsx("dt",{children:"Read sources"}),u.jsx("dd",{children:s.allowedSources.length?s.allowedSources.join(", "):s.sourceId??"Not configured"})]}),u.jsx("dt",{children:"Resource"}),u.jsx("dd",{children:u.jsx("code",{children:s.resource??"No resource binding requested"})}),u.jsx("dt",{children:"Request expires"}),u.jsx("dd",{children:new Date(s.expiresAt).toLocaleTimeString()})]}),u.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:24},children:[u.jsx("button",{className:"btn",disabled:T,onClick:()=>z("deny"),children:"Deny"}),u.jsx("button",{className:"btn btn-primary",disabled:T,onClick:()=>z("approve"),children:T?"Completing request…":"Approve access"})]})]}),b&&u.jsx("button",{className:"btn",onClick:()=>{Hd(),window.location.hash="agents"},children:"Return to agents"})]})}function wd(){const s=window.location.hash.replace("#","")||"dashboard";return Ki()&&s==="dashboard"?"oauth-consent":["login","dashboard","agents","log","calibration","jobs","oauth-consent"].includes(s)?s:"dashboard"}function Py(){const[s,x]=R.useState(wd);R.useEffect(()=>{const T=()=>x(wd());return window.addEventListener("hashchange",T),()=>window.removeEventListener("hashchange",T)},[]);const b=T=>{window.location.hash=T,x(T)};if(s==="login")return u.jsx(Ny,{onLogin:()=>b(Ki()?"oauth-consent":"dashboard")});const o=async()=>{if(confirm("Sign out every active admin session, including other browsers and tabs? Each one will need to re-authenticate via a fresh magic link.")){try{await Oe.signOutEverywhere()}catch{}b("login")}};return u.jsxs("div",{className:"app",children:[u.jsxs("nav",{className:"sidebar",children:[u.jsx("div",{className:"sidebar-logo",children:"GBrain"}),u.jsxs("div",{className:"sidebar-nav",children:[u.jsx("a",{className:`nav-item ${s==="dashboard"?"active":""}`,onClick:()=>b("dashboard"),children:"Dashboard"}),u.jsx("a",{className:`nav-item ${s==="agents"?"active":""}`,onClick:()=>b("agents"),children:"Agents"}),u.jsx("a",{className:`nav-item ${s==="log"?"active":""}`,onClick:()=>b("log"),children:"Request Log"}),u.jsx("a",{className:`nav-item ${s==="calibration"?"active":""}`,onClick:()=>b("calibration"),children:"Calibration"}),u.jsx("a",{className:`nav-item ${s==="jobs"?"active":""}`,onClick:()=>b("jobs"),children:"Jobs Watch"})]}),u.jsx("div",{style:{marginTop:"auto",padding:"16px 12px",borderTop:"1px solid var(--border)"},children:u.jsx("button",{onClick:o,style:{background:"transparent",border:"1px solid var(--border)",color:"var(--text-secondary)",padding:"6px 10px",borderRadius:6,fontSize:12,cursor:"pointer",width:"100%"},title:"Revoke every active admin session — every browser, every tab",children:"Sign out everywhere"})})]}),u.jsxs("main",{className:"main",children:[s==="dashboard"&&u.jsx(My,{}),s==="agents"&&u.jsx(Xy,{}),s==="log"&&u.jsx(Jy,{}),s==="calibration"&&u.jsx(Wy,{}),s==="jobs"&&u.jsx(Fy,{}),s==="oauth-consent"&&u.jsx(Iy,{})]})]})}zy.createRoot(document.getElementById("root")).render(u.jsx(Xd.StrictMode,{children:u.jsx(Py,{})}));diff --cc admin/dist/index.htmlindex cfb7e7581f,b715fd0f2c..19a2513a9c--- a/admin/dist/index.html+++ b/admin/dist/index.html@@@ -7,7 -7,7 +7,7 @@@<link rel="preconnect" href="https://fonts.googleapis.com" /><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /><link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />- <script type="module" crossorigin src="/admin/assets/index-CCbzt6ZN.js"></script>- <script type="module" crossorigin src="/admin/assets/index-CaaGFcPc.js"></script>++ <script type="module" crossorigin src="/admin/assets/index-B9c8JuNx.js"></script><link rel="stylesheet" crossorigin href="/admin/assets/index-BB8hJoAN.css"></head><body>diff --cc docs/architecture/key-files/agent-bootstrap-continued.mdindex 3eac909d87,2771fc7432..0903c326f9--- a/docs/architecture/key-files/agent-bootstrap-continued.md+++ b/docs/architecture/key-files/agent-bootstrap-continued.md@@@ -33,7 -33,7 +33,7 @@@- `src/core/backup/status-file.ts` — ENGINE-FREE core of the monthly backup-coverage check: the cached verdict (`~/.gbrain/backup-status.json`, schema `gbrain-backup-status-v2`, which includes the `connector` asset kind; a cache with any other schema reads as absent and is recomputed; fail-open load, atomic tmp+rename write, `invalidateBackupStatus()` fired by the fix paths — `bootstrap repo` receipt write, `sources harden`, `workspacePush` finish on ok when the cache carried a warn or failing/unpushed totals (a routine healthy push leaves an ok cache alone, preserving the monthly throttle)), the notice renderer (`backupNoticeText(s, 'human'|'aggregate')` — human ≤300 chars names assets, aggregate is counts-only for remote surfaces; the remote-privacy pin), and the bounded nag gate shared by every render channel (`backupNagGate(channel, s)` on `backup-nag-state.json`, OWN schema `gbrain-backup-nag-v1` — skillpack `loadNagState` would drop the extra fields on round-trip, so only the pure policy fns `decideNagAction`/`recordNagDisplay` are reused). Budget = AND of: 24h cross-channel dampener (`last_shown_at`), per-channel ceiling 3 per pseudo-version (`YYYY-MM(checked_at)` + no-remote fingerprint — month rollover or a changed verdict re-surfaces; a same-month recompute with an unchanged verdict stays quiet), and a global cap of 3 recorded impressions per month (`global_shown_count`/`global_month`). `backupNagReadOnlyConsult` is the OpenClaw context-engine's never-writes variant; `backupSpawnDue`/`recordBackupSpawn` debounce the session-end detached spawn (no sidecar file); `maybeEmitBackupNag` is the cli.ts startup rail body (skip set incl. serve/call/jobs; `BACKUP_LOCAL_ONLY <n>` machine marker + human line). Off switches: `GBRAIN_BACKUP_CHECK=0`, config `backup.check_enabled`; interval env `GBRAIN_BACKUP_CHECK_DAYS` > config `backup.check_interval_days` > 30; values <1 or non-numeric fall back to the 30-day default (`DAYS=0` never means "always stale"; `config set` rejects <1 outright). Tests: `test/backup-status-file.serial.test.ts`. Remote evidence is identity-bound and one-hour-limited; absent, stale, future-dated or inconsistent evidence cannot produce verified recovery counts, and failed refresh does not overwrite cache.- Workspace push and backup coverage (`src/core/workspace-push.ts`, `src/core/backup/{coverage,repository}.ts`): see [workspace-push-and-backup.md](workspace-push-and-backup.md).- `src/core/gbrain-home.ts` — the single GBRAIN_HOME resolution choke point (delegates to config's parent-dir semantics; 0700 on create) — durability, push, hooks, and bootstrap all route through it so home semantics cannot drift.- - `src/core/bootstrap/verify.ts` + `status.ts` — verify is the definition of done: fail-soft check suite over the REAL write path (put_page op → write-through file under `brain/` → in-process sweep → graph floor via link tables → recall), the keyless magic-moment check (`## Facts` fence → zero-LLM reconciliation → world-visibility read-back), source_id collision resolution (as the one bootstrap subcommand holding an engine: a manifest `source_id` already registered to a DIFFERENT checkout → derives a stable `workspace-<8char-path-hash>`, persists it to agent.json, names the re-register steps — every consumer reads `manifest.source_id`), the `embedding_plane` check (keyed installs live-embed ONE probe string and compare the RETURNED width to the actual `content_chunks.embedding` width — a plane split is a named FAIL with the recovery command, keyless passes, a dead probe warns; runs BEFORE the roundtrip so a keyless-passing roundtrip can never certify a brain whose keyed writes all fail), token sweep, byte floors, secret scan, deny globs, repo privacy, hooks smoke (in-process IPC), capability report, first-run tour; snapshots kept last-5 under `<home>/bootstrap/`. The roundtrip's probe section runs under one try/finally, so both fixed-slug probes are removed on every exit, early failure returns included (#6001; pinned by the early-exit case in `test/bootstrap-verify.serial.test.ts`). status owns the ordered PHASES list (the runbook defers to it), artifact-first detection, install.jsonl, the runbook version-stamp skew check, and the support blob doctor/agents relay verbatim.-- `src/core/bootstrap/verify.ts` + `status.ts` — verify is the definition of done: fail-soft check suite over the REAL write path (put_page op, waiting as long as a CLI write: `resolveCliWriteWaitMs`, so `GBRAIN_WRITE_WAIT_MS`/`persistence.write_wait_ms`, default 30 s; a write still pending after that names its request and `gbrain write-request` poll command → write-through file under `brain/` → in-process sweep → graph floor via link tables → recall), the keyless magic-moment check (`## Facts` fence → zero-LLM reconciliation → world-visibility read-back), source_id collision resolution (as the one bootstrap subcommand holding an engine: a manifest `source_id` already registered to a DIFFERENT checkout → derives a stable `workspace-<8char-path-hash>`, persists it to agent.json, names the re-register steps — every consumer reads `manifest.source_id`), the `embedding_plane` check (keyed installs live-embed ONE probe string and compare the RETURNED width to the actual `content_chunks.embedding` width — a plane split is a named FAIL with the recovery command, keyless passes, a dead probe warns; runs BEFORE the roundtrip so a keyless-passing roundtrip can never certify a brain whose keyed writes all fail), token sweep, byte floors, secret scan, deny globs, repo privacy, hooks smoke (in-process IPC), capability report, first-run tour; snapshots kept last-5 under `<home>/bootstrap/`. status owns the ordered PHASES list (the runbook defers to it), artifact-first detection, install.jsonl, the runbook version-stamp skew check, and the support blob doctor/agents relay verbatim.++- `src/core/bootstrap/verify.ts` + `status.ts` — verify is the definition of done: fail-soft check suite over the REAL write path (put_page op, waiting as long as a CLI write: `resolveCliWriteWaitMs`, so `GBRAIN_WRITE_WAIT_MS`/`persistence.write_wait_ms`, default 30 s; a write still pending after that names its request and `gbrain write-request` poll command → write-through file under `brain/` → in-process sweep → graph floor via link tables → recall), the keyless magic-moment check (`## Facts` fence → zero-LLM reconciliation → world-visibility read-back), source_id collision resolution (as the one bootstrap subcommand holding an engine: a manifest `source_id` already registered to a DIFFERENT checkout → derives a stable `workspace-<8char-path-hash>`, persists it to agent.json, names the re-register steps — every consumer reads `manifest.source_id`), the `embedding_plane` check (keyed installs live-embed ONE probe string and compare the RETURNED width to the actual `content_chunks.embedding` width — a plane split is a named FAIL with the recovery command, keyless passes, a dead probe warns; runs BEFORE the roundtrip so a keyless-passing roundtrip can never certify a brain whose keyed writes all fail), token sweep, byte floors, secret scan, deny globs, repo privacy, hooks smoke (in-process IPC), capability report, first-run tour; snapshots kept last-5 under `<home>/bootstrap/`. The roundtrip's probe section runs under one try/finally, so both fixed-slug probes are removed on every exit, early failure returns included (#6001; pinned by the early-exit case in `test/bootstrap-verify.serial.test.ts`). status owns the ordered PHASES list (the runbook defers to it), artifact-first detection, install.jsonl, the runbook version-stamp skew check, and the support blob doctor/agents relay verbatim.- `src/core/bootstrap/template-repo.ts` + `scripts/generate-template-repo.ts` — deterministic public-template generation (render `--minimal` + placeholder manifest + stamped README); published only by the release workflow after diffing against the vendored tree.- `scripts/check-bootstrap-tag.sh` / `scripts/check-bootstrap-templates.sh` — CI guards: sanctioned distribution ref only (`latest-stable`; the release job advances it after assets publish) + runbook stamp == VERSION; template↔question-bank token bijection + placeholder-only assertion + offline generator↔vendored byte-diff + runbook-phase↔status.ts consistency. Both skip gracefully when their subjects are absent.- `src/core/cycle/synthesize-concepts.ts` concept-quality addendum — a `concepts/<x>` page whose frontmatter lacks `synthesized_by: synthesize_concepts-*` belongs to a human or another writer: the phase checks it before any LLM spend, never rewrites it, and reports it in `details.skipped_human_owned` (pinned by `test/cycle/synthesize-concepts-human-owned.test.ts`). Concept refs are normalized before grouping (`conceptStemFor`: last path segment through `slugifySegment`, validated by `validatePageSlug`; one atom counts once per concept), so spelling variants share one page and no slug carries a space. Each page records `member_hash` (member atom slugs, titles and bodies without their `## Facts` / `## Takes` sections, which the prompt also omits, plus the synthesis model; a page still carrying the full-body hash whose inputs are unchanged is rehashed without a model call, `details.rehashed`; a narrative a `chat_fallback_chain` model wrote is hashed under that model, so the next cycle re-synthesizes it); an unchanged hash on an `llm` or `deterministic_tier` page is skipped without spend (`details.skipped_unchanged`), and a budget or error fallback never replaces an existing `llm` narrative (`details.kept_existing_narrative`); fallback pages retry next cycle. Pinned by `test/cycle/synthesize-concepts-identity.test.ts`. Eligible groups are processed deterministically by tier, descending atom count, then concept slug so the fixed LLM budget reaches the strongest evidence first regardless of database row order. Every page and phase receipt distinguishes `llm`, intended `deterministic_tier`, `budget_fallback`, and `error_fallback` synthesis modes. The narrative call's output cap is sized from the resolved `models.dream.synthesize` model via `resolveSynthMaxOutputTokens`: 500 for non-thinking models, the gateway's `THINKING_MODEL_MAX_OUTPUT_TOKENS` (no phase-private number — DeepSeek v4 truncates at 8192-class caps) when the gateway's shared `isThinkingModel` matches (name-matched Claude 5 or recipe-declared `thinking_by_default`; unknown providers count as non-thinking), so a tier-`reasoning` thinking model no longer spends the whole budget on reasoning and persists a template stub or truncated chain-of-thought as the concept narrative. Pinned by `test/cycle/synthesize-concepts-token-cap.test.ts`. Right after each concept page write the phase banks concept<->member-atom provenance edges through `engine.addLinksBatch` (`link_source: 'concept-provenance'`; `synthesized_from` concept->atom, `synthesizes` atom->concept; audit site `cycle.synthesize_concepts.provenance`), both endpoints scoped to the cycle's source, so the concept pages are graph-reachable (backlinks, relational recall, doctor `graph_signals_coverage`/`orphans`) even though the prompt forbids enumerating atoms in the body. The dedicated `link_source` keeps reconcile passes from pruning them; `ON CONFLICT DO NOTHING` makes re-runs the backfill; a failed or zero-row edge write lands in `link_warnings[]` (phase `warn`) — NOT in `failures[]`, which means "LLM-failed → template fallback" downstream and drives the rollup's `halt_delta`/`round_completed_delta` — and never aborts the page write. Atom discovery (the `type = 'atom'` scan) is scoped to the cycle source (`opts.sourceId ?? 'default'`) so same-slug atoms from other sources are never grouped into this source's concepts. Pinned by the `#4589` describe in `test/cycle/extract-atoms-synthesize-concepts.test.ts` and `test/cycle/synthesize-concepts-source-scope.test.ts`. The phase budget is `cycle.synthesize_concepts.budget_usd` (finite USD above 0, default 1.5; `config set` refuses other values, a stored invalid value keeps the default with a named-key warning, specs in `src/core/cycle/phase-config-values.ts`); groups refused at the cap are counted in the summary and `details.warnings`. Pinned by `test/cycle-synthesize-concepts-budget-config.test.ts`. A narrative whose stop reason is `length`, `refusal` or `content_filter` is a failure (template fallback for a new concept; an existing `llm` page and its `member_hash` stay), and failed narratives are bounded per concept and member hash by `cycle/concept-retry-bound.ts` (`ConceptRetryBound`, DB-only config key `dream.concepts.failed_attempts`, `MAX_CONCEPT_ATTEMPTS` = 3): a bounded concept is skipped before any spend into `details.skipped_retry_bound` until its members change, a narrative succeeds, or the key is unset (`test/cycle/synthesize-concepts-stop-reason.test.ts`).diff --cc docs/architecture/key-files/core-persistence.mdindex 739e798e91,0afb44e2a2..1ce2d562cf--- a/docs/architecture/key-files/core-persistence.md+++ b/docs/architecture/key-files/core-persistence.md@@@ -54,8 -54,8 +54,8 @@@ Connector ingestion, item holds, checkp- `src/core/persistence/{schema,model,journal,authority,identity,ownership,coordinator,consumer,service,page-mutations,page-prepare,source-storage,control,context,digest,prepared-import}.ts` — dedicated durable mutation admission and permanent principal-scoped replay IDs, atomic quota reservations, registered canonical worktree ownership, native lock publication, conditional file recovery, and coherent receipt completion. Recovery presence blocks its whole worktree even when the receipt is terminal; admission and publication both enforce the fence. A file write is not claimed while a queued or running withdrawal mirror targets its page (any page, for an untargeted mirror), so the mirror cannot rewrite the file under an accepted request; when file bytes differ from preparation and the page revision also moved, publication reprepares (`revision_conflict`) instead of refusing as `raw_file_changed`, which stays the outcome for changed bytes at an unchanged revision (`test/withdrawal-followup-writes.test.ts`). Migration 159 adds a partial worktree/sequence recovery index so permanent receipt retention does not turn the fence into a history scan. Canonical file preparation honors a recorded source path or contained absolute capture file URI within the registered owner root (relative or host-only `file://` URIs are absent); symlink confinement and coherent snapshot checks still apply. A slug under a `storage.db_only` dir declared in `gbrain.yml` (matched case-insensitively, derive-phase defaults excluded) publishes database-only when a live page's file is absent (the case that otherwise refuses as an uncoordinated removal), with receipt `write_through.skipped: db_only`; new pages, tombstones, missing-file-tolerant callers and present cache files keep the full file treatment and never read `gbrain.yml`. `gbrain.yml` is read from the source root, like doctor, export and backup, not the git root `manageGitignore` uses, which differs for a monorepo-subdir source. `source-storage.ts` caches the parsed file per version and logs an invalid one (unreadable, overlapping tiers, db_only declared in syntax that resolves nothing) once; that missing-file refusal then reports `storage_error`, and the Git effect treats the page as not db_only. The drift guard applies the import rule for a file without an explicit `type:` (the stored type stands) and compares titles trimmed, as the parser reads them; a real drift refuses with `detail: file_database_drift` and a filled `sources reconcile` command; when sync holds the page's file (`sync-holds.ts`), the drift and occupied-path refusals name the hold instead (location-free message from `verb-errors.ts` `heldFileMessage`, mapped back by `heldFileDiagnostic` in receipts and `service.ts`) and its repair, and the page stays read-only for put_page until the file is repaired. The first write that binds an origin in a Git-subdirectory source with no slug-root pin pins the inferred mode in its publication transaction (a concurrent different pin refuses with `revision_conflict`), so later pages cannot flip the inference. A new page captured from a file inside the source (`capture_path`, resolved from the trusted CLI `local_file` in `page-mutations`, only when sync would give that file the capture slug under the source's slug-root mode) publishes to that file when its bytes are exactly the captured input; otherwise capture records `source_uri: cli-file`, never a host path. `acquireWorktree(binding, waitMs, signal, engine)` re-stamps a device-only physical-root change under the native lock (see `physical-root.ts`); without an engine, or when birth time is zero, it refuses with `detail: physical_root_device_changed` and the filled self-transfer commands. Version snapshots retain nullable `is_deleted`: new snapshots restore recorded deletion state atomically with content, tags, files and receipts; legacy NULL preserves current deletion state. Canonical no-op detection compares deletion state as well as content. Page replacement preconditions are checked before no-op detection; providers prepare outside publication transactions; recovery never restores unexpected bytes. Local registrations retain immutable CLI/stdio trust lanes and hashed credentials; accepted authority is intersected with current grants. `limits.ts` reads every `persistence.limits.*` cap and `persistence.receipt_retention_days` (default 30) from the database config table (`JOURNAL_CONFIG_KEYS`, registered for `gbrain config set`; malformed values are rejected at set time). Cumulative defaults (250,000 lifetime IDs and 1.5 GiB receipt bytes per principal, 8 GiB brain receipt bytes) cover 600 admissions a day for a year; each admission reserves at least 16 KiB and a compacted receipt keeps about 4 KiB. A cumulative `queue_capacity` refusal names its key in `detail` and suggests a `gbrain config set` value covering one more year at the recent admission rate (`oneYearCapacity`). Compaction filters out receipts with unfinished effects before its batch limit. `test/persistence-journal.test.ts` exercises real PGLite and optional guarded Postgres admission, cancellation, compaction, conflict and publication recovery; `test/persistence-capacity.test.ts` covers retention, the compaction filter, capacity hints and default sizing. `service.ts` also dispatches operation `decide_proposal` (S9 proposal accept/undo) to `facts/proposal-supersede.ts`. FENCE REPAIR RECEIPT: `fence_repair` is a reserved `put_page` param; `preparePageAdmission` refuses it (`invalid_params`) on every operation unless the call is a trusted local (`ctx.remote === false`) `put_page` whose value `parseFenceRepairReceipt` accepts; `page-prepare.ts` re-parses it from the stored intent, returns it in the outcome as `fence_repair` and gives the page's file target the `fenceRepairCommit` note for its source-relative path. GOOGLE PUBLISH MODE: a page target is a `PageMutationFile` (`MutationFile` plus optional `publishMode` and `commit`). The Google callers set `publishMode: 0o600` at prepare time from the stored connector (`prepareConnectorMutation` in `connector-sync.ts` when `p.connector === 'google'`, and `prepareGoogleReceiptPatch`); it is never part of the submitted intent, so request ids are unchanged. `publishFile` then creates missing directories with `mkdirPrivate(dirname(path), root)` (0700) instead of `mkdirSync` and opens the stage with `mode ?? publishMode` through `AtomicWriteOpts.mode`, so a rewrite of a legacy 0644 page lands 0600. Restoration keeps restoring the journaled before-mode and opens its stage with it (the post-flush chmod stays), so a restored private page is never staged wider than its mode.- `src/core/persistence/protocol.ts` — the persistence protocol declaration and the global row-lock order: the `persistence_brain` row, then worktree rows (id order), then source rows (id order), then `persistence_counters`, request rows and page keys. The request and effect protocol triggers (`shared-skills/persistence-schema.ts`) read the brain row FOR SHARE, and worktree claims, topology changes (`lockTopologyRows`, then `settleTopologyRequests` locks the `brain` counter) and activation hold it FOR UPDATE before their worktrees, sources and counters. So `declarePersistenceProtocol` and `declareDurablePersistence` take the brain row FOR SHARE in the same statement as their settings (after `lock_timeout`, a missing row still declares), and every journal transaction declares before any other row lock: admission, publication, recovery, completion, cancellation (`control.ts`), `forget` (`memory-mutations.ts`), connector retry approval, embedding effect retry and settlement, and withdrawal-target upgrades (`effect-targets.ts`). A transaction that needs the brain row FOR UPDATE takes it first and declares after it (`skill-activation.ts`). Before this order, an ordinary write that locked its source and counters before the trigger's brain read inverted against a concurrent claim or topology change and ended in a 1 s `lock_timeout` (or a deadlock), a retry, and writes left pending. Tests: `test/e2e/persistence-publish-lock-order-postgres.test.ts` (paused topology change and a claim/topology race, direct and through PgBouncer), the crash robot's `brain_before_rows` rule (`scripts/persistence/lock-order.ts`, `test/persistence-crash-robot.test.ts`).- - `src/core/persistence/unbound-source.ts` — #5254 policy for a Postgres page write to a filesystem source (`local_path`, or `sync.repo_path` for `default`) with default write-through and no worktree binding. `submitPageMutation` refuses `owner_unavailable` with `detail: unbound_source`, a `docs` pointer to `write-refusals.md#unbound-sources-on-postgres`, and a hint naming the filled `sources writer status`/`writer claim ... --admin-intent writer_claim --expected-state <admin_state>` bind command (host path only for trusted local callers) and, for `put_page` to a page without `source_path`, `gbrain config set persistence.unbound_write database_only`. That key (`refuse` default, validated by `config set`; any other stored value refuses) lets such a `put_page` admit with `databaseOnlyReason: 'unbound_source'`. Publication rechecks inside its transaction, after `authorizeStoredRequest` share-locks the source row, that the source is still unbound and the page still has no `source_path` (else `owner_unavailable`/`unbound_source`, hint rebuilt from the persisted message by `writeResponse`), then stamps `pages.database_only_reason='unbound_source'` (migration 177). After binding, `prepareFileTarget` keeps a stamped page with no file database-only (receipt `write_through.skipped: unbound_source` with a warning) and managed sync refuses to import a file at its path (`source_changed`, diagnostic reason `unbound_source`). PGLite keeps auto-claiming. Tests: `test/e2e/unbound-source-postgres.test.ts`, `test/persistence-unbound-source.test.ts`. See [persistence stalls](persistence-stalls.md).+ - `src/core/persistence/unbound-source.ts` — #5254 policy for a Postgres page write to a filesystem source (`local_path`, or `sync.repo_path` for `default`) with default write-through and no worktree binding. `submitPageMutation` refuses `owner_unavailable` with `detail: unbound_source`, a `docs` pointer to `write-refusals.md#unbound-sources-on-postgres`, and a hint naming the filled `sources writer status`/`writer claim ... --admin-intent writer_claim --expected-state <admin_state>` bind command (host path only for trusted local callers) and, for `put_page` to a page without `source_path`, `gbrain config set persistence.unbound_write database_only`. That key (`refuse` default, validated by `config set`; any other stored value refuses) lets such a `put_page` admit with `databaseOnlyReason: 'unbound_source'`. On a classic brain (managed persistence not activated) the hint leads with the classic write path: write `<checkout>/<slug>.md`, commit it, `gbrain sync --source <id>` (a remote caller is told to ask the user to). The refusal is `retryable: false` with a `fix` of `next: ask_user` and a `user_message` (classic or managed wording), because every way out is the user's choice (`test/unbound-source-hint.test.ts`). Publication rechecks inside its transaction, after `authorizeStoredRequest` share-locks the source row, that the source is still unbound and the page still has no `source_path` (else `owner_unavailable`/`unbound_source`, hint rebuilt from the persisted message by `writeResponse`), then stamps `pages.database_only_reason='unbound_source'` (migration 177). After binding, `prepareFileTarget` keeps a stamped page with no file database-only (receipt `write_through.skipped: unbound_source` with a warning) and managed sync refuses to import a file at its path (`source_changed`, diagnostic reason `unbound_source`). PGLite keeps auto-claiming. Tests: `test/e2e/unbound-source-postgres.test.ts`, `test/persistence-unbound-source.test.ts`. See [persistence stalls](persistence-stalls.md).-- `src/core/persistence/{semantic,semantic-pages}.ts` — revision-bound semantic tag/timeline merges through the journal. Supported merges reprepare against a newer snapshot; exact timeline replay leaves canonical bytes, revision, versions and structured rows unchanged. The public timeline handler resolves durable replay before page-existence preflight, retaining original outcomes after page purge or recreation; fresh writes preserve same-source diagnostics. `page-state/projections.ts` completes sanitized text and page search vectors together, and installs delayed embeddings with UPDATE-only revision/chunk/text/index-context checks. New vectors receive the full provider:model captured before provider execution, and a runtime model switch invalidates the prepared indexing context. Metadata updates preserve the sanitized vector. Tests: `persistence-semantic-pages.test.ts`, `page-projection-concurrency.test.ts`.+- `src/core/persistence/{semantic,semantic-pages}.ts` — revision-bound semantic tag/timeline merges through the journal. Supported merges reprepare against a newer snapshot; exact timeline replay leaves canonical bytes, revision, versions and structured rows unchanged. The public timeline handler resolves durable replay before page-existence preflight, retaining original outcomes after page purge or recreation; fresh writes preserve same-source diagnostics. #5251: `add_tag` / `remove_tag` prepare with `deferEmbedding: true` (a tag change leaves every chunk's text as it was, so no `embedding` effect is queued and `embedding_state` reads `deferred`; the stale sweep still covers any chunk the republication left without a vector); the full page republication they ride stays, so the issue stays open. `page-state/projections.ts` completes sanitized text and page search vectors together, and installs delayed embeddings with UPDATE-only revision/chunk/text/index-context checks. New vectors receive the full provider:model captured before provider execution, and a runtime model switch invalidates the prepared indexing context. Metadata updates preserve the sanitized vector. Tests: `persistence-semantic-pages.test.ts`, `page-projection-concurrency.test.ts`.- `src/core/persistence/{source-lifecycle,managed-sources,topology-schema,topology-locks,topology-receipts,topology-clone,topology-clone-model,topology-filesystem,topology-recovery}.ts` — migration 157 coordinates source add/claim/archive/restore/remove/purge/rebind/reclone. Native root locks precede topology/source/grant/counter/request guards; a shared root advances every membership and permanently conflicts accepted old-topology requests. Withdrawal mirrors and running publication must settle first. Administrative UUIDs share the page journal's principal-scoped conflict domain and permanent capacity counters. Directory replacement reserves the configured recovery budget before provider/staging work, records a verified manifest and physical identity, and recovers only known bytes; clone failure retains the original checkout and a replayable failure receipt. Rebinding accepts a fresh candidate with exactly matching canonical content, including deletions. Stored worktree manifests and clone recovery records keep `digest`, `file_count`, `canonical_stamp` and `self_transfer` but no per-file map (#5790), so their size is independent of the worktree; `compactStoredManifest` drops a legacy map on rewrite, and transfer prepare/accept hash under the native lock before their transaction. Large-repo tests: `test/persistence-large-manifest.test.ts` (12k files, both engines via `test/e2e/persistence-large-manifest-postgres.test.ts`) and `test/e2e/persistence-large-manifest-50k.test.ts`. Old root refusal records remain. Metadata deletion retains local storage. Restart recovery rotates a bounded root scan so one conflict cannot starve other roots. Tests: `test/persistence-source-lifecycle.test.ts` on PGLite and guarded isolated Postgres. #6099: manifests are Git-scoped for Git checkouts; see `worktree-manifest.ts` in [managed sync and persistence stalls](persistence-stalls.md).diff --cc docs/architecture/key-files/open-loops-engine.mdindex 024711d9c1,0000000000..8e2da74e46mode 100644,000000..100644--- a/docs/architecture/key-files/open-loops-engine.md+++ b/docs/architecture/key-files/open-loops-engine.md@@@ -1,16 -1,0 +1,16 @@@+# Open-loop engine (key files cluster)++[Subsystem index](../KEY_FILES.md) · [Google connector entries](google-and-loops.md).++User-facing contract: `docs/guides/open-loops.md` (detection, exclusion and+close semantics). The Gmail sweep that feeds both lanes is in+`google-and-loops.md` (`google-source.ts`, `loop-catchup.ts`, `loops-enqueue.ts`).++- `src/core/google/loops-exclusion.ts` — the user's own label exclusion for the open-loop engine (#5445). `excludedLabelTokens` reads the source's `g_loops_exclude_labels`, else the brain-wide `loops.extraction_exclude_labels` (no merge); `resolveExcludedLabels` matches tokens against the account's label catalog (id verbatim, name case-insensitively; with no catalog only id-shaped tokens resolve) into a `LoopsExclusionPolicy { tokens, ids, unresolved }`, where a non-empty `unresolved` means FAIL CLOSED for new paid extraction. `resolveSweepExclusion` (`loops-enqueue.ts`) runs it once per Gmail sweep (one `GmailClient.getLabels` call when anything is configured), logs each unresolved name, and `storeLoopsExclusion` keeps the resolution in `op_checkpoints` (op `loops-exclusion`, keyed like the loop outcomes) so `loadLoopsExclusionPolicy` can apply the policy without a Gmail client at the two late sites: `runLoopsExtract` (skips `excluded_label`, throws retryable `excluded_label_unresolved`) and `openDueGraceHold` (`'excluded'` drops the hold, `'deferred'` keeps it). A stored resolution is reused only for the same token list; changed tokens fall back to id-only until the next sweep. The policy gates `loopExtractionEligibility` right after SPAM/TRASH and before the owner override (reasons `excluded_label` / `excluded_label_unresolved` in the sweep's counters), `withLabelExclusion` strips the opens from a `detectThreadLoop` verdict (closes untouched), `recordGraceVerdict` records no hold for an excluded thread, `runLoopsCatchup` skips with `excluded_label_unresolved`, and `enqueueLoopsExtraction` reports the same `skipped_reason` ahead of `no_candidates`. The leaf is `excluded` from connector identity. Tests: `test/loops-exclusion.test.ts`, `test/google-source-reconcile.test.ts` ("label exclusion (#5445)"), `test/loops-extract-run.serial.test.ts` ("#5445 execution-time").+- `src/core/google/loops-spend.ts` — the daily spend cap on loop extraction (wave 14 P4.6b): `loops.extraction_max_usd_per_day` (default $2.00, validated at `config set` by `validateLoopsSpendConfigValue`; a stored value is `user`-sourced). `loopsSpendGate` is what both enqueue sites call: it reads the cap and the day's group spend (`readGroupSpend` on `group:<day group>`) and returns the `SpendAuthorization` to stamp (`loopsExtractSpendAuthorization`: kind `authorized`, command `loops_extract`, via `preapproval`, one deterministic UUID per UTC day from `loopsSpendGroupId`) or the reason to queue nothing (`daily_spend_cap` at the cap, `spend_cap_zero` at 0). The sweep's `enqueueLoopsExtraction` and the catch-up's enqueue pass that record through `MinionQueue.add`'s trusted `spendAuthorization` option, so the worker runs each job under `runWithJobSpend` (spend-authorization.ts): every provider attempt reserves against the group and settles its usage; refusal before the call is `cost_cap_exceeded`, recorded on the row. An unreadable meter admits the enqueue (the worker still enforces). Tests: `test/loops-extract-spend-cap.test.ts`.- - `src/core/google/counterparty.ts` — where a loop's counterparty page is (#5504, wave 14 P4.1). `resolveCounterparty(engine, sourceId, { name, email })` tries the loop's OWN source first through `resolveEntitySlugWithSource` (name, then email; never the slugify fallback), and only then crosses a source boundary by identity: an `entity_identities` canonical member in another source (`identity_canonical`, which also redirects an own-source stub to its canonical twin) or the exact email as a `page_aliases` row on exactly one live page in exactly one other source (`email_alias`). A display name never crosses, a tie (two other sources) stays unresolved and the loop keeps a NULL counterparty rather than a guess. Both writers (`loop-detect.ts` `upsertThreadLoop`, `loops-extract.ts`) stamp the result into `open_loops.counterparty_source_id` and point the `owes_to` / `awaiting_reply_from` edge at the page's source; the commitment fact stays in the connector source. Readers confine with `COALESCE(counterparty_source_id, source_id)` (`COUNTERPARTY_SOURCE_SQL`): a row written before v233 reads as its own source. `src/core/loops/loops-schema.ts` is the leaf the migration and the store share (column DDL + the partial index `open_loops_counterparty_source_idx`).++- `src/core/google/counterparty.ts` — where a loop's counterparty page is (#5504, wave 14 P4.1). `resolveCounterparty(engine, sourceId, { name, email })` tries the loop's OWN source first through `resolveEntitySlugWithSource` (name, then email; never the slugify fallback), and only then crosses a source boundary by identity: an `entity_identities` canonical member in another source (`identity_canonical`, which also redirects an own-source stub to its canonical twin) or the exact email as a `page_aliases` row on exactly one live page in exactly one other source (`email_alias`). A display name never crosses, a tie (two other sources) stays unresolved and the loop keeps a NULL counterparty rather than a guess. Both writers (`loop-detect.ts` `upsertThreadLoop`, `loops-extract.ts`) stamp the result into `open_loops.counterparty_source_id` and point the `owes_to` / `awaiting_reply_from` edge at the page's source; the commitment fact stays in the connector source. Readers confine with `COALESCE(counterparty_source_id, source_id)` (`COUNTERPARTY_SOURCE_SQL`): a row written before v234 reads as its own source. `src/core/loops/loops-schema.ts` is the leaf the migration and the store share (column DDL + the partial index `open_loops_counterparty_source_idx`).+- `src/core/google/loop-detect.ts` — the zero-LLM thread-state machine: last substantive message inbound + user in To: + unanswered ≥24h → `unanswered_inbound`; last outbound + contains a question + unanswered ≥72h → `unanswered_outbound` (both grace windows measured from the oldest owed message in the trailing run since the last turn flip, so a nudge or follow-up never restarts the clock — gbrain-evals N7-1); a reply closes the loop (`closed_by: reply_detected`), except that my acknowledgement-only reply to their question (`isAcknowledgementOnly`: "Thanks!", "Got it, thanks.") is dropped from the substantive run so it neither closes nor restarts the loop (N7-2); `asksQuestion` ignores a `?` inside a link (N7-7); each spec carries `openedMs`, the oldest obligation-carrying message in the run, which the apply step writes as `opened_at` (N7-6). Precision IS the product: noise senders, list mail (List-Unsubscribe), auto-submitted mail (RFC 3834 `Auto-Submitted` other than `no`, which also never closes a loop, so an auto-reply is not an answer), CC-only delivery, FYI/forwards without a question, self-threads, and muted senders/threads never open loops — pinned by the labeled fixture corpus in `test/google-loop-detect.test.ts` (every false-positive class gets a fixture before its fix). Pure verdict function + a thin apply step called per touched thread from the sync; the apply step must never fail the sync. A grace-window hold returns `held: { untilMs, spec }` (the loop it would open) and `applyThreadLoopVerdict` returns the verdict, so the sweep can record it (`loop-catchup.ts`); `openDueGraceHold` opens a stored spec after re-reading suppressions.+- `src/core/google/loops-extract.ts` — the LLM half of the open-loop engine: ONE extractor per recent thread page projects each commitment into THREE substrates in the same pass — the `open_loops` row (dedup `commit:<sha8>`), a facts row via writeSingleFact (kind=commitment, fence-first, deduped; its id lands on `open_loops.fact_id` so entity cards / recall / context_pack see the commitment through existing read paths with zero new read code; a failed facts write is logged with slug, source and a bounded error, never the commitment text, and the loop row still lands), and a typed edge thread-page → person-page (`owes_to` / `awaiting_reply_from`) for relational search. `extract_facts` never runs separately on google-source email pages. Guardrails: injection-hardened input, ALL-or-nothing parse barrier (a malformed model response writes NOTHING), a structural eligibility gate (`loopExtractionEligibility` — Gmail labels, `List-Unsubscribe`, `Auto-Submitted`, calendar part, who wrote the message; no vendor lists) plus the per-source waiting-depth enqueue budget (`LOOPS_EXTRACT_ENQUEUE_CEILING`, a spend backstop — see `google-source.ts`), only the last `LOOPS_EXTRACT_WINDOW_DAYS` (30) of mail (the deep backfill is never extracted), kill switch `loops.extraction_enabled` (default ON for google sources). Suppressions gate the lane before any model/facts/edge write: a muted thread id, or a muted SENDER — `fm.from` ∪ `fm.senders`, every address that AUTHORED a message, so a muted counterparty who wrote earlier in the thread still suppresses — returns `reason: 'suppressed'`; recipients/CC never count (muting one person must not hide everyone else's commitments in a group thread, and an outside sender must not be able to dodge extraction by CC'ing a muted address). Pages without a `senders:` field fall back to `fm.from` alone until their next re-render. Eligibility computes the substantive (non-noise, non-calendar) message set FIRST and `owner_participated` requires the owner to have written a SUBSTANTIVE message — a pure-calendar thread the owner RSVP'd to stays `no_substantive_messages`. When the chat provider is unavailable, `runLoopsExtract` throws `LoopsExtractRetryableError` (reason `llm_unavailable`) rather than returning a skipped result: a completed no-work row would hold the revision-keyed idempotency slot forever, while a retried-then-dead row frees it so the same revision re-enqueues on the next sweep. On a managed brain `managedFactWritePreflight` checks the managed fact authority and canonical owner before chat (an unaccepted writer refuses with `writer_coordinator_required`), and the commitment fact publishes through writeSingleFact's coordinator path; disabled, missing-page and suppressed cases retain their existing no-work outcomes. A judge response cut off at the 2048-token cap (`stopReason: length`) is retried once at 8192; still truncated, the job fails retryable (`truncated`) with the ceiling named. Non-length errors and refusals are never escalated.+- `src/core/loops/loops-store.ts` — SQL accessors for the `open_loops` + `loop_suppressions` tables over `engine.executeRaw` with IDENTICAL SQL text on both engines (parity by construction, the sources-ops.ts pattern — no per-engine method twins). JSONB discipline: evidence binds through `$N::text::jsonb`, never a bare `::jsonb` cast over JSON.stringify. Loops close by state transition, never delete: reply-driven auto-close flips status to `done` and stamps `closed_by`, keeping the audit trail. `openedAt` sets `opened_at` (default now()); an open row keeps the earlier of its stored and incoming value, a reopened row takes the incoming one. The upsert's DO UPDATE carries a manual-close guard in its WHERE: a closed row (done/dropped/stale) only reopens on GENUINELY newer activity, so a routine sweep re-seeing the same thread never resurrects a hand-closed loop, and the staleness auto-close (`closed_by: 'staleness'`) is likewise guarded against the upsert's reopen. `listOpenLoops` takes an optional `id` that composes with the status/type/counterparty filters and never replaces the source scope; `counterpartySourceId` narrows a `counterparty` slug match to the source the page lives in (`COALESCE(counterparty_source_id, source_id)`), leaving an email match untouched (#5504). `removeSuppression(engine, sourceId, kind, value)` is the exact inverse of the mute write — deletes the one `(source_id, kind, value)` row with the same lower-casing, returns `{removed: boolean}` (false = was not muted, callers treat it as a no-op success), and never reopens loops: suppressions gate NEW detection only.+- `src/core/ops/loops.ts` — the op surface: `open_loops` (read), `loops_close` (write), `loops_mute` (write). `loops_close` retires a commitment loop's fact through `persistence/loop-fact-retirement.ts` and returns `{ closed, id, status, fact_expired, retryable, reason? }` from the real publication outcome; a loop already closed whose fact is still active re-attempts the retirement. `open_loops` is deliberately NOT localOnly (hosted serves it over HTTP to the authenticated owner); instead it applies fail-closed evidence redaction for `ctx.remote !== false` — counts, counterparty, summary, due date only; verbatim quotes, Gmail deep links, and the injectable `text` digest are trusted-local only. Ranking and rendered ages use one reference time, `as_of` (ISO, default now, echoed in the grouped result; `gbrain waiting --as-of`), so a published order is reproducible (N7-5). An optional `id` (positive safe integer, else `invalid_params` through `invalidParam` without echoing the value) finds one loop at any status unless `status` is given; explicit filters still intersect, scope and redaction are unchanged, so an out-of-scope id returns exactly what a missing id returns, and an id lookup carries no `text` digest. The result carries per-source last-successful-sync ages + a `stale` flag (>24h): all stale sources remain a refusal condition for `gbrain waiting`, while a mixed fresh/stale set continues with a warning naming stale sources (`stale_sources` in JSON). Per-call scope params `source_id`/`all_sources` resolve through `resolveRequestedScope` (an MCP client bound to another source can reach the google source's loops; remote callers stay in-grant, out-of-grant `source_id` is denied); a scope with NO google source returns `no_google_sources: true` and the digest says the engine has nothing to read instead of a false "You are clean". Scope is fail-closed too: an UNSCOPED remote `open_loops` read is refused outright (the op must not rely on transports to enforce it — an unscoped remote read would span every source), and the write ops (`loops_close`, `loops_mute`, `loops_unmute`) require a single-source remote scope that matches the caller's grants — trusting a caller-supplied `source_id` for a remote write would let any remote client plant (or lift) suppression rows cross-source; `loops_unmute` reverses a suppression via `removeSuppression` and reports `{removed}` honestly. #5871: grouped output ranks people only; loops with neither a counterparty slug nor an email return in `no_counterparty` (`loop_count`, `by_type`, shown loops, `loops_omitted`; null when none), never ranked or counted by `limit`, and the digest lists them last and never says "You are clean" while they exist; each group shows at most `LOOPS_PER_GROUP` (5) loops, due-soonest then most recently active, with `loops_omitted` (`test/ops-loops.test.ts`, `test/loops-cli.test.ts`).+- `src/commands/loops.ts` — `gbrain waiting [--top N] [--json] [--stale-ok]` + `gbrain loops list|show|done|drop|mute`: all paths dispatch through the trusted-local op layer (`handleToolCall`, remote:false) so CLI and MCP share one behavior. `waiting` REFUSES when EVERY google source has gone >24h without a successful sync and prints the exact fix (`--stale-ok` bypasses; per-source sync ages are always reported); when only some sources are stale, it continues with the warning and source ids from `open_loops`. Output per counterparty: what's owed, evidence quotes, Gmail deep links, entity-card context, a paste-ready digest. Reads default to the `__all__` brain span (loops live in google sources, not `default` — a default-scoped read would say "all clean" while people wait); `--source <id>` narrows explicitly. `loops show <id>` passes the id to `open_loops` (any status and rank); a missing positive id is a usage error (exit 2) and an unknown id renders `not_found` with the `gbrain loops list` fix (exit 1). An unqualified `mute`/`unmute` resolves the brain's google source (never `default`) through the SAME resolution — an unmute can never aim at a different source than the mute it reverses — and refuses with the exact fix when none or multiple exist. `unmute sender <email> | thread <id>` is exact and forward-only; a repeated unmute is a no-op success (`removed: false`, exit 0) so scripts can call it unconditionally.diff --cc scripts/e2e-backend-matrix.txtindex 85bfdceaa4,cb33235014..ea88d585ea--- a/scripts/e2e-backend-matrix.txt+++ b/scripts/e2e-backend-matrix.txt@@@ -61,4 -61,6 +61,7 @@@ test/e2e/fence-chunk-overlay-postgres.ttest/e2e/fence-chunk-trust-read-postgres.test.tstest/e2e/trust-cross-session-parity.test.tstest/e2e/single-write-group-parity-postgres.test.ts+test/e2e/db-lock-token-predicate-postgres.test.ts+ test/e2e/fts-cjk-boundary-postgres.test.ts+ test/e2e/oauth-client-registered-via-postgres.test.ts+ test/e2e/oauth-owner-consent-source-postgres.test.tsdiff --cc scripts/module-size-limits.tsvindex 790a5d8e1d,9186027731..1294c632ea--- a/scripts/module-size-limits.tsv+++ b/scripts/module-size-limits.tsv@@@ -30,13 -30,13 +30,15 @@@ src/commands/integrations.ts 1739 ratchsrc/core/minions/handlers/subagent.ts 1925 ratchet merged: master v131 settle rework + dream-wave C5 peel + C6 accounting + C7 lease heartbeats/lost-lease aborts + C9 oneshot dispatch + adversarial fix batches; grown by #4078 subagent-loop capability fix; +6 lines (reasoning-item replay: adaptContentBlocksToChatBlocks handles 'reasoning' blocks); +3 wave G #4514: Anthropic-via-OpenRouter allowed on the subagent loop; +36 lines (code review, same PR): isPromptTooLongError walks a bounded .cause chain so it still matches post-normalizeAIError() wrapping, plus extractPromptTooLongDetail so the dead-lettered job's error carries the matched provider detail instead of the generic normalizeAIError() wrapper text; master integration: harness support: boundary wiring to shared grants, isolated setup, withdrawal and delegated guards; #5105: +13 call-site wiring to shared tool-write-identity helper across fresh and replay dispatch; +7 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms read once and passed to the oneshot and gateway-loop paths (resolver lives in minions/handler-timeouts.ts)src/commands/bootstrap.ts 2134 ratchet grandfathered at merge (grew past the 1500 cap on master); raised for #4066 HOME_WORKSPACE_GUARD_EXEMPT (status/uninstall/harness); +5 for the harnessDetect test seam (bulk lives in core/bootstrap/harness.ts); +23 for the contract subcommand dispatcher glue (#4105 absorb — bulk lives in core/bootstrap/contract.ts); +codex hooks-consent gate + mcp+hooks receipt registration + uninstall arm; +42 ambient-writeback WP8: interview-time SURFACE_MULTIUSER audience apply (pre-init ordering) + applyDeclaredAudienceFromInterview; +3 #4897 harness usage clause documenting --source ID semantics; +5 #5878: --refresh-skills dispatch and usage lines (logic in core/bootstrap/harness-skills.ts); +11 #5488: SUBCOMMAND_HELP harness entry (gate on --help / -h / help) — CLI help line, cannot move; +11 #4618 seat: --seat/--no-seat help lines and the runHooks parse (parse + notes live in core/bootstrap/hooks.ts parseSeatFlags)src/core/minions/worker.ts 1774 ratchet grandfathered at merge (grew past the 1500 cap on master, #4170); grown v0.46.11.0 five-issue wave; security: durable queued authority and confined filesystem dispatch; typed readiness, configuration-blocked lifecycle and bounded release; post-validation readiness publication and confirmed isolated-execution stop evidence; latch typed lock-renewal faults before generic retry; +9 Lane D: JobDeferredError routing (deferJob helper); +1 spend authorization: runWithJobSpend import (both handler seams call it in place of the bare handler)+src/commands/sources.ts 2077 ratchet +5 #5988: sources status/retry-held help rows describe Git holds (help lines cannot move); +2 #5988: sources status <id> filter and Git held files (view in persistence/connector-status.ts); +5 F0: sources refresh dispatch and help rows (command body in sources-refresh.ts, protocol in persistence/worktree-refresh.ts); +6 fix wave 5 #5409: mirror-readonly/mirror-writable dispatch, help rows and the list --json mirror_read_only field (body in sources-mirror.ts); grown v0.46.22.0 phone wave: github source kind (#4104); +129 v0.47 gmail-loops: google source-kind flags + vault preflight + duplicate-account warn + access-mode validation; +8 set-path dispatch + help rows (#4739 — command body peeled to sources-set-path.ts); +29 #4698 adoption: --calendar-id flag + duplicate-account warn scoped to overlapping services; #5105: trusted writer administration route; company handlers and receipt status wiring; parsing stays in dedicated modules; canonical reconciliation: +5 engine-free sibling-command dispatch and help row, implementation remains in source-reconcile.ts; +4 fix wave 3 lane A: sources status connector recovery state and run counts (view lives in persistence/connector-status.ts); +3 fix wave 4 lane B: sources retry-held dispatch and help row (command body in sources-retry-held.ts) and the connector first-sync note on add; bodies in source-delete.ts and sources-set-path.ts); +4 #5984: sources status shows the managed sync backlog (logic in persistence/sync-drain.ts); v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (2031 measured); +11 W-B4: sources shared-skills dispatch, its --help guard and help rows, and the shared_skills field/lines in sources status (body in sources-shared-skills.ts, view in shared-skills/source-opt-out.ts); +4 #6188: uncommitted legacy fence-repair notices in sources status (logic in fence-repair/uncommitted.ts); +7 #6317: data_moving/movement_state on sources status and its human line (reader in persistence/sync-movement.ts), writer movement help row; +23 W14 P4.2/P4.6a (#5442, #5445): `sources add --future-days` and `--loops-exclude-labels` on the legacy google parser plus their help line (validation constants live in google/calendar-window.ts and google/loops-exclusion.ts)+src/core/link-extraction.ts 2358 ratchet grown v0.46.26.0 megawave: link-aware timeline split + delimiter-outside-links (#3957 #4062 #3737); +37 wave-k #3908 reimpl: isCrossSourceLinksEnabled config ladder; +10 wave #4277: parseTimelineEntries skips generated backlink receipts; +17 #4855: latin-fold in normalizeBasename + dir-hint step tries both slug grammars; +17: #4855 Latin stroke-letter fold; +5: #4873 ./-relative markdown links kept as live references; +34 wave review: `../y.md` sibling links resolve on the DB path + folded bare-wikilink grammar (#4873 class); +62 #4977: role-prior suppression in machine-list sections (rolePriorSuppressedRanges, EntityRef.index); +3 composed with #4985 (variation-selector strip) in the same wave; +4 #4995: markdown-link anchor strip + lowercase-candidate rationale comments; +6 pre-landing review: #4977 suppression on code-stripped content + truthful watermark/section-list comments; T2: source-qualified inference and atomic origin-scoped derived links; canonical attendance evidence, source-qualified orientation, strict attendee resolution, and relocated filesystem link scanner (command export preserved); +4: pack-owned fallback and ambiguous attendee guards Display-label attendance exclusion, indexed evidence membership, and bounded strict resolver caching; attendance-boundary review.; complete attendance resolution and fence-safe evidence traversal; frontmatter discovery, canonical basename admission and code-aware attendance comment masking; exclude inline HTML comment spans from admitted attendance ranges; +17 write-path wave: same-name rule for entity fuzzy matches + rename-alias fallback in makeResolver; +1 #5567: materialized marker ends bullet detail; +30 #5749: unique global-basename step before fuzzy and live keyword resolution (ResolveOptions, watermark note); #5765: bold **Attendees:** label accepted + LINK_EXTRACTOR_VERSION_TS bump note; +10 eval-wave N9-2/N9-3/N12-7: pack frontmatter mappings inherit FRONTMATTER_LINK_MAP direction, page-type-bound pack attended follows canonical attendance, LINK_EXTRACTOR_VERSION_TS bump note; +1 #5623: normalizeBasename collapses hyphen runs like slugifySegment (extractor watermark note); +11 #5562: parseTimelineEntries accepts dated ### headings (FS-extractor parity); +3 eval-wave N12-6: Participants accepted as attendance evidence + LINK_EXTRACTOR_VERSION_TS bump note; +22 P5 wanted pages: AuthoredRef on body link candidates; -33 lowered: P5 moved machine-section ranges to core/machine-sections.ts and stated relation types to core/line-grammar.ts; +7 P5: ExtractPageLinksOptions interface + wikilinkAuthoredRef helper (keeps extractPageLinks under the function-size limit); +32 P5: per-edge verb attachment (attachedVerb, VERB_RULES) + joined-as works_at + extractor watermark note; P5 x temporal-edges merge: verb attachment reads the verb at the link's own position in the window (excerptAnchor) and the within-page dedup (now dedupeCandidates) drops a mention of a target the page also links with a typed edge; links joined only by commas/conjunctions share the verb before the first (coordinated); board roles (BOARD_RE, BOARD_AFTER_RE) resolve to invested_in for an investor page and advises otherwise, never works_at; +1 fix wave 11 #6191: imports targetTakesVerb (role-verb target guard lives in link-target-roles.ts); v0.60.105.0 merge: #5984 Phase 5 link preparation (+6) re-summed over wave 11 at 2211; +109 Q2 Track C: stable verb-rule ids, traceLinkType/explainLinkType (reasons for every typing decision), per-occurrence typer hoisted out of extractPageLinks (makeTypeFor); unit logic lives in core/link-typing-units.ts; +25 Q2 Track C: typing-unit verb rules and vetoes in attachedVerb/traceLinkType, validity stints in explainLinkType; +4 U3: board-seat rule split out of INVESTED_RE (same verb and precedence) and investor-prior/link offsets passed to unit vetoes; +11 U2: locateLink shared by attachedVerb and the U2 post-pass in traceLinkType; -11 lowered: Q2 verdict reverted U2 (locateLink and the post-pass)+ src/commands/sources.ts 2054 ratchet +5 #5988: sources status/retry-held help rows describe Git holds (help lines cannot move); +2 #5988: sources status <id> filter and Git held files (view in persistence/connector-status.ts); +5 F0: sources refresh dispatch and help rows (command body in sources-refresh.ts, protocol in persistence/worktree-refresh.ts); +6 fix wave 5 #5409: mirror-readonly/mirror-writable dispatch, help rows and the list --json mirror_read_only field (body in sources-mirror.ts); grown v0.46.22.0 phone wave: github source kind (#4104); +129 v0.47 gmail-loops: google source-kind flags + vault preflight + duplicate-account warn + access-mode validation; +8 set-path dispatch + help rows (#4739 — command body peeled to sources-set-path.ts); +29 #4698 adoption: --calendar-id flag + duplicate-account warn scoped to overlapping services; #5105: trusted writer administration route; company handlers and receipt status wiring; parsing stays in dedicated modules; canonical reconciliation: +5 engine-free sibling-command dispatch and help row, implementation remains in source-reconcile.ts; +4 fix wave 3 lane A: sources status connector recovery state and run counts (view lives in persistence/connector-status.ts); +3 fix wave 4 lane B: sources retry-held dispatch and help row (command body in sources-retry-held.ts) and the connector first-sync note on add; bodies in source-delete.ts and sources-set-path.ts); +4 #5984: sources status shows the managed sync backlog (logic in persistence/sync-drain.ts); v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (2031 measured); +11 W-B4: sources shared-skills dispatch, its --help guard and help rows, and the shared_skills field/lines in sources status (body in sources-shared-skills.ts, view in shared-skills/source-opt-out.ts); +4 #6188: uncommitted legacy fence-repair notices in sources status (logic in fence-repair/uncommitted.ts); +7 #6317: data_moving/movement_state on sources status and its human line (reader in persistence/sync-movement.ts), writer movement help row+ src/core/link-extraction.ts 2379 ratchet grown v0.46.26.0 megawave: link-aware timeline split + delimiter-outside-links (#3957 #4062 #3737); +37 wave-k #3908 reimpl: isCrossSourceLinksEnabled config ladder; +10 wave #4277: parseTimelineEntries skips generated backlink receipts; +17 #4855: latin-fold in normalizeBasename + dir-hint step tries both slug grammars; +17: #4855 Latin stroke-letter fold; +5: #4873 ./-relative markdown links kept as live references; +34 wave review: `../y.md` sibling links resolve on the DB path + folded bare-wikilink grammar (#4873 class); +62 #4977: role-prior suppression in machine-list sections (rolePriorSuppressedRanges, EntityRef.index); +3 composed with #4985 (variation-selector strip) in the same wave; +4 #4995: markdown-link anchor strip + lowercase-candidate rationale comments; +6 pre-landing review: #4977 suppression on code-stripped content + truthful watermark/section-list comments; T2: source-qualified inference and atomic origin-scoped derived links; canonical attendance evidence, source-qualified orientation, strict attendee resolution, and relocated filesystem link scanner (command export preserved); +4: pack-owned fallback and ambiguous attendee guards Display-label attendance exclusion, indexed evidence membership, and bounded strict resolver caching; attendance-boundary review.; complete attendance resolution and fence-safe evidence traversal; frontmatter discovery, canonical basename admission and code-aware attendance comment masking; exclude inline HTML comment spans from admitted attendance ranges; +17 write-path wave: same-name rule for entity fuzzy matches + rename-alias fallback in makeResolver; +1 #5567: materialized marker ends bullet detail; +30 #5749: unique global-basename step before fuzzy and live keyword resolution (ResolveOptions, watermark note); #5765: bold **Attendees:** label accepted + LINK_EXTRACTOR_VERSION_TS bump note; +10 eval-wave N9-2/N9-3/N12-7: pack frontmatter mappings inherit FRONTMATTER_LINK_MAP direction, page-type-bound pack attended follows canonical attendance, LINK_EXTRACTOR_VERSION_TS bump note; +1 #5623: normalizeBasename collapses hyphen runs like slugifySegment (extractor watermark note); +11 #5562: parseTimelineEntries accepts dated ### headings (FS-extractor parity); +3 eval-wave N12-6: Participants accepted as attendance evidence + LINK_EXTRACTOR_VERSION_TS bump note; +22 P5 wanted pages: AuthoredRef on body link candidates; -33 lowered: P5 moved machine-section ranges to core/machine-sections.ts and stated relation types to core/line-grammar.ts; +7 P5: ExtractPageLinksOptions interface + wikilinkAuthoredRef helper (keeps extractPageLinks under the function-size limit); +32 P5: per-edge verb attachment (attachedVerb, VERB_RULES) + joined-as works_at + extractor watermark note; P5 x temporal-edges merge: verb attachment reads the verb at the link's own position in the window (excerptAnchor) and the within-page dedup (now dedupeCandidates) drops a mention of a target the page also links with a typed edge; links joined only by commas/conjunctions share the verb before the first (coordinated); board roles (BOARD_RE, BOARD_AFTER_RE) resolve to invested_in for an investor page and advises otherwise, never works_at; +1 fix wave 11 #6191: imports targetTakesVerb (role-verb target guard lives in link-target-roles.ts); v0.60.105.0 merge: #5984 Phase 5 link preparation (+6) re-summed over wave 11 at 2211; +109 Q2 Track C: stable verb-rule ids, traceLinkType/explainLinkType (reasons for every typing decision), per-occurrence typer hoisted out of extractPageLinks (makeTypeFor); unit logic lives in core/link-typing-units.ts; +25 Q2 Track C: typing-unit verb rules and vetoes in attachedVerb/traceLinkType, validity stints in explainLinkType; +4 U3: board-seat rule split out of INVESTED_RE (same verb and precedence) and investor-prior/link offsets passed to unit vetoes; +11 U2: locateLink shared by attachedVerb and the U2 post-pass in traceLinkType; -11 lowered: Q2 verdict reverted U2 (locateLink and the post-pass); +21 fix wave 13 P4.10 #6266: resolveSameDirSlug + exported resolveMarkdownLinkSlug, shared with the link validatorsrc/core/embedding-migration.ts 1587 ratchet new row: crossed 1500 in v0.46.25.0 fix waves (#4305 #4306 chunk-model truth helpers); retired provider integration removed; safety wave: canonical projection readiness and fact-aware completion; file configuration publication retains lease-row locks; +8 transactional retained-vector rebuildability checks before destructive migration boundaries; archived eligibility: source-locked reconciliation and live/current smoke revalidation; +2 #5680: authorization_generation field and its carry-forward on same-target re-apply (settle idempotency); +10 #5226: plan carries chunks_to_restamp beside chunks_to_embed; +9 #5088: schema transition defers HNSW builds into the marker (deferred_ann_indexes), carry-forward on re-apply, verify blocks on pending/INVALID ANN indexes (build phase in embedding-ann-build.ts); +10 #5088: dim-pinned tables (query_cache, facts, and any later entry of TEXT_EMBEDDING_DIM_PINNED_TABLES) defer their HNSW through the same worklist (DEFERRED_ANN_TABLES, recordDeferredAnnIndexes); +25 wave 8 lane D1 #5885: takes in the dim-pinned column list, plan (takes_to_embed), status (takes_pending) and completion verify; +17 #5334: smoke check samples one representative chunk per distinct page (bounded index-ordered batch walk, longest chunk re-read under the page lock, title-prefixed bounded query); +1 #5334: the smoke-query length limits are shared with the worst-case budgetsrc/core/github-source.ts 1530 ratchet new row: crossed the 1500 unlisted cap in v0.46.23.0 review fix wave (scope-state gating, client hardening, symlink containment); merged reliability/shared-skills source integration; managed sweep lease wrapper; fix wave 3 lane A: config parser peeled to github-source-config.ts (-47), +account pin wiring and pinned-installation refresh- src/commands/hook.ts 1926 ratchet cathedral-5 heartbeat extraction offsets part of the BrainBench-seam growth; grown v0.46.26.0 megawave hooks-ipc (#4245); +108 monthly backup check: banner + gated session-start note + detached spawn (backup/status-file readers); +28 ship-review egress hardening: per-harness capture dispatch (capture-spec), memorable gate + receipt + relay block, fail-closed unscanned/newest-guess skips; +79 ambient-writeback WP4: hookStop bank step (gate -> bankWritebackTurn -> IPC flush; gate/bank logic live in core/facts + corpus-segments); +41 adversarial fix wave: wide-tail retry when the 128KB window misses the user turn, by-design heartbeat outcome classes, source-in-name banking; +11 #5413 session-end skips claude-cli self-transcripts; +11 #5701: hook lanes pass allowOversize so a long session reaches the bounded tail read; +1 #5371: the stop-hook dirty probe ignores physical-root ownership metadata (root-metadata.ts, engine-free); 2 core memory: user-prompt context-pressure notice wiring (logic in core/context/pressure.ts; session-start composition in core/context/session-start-output.ts); +3 fix wave 11 W2.1 #6091: PreCompact/SessionEnd capture-time consent record calls (logic in core/context/capture-consent.ts); +5 fix wave 11 W2.9 #6083: the three detached-push call sites skip a managed canonical worktree (push_managed_coordinator) + import; +2 fix wave 11 integration: W1 router help guard import beside the W2 managed-root import+ src/commands/hook.ts 1928 ratchet cathedral-5 heartbeat extraction offsets part of the BrainBench-seam growth; grown v0.46.26.0 megawave hooks-ipc (#4245); +108 monthly backup check: banner + gated session-start note + detached spawn (backup/status-file readers); +28 ship-review egress hardening: per-harness capture dispatch (capture-spec), memorable gate + receipt + relay block, fail-closed unscanned/newest-guess skips; +79 ambient-writeback WP4: hookStop bank step (gate -> bankWritebackTurn -> IPC flush; gate/bank logic live in core/facts + corpus-segments); +41 adversarial fix wave: wide-tail retry when the 128KB window misses the user turn, by-design heartbeat outcome classes, source-in-name banking; +11 #5413 session-end skips claude-cli self-transcripts; +11 #5701: hook lanes pass allowOversize so a long session reaches the bounded tail read; +1 #5371: the stop-hook dirty probe ignores physical-root ownership metadata (root-metadata.ts, engine-free); 2 core memory: user-prompt context-pressure notice wiring (logic in core/context/pressure.ts; session-start composition in core/context/session-start-output.ts); +3 fix wave 11 W2.1 #6091: PreCompact/SessionEnd capture-time consent record calls (logic in core/context/capture-consent.ts); +5 fix wave 11 W2.9 #6083: the three detached-push call sites skip a managed canonical worktree (push_managed_coordinator) + import; +2 fix wave 11 integration: W1 router help guard import beside the W2 managed-root import; +2 fix wave 13 P4.9 #6399: a header-only Codex rollout ends empty_session, not parser_driftsrc/core/chunkers/code.ts 1598 ratchet new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (decorated-python defs #3821, version-gate + timeout chunker fixes); grown wave-g (#4511): named defs never folded into merged chunks; grown #4669: skip WASM parse for languages without TOP_LEVEL_TYPES; +6 N13-1: CodeChunkMetadata.definesFunction field + merge-guard stamp (predicate lives in def-types.ts); +10 Lua grammar swap: GRAMMAR_REVISIONS + chunkerStamp() (per-language re-chunk gate)-src/core/config.ts 1932 ratchet +1 budgeted delivery PR 1: the search.auto_packing KNOWN_CONFIG_KEYS row (values validated in search/evidence-packing.ts); +1 #6278: persistence.sync_preparation_ms/maintenance_preparation_ms/preparation_ceiling_ms/max_preparation_attempts/preparation_deadlines key row (logic in persistence/preparation-budget.ts, switches.ts); +22 fix wave 11 W6.2/W6.3 (#5989, #6132): search.cjk_keyword_deadline_ms and search.hnsw_iterative_scan type fields, KNOWN_CONFIG_KEYS rows and the mergeSearchScanKnobs helper that keeps loadConfigWithEngine under its function-size baseline (logic in search/cjk-keyword-deadline.ts, search/hnsw-iterative-scan.ts); +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured); +3 retrieval feedback: the feedback keys in KNOWN_CONFIG_KEYS; 2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x engine graduation composition: both deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x foundations-2 composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); P3 x P1 (v0.60.57.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); P3 x aow-followup composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); +2 entity mention index: mentions.auto_link, mentions.entity_types, mentions.ignore key rows (resolver in core/mentions/policy.ts); cat40 entity wave merge with v0.60.61.0 (1853 measured); P3 x cat40-entity-wave composition: deltas re-summed at the merge; +6 fix wave lane B3: chat_fallback_on_refusal (GBrainConfig slot, GBRAIN_CHAT_FALLBACK_ON_REFUSAL env fold, known key); +2 W-B4: shared_skills.inventory.* known keys (logic in shared-skills/inventory-limits.ts); +2 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms known key; +1 wave 9 lane W #5363: cycle.consolidate.cluster_threshold key row; +1 #5984 lanes: sync.lanes key registration; +2 P8: dream.quote_verify and think.quote_verify known keys; +2 P8: GBrainConfig.mcp.advertised_surface interface slot (resolver in mcp/surface.ts); +2 fix wave 10 lane L1 #4907: cycle.synthesize_concepts.budget_usd registered (validation in cycle/phase-config-values.ts); +2 #5958: dream.propose_takes.call_timeout_ms registered; 3 core memory: memory.core.* and memory.pressure.* known keys; +15 P5: wanted_pages.enabled/remote, line_grammar.enabled/allow_undeclared_types/effective_ranges and put_page.similar_pages key rows (logic in wanted-links.ts, line-grammar.ts, similar-pages.ts); +1 P2 extraction.date_grounding / facts.attribution keys; +1 #6188: fences.normalize registered in KNOWN_CONFIG_KEYS; +2 #6188: fences.repair.max_usd_per_page/per_day key rows; +1 fix wave 12 W2.3 #6231: facts.page_write_notability_filter key row (resolver in facts/notability-filter.ts); +1 #6317: persistence.single_consumer key row (logic in persistence/switches.ts, consumer-election.ts); +2 newer mentions on context_pack cards: mentions.newer_on_cards key row (logic in mentions/newer-mentions.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept)+src/core/config.ts 1939 ratchet +1 budgeted delivery PR 1: the search.auto_packing KNOWN_CONFIG_KEYS row (values validated in search/evidence-packing.ts); +1 #6278: persistence.sync_preparation_ms/maintenance_preparation_ms/preparation_ceiling_ms/max_preparation_attempts/preparation_deadlines key row (logic in persistence/preparation-budget.ts, switches.ts); +22 fix wave 11 W6.2/W6.3 (#5989, #6132): search.cjk_keyword_deadline_ms and search.hnsw_iterative_scan type fields, KNOWN_CONFIG_KEYS rows and the mergeSearchScanKnobs helper that keeps loadConfigWithEngine under its function-size baseline (logic in search/cjk-keyword-deadline.ts, search/hnsw-iterative-scan.ts); +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured); +3 retrieval feedback: the feedback keys in KNOWN_CONFIG_KEYS; 2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x engine graduation composition: both deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x foundations-2 composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); P3 x P1 (v0.60.57.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); P3 x aow-followup composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); +2 entity mention index: mentions.auto_link, mentions.entity_types, mentions.ignore key rows (resolver in core/mentions/policy.ts); cat40 entity wave merge with v0.60.61.0 (1853 measured); P3 x cat40-entity-wave composition: deltas re-summed at the merge; +6 fix wave lane B3: chat_fallback_on_refusal (GBrainConfig slot, GBRAIN_CHAT_FALLBACK_ON_REFUSAL env fold, known key); +2 W-B4: shared_skills.inventory.* known keys (logic in shared-skills/inventory-limits.ts); +2 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms known key; +1 wave 9 lane W #5363: cycle.consolidate.cluster_threshold key row; +1 #5984 lanes: sync.lanes key registration; +2 P8: dream.quote_verify and think.quote_verify known keys; +2 P8: GBrainConfig.mcp.advertised_surface interface slot (resolver in mcp/surface.ts); +2 fix wave 10 lane L1 #4907: cycle.synthesize_concepts.budget_usd registered (validation in cycle/phase-config-values.ts); +2 #5958: dream.propose_takes.call_timeout_ms registered; 3 core memory: memory.core.* and memory.pressure.* known keys; +15 P5: wanted_pages.enabled/remote, line_grammar.enabled/allow_undeclared_types/effective_ranges and put_page.similar_pages key rows (logic in wanted-links.ts, line-grammar.ts, similar-pages.ts); +1 P2 extraction.date_grounding / facts.attribution keys; +1 #6188: fences.normalize registered in KNOWN_CONFIG_KEYS; +2 #6188: fences.repair.max_usd_per_page/per_day key rows; +1 fix wave 12 W2.3 #6231: facts.page_write_notability_filter key row (resolver in facts/notability-filter.ts); +1 #6317: persistence.single_consumer key row (logic in persistence/switches.ts, consumer-election.ts); +2 newer mentions on context_pack cards: mentions.newer_on_cards key row (logic in mentions/newer-mentions.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept); +3 W14 P4.6a #5445: loops.extraction_exclude_labels key row (resolver in google/loops-exclusion.ts); +4 W14 P4.6b: loops.extraction_max_usd_per_day key row (validated in google/loops-spend.ts)src/core/bootstrap/harness.ts 2610 ratchet +29 live-PGLite-serve lane: LIVE_SERVE refusal ahead of source resolution + unpinned --token hooks (CI e2e fix); +46 wave review: resolveHookSource dep (serve-parity resolver + federated grant), --source shape validation, loud SOURCE_UNRESOLVED instead of a silent 'default'; +10: #4574 parseCodexBlockBearer http_headers shape + legacy bearer_token fallback; +4 at megawave/wave-k merge; +codex hooks lane: step-7 codex hooks.json + config.toml trust pair, removeHarness arm; +234 ambient-writeback WP3: kind:'instructions' targets (plan/apply/converge-off/remove/status probes, OV-A4 override pre-check) — splice/render mechanics live in instructions-block.ts; +59 adversarial fix wave: registrar-mode block suppression, converge-failure receipt tracking, MCP-confirmed guard before block install; +26 round-3 fixes: codex-lane MCP-confirmed guard + smoke-rollback block strip; master: | merged v0.48.1.0 true-up; +41 #4897 resolveImplicitSource dep + defaultResolveImplicitSource: hooks/token/receipt bind to the serve's implicit default source when --source is omitted; +23 #4586 statusHarness live claude-code mcp verdict (URL mismatch or same-scope non-HTTP registration reads failed, receipt untouched); shared-skills integration on company-ingestion base; +18 #5671: logAmbientPostureNotes helper (registrar note moved out of applyHarness + pre-consent warning when an explicit private facts default meets the HTTP harness; text shared with doctor in facts/writeback-config.ts); +24 #5893: rotation grant carry wiring and its rotationCarry/withheldOperationsNote helpers (carry rules live in token-mint.ts carryLegacyGrant); +6 #5878: --refresh-skills flag and status epoch line (refresh logic lives in harness-skills.ts); +7 #4618 seat: HarnessFlags.seat field, --seat/--no-seat parse via hooks.ts parseSeatFlags, GBRAIN_SEAT in the hook env; -119 #6082: plugin-lane detectors moved to plugin-lanes.ts (re-exported); +18 #6092/#6171: hook ownership identity on write/remove/converge, permission ownership carry, --remove --dry-run and the --status hook census (logic in hooks.ts + harness-hooks.ts)src/core/oauth-provider.ts 1236 ratchet new row: crossed the 1500 unlisted cap absorbing #3819 (DCR 400 invalid_client_metadata + scope filtering + custom-scheme redirect_uris + pseudo-scheme guard); merged v0.49: transactional grant enforcement shared with hosted grant policies; +1 #5222 resourceUrl optionsrc/core/ops/pages.ts 683 ratchet crossed the unlisted 1500 cap in the fix wave: pack-vocabulary enforcement on capture (#4721) + get_page alias follow (#4275) landed together; next growth should peel a pages-ops submodule; +3: alias hop reads the canonical in the owning source (ship-review); +5: explicit source_id liveness check in get_page/list_pages (#4620); +3: #4857 total-order slug sort + list_pages source_id parse; +5: #4620 explicit removed-source id fails loudly; master integration: +4: authenticated delegated private-write boundary and auto-link suppression; #5105: canonical page mutations peeled into persistence modules; +2 v0.50.5.0 purge parameter and shared preflight call; preparation composes through the persistence modules; +7: source-qualified deep-research fetch authorization and ambiguity refusal (codec lives in deep-research-id.ts); +1 #5567: remote get_page keeps materialized markers; +1 #5622: trusted local capture file parameter; +5 #5709: get_page include_timeline_entries (rows via get_timeline's read policy); +8 GBRA-36 security wave: required outputRedaction policy on each pages op; +1 #5154: list_pages passes listColumnsOnly; +17 #5641: list_pages exposes the updated_after_slug keyset cursor and updated_at_iso; +8 agent operator wave A2: every op declares mutating + idempotent (tags only); +7 F3b (#5954): list_pages pagination meta + listing_truncated notice for MCP callers (logic in ops/list-pages-pagination.ts); +4 #5988: get_page file_held (one indexed hold lookup; logic in persistence/held-reads.ts); +6 #6103: list_pages maps an unreadable updated_after (SQLSTATE 22007/22008) to invalid_params; wave 10 collector: #6103 (+6) and #4807 (+2) compose; +1 wave 11 W4.3 (#5969 D3): put_page drop_timeline param; +1 wave 11 security review: purge_deleted_pages yes param + trusted-CLI guard (consent logic in persistence/purge-deleted.ts); +1 Q2 parser gaps: get_page grammar_diagnostics param (report logic in core/line-grammar-report.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept)diff --cc src/admin-embedded.tsindex 2115e9cf1e,5b7dd6154b..d3e8e0e01a--- a/src/admin-embedded.ts+++ b/src/admin-embedded.ts@@@ -7,9 -7,9 +7,9 @@@// the request path the express handler sees to (resolved-path, mime).// @ts-ignore — type: 'file' is Bun ESM, not in lib.d.ts--import A_0_assets_index_BB8hJoAN_css from '../admin/dist/assets/index-BB8hJoAN.css' with { type: 'file' };++import A_0_assets_index_B9c8JuNx_js from '../admin/dist/assets/index-B9c8JuNx.js' with { type: 'file' };// @ts-ignore — type: 'file' is Bun ESM, not in lib.d.ts- import A_1_assets_index_CCbzt6ZN_js from '../admin/dist/assets/index-CCbzt6ZN.js' with { type: 'file' };-import A_1_assets_index_CaaGFcPc_js from '../admin/dist/assets/index-CaaGFcPc.js' with { type: 'file' };++import A_1_assets_index_BB8hJoAN_css from '../admin/dist/assets/index-BB8hJoAN.css' with { type: 'file' };// @ts-ignore — type: 'file' is Bun ESM, not in lib.d.tsimport A_2_index_html from '../admin/dist/index.html' with { type: 'file' };@@@ -19,8 -19,8 +19,8 @@@ export interface AdminAsset}export const ADMIN_ASSETS: Record<string, AdminAsset> = {-- "/admin/assets/index-BB8hJoAN.css": { path: A_0_assets_index_BB8hJoAN_css as unknown as string, mime: "text/css; charset=utf-8" },- "/admin/assets/index-CCbzt6ZN.js": { path: A_1_assets_index_CCbzt6ZN_js as unknown as string, mime: "application/javascript; charset=utf-8" },- "/admin/assets/index-CaaGFcPc.js": { path: A_1_assets_index_CaaGFcPc_js as unknown as string, mime: "application/javascript; charset=utf-8" },++ "/admin/assets/index-B9c8JuNx.js": { path: A_0_assets_index_B9c8JuNx_js as unknown as string, mime: "application/javascript; charset=utf-8" },++ "/admin/assets/index-BB8hJoAN.css": { path: A_1_assets_index_BB8hJoAN_css as unknown as string, mime: "text/css; charset=utf-8" },"/admin/index.html": { path: A_2_index_html as unknown as string, mime: "text/html; charset=utf-8" },};diff --cc src/core/bootstrap/verify.tsindex dbd80c251a,f1cb4d7d8f..ab96744ebe--- a/src/core/bootstrap/verify.ts+++ b/src/core/bootstrap/verify.ts@@@ -767,135 -778,129 +778,135 @@@ async function runRoundtripawait sweepProbeLeftovers(engine, ws, sourceId);- // 1. Write both probe pages through the REAL op handler [G1].- let writeThroughDetail = '';+ // #6001: the probe section runs under one try/finally so the fixed-slug+ // probes are removed on every exit, including the early returns below.+ // `checks` is the same array the early returns hand back, so a cleanup+ // warning pushed in `finally` still reaches the caller.try {- await putPage.handler(ctx, { slug: VERIFY_PROBE_ENTITY_SLUG, content: PROBE_ENTITY_CONTENT });- const res = (await putPage.handler(ctx, { slug: VERIFY_PROBE_SLUG, content: PROBE_CONTENT })) as {- write_through?: { written: boolean; path?: string; skipped?: string; error?: string };- };- const wt = res.write_through;- const expectedFile = join(ws, 'brain', `${VERIFY_PROBE_SLUG}.md`);- if (wt?.written && wt.path && existsSync(wt.path)) {- writeThroughDetail = `file materialized at ${wt.path}`;- checks.push({ id: 'roundtrip', ok: true, detail: `put_page landed in DB and ${writeThroughDetail}` });- } else if (existsSync(expectedFile)) {- checks.push({ id: 'roundtrip', ok: true, detail: `put_page landed in DB and file materialized at ${expectedFile}` });- } else if (wt?.skipped === 'disabled_by_config') {- // DB-only by operator choice (`sync.write_through=false`), not a broken- // install: the DB write landed, so WARN and keep the remaining- // roundtrip-family checks — sweep/graph/search/magic-moment all run off- // the DB row and still prove the memory loop.- checks.push({- id: 'roundtrip',- ok: true,- warn: true,- detail:- `put_page landed in DB; no file under brain/ because sync.write_through is disabled by config — ` +- `agent writes stay DB-only (run \`gbrain config set sync.write_through true\` to materialize repo files)`,- });- } else {- // [G1] A green verify with an empty repo is impossible: name the- // write-through problem explicitly.- const why = wt?.skipped ?? wt?.error ?? 'write-through reported nothing';- checks.push({- id: 'roundtrip',- ok: false,- detail:- `put_page wrote the DB but NO file appeared under brain/ (write-through: ${why}). ` +- `The workspace source must be registered with its brain/ dir as local_path ` +- `(gbrain sources add ${sourceId} --path ${join(ws, 'brain')}) or agent writes never reach the repo.`,- });+ // 1. Write both probe pages through the REAL op handler [G1].+ let writeThroughDetail = '';+ try {+ await putPage.handler(ctx, { slug: VERIFY_PROBE_ENTITY_SLUG, content: PROBE_ENTITY_CONTENT });+ const res = (await putPage.handler(ctx, { slug: VERIFY_PROBE_SLUG, content: PROBE_CONTENT })) as {+ write_through?: { written: boolean; path?: string; skipped?: string; error?: string };+ };+ const wt = res.write_through;+ const expectedFile = join(ws, 'brain', `${VERIFY_PROBE_SLUG}.md`);+ if (wt?.written && wt.path && existsSync(wt.path)) {+ writeThroughDetail = `file materialized at ${wt.path}`;+ checks.push({ id: 'roundtrip', ok: true, detail: `put_page landed in DB and ${writeThroughDetail}` });+ } else if (existsSync(expectedFile)) {+ checks.push({ id: 'roundtrip', ok: true, detail: `put_page landed in DB and file materialized at ${expectedFile}` });+ } else if (wt?.skipped === 'disabled_by_config') {+ // DB-only by operator choice (`sync.write_through=false`), not a broken+ // install: the DB write landed, so WARN and keep the remaining+ // roundtrip-family checks — sweep/graph/search/magic-moment all run off+ // the DB row and still prove the memory loop.+ checks.push({+ id: 'roundtrip',+ ok: true,+ warn: true,+ detail:+ `put_page landed in DB; no file under brain/ because sync.write_through is disabled by config — ` ++ `agent writes stay DB-only (run \`gbrain config set sync.write_through true\` to materialize repo files)`,+ });+ } else {+ // [G1] A green verify with an empty repo is impossible: name the+ // write-through problem explicitly.+ const why = wt?.skipped ?? wt?.error ?? 'write-through reported nothing';+ checks.push({+ id: 'roundtrip',+ ok: false,+ detail:+ `put_page wrote the DB but NO file appeared under brain/ (write-through: ${why}). ` ++ `The workspace source must be registered with its brain/ dir as local_path ` ++ `(gbrain sources add ${sourceId} --path ${join(ws, 'brain')}) or agent writes never reach the repo.`,+ });+ return { checks };+ }+ } catch (e) {- checks.push({ id: 'roundtrip', ok: false, detail: `put_page failed: ${(e as Error).message}` });++ checks.push({ id: 'roundtrip', ok: false, detail: putPageFailureDetail(e, ctx.writeWaitMs) });return { checks };}- } catch (e) {- checks.push({ id: 'roundtrip', ok: false, detail: putPageFailureDetail(e, ctx.writeWaitMs) });- return { checks };- }- // 2. Sweep — the `gbrain sweep --once` equivalent, run in-process because- // verify's caller holds the engine [CX2-5].- const caps = opts.capabilities ?? detectCapabilities();- try {- const report = await runMaintenanceSweep(engine, {- sourceId,- budgetMs: opts.sweepBudgetMs ?? 20_000,- capabilities: caps,- log: opts.log,- });- opts.log?.(`[verify] sweep: facts=${report.factsReconciled} links=${report.linksExtracted} timeline=${report.timelineExtracted}`);- } catch (e) {- checks.push({ id: 'graph_floor', ok: false, detail: `maintenance sweep failed: ${(e as Error).message}` });- return { checks };- }-- // 3. Graph floor: ≥1 extracted edge, answered through the link tables.- try {- const links = await engine.getLinks(VERIFY_PROBE_SLUG, { sourceId });- const edge = links.find((l) => l.to_slug === VERIFY_PROBE_ENTITY_SLUG);- const backlinks = await engine.getBacklinks(VERIFY_PROBE_ENTITY_SLUG, { sourceId });- const back = backlinks.find((l) => l.from_slug === VERIFY_PROBE_SLUG);- if (edge && back) {- checks.push({ id: 'graph_floor', ok: true, detail: `entity link extracted and the edge-only query answers (probe → entity, ${links.length} outbound / ${backlinks.length} inbound)` });- } else {- checks.push({ id: 'graph_floor', ok: false, detail: `expected probe→entity edge missing after sweep (outbound: ${links.length}, inbound: ${backlinks.length}) — link extraction is not compounding the graph` });+ // 2. Sweep — the `gbrain sweep --once` equivalent, run in-process because+ // verify's caller holds the engine [CX2-5].+ const caps = opts.capabilities ?? detectCapabilities();+ try {+ const report = await runMaintenanceSweep(engine, {+ sourceId,+ budgetMs: opts.sweepBudgetMs ?? 20_000,+ capabilities: caps,+ log: opts.log,+ });+ opts.log?.(`[verify] sweep: facts=${report.factsReconciled} links=${report.linksExtracted} timeline=${report.timelineExtracted}`);+ } catch (e) {+ checks.push({ id: 'graph_floor', ok: false, detail: `maintenance sweep failed: ${(e as Error).message}` });+ return { checks };}- } catch (e) {- checks.push({ id: 'graph_floor', ok: false, detail: `edge query failed: ${(e as Error).message}` });- }- // 4. get_page + search recall.- try {- await getPage.handler(ctx, { slug: VERIFY_PROBE_SLUG });- } catch (e) {- checks.push({ id: 'roundtrip', ok: false, detail: `get_page read-back failed: ${(e as Error).message}` });- }- try {- const result = await queryOp.handler(ctx, {- query: 'bootstrap verify probe lighthouse',- limit: 10,- expand: false,- });- const found = JSON.stringify(result).includes(VERIFY_PROBE_SLUG);- if (!found) {- checks.push({ id: 'roundtrip', ok: false, detail: `search did not return the probe page (${caps.search} search) — retrieval round-trip broken` });+ // 3. Graph floor: ≥1 extracted edge, answered through the link tables.+ try {+ const links = await engine.getLinks(VERIFY_PROBE_SLUG, { sourceId });+ const edge = links.find((l) => l.to_slug === VERIFY_PROBE_ENTITY_SLUG);+ const backlinks = await engine.getBacklinks(VERIFY_PROBE_ENTITY_SLUG, { sourceId });+ const back = backlinks.find((l) => l.from_slug === VERIFY_PROBE_SLUG);+ if (edge && back) {+ checks.push({ id: 'graph_floor', ok: true, detail: `entity link extracted and the edge-only query answers (probe → entity, ${links.length} outbound / ${backlinks.length} inbound)` });+ } else {+ checks.push({ id: 'graph_floor', ok: false, detail: `expected probe→entity edge missing after sweep (outbound: ${links.length}, inbound: ${backlinks.length}) — link extraction is not compounding the graph` });+ }+ } catch (e) {+ checks.push({ id: 'graph_floor', ok: false, detail: `edge query failed: ${(e as Error).message}` });}- } catch (e) {- checks.push({ id: 'roundtrip', ok: false, detail: `search failed: ${(e as Error).message}` });- }- // 5. Magic moment [CX-P0.5]: the fence fact reconciled by the ZERO-LLM- // sweep pass, read back at visibility='world' (what the harness can read).- try {- const rows = await engine.executeRaw<{ fact: string }>(- `SELECT fact FROM facts WHERE source_id = $1 AND visibility = 'world' AND fact LIKE $2 LIMIT 1`,- [sourceId, `%${VERIFY_MAGIC_TOKEN}%`],- );- if (rows.length > 0) {- checks.push({ id: 'magic_moment', ok: true, detail: `fence-written fact recalled at visibility=world (keyless path: ${caps.mode === 'keyless' ? 'yes' : 'keyed install, same zero-LLM pass'})` });- } else {- checks.push({ id: 'magic_moment', ok: false, detail: 'the ## Facts fence fact never reached the facts index — keyless memory (agent-authored fences) is broken; check the sweep fence pass' });+ // 4. get_page + search recall.+ try {+ await getPage.handler(ctx, { slug: VERIFY_PROBE_SLUG });+ } catch (e) {+ checks.push({ id: 'roundtrip', ok: false, detail: `get_page read-back failed: ${(e as Error).message}` });+ }+ try {+ const result = await queryOp.handler(ctx, {+ query: 'bootstrap verify probe lighthouse',+ limit: 10,+ expand: false,+ });+ const found = JSON.stringify(result).includes(VERIFY_PROBE_SLUG);+ if (!found) {+ checks.push({ id: 'roundtrip', ok: false, detail: `search did not return the probe page (${caps.search} search) — retrieval round-trip broken` });+ }+ } catch (e) {+ checks.push({ id: 'roundtrip', ok: false, detail: `search failed: ${(e as Error).message}` });}- } catch (e) {- checks.push({ id: 'magic_moment', ok: false, detail: `facts read-back failed: ${(e as Error).message}` });- }- // 6. Delete the probes [G13] — failure is a WARNING, never a verify fail.- // HARD delete via the engine primitive (same as sweepProbeLeftovers): the- // probe is not user content and verify is a trusted local caller. The- // delete_page OP is a v0.26.5 SOFT delete (sets deleted_at, row stays in- // pages until the 72h purge) — using it here left two probe tombstones in- // the user's brain after every verify run, visible to include_deleted- // readers and pinned as residue by the Postgres e2e cleanup assertion.- const deleteWarnings = await removeProbes(engine, ws, sourceId);- if (deleteWarnings.length > 0) {- checks.push({ id: 'probe_cleanup', ok: false, warn: true, detail: `probe deletion incomplete: ${deleteWarnings.join('; ')}` });+ // 5. Magic moment [CX-P0.5]: the fence fact reconciled by the ZERO-LLM+ // sweep pass, read back at visibility='world' (what the harness can read).+ try {+ const rows = await engine.executeRaw<{ fact: string }>(+ `SELECT fact FROM facts WHERE source_id = $1 AND visibility = 'world' AND fact LIKE $2 LIMIT 1`,+ [sourceId, `%${VERIFY_MAGIC_TOKEN}%`],+ );+ if (rows.length > 0) {+ checks.push({ id: 'magic_moment', ok: true, detail: `fence-written fact recalled at visibility=world (keyless path: ${caps.mode === 'keyless' ? 'yes' : 'keyed install, same zero-LLM pass'})` });+ } else {+ checks.push({ id: 'magic_moment', ok: false, detail: 'the ## Facts fence fact never reached the facts index — keyless memory (agent-authored fences) is broken; check the sweep fence pass' });+ }+ } catch (e) {+ checks.push({ id: 'magic_moment', ok: false, detail: `facts read-back failed: ${(e as Error).message}` });+ }+ } finally {+ // 6. Delete the probes [G13] — failure is a WARNING, never a verify fail.+ // HARD delete via the engine primitive (same as sweepProbeLeftovers): the+ // probe is not user content and verify is a trusted local caller. The+ // delete_page OP is a v0.26.5 SOFT delete (sets deleted_at, row stays in+ // pages until the 72h purge) — using it here left two probe tombstones in+ // the user's brain after every verify run, visible to include_deleted+ // readers and pinned as residue by the Postgres e2e cleanup assertion.+ const deleteWarnings = await removeProbes(engine, ws, sourceId);+ if (deleteWarnings.length > 0) {+ checks.push({ id: 'probe_cleanup', ok: false, warn: true, detail: `probe deletion incomplete: ${deleteWarnings.join('; ')}` });+ }}return { checks };diff --cc src/core/cli-flag-registry.generated.tsindex f4d3572169,b17a2a2249..96a416eb98--- a/src/core/cli-flag-registry.generated.ts+++ b/src/core/cli-flag-registry.generated.ts@@@ -47,7 -47,7 +47,7 @@@ export const CLI_FLAG_REGISTRY: Record<'creds': ['--allow-create-db', '--allow-docker', '--brain', '--chat-model', '--content-root', '--db-only', '--embedding-dimensions', '--embedding-model', '--expansion-model', '--force', '--git', '--grant-types', '--help', '--http', '--ids', '--issuer-url', '--json', '--key', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-embedding', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--out', '--passphrase-env', '--path', '--pglite', '--plan', '--prefer-postgres', '--provenance', '--provider', '--query', '--schema-pack', '--scopes', '--skip-embed-check', '--source', '--status', '--supabase', '--surface', '--to', '--url', '--version'],'db-repair': ['--accept-pending', '--apply', '--apply-rewrites', '--background', '--brain', '--break-lock', '--db-url', '--dry-run', '--explain', '--filter', '--follow', '--force', '--force-retry', '--format', '--help', '--http', '--json', '--locks', '--name', '--no-accept-pending', '--path', '--prefer-postgres', '--probe', '--progress-interval', '--progress-json', '--quiet', '--remediate', '--restart', '--skip-verify', '--source', '--supabase', '--timeout', '--undo-last-rewrite', '--url', '--version', '--wait', '--yes'],'decide': ['--accept-all', '--all', '--all-from', '--apply', '--brain', '--call-site', '--dataset', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--expect', '--from', '--help', '--include-withdrawals', '--input', '--json', '--kind', '--limit', '--max-cost', '--max-usd', '--min', '--non-interactive', '--out', '--provenance', '--provider', '--query', '--reason', '--reason-family', '--recommended', '--remove', '--shadow', '--since', '--slot', '--source', '--status', '--suite', '--target', '--threshold', '--trust', '--undo', '--uri-prefix', '--version', '--what-if-threshold', '--yes'],- 'doctor': ['--abandon', '--abbrev-ref', '--abort', '--accept-pending', '--access', '--add', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--allowed-operations', '--apply', '--apply-rewrites', '--assign-corpus', '--audit', '--auto', '--auto-fix', '--background', '--bound-brain', '--bound-max-concurrent', '--bound-source', '--bound-tools', '--brain', '--branch', '--break-lock', '--budget-ms', '--budget-usd', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--client', '--concurrency', '--confidence', '--confirm', '--confirm-quiesced', '--contacts-dir', '--content-audit', '--content-root', '--count', '--dataset', '--db-url', '--delegated-namespace', '--delegated-slug-prefixes', '--delete-brain', '--dest', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--error-unmatch', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--get', '--get-url', '--git-common-dir', '--git-dir', '--git-path', '--group', '--hard', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--if-version', '--ignore-env-override', '--images', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--include-withdrawals', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lanes', '--lang', '--left-right', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--min', '--mode', '--multimodal', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-capture', '--no-confirm', '--no-cron', '--no-delegate', '--no-edit', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-lanes', '--no-llm', '--no-migrate', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-seat', '--no-tags', '--no-verify', '--no-write-fetch-head', '--non-interactive', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--page', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--profile', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--reference-date', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--relative', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--repair', '--replace', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--reverse', '--review-lower', '--revision', '--rollback-to-source', '--scope', '--scopes', '--seat', '--section', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-prefix', '--show-token', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--warn-only', '--what-if-threshold', '--window', '--workers', '--working-tree', '--workspace', '--yes'],- 'doctor': ['--abandon', '--abbrev-ref', '--abort', '--accept-pending', '--access', '--add', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--allowed-operations', '--apply', '--apply-rewrites', '--assign-corpus', '--audit', '--auto', '--auto-fix', '--background', '--bound-brain', '--bound-max-concurrent', '--bound-source', '--bound-tools', '--brain', '--branch', '--break-lock', '--budget-ms', '--budget-usd', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--client', '--concurrency', '--confidence', '--confirm', '--confirm-quiesced', '--content-audit', '--content-root', '--count', '--dataset', '--db-url', '--delegated-namespace', '--delegated-slug-prefixes', '--delete-brain', '--dest', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--error-unmatch', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--get', '--get-url', '--git-common-dir', '--git-dir', '--git-path', '--group', '--hard', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--if-version', '--ignore-env-override', '--images', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--include-withdrawals', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lanes', '--lang', '--left-right', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--min', '--mode', '--multimodal', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-capture', '--no-confirm', '--no-cron', '--no-delegate', '--no-edit', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-lanes', '--no-llm', '--no-migrate', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-seat', '--no-tags', '--no-verify', '--no-write-fetch-head', '--non-interactive', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--page', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--profile', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--reference-date', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--relative', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--repair', '--replace', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--reverse', '--review-lower', '--revision', '--rollback-to-source', '--scope', '--scopes', '--seat', '--section', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-prefix', '--show-token', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--stdin', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--warn-only', '--what-if-threshold', '--window', '--workers', '--working-tree', '--workspace', '--yes'],++ 'doctor': ['--abandon', '--abbrev-ref', '--abort', '--accept-pending', '--access', '--add', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--allowed-operations', '--apply', '--apply-rewrites', '--assign-corpus', '--audit', '--auto', '--auto-fix', '--background', '--bound-brain', '--bound-max-concurrent', '--bound-source', '--bound-tools', '--brain', '--branch', '--break-lock', '--budget-ms', '--budget-usd', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--client', '--concurrency', '--confidence', '--confirm', '--confirm-quiesced', '--contacts-dir', '--content-audit', '--content-root', '--count', '--dataset', '--db-url', '--delegated-namespace', '--delegated-slug-prefixes', '--delete-brain', '--dest', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--error-unmatch', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--get', '--get-url', '--git-common-dir', '--git-dir', '--git-path', '--group', '--hard', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--if-version', '--ignore-env-override', '--images', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--include-withdrawals', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lanes', '--lang', '--left-right', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--min', '--mode', '--multimodal', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-capture', '--no-confirm', '--no-cron', '--no-delegate', '--no-edit', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-lanes', '--no-llm', '--no-migrate', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-seat', '--no-tags', '--no-verify', '--no-write-fetch-head', '--non-interactive', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--page', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--profile', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--reference-date', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--relative', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--repair', '--replace', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--reverse', '--review-lower', '--revision', '--rollback-to-source', '--scope', '--scopes', '--seat', '--section', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-prefix', '--show-token', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--stdin', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--warn-only', '--what-if-threshold', '--window', '--workers', '--working-tree', '--workspace', '--yes'],'dream': ['--audit-rejects', '--brain', '--cancel-unmatched', '--date', '--dir', '--drain', '--dry-run', '--eval-run', '--force', '--from', '--help', '--input', '--install', '--json', '--limit', '--list', '--max-usd', '--once', '--path', '--phase', '--pull', '--reconcile-queue', '--since', '--source', '--source-id', '--threshold', '--to', '--unsafe-bypass-dream-guard', '--window', '--yes'],'edge-proposals': ['--access', '--add', '--all-applied', '--all-held', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-usd', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--purge', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--status', '--surface', '--to', '--updated-after', '--url', '--yes'],'edges-backfill': ['--all-sources', '--brain', '--concurrency', '--help', '--json', '--max-chunks', '--source', '--workers'],diff --cc src/core/google/counterparty.tsindex eb97dafa20,0000000000..05abc320famode 100644,000000..100644--- a/src/core/google/counterparty.ts+++ b/src/core/google/counterparty.ts@@@ -1,100 -1,0 +1,100 @@@+/**+ * Counterparty resolution for open loops (#5504, wave 14 P4.1).+ *+ * A loop's counterparty is a person named in a connector source (a Gmail+ * sweep), while the person's page often lives in another source (`default`+ * on a federated brain). Resolution runs in two steps and records the source+ * it landed in, so `open_loops.counterparty_source_id` can confine every+ * later read to one (source, slug) page:+ *+ * 1. the loop's OWN source, through the ordinary resolver, any+ * high-confidence arm (never the slugify fallback);+ * 2. failing that, ACROSS sources by identity only (T8): the exact email+ * as a page alias (one live page in one other source), or a page the+ * own-source hit belongs to through `entity_identities` whose canonical+ * member sits elsewhere. A display name never crosses a source+ * boundary, and a tie (two sources match) stays unresolved.+ *+ * Facts stay in the connector source (T5): this module only decides where+ * the loop row and its typed edge point.+ */+import type { BrainEngine } from '../engine.ts';+import { normalizeAlias } from '../search/alias-normalize.ts';+import { isUndefinedTableError } from '../utils.ts';++export interface ResolvedCounterparty {+ slug: string;+ sourceId: string;+ via: 'same_source' | 'identity_canonical' | 'email_alias';+}++/** The identity group's canonical member when the page has one in ANOTHER source. */+async function canonicalTwin(engine: BrainEngine, sourceId: string, slug: string): Promise<{ slug: string; sourceId: string } | null> {+ try {+ const rows = await engine.executeRaw<{ slug: string; source_id: string }>(+ `SELECT c.slug, ei.source_id+ FROM entity_identities me+ JOIN pages p ON p.id = me.page_id AND p.source_id = $1 AND p.slug = $2 AND p.deleted_at IS NULL+ JOIN entity_identities ei ON ei.entity_id = me.entity_id AND ei.canonical AND ei.source_id <> $1+ JOIN pages c ON c.id = ei.page_id AND c.deleted_at IS NULL+ LIMIT 2`,+ [sourceId, slug],+ );+ return rows.length === 1 ? { slug: rows[0]!.slug, sourceId: rows[0]!.source_id } : null;+ } catch (err) {+ if (isUndefinedTableError(err)) return null;+ throw err;+ }+}++/** A live page in exactly one other source that declares the exact email as an alias. */+async function emailAliasElsewhere(engine: BrainEngine, sourceId: string, email: string): Promise<{ slug: string; sourceId: string } | null> {+ const norm = normalizeAlias(email);+ if (!norm || !norm.includes('@')) return null;+ try {+ const rows = await engine.executeRaw<{ slug: string; source_id: string }>(+ `SELECT DISTINCT pa.slug, pa.source_id+ FROM page_aliases pa+ JOIN pages p ON p.slug = pa.slug AND p.source_id = pa.source_id AND p.deleted_at IS NULL+ WHERE pa.alias_norm = $1 AND pa.source_id <> $2+ LIMIT 2`,+ [norm, sourceId],+ );+ return rows.length === 1 ? { slug: rows[0]!.slug, sourceId: rows[0]!.source_id } : null;+ } catch (err) {+ if (isUndefinedTableError(err)) return null;+ throw err;+ }+}++/**+ * Where the loop's counterparty page is, or null when nothing resolves with+ * confidence. `name` and `email` are what the detector or the model saw;+ * either may be empty.+ */+export async function resolveCounterparty(+ engine: BrainEngine,+ sourceId: string,+ ref: { name?: string | null; email?: string | null },+): Promise<ResolvedCounterparty | null> {+ const own = [ref.name?.trim(), ref.email?.trim()].filter((v): v is string => Boolean(v));+ if (own.length === 0) return null;+ const { resolveEntitySlugWithSource } = await import('../entities/resolve.ts');+ for (const raw of own) {+ const resolved = await resolveEntitySlugWithSource(engine, sourceId, raw);+ if (!resolved || resolved.source === 'fallback_slugify') continue;+ const canonical = await canonicalTwin(engine, sourceId, resolved.slug);+ return canonical ? { ...canonical, via: 'identity_canonical' } : { slug: resolved.slug, sourceId, via: 'same_source' };+ }+ const elsewhere = ref.email ? await emailAliasElsewhere(engine, sourceId, ref.email) : null;+ if (!elsewhere) return null;+ const canonical = await canonicalTwin(engine, elsewhere.sourceId, elsewhere.slug);+ return canonical ? { ...canonical, via: 'identity_canonical' } : { ...elsewhere, via: 'email_alias' };+}++/**+ * The `(counterparty_slug, source)` predicate readers confine a loop → entity- * join with: a row written before v233 has no counterparty source and is read++ * join with: a row written before v234 has no counterparty source and is read+ * as its own source, the posture it was written under.+ */+export const COUNTERPARTY_SOURCE_SQL = 'COALESCE(counterparty_source_id, source_id)';diff --cc src/core/loops/loops-store.tsindex 3552ddec44,deec074aed..35c21073e5--- a/src/core/loops/loops-store.ts+++ b/src/core/loops/loops-store.ts@@@ -35,12 -35,6 +35,12 @@@ export interface OpenLoopUpsertdedupKey: string;loopType: LoopType;counterpartySlug?: string | null;+ /**+ * Source of the page `counterpartySlug` names (#5504). Omitted or null+ * means the loop's own source, which is how every reader treats a NULL- * column (rows written before v233).++ * column (rows written before v234).+ */+ counterpartySourceId?: string | null;counterpartyEmail?: string | null;summary: string;evidence: LoopEvidence[];@@@ -66,8 -60,6 +66,8 @@@ export interface OpenLoopRowdedup_key: string;loop_type: LoopType;counterparty_slug: string | null;- /** Source of the counterparty page; NULL on pre-v233 rows (read as `source_id`). */++ /** Source of the counterparty page; NULL on pre-v234 rows (read as `source_id`). */+ counterparty_source_id: string | null;counterparty_email: string | null;summary: string;evidence: LoopEvidence[];@@@ -231,12 -218,6 +231,12 @@@ export interface ListLoopsOptsstatus?: LoopStatus;loopType?: LoopType;counterparty?: string;+ /**+ * With `counterparty`, the source the counterparty page lives in (#5504):+ * a slug match counts only when the loop's counterparty source (its own- * source for a pre-v233 row) is this one. An email match is unaffected.++ * source for a pre-v234 row) is this one. An email match is unaffected.+ */+ counterpartySourceId?: string;/*** Restrict the read to the loop with this primary key. It is ANDed with* every other filter, so the source scope above still bounds the result.diff --cc src/core/ops/loops.tsindex 1f5e20335c,3fea493107..a9b822fca0--- a/src/core/ops/loops.ts+++ b/src/core/ops/loops.ts@@@ -232,12 -232,9 +232,12 @@@ interface CounterpartyGroupcounterparty: string;counterparty_slug: string | null;counterparty_email: string | null;- /** The loops' home source — entity cards/aliases live THERE, not in the- * caller's (often 'default') scope. */+ /** The loops' home source. */source_id: string;+ /** Where the counterparty page lives (#5504): entity cards/aliases live+ * THERE, not in the caller's (often 'default') scope and not always in- * the loops' source. A pre-v233 row reads as its own source. */++ * the loops' source. A pre-v234 row reads as its own source. */+ counterparty_source_id: string;loop_count: number;oldest_opened_at: string;nearest_due_at: string | null;diff --cc src/core/schema-migrations/latest.generated.tsindex 7cdcfafcf0,7cdcfafcf0..663df87dfd--- a/src/core/schema-migrations/latest.generated.ts+++ b/src/core/schema-migrations/latest.generated.ts@@@ -4,4 -4,4 +4,4 @@@// The highest schema migration version (migrate.ts LATEST_VERSION), importable without// loading the migrations themselves.--export const LATEST_SCHEMA_VERSION = 233;++export const LATEST_SCHEMA_VERSION = 234;diff --cc src/core/schema-migrations/registry.generated.tsindex e8c67fa149,66df0323fc..4cd755c3f0--- a/src/core/schema-migrations/registry.generated.ts+++ b/src/core/schema-migrations/registry.generated.ts@@@ -232,7 -232,8 +232,9 @@@ import { v228 } from './v228-memory-purimport { v229 } from './v229-trust-allow-rules.ts';import { v230 } from './v230-trust-generation.ts';import { v231 } from './v231-fact-purge-lookup-indexes.ts';- import { v233 } from './v233-open-loops-counterparty-source.ts';+ import { v232 } from './v232-fts-cjk-boundary.ts';+ import { v233 } from './v233-oauth-client-registered-via.ts';++import { v234 } from './v234-open-loops-counterparty-source.ts';// Array order is historical (see HISTORICAL_ARRAY_ORDER in the generator); the// runner sorts by version before applying.@@@ -463,5 -464,6 +465,7 @@@ export const MIGRATIONS: Migration[] =v229,v230,v231,+ v232,v233,++ v234,];diff --cc src/core/schema-migrations/v234-open-loops-counterparty-source.tsindex 53a3554044,0000000000..0f3ad2c94amode 100644,000000..100644--- a/src/core/schema-migrations/v234-open-loops-counterparty-source.ts+++ b/src/core/schema-migrations/v234-open-loops-counterparty-source.ts@@@ -1,28 -1,0 +1,28 @@@+import type { Migration } from './types.ts';+import { OPEN_LOOPS_COUNTERPARTY_SOURCE_COLUMN_SQL, OPEN_LOOPS_COUNTERPARTY_SOURCE_INDEX } from '../loops/loops-schema.ts';+import { buildIndexOnline, migrationNotice } from './helpers.ts';++// Applied by src/core/migrate.ts on the next initSchema(); see docs/ENGINES.md+// ("Canonical schema sources") for when schema.sql or a TS fragment also changes.+//+// #5504 (wave 14 P4.1): `open_loops.counterparty_source_id` names the source of+// the person page a loop's counterparty resolved to. loops_extract and the+// deterministic detector resolve a counterparty in the loop's own source first+// and, failing that, across sources by identity only (an entity_identities+// canonical member or an exact-email alias; google/counterparty.ts), so a+// Gmail source's loop can point at `default:people/<slug>`. Readers that join a+// loop to an entity page confine on both predicates (slug AND source), with a- // NULL (pre-v233 row) read as the loop's own source. Nullable, no default,++// NULL (pre-v234 row) read as the loop's own source. Nullable, no default,+// metadata-only on Postgres 11+ and PGLite; not in schema.sql's CREATE TABLE,+// so fresh and upgraded brains share column ordinals (the v180/v221 pattern).+// The partial index serves the entity card's lookup; Postgres builds it+// CONCURRENTLY on a dedicated connection, PGLite inline (buildIndexOnline).- export const v233: Migration = {- version: 233,++export const v234: Migration = {++ version: 234,+ name: 'open_loops_counterparty_source',+ idempotent: true,+ sql: `${OPEN_LOOPS_COUNTERPARTY_SOURCE_COLUMN_SQL};`,+ handler: async engine => {- await buildIndexOnline(engine, 233, OPEN_LOOPS_COUNTERPARTY_SOURCE_INDEX, { notice: migrationNotice });++ await buildIndexOnline(engine, 234, OPEN_LOOPS_COUNTERPARTY_SOURCE_INDEX, { notice: migrationNotice });+ },+};diff --cc src/core/verbs/entity-card.tsindex c968d988ca,b066566e10..5320363de0--- a/src/core/verbs/entity-card.ts+++ b/src/core/verbs/entity-card.ts@@@ -467,11 -467,7 +467,11 @@@ async function assembleCardconst openThreads: EntityOpenThread[] = [];const loopFactIds = new Set<number>();try {- // Zero-LLM, indexed lookup — stays inside the p99<100ms budget.+ // Zero-LLM, indexed lookup — stays inside the p99<100ms budget. A loop+ // belongs to this card when its counterparty page is THIS (source, slug):+ // a Gmail-source loop whose person page lives in `default` shows on the- // default card, a pre-v233 row (NULL counterparty source) on its own++ // default card, a pre-v234 row (NULL counterparty source) on its own+ // source's card (#5504).const loopRows = await engine.executeRaw<{id: number;loop_type: string;diff --cc test/fixtures/goldens/migrations/records.jsonindex a02e2cd3bb,e866bdb20c..18ab3b6bf0--- a/test/fixtures/goldens/migrations/records.json+++ b/test/fixtures/goldens/migrations/records.json@@@ -1,6 -1,6 +1,6 @@@{"golden": {- "count": 227,- "count": 228,++ "count": 229,"gaps": [17,18,@@@ -14,8 -14,9 +14,10 @@@"FACT_PURGES_SUBJECT_INDEX": "f4fba07082f2e26da3fa51b0b689f3fe78a3d09afd20c1924dbc2fbe6b1560f1","FACT_RELINK_TABLE_SQL": "1fdde4b99d0077365274096f294be64a992961c7b4544af794224de238b03630","FACT_UNLINKED_INDEX_SQL": "87dcf23c3fa570d93bfb214b6bbb024faa9ff9bff227aa78869a29580be03298",+ "FTS_CJK_BOUNDARY_REGEX": "e8605bc0f2c6f3ecd2b451cbc8a4fe27ae0974d048f0bea655533cf37e0ff88d",+ "FTS_INPUT_FUNCTION_SQL": "d2f44fc1ef338ff7563c07659d938b743fedb20230948792c71068c022ec54c3","ISSUANCE_CLOCK_SLACK_SECONDS": "8f36c80392df6f9b9c754826289b63969d9d41ca8955213291e4413d614dce35",+ "OPEN_LOOPS_COUNTERPARTY_SOURCE_INDEX": "e9b472d9db37733e908ea40512ad3f9520d7a6729ce207b0d279d43d3beb5b2f","PAGES_RECONCILE_NAME_INDEXES": "8805e35341b22324b932b1cc05030cc8f2bfc95532bf810ec35330783f29c59a","PERSISTENCE_COMMITTED_WATERMARK_INDEX": "f472fa0acb542c1caebaaa3bc69fb2da1647e5e201239429fc02ccef0d669533","PERSISTENCE_COMPACTABLE_INDEX": "25ee657878efb41ba9ea3a7624464ddcf66407d861659456c230366e57f230a0",@@@ -43,7 -49,7 +50,7 @@@"sqlQueryForEngine": "71fb1ccec1b22cdc1662876dbd8c17ed81e9ab83485c6965cdf5caa4fc4a4ab5","verifyProjectionStatistics": "0d231b04ecfbc5a4109d6fca9567bf4e8c9e9db6c3fbbb35212e026579ed6f67"},-- "latest": 233,++ "latest": 234,"records": [{"handler": {@@@ -3458,28 -3464,47 +3465,70 @@@"verify": "absent","version": 231},+ {+ "handler": {+ "form": "arrow",+ "helpers": [+ "CHECKPOINT",+ "FTS_CJK_BOUNDARY_REGEX",+ "FTS_INPUT_FUNCTION_SQL",+ "backfillChunkVectors",+ "backfillPageVectors",+ "checkpointKey",+ "chunkSearchVectorTriggerFnSql",+ "getFtsLanguage",+ "migrationNotice",+ "pageSearchVectorTriggerFnSql",+ "quietMigrationNotices"+ ],+ "sha256": "b7a73381f45a5bcdc68e07cd45b2126cd7091140747f69e224abfc39bf8c7959"+ },+ "idempotent": true,+ "name": "fts_cjk_boundary",+ "sql": {+ "length": 0,+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"+ },+ "sqlFor": "absent",+ "transaction": "absent",+ "verify": "absent",+ "version": 232+ },+ {+ "handler": "absent",+ "idempotent": true,+ "name": "oauth_client_registered_via",+ "sql": {+ "length": 489,+ "sha256": "5767fc58a79405b9ff3bbcc291a988f42e6f41553a1bbf062c132b3306f04ba3"+ },+ "sqlFor": "absent",+ "transaction": "absent",+ "verify": "absent",+ "version": 233++ },+ {+ "handler": {+ "form": "arrow",+ "helpers": [+ "OPEN_LOOPS_COUNTERPARTY_SOURCE_INDEX",+ "buildIndexOnline",+ "dropInvalidConcurrentIndex",+ "migrationNotice",+ "quietMigrationNotices"+ ],- "sha256": "6aa0ec5da80beb3ee59b46ac273e3109062befad63aa7ec6fba4919f72720964"++ "sha256": "f660917b41c415f26c1dcb3ade1a0b18ef5fe4b8e01d245e4ad9c4e5e2de24fc"+ },+ "idempotent": true,+ "name": "open_loops_counterparty_source",+ "sql": {+ "length": 76,+ "sha256": "1976b6a28a5078fa1879722e27fdd7778d9524810212c1e4953a6b9cf0b78d70"+ },+ "sqlFor": "absent",+ "transaction": "absent",+ "verify": "absent",- "version": 233++ "version": 234}],"versions": [@@@ -3709,7 -3734,8 +3758,9 @@@229,230,231,- 233+ 232,- 233++ 233,++ 234]},"normalizer": "migrations-record-v1"diff --cc test/loops-counterparty-null-entity.test.tsindex a575f61e09,0000000000..e2385b6670mode 100644,000000..100644--- a/test/loops-counterparty-null-entity.test.ts+++ b/test/loops-counterparty-null-entity.test.ts@@@ -1,241 -1,0 +1,241 @@@+/**+ * #5504 (wave 14 P4.1): a loop's counterparty page may live in another+ * source than the loop. On a federated brain the Gmail source carries the+ * thread pages while `people/<slug>` lives in `default`.+ *+ * (a) A counterparty nothing resolves with confidence leaves the loop row+ * with a NULL slug and a NULL counterparty source, fabricates no page in+ * any source and writes no edge.+ * (b) The resolver (google/counterparty.ts) crosses a source boundary by+ * identity only: an exact-email alias in exactly one other source, or an+ * entity_identities canonical member. A display name never crosses, a tie+ * stays unresolved. Both writers stamp `counterparty_source_id`, the+ * typed edge points at the page's source, and every reader confines on+ * (slug, counterparty source): the entity card in `default` shows the+ * Gmail loop, a namesake page in the Gmail source does not inherit it.+ *+ * Runs on PGLite and, with DATABASE_URL, on an isolated Postgres database+ * (test/e2e/loops-counterparty-null-entity-postgres.test.ts registers the+ * Postgres arm; the E2E matrix adds the PgBouncer transaction-mode pass).+ * Synthetic data only.+ */+import { afterAll, beforeAll, describe, expect, test } from 'bun:test';+import type { BrainEngine } from '../src/core/engine.ts';+import { PGLiteEngine } from '../src/core/pglite-engine.ts';+import { configureGateway, resetGateway, __setChatTransportForTests, type ChatResult } from '../src/core/ai/gateway.ts';+import { runLoopsExtract } from '../src/core/google/loops-extract.ts';+import { applyThreadLoopVerdict } from '../src/core/google/loop-detect.ts';+import { resolveCounterparty } from '../src/core/google/counterparty.ts';+import { listOpenLoops } from '../src/core/loops/loops-store.ts';+import { buildEntityCard } from '../src/core/verbs/entity-card.ts';+import { loopsOperations } from '../src/core/ops/loops.ts';+import type { OperationContext } from '../src/core/ops/contract.ts';+import type { GmailThreadData } from '../src/core/google/types.ts';+import { normalizeAlias } from '../src/core/search/alias-normalize.ts';+import { testBackends } from './helpers/test-backends.ts';+import { isolatedPersistencePostgres } from './helpers/persistence-postgres.ts';++const G1 = 'g1';+const OTHER = 'other';+const engines: Array<{ engine: BrainEngine; close: () => Promise<void> }> = [];+const usage = { input_tokens: 10, output_tokens: 10, cache_read_tokens: 0, cache_creation_tokens: 0 };++async function seed(engine: BrainEngine): Promise<void> {+ for (const id of [G1, OTHER]) {+ await engine.executeRaw(`INSERT INTO sources (id, name, config) VALUES ($1, $1, '{"kind":"google"}'::jsonb) ON CONFLICT (id) DO NOTHING`, [id]);+ }+ const person = (title: string) => ({ type: 'person', title, compiled_truth: `# ${title}\n` });+ const alias = (sourceId: string, raw: string, slug: string) =>+ engine.executeRaw(`INSERT INTO page_aliases (source_id, alias_norm, slug) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING`, [sourceId, normalizeAlias(raw), slug]);+ // Alice: page and email alias in default only (the federated-brain case).+ await engine.putPage('people/alice-example', person('Alice Example'), { sourceId: 'default' });+ await alias('default', '[email protected]', 'people/alice-example');+ await alias('default', 'Alice Example', 'people/alice-example');+ // A namesake slug in the Gmail source: a stub that must not inherit Alice's loops.+ await engine.putPage('people/alice-example', { ...person('Alice (stub)'), frontmatter: { google_contact_id: 'c1' } }, { sourceId: OTHER });+ // Bob: name alias in default, no email alias anywhere (names never cross).+ await engine.putPage('people/bob-example', person('Bob Example'), { sourceId: 'default' });+ await alias('default', 'Bob Example', 'people/bob-example');+ // Carol: email alias in two other sources (a tie).+ await engine.putPage('people/carol-example', person('Carol Example'), { sourceId: 'default' });+ await engine.putPage('people/carol-example', person('Carol Example'), { sourceId: OTHER });+ await alias('default', '[email protected]', 'people/carol-example');+ await alias(OTHER, '[email protected]', 'people/carol-example');+ // Dave: connector stub in g1 with its alias, identity group canonical in default.+ await engine.putPage('people/dave-stub', person('Dave Example'), { sourceId: G1 });+ await alias(G1, 'Dave Example', 'people/dave-stub');+ await engine.putPage('people/dave-example', person('Dave Example'), { sourceId: 'default' });+ const ids = await engine.executeRaw<{ id: number; source_id: string }>(+ `SELECT id, source_id FROM pages WHERE slug IN ('people/dave-stub', 'people/dave-example') AND source_id IN ($1, 'default')`, [G1]);+ for (const r of ids) {+ await engine.executeRaw(`INSERT INTO entity_identities (entity_id, source_id, page_id, canonical) VALUES ('ent-dave', $1, $2, $3)`,+ [r.source_id, r.id, r.source_id === 'default']);+ }+ // Erin: resolvable in the Gmail source itself.+ await engine.putPage('people/erin-example', person('Erin Example'), { sourceId: G1 });+ await alias(G1, '[email protected]', 'people/erin-example');+}++beforeAll(async () => {+ configureGateway({ chat_model: 'anthropic:claude-sonnet-4-6', env: { ANTHROPIC_API_KEY: 'sk-ant-test' } });+ for (const backend of testBackends()) {+ if (backend === 'pglite') {+ const engine = new PGLiteEngine();+ await engine.connect({ database_url: '' });+ await engine.initSchema();+ engines.push({ engine, close: () => engine.disconnect() });+ } else {+ engines.push(await isolatedPersistencePostgres(process.env.DATABASE_URL!));+ }+ }+ for (const { engine } of engines) await seed(engine);+}, 120_000);++afterAll(async () => {+ __setChatTransportForTests(null);+ resetGateway();+ for (const e of engines) await e.close();+});++function chatReturns(commitments: Array<Record<string, unknown>>): void {+ __setChatTransportForTests(async (): Promise<ChatResult> => ({+ text: JSON.stringify({ commitments, decisions_pending: [] }), blocks: [], stopReason: 'end', usage,+ model: 'anthropic:claude-sonnet-4-6', providerId: 'anthropic',+ }));+}++async function emailPage(engine: BrainEngine, slug: string, threadId: string, from: string, body: string): Promise<void> {+ await engine.putPage(slug, {+ type: 'email', title: `Re: ${threadId}`, compiled_truth: `From: ${from}\n\n${body}\n`,+ frontmatter: { thread_id: threadId, date: '2026-09-20T10:00:00Z', from },+ effective_date: new Date('2026-09-20T10:00:00Z'),+ }, { sourceId: G1 });+}++async function extract(engine: BrainEngine, slug: string, threadId: string, c: Record<string, unknown>) {+ await emailPage(engine, slug, threadId, String(c.counterparty_email || '[email protected]'), 'I will send you the deck by Friday.');+ chatReturns([{ direction: 'owed_by_me', text: `Send the deck (${threadId})`, due_iso: null, quote: 'I will send you the deck by Friday.', ...c }]);+ const r = await runLoopsExtract(engine, { slug, sourceId: G1 });+ expect(r).toMatchObject({ status: 'extracted', commitments: 1 });+ const [row] = await engine.executeRaw<{ counterparty_slug: string | null; counterparty_source_id: string | null }>(+ `SELECT counterparty_slug, counterparty_source_id FROM open_loops WHERE source_id = $1 AND thread_id = $2`, [G1, threadId]);+ return row;+}++async function edgesFrom(engine: BrainEngine, slug: string) {+ return engine.executeRaw<{ to_slug: string; to_source: string; link_type: string }>(+ `SELECT t.slug AS to_slug, t.source_id AS to_source, l.link_type FROM links l+ JOIN pages f ON f.id = l.from_page_id JOIN pages t ON t.id = l.to_page_id+ WHERE f.slug = $1 AND f.source_id = $2 AND l.link_source = 'google-loops'`, [slug, G1]);+}++describe('(a) an unresolvable counterparty', () => {+ test('writes a NULL-counterparty loop, no page in any source and no edge', async () => {+ for (const { engine } of engines) {+ const row = await extract(engine, 'emails/nobody', 'thread-nobody', { counterparty_name: 'Nobody Known', counterparty_email: '[email protected]' });+ expect(row).toEqual({ counterparty_slug: null, counterparty_source_id: null });+ const pages = await engine.executeRaw<{ slug: string }>(`SELECT slug FROM pages WHERE slug <> 'emails/nobody' AND (slug LIKE '%nobody%' OR slug LIKE '%known%') AND deleted_at IS NULL`);+ expect(pages).toEqual([]);+ expect(await edgesFrom(engine, 'emails/nobody')).toEqual([]);+ }+ }, 60_000);+});++describe('(b) resolver: identity-only cross-source matching', () => {+ test('own source first, then an exact-email alias in exactly one other source', async () => {+ for (const { engine } of engines) {+ expect(await resolveCounterparty(engine, G1, { name: 'Erin Example', email: '[email protected]' }))+ .toEqual({ slug: 'people/erin-example', sourceId: G1, via: 'same_source' });+ expect(await resolveCounterparty(engine, G1, { name: 'Alice Example', email: '[email protected]' }))+ .toEqual({ slug: 'people/alice-example', sourceId: 'default', via: 'email_alias' });+ }+ });++ test('a display name never crosses a source; a tie stays unresolved', async () => {+ for (const { engine } of engines) {+ expect(await resolveCounterparty(engine, G1, { name: 'Bob Example', email: '[email protected]' })).toBeNull();+ expect(await resolveCounterparty(engine, G1, { name: 'Bob Example' })).toBeNull();+ expect(await resolveCounterparty(engine, G1, { name: 'Carol Example', email: '[email protected]' })).toBeNull();+ }+ });++ test('an entity_identities canonical member in another source wins over the local stub', async () => {+ for (const { engine } of engines) {+ expect(await resolveCounterparty(engine, G1, { name: 'Dave Example', email: '[email protected]' }))+ .toEqual({ slug: 'people/dave-example', sourceId: 'default', via: 'identity_canonical' });+ }+ });+});++describe('(b) writers stamp counterparty_source_id', () => {+ test('loops_extract: the row names the page source and the owes_to edge points there', async () => {+ for (const { engine } of engines) {+ const row = await extract(engine, 'emails/alice', 'thread-alice', { counterparty_name: 'Alice Example', counterparty_email: '[email protected]' });+ expect(row).toEqual({ counterparty_slug: 'people/alice-example', counterparty_source_id: 'default' });+ expect(await edgesFrom(engine, 'emails/alice')).toEqual([{ to_slug: 'people/alice-example', to_source: 'default', link_type: 'owes_to' }]);+ const same = await extract(engine, 'emails/erin', 'thread-erin', { counterparty_name: 'Erin Example', counterparty_email: '[email protected]' });+ expect(same).toEqual({ counterparty_slug: 'people/erin-example', counterparty_source_id: G1 });+ }+ }, 60_000);++ test('deterministic detector: an unanswered inbound from Alice resolves across sources', async () => {+ for (const { engine } of engines) {+ const thread: GmailThreadData = {+ threadId: 'thread-alice-inbound', account: '[email protected]',+ messages: [{+ id: 'm1', threadId: 'thread-alice-inbound', from: 'Alice Example <[email protected]>', fromAddress: '[email protected]',+ to: ['[email protected]'], cc: [], subject: 'Quarterly plan', bodyText: 'Can you review the plan?', dateIso: '2026-09-10T10:00:00Z',+ internalDateMs: Date.parse('2026-09-10T10:00:00Z'), labelIds: ['INBOX'], listUnsubscribe: false,+ }],+ };+ const verdict = await applyThreadLoopVerdict(engine, G1, thread, new Set(['[email protected]']), null, new Date('2026-09-20T10:00:00Z'));+ expect(verdict.open.map((s) => s.loopType)).toEqual(['unanswered_inbound']);+ const [row] = await engine.executeRaw<{ counterparty_slug: string | null; counterparty_source_id: string | null }>(+ `SELECT counterparty_slug, counterparty_source_id FROM open_loops WHERE source_id = $1 AND thread_id = $2`, [G1, 'thread-alice-inbound']);+ expect(row).toEqual({ counterparty_slug: 'people/alice-example', counterparty_source_id: 'default' });+ }+ }, 60_000);+});++describe('(b) readers confine on (slug, counterparty source)', () => {+ test("Alice's card in default shows the Gmail loops; the namesake stub in another source does not", async () => {+ for (const { engine } of engines) {+ const card = await buildEntityCard(engine, 'default', 'people/alice-example', { remote: false });+ expect(card.found).toBe(true);+ const threads = (card.card!.open_threads ?? []).filter((t) => t.loop_id !== undefined);+ expect(threads.map((t) => t.direction).sort()).toEqual(['my_turn', 'owed_by_me']);+ const stub = await buildEntityCard(engine, OTHER, 'people/alice-example', { remote: false });+ expect(stub.found).toBe(true);+ expect((stub.card!.open_threads ?? []).filter((t) => t.loop_id !== undefined)).toEqual([]);+ }+ });++ test('listOpenLoops counterpartySourceId filters the slug to one source', async () => {+ for (const { engine } of engines) {+ const inDefault = await listOpenLoops(engine, { sourceIds: [G1], status: 'open', counterparty: 'people/alice-example', counterpartySourceId: 'default' });+ expect(inDefault.map((l) => l.thread_id).sort()).toEqual(['thread-alice', 'thread-alice-inbound']);+ expect(inDefault.every((l) => l.counterparty_source_id === 'default')).toBe(true);+ const inOther = await listOpenLoops(engine, { sourceIds: [G1], status: 'open', counterparty: 'people/alice-example', counterpartySourceId: OTHER });+ expect(inOther).toEqual([]);- // A pre-v233 row (NULL counterparty source) reads as its own source.++ // A pre-v234 row (NULL counterparty source) reads as its own source.+ const legacy = await listOpenLoops(engine, { sourceIds: [G1], status: 'open', counterparty: 'people/erin-example', counterpartySourceId: G1 });+ expect(legacy.map((l) => l.thread_id)).toEqual(['thread-erin']);+ }+ });++ test('open_loops groups carry counterparty_source_id and attach the card from that source', async () => {+ for (const { engine } of engines) {+ const op = loopsOperations.find((o) => o.name === 'open_loops')!;+ const ctx = { engine, config: { engine: engine.kind, embedding_disabled: true }, sourceId: G1, remote: false, dryRun: false,+ logger: { info() {}, warn() {}, error() {} } } as unknown as OperationContext;+ const res = await op.handler(ctx, { group_by: 'counterparty', source_id: G1, limit: 50 }) as {+ groups: Array<{ counterparty_slug: string | null; source_id: string; counterparty_source_id: string; context?: { slug?: string } }>;+ };+ const alice = res.groups.find((g) => g.counterparty_slug === 'people/alice-example');+ expect(alice).toMatchObject({ source_id: G1, counterparty_source_id: 'default' });+ expect(alice?.context).toBeDefined();+ const erin = res.groups.find((g) => g.counterparty_slug === 'people/erin-example');+ expect(erin).toMatchObject({ source_id: G1, counterparty_source_id: G1 });+ }+ });+});diff --cc test/schema-bootstrap-coverage.test.tsindex 51e903830b,9063cb13f3..64f61d35ce--- a/test/schema-bootstrap-coverage.test.ts+++ b/test/schema-bootstrap-coverage.test.ts@@@ -903,11 -903,11 +903,16 @@@ const COLUMN_EXEMPTIONS = new Set<strin// the schema blob carries a comment, no CREATE TABLE column and no index// reads it, so there is no forward reference for the bootstrap to trip on.'content_chunks.embedding_pending_since',+ // #5504 (wave 14 P4.1) open_loops.counterparty_source_id (migration+ // open_loops_counterparty_source): same posture as embedding_pending_since,+ // migration-only so fresh and upgraded brains share column ordinals; the+ // partial index is built by the migration handler, never by the blob.+ 'open_loops.counterparty_source_id',+ // #6202 oauth_clients.registered_via (migration oauth_client_registered_via):+ // migration-only like min_trust, so fresh and upgraded catalogs keep the same+ // column order; no blob statement or index reads it, and the DCR insert falls+ // back to the unmarked insert while the column is missing.+ 'oauth_clients.registered_via',// T7 — search_telemetry rank-1 drift columns (migration v111). search_telemetry// is created entirely by migration v57 (not in the schema blob), so the v57+v111// chain handles fresh + upgrade; no CREATE INDEX references these columns, so