{"version":3,"sources":["../src/index.ts","../src/types/compare.ts","../src/compare/diff-runs.ts","../src/formatters/run-diff-changelog.ts","../src/formatters/run-diff-html.ts","../src/formatters/report-theme-css.ts","../src/formatters/run-diff-markdown.ts","../src/utils/ci-detect.ts","../src/converters/adapters/jest.ts","../src/converters/adapters/vitest.ts","../src/converters/adapters/playwright.ts","../src/sync/engine.ts","../src/sync/lockfile.ts","../src/sync/report.ts","../src/sync/adapters/case-text.ts","../src/sync/adapters/testrail.ts","../src/sync/adapters/xray.ts","../src/sync/adapters/registry.ts","../src/formatters/cucumber-json.ts","../src/formatters/story-report-json.ts","../src/formatters/scenario-index-json.ts","../src/formatters/agent-text.ts","../src/formatters/behavior-manifest-json.ts","../src/select-test-cases.ts","../src/coverage-index.ts","../src/watch.ts","../src/report-generator.ts","../src/generated/react-assets.ts","../src/formatters/span-graph.ts","../src/formatters/junit-xml.ts","../src/formatters/markdown.ts","../src/formatters/source-order.ts","../src/formatters/release-manifest.ts","../src/review/build-review.ts","../src/review/diff-anchor.ts","../src/review/conventions.ts","../src/jev.ts","../src/formatters/traceability-matrix.ts","../src/formatters/cucumber-messages/synthesize-feature.ts","../src/formatters/cucumber-messages/build-gherkin-document.ts","../src/utils/cucumber-messages.ts","../src/formatters/cucumber-messages/build-pickles.ts","../src/formatters/cucumber-messages/build-execution.ts","../src/formatters/cucumber-messages/formatter.ts","../src/formatters/cucumber-html.ts","../src/colocated-index.ts","../src/file-reports.ts","../src/formatters/astro.ts","../src/formatters/confluence.ts","../src/formatters/astro-assets.ts","../src/bundler/copy-asset.ts","../src/bundler/bundle-assets.ts","../src/bundler/scan-html-assets.ts","../src/aggregate-reports.ts","../src/runs-lifecycle.ts","../src/behavior-diff.ts","../src/publishers/confluence.ts","../src/publishers/jira.ts","../src/utils/git-info.ts","../src/utils/metadata.ts","../src/notifiers/ansi-strip.ts","../src/notifiers/slack.ts","../src/notifiers/teams.ts","../src/notifiers/hmac.ts","../src/notifiers/webhook.ts","../src/notifiers/send-notifications.ts","../src/history/history-store.ts","../src/history/sample-policy.ts","../src/history/flakiness.ts","../src/history/performance.ts","../src/history/stability.ts","../src/history/metrics.ts","../src/list-scenarios.ts","../src/check.ts","../src/scenario-failure.ts","../src/goal.ts","../src/codeowners.ts","../src/triage.ts","../src/compare/pr-summary.ts","../src/review/code-diff-sidecar.ts","../src/formatters/review-markdown.ts","../src/formatters/review-html.ts","../src/deploy/ledger.ts","../src/deploy/deployments.ts"],"sourcesContent":["/**\n * @executable-stories/formatters\n *\n * Cucumber-compatible report formats (JSON, HTML, JUnit, Markdown)\n * for Jest, Vitest, and Playwright test results.\n *\n * Architecture:\n * - Layer 1: Framework Adapters (adaptJestRun, adaptVitestRun, adaptPlaywrightRun)\n * - Layer 2: Anti-Corruption Layer (canonicalizeRun)\n * - Layer 3: Formatters (CucumberJsonFormatter, JUnitFormatter, MarkdownFormatter; the\n *   HTML report renders via executable-stories-react — the `html` format)\n */\n\nimport * as path from \"node:path\";\n\nimport * as fsPromises from \"node:fs/promises\";\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\nimport type { CanonicalizeOptions } from \"./types/options\";\nimport type { RawRun } from \"executable-stories-core/types/raw\";\n\nimport { canonicalizeRun } from \"executable-stories-core/converters/acl/canonicalize\";\nimport { diffRuns } from \"./compare/diff-runs\";\nimport { RunDiffChangelogFormatter } from \"./formatters/run-diff-changelog\";\nimport { RunDiffHtmlFormatter } from \"./formatters/run-diff-html\";\nimport { RunDiffMarkdownFormatter } from \"./formatters/run-diff-markdown\";\n\n// Import adapters for convenience functions\nimport { adaptJestRun } from \"./converters/adapters/jest\";\nimport { adaptVitestRun } from \"./converters/adapters/vitest\";\nimport { adaptPlaywrightRun } from \"./converters/adapters/playwright\";\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n// Story types (shared vocabulary for all adapters)\nexport type {\n  StepKeyword,\n  StepMode,\n  DocPhase,\n  DocEntry,\n  StoryStep,\n  StoryMeta,\n  NormalizedTicket,\n} from \"executable-stories-core/types/story\";\nexport { STORY_META_KEY } from \"executable-stories-core/types/story\";\n\n// OTel span types (trace waterfall rendering)\nexport type { OtelSpan, OtelAttributeValue } from \"executable-stories-core/types/otel\";\n\n// Canonical types (Layer 2 output - what formatters accept)\nexport type {\n  TestStatus,\n  StepResult,\n  Attachment,\n  TestCaseResult,\n  TestCaseAttempt,\n  TestCaseEvidence,\n  CIInfo,\n  CoverageSummary,\n  FeatureDeclaration,\n  GlossaryTerm,\n  TestRunResult,\n} from \"executable-stories-core/types/test-result\";\n\n// Raw types (Layer 1 - for adapter authors)\nexport type {\n  RawStatus,\n  RawAttachment,\n  RawStepEvent,\n  RawTestCase,\n  RawCIInfo,\n  RawRun,\n  RawFeature,\n  RawGlossaryTerm,\n} from \"executable-stories-core/types/raw\";\n\n// Cucumber JSON types (Layer 3 output)\nexport type {\n  IJsonTag,\n  IJsonDocString,\n  IJsonTableRow,\n  IJsonDataTable,\n  IJsonStepArgument,\n  IJsonEmbedding,\n  IJsonStepResult,\n  IJsonStep,\n  IJsonScenario,\n  IJsonFeature,\n} from \"./types/cucumber-json\";\n\n// Formatter plugin types\nexport type { Formatter, ExecutableStoriesConfig } from \"./types/formatter\";\n\n// Test-management sync: the port, the engine, and the built-in adapters.\n// The port is a plain object, so a third-party provider is a value someone can\n// construct — no plugin machinery needed if we ever expose it from config.\nexport type {\n  SyncProvider,\n  RemoteCase,\n  CaseBody,\n  CaseResult,\n  ResultAttachment,\n  RecordResultsSummary,\n  AdapterDeps,\n} from \"./sync/port\";\nexport {\n  analyzeSync,\n  applySync,\n  projectBehaviours,\n  toCaseBody,\n  collectAttachments,\n  type SyncAnalysis,\n  type SyncApplyResult,\n  type SyncEngineConfig,\n  type AttachPolicy,\n  type CoverageClass,\n} from \"./sync/engine\";\nexport {\n  renderCoverageText,\n  renderCoverageMarkdown,\n  renderPlan,\n  renderApplyResult,\n  buildCoverageJson,\n  type CoverageJson,\n} from \"./sync/report\";\nexport {\n  buildProvider,\n  isProviderName,\n  PROVIDER_NAMES,\n  type ProviderName,\n  type SyncTargets,\n} from \"./sync/adapters/registry\";\nexport { createTestRailProvider, type TestRailConfig } from \"./sync/adapters/testrail\";\nexport { createXrayProvider, type XrayConfig } from \"./sync/adapters/xray\";\nexport {\n  readLockfile,\n  writeLockfile,\n  parseLockfile,\n  serializeLockfile,\n  emptyLockfile,\n  hashCaseBody,\n  DEFAULT_LOCKFILE_PATH,\n  type Lockfile,\n  type LockEntry,\n} from \"./sync/lockfile\";\n\n// StoryReport public contract (consumed by UI renderers — additive-only within major)\nexport type {\n  StoryReportSchemaVersion,\n  ReportSummary,\n  ReportTicket,\n  ReportAttachment,\n  ReportCIInfo,\n  ReportCoverageSummary,\n  ReportDocEntry,\n  ReportDocNote,\n  ReportDocTag,\n  ReportDocKv,\n  ReportDocCode,\n  ReportDocTable,\n  ReportDocLink,\n  ReportDocSection,\n  ReportDocMermaid,\n  ReportDocScreenshot,\n  ReportDocCustom,\n  ReportStep,\n  ReportScenario,\n  ReportFeature,\n  StoryReport,\n} from \"executable-stories-core/types/story-report\";\nexport {\n  STORY_REPORT_SCHEMA_VERSION,\n  STORY_REPORT_SCHEMA_MAJOR,\n} from \"executable-stories-core/types/story-report\";\n\n// Options types\nexport type {\n  CanonicalizeOptions,\n  OutputFormat,\n  OutputMode,\n  ColocatedStyle,\n  OutputRule,\n  OutputConfig,\n  Logger,\n  WriteFile,\n  MarkdownFormatterOptions,\n  MarkdownRenderers,\n  FormatterOptions,\n  ResolvedFormatterOptions,\n  SortTestCasesMode,\n} from \"./types/options\";\nexport type {\n  ScenarioChangeKind,\n  ScenarioChangeFlags,\n  ScenarioSnapshot,\n  ScenarioDiff,\n  RunDiffSummary,\n  RunDiffResult,\n  CompareFormat,\n  CompareFormatterOptions,\n} from \"./types/compare\";\n\n// Review types (Evidence-Driven Review report)\nexport type {\n  ReviewAudience,\n  ChangeType,\n  EvidenceStrength,\n  ReviewBand,\n  FileChangeKind,\n  ChangedFile,\n  ReviewContext,\n  ReviewClaim,\n  ChangedFileReview,\n  ReviewSummary,\n  ReviewResult,\n  CodeDiffInput,\n  CodeDiffAnnotationInput,\n  CodeDiffEvidence,\n  CodeDiffAnnotation,\n  CodeDiffScenarioRef,\n} from \"./types/review\";\n\n// Canonical --es-* theme tokens (shared with executable-stories-react)\nexport { ES_THEME_TOKENS_CSS, ES_THEME_TOKEN_VALUES } from \"executable-stories-core/theme/tokens\";\n\n// ============================================================================\n// ACL Exports\n// ============================================================================\n\nexport { canonicalizeRun } from \"executable-stories-core/converters/acl/canonicalize\";\n\n/** @internal */\nexport { normalizeStatus } from \"executable-stories-core/converters/acl/status\";\n/** @internal */\nexport {\n  generateTestCaseId,\n  generateRunId,\n  slugify,\n} from \"executable-stories-core/converters/acl/ids\";\n/** @internal */\nexport {\n  deriveStepResults,\n  mergeStepResults,\n} from \"executable-stories-core/converters/acl/steps\";\n/** @internal */\nexport {\n  resolveAttachment,\n  resolveAttachments,\n} from \"executable-stories-core/converters/acl/attachments\";\n\nexport {\n  validateCanonicalRun,\n  assertValidRun,\n  type ValidationResult,\n} from \"executable-stories-core/converters/acl/validate\";\n\n// ============================================================================\n// Formatter Exports\n// ============================================================================\n\nexport {\n  CucumberJsonFormatter,\n  type CucumberJsonOptions,\n} from \"./formatters/cucumber-json\";\n\nexport {\n  StoryReportJsonFormatter,\n  type StoryReportJsonOptions,\n} from \"./formatters/story-report-json\";\n\nexport {\n  ScenarioIndexJsonFormatter,\n  toScenarioIndex,\n  type ScenarioIndex,\n  type ScenarioIndexFilters,\n  type ScenarioIndexItem,\n  type ScenarioIndexJsonOptions,\n  type ScenarioIndexStep,\n} from \"./formatters/scenario-index-json\";\n\nexport { AgentTextFormatter, toAgentText } from \"./formatters/agent-text\";\n\nexport {\n  BehaviorManifestJsonFormatter,\n  toBehaviorManifest,\n  type BehaviorDebuggerIssue,\n  type BehaviorManifest,\n  type BehaviorManifestJsonOptions,\n  type BehaviorSourceFile,\n  type BehaviorTag,\n} from \"./formatters/behavior-manifest-json\";\n\nexport { scenariosCoveringPaths } from \"./coverage-index\";\n\nexport {\n  regenerateArtifacts,\n  regenerateRun,\n  startWatch,\n  type WatchOptions,\n  type WatchDeps,\n  type WatchHandle,\n} from \"./watch\";\n\n// The session trajectory primitive lives in core.\nexport { advanceState, initialRunState, type RunState } from \"executable-stories-core\";\nexport { aggregateReports, type AggregateDeps, type AggregateResult } from \"./aggregate-reports\";\nexport { runsStatus, runsReset, type RunsStatusReport, type RunsResetResult } from \"./runs-lifecycle\";\n\nexport {\n  diffStoryReports,\n  classifyStatusChange,\n  type BehaviorDiff,\n  type BehaviorDiffEntry,\n} from \"./behavior-diff\";\n\nexport { toStoryReport } from \"executable-stories-core/converters/story-report\";\n\n// The HTML report renders via executable-stories-react (the `html` format) —\n// the single report renderer. The in-package HTML string renderer was removed.\n// To render a report programmatically, use `renderReportToHtml` from\n// executable-stories-react/ssr.\n\nexport {\n  JUnitFormatter,\n  type JUnitOptions,\n} from \"./formatters/junit-xml\";\n\nexport {\n  MarkdownFormatter,\n  type MarkdownOptions,\n} from \"./formatters/markdown\";\n\nexport {\n  AstroFormatter,\n  type AstroFormatterOptions as AstroFormatterOpts,\n  type StarlightBadge,\n} from \"./formatters/astro\";\n\nexport {\n  ConfluenceFormatter,\n  type ConfluenceFormatterOptions as ConfluenceFormatterOpts,\n} from \"./formatters/confluence\";\n\nexport {\n  publishConfluencePage,\n  type PublishConfluenceArgs,\n  type PublishConfluenceDeps,\n  type PublishConfluenceResult,\n  type ConfluenceAuth,\n  type FetchFn,\n} from \"./publishers/confluence\";\n\nexport {\n  publishJiraIssue,\n  type PublishJiraArgs,\n  type PublishJiraDeps,\n  type PublishJiraResult,\n  type JiraAuth,\n  type JiraPublishMode,\n} from \"./publishers/jira\";\n\nexport {\n  copyMarkdownAssets,\n  rewriteAssetPaths,\n  type AstroAssetResult,\n  type CopyMarkdownAssetsOptions,\n} from \"./formatters/astro-assets\";\n\nexport {\n  CucumberMessagesFormatter,\n  type CucumberMessagesOptions,\n} from \"./formatters/cucumber-messages/formatter\";\n\nexport {\n  CucumberHtmlFormatter,\n  type CucumberHtmlOptions,\n} from \"./formatters/cucumber-html\";\n\nexport {\n  RunDiffHtmlFormatter,\n  type RunDiffHtmlOptions,\n} from \"./formatters/run-diff-html\";\n\nexport {\n  RunDiffMarkdownFormatter,\n  type RunDiffMarkdownOptions,\n} from \"./formatters/run-diff-markdown\";\n\nexport {\n  RunDiffChangelogFormatter,\n  type RunDiffChangelogOptions,\n} from \"./formatters/run-diff-changelog\";\n\n// ============================================================================\n// NDJSON Parser (compat path: NDJSON → TestRunResult)\n// ============================================================================\n\nexport { parseNdjson, parseEnvelopes } from \"executable-stories-core/converters/ndjson-parser\";\n\n// ============================================================================\n// Utility Exports\n// ============================================================================\n\n/** @internal */\nexport { readGitSha } from \"./utils/git-info\";\n/** @internal */\nexport { findGitDir } from \"./utils/git-info\";\n/** @internal */\nexport { readBranchName } from \"./utils/git-info\";\n/** @internal */\nexport { formatDuration } from \"executable-stories-core/utils/duration\";\n/** @internal */\nexport { msToNanoseconds } from \"executable-stories-core/utils/duration\";\n/** @internal */\nexport { nanosecondsToMs } from \"executable-stories-core/utils/duration\";\n/** @internal */\nexport { readPackageVersion } from \"./utils/metadata\";\n/** @internal */\nexport { clearVersionCache } from \"./utils/metadata\";\nexport { detectCI } from \"./utils/ci-detect\";\nexport {\n  tryGetActiveOtelContext,\n  resolveTraceUrl,\n  type OtelTraceContext,\n} from \"executable-stories-core/utils/otel-detect\";\nexport { buildHtmlDocEntry, type HtmlDocOptions } from \"executable-stories-core/utils/doc-builders\";\n\n// ============================================================================\n// Notifier Exports\n// ============================================================================\n\nexport { sendNotifications } from \"./notifiers/send-notifications\";\nexport { sendSlackNotification } from \"./notifiers/slack\";\nexport { sendTeamsNotification } from \"./notifiers/teams\";\nexport { sendWebhookNotification } from \"./notifiers/webhook\";\nexport { signBody } from \"./notifiers/hmac\";\nexport { stripAnsi } from \"./notifiers/ansi-strip\";\nexport type { NotificationSummary, NotifyCondition, GenericWebhookNotifierOptions, WebhookSignerHmac, WebhookPayload } from \"./notifiers/types\";\n\n// ============================================================================\n// CI Type Exports\n// ============================================================================\n\nexport type { CIProvider, CIInfo as TypedCIInfo } from \"executable-stories-core/types/ci\";\nexport { toCIInfo, toRawCIInfo } from \"executable-stories-core/types/ci\";\n\n// ============================================================================\n// History Exports\n// ============================================================================\n\nexport { loadHistory, saveHistory, updateHistory } from \"./history/history-store\";\nexport { calculateFlakiness } from \"./history/flakiness\";\nexport { detectPerformanceTrend } from \"./history/performance\";\nexport { calculateStability } from \"./history/stability\";\nexport { computeTestMetrics } from \"./history/metrics\";\nexport {\n  MIN_PERF_SAMPLES,\n  MIN_METRIC_SAMPLES,\n  MIN_FLAKINESS_SAMPLES,\n  hasSufficientHistory,\n} from \"./history/sample-policy\";\n\nexport type {\n  HistoryEntry,\n  TestHistory,\n  HistoryStore,\n  StabilityGrade,\n  FlakinessLevel,\n  PerformanceTrend,\n  TestMetrics,\n} from \"./history/types\";\n\n// ============================================================================\n// List Scenarios\n// ============================================================================\n\nexport { listScenarios } from \"./list-scenarios\";\nexport type { ListScenariosArgs, ListScenariosDeps } from \"./list-scenarios\";\n\nexport { buildCheck, renderCheck } from \"./check\";\nexport type {\n  CheckArgs,\n  CheckDeps,\n  CheckReport,\n  CheckFailure,\n  CheckStep,\n} from \"./check\";\n\nexport { buildGoal, enrichGoal, renderGoal } from \"./goal\";\nexport type {\n  GoalArgs,\n  GoalDeps,\n  GoalReport,\n  GoalRequirementResult,\n  RatchetViolation,\n} from \"./goal\";\n\nexport { buildTriage, enrichTriage, renderTriage } from \"./triage\";\nexport type {\n  TriageArgs,\n  TriageDeps,\n  TriageReport,\n  TriageItem,\n  FailureKind,\n} from \"./triage\";\n\nexport { createJevClient, jevFromEnv } from \"./jev\";\nexport type { JevClient, JevQuestion, JevAnswer } from \"./jev\";\n\n// ============================================================================\n// ReportGenerator\n// ============================================================================\n\nimport { toPosix } from \"./report-generator\";\nimport type { GenerateCompareResult } from \"./report-generator\";\n\nexport {\n  ReportGenerator,\n  createReportGenerator,\n  joinNameAndExt,\n  normalizeFormats,\n  type GenerateArgs,\n  type GenerateDeps,\n  type GenerateResult,\n  type GenerateCompareResult,\n} from \"./report-generator\";\n\n\nexport async function generateRunComparison(args: {\n  baseline: TestRunResult;\n  current: TestRunResult;\n  formats: Array<\"html\" | \"markdown\" | \"changelog\">;\n  outputDir?: string;\n  outputName?: string;\n  title?: string;\n  /** Current run covers only some test files; see {@link DiffRunsOptions}. */\n  partialCurrent?: boolean;\n}): Promise<GenerateCompareResult> {\n  const outputDir = args.outputDir ?? \"reports\";\n  const outputName = args.outputName ?? \"test-results-diff\";\n  const diff = diffRuns(args.baseline, args.current, {\n    partialCurrent: args.partialCurrent,\n  });\n  const files: string[] = [];\n\n  await fsPromises.mkdir(outputDir, { recursive: true });\n\n  for (const format of args.formats) {\n    // The changelog gets its own suffix so requesting markdown + changelog\n    // together never writes both to the same file.\n    const ext = format === \"html\" ? \".html\" : format === \"changelog\" ? \".changelog.md\" : \".md\";\n    const outputPath = toPosix(path.join(outputDir, `${outputName}${ext}`));\n    const content =\n      format === \"html\"\n        ? new RunDiffHtmlFormatter({ title: args.title }).format(diff)\n        : format === \"changelog\"\n          ? new RunDiffChangelogFormatter().format(diff)\n          : new RunDiffMarkdownFormatter({ title: args.title }).format(diff);\n    await fsPromises.writeFile(outputPath, content, \"utf8\");\n    files.push(outputPath);\n  }\n\n  return { files, diff };\n}\n\nexport { diffRuns, type DiffRunsOptions } from \"./compare/diff-runs\";\nexport { createPrCommentSummary } from \"./compare/pr-summary\";\n\n// Review domain + formatter (Evidence-Driven Review report)\nexport { buildReview, enrichReview, gradeEvidence, codeDiffDiagnostics } from \"./review/build-review\";\nexport {\n  assembleCodeDiff,\n  type CodeDiffSidecar,\n  type CodeDiffSidecarAnnotation,\n} from \"./review/code-diff-sidecar\";\nexport { parseUnifiedDiff, createAnchor, relocateAnchor } from \"./review/diff-anchor\";\nexport type {\n  DiffAnchor,\n  AnchorResolution,\n  AnchorState,\n  FileDiff,\n  DiffHunk,\n  DiffLine,\n} from \"./types/diff\";\nexport {\n  deriveAudience,\n  deriveChangeType,\n  isReviewableSource,\n  isTestFile,\n} from \"./review/conventions\";\nexport {\n  ReviewMarkdownFormatter,\n  type ReviewMarkdownOptions,\n} from \"./formatters/review-markdown\";\nexport {\n  ReviewHtmlFormatter,\n  type ReviewHtmlOptions,\n} from \"./formatters/review-html\";\n\n// ============================================================================\n// Convenience Functions\n// ============================================================================\n\n// Re-export adapters\nexport { adaptJestRun, adaptVitestRun, adaptPlaywrightRun };\n\n// ============================================================================\n// Bundler Exports\n// ============================================================================\n\nexport { bundleAssets } from \"./bundler/bundle-assets\";\nexport type { BundleOptions, BundleResult } from \"./bundler/bundle-assets\";\n\n// Re-export adapter types\nexport type {\n  JestTestResult,\n  JestFileResult,\n  JestAggregatedResult,\n  StoryFileReport,\n  JestAdapterOptions,\n} from \"./converters/adapters/jest\";\nexport type {\n  VitestState,\n  VitestSerializedError,\n  VitestTestResult,\n  VitestTestCase,\n  VitestTestModule,\n  VitestAdapterOptions,\n} from \"./converters/adapters/vitest\";\nexport type {\n  PlaywrightStatus,\n  PlaywrightError,\n  PlaywrightAttachment,\n  PlaywrightTestResult,\n  PlaywrightAnnotation,\n  PlaywrightLocation,\n  PlaywrightTestCase,\n  PlaywrightAdapterOptions,\n} from \"./converters/adapters/playwright\";\n\n/**\n * Normalize Jest results to canonical TestRunResult.\n *\n * Combines adaptJestRun + canonicalizeRun.\n */\nexport function normalizeJestResults(\n  jestResults: Parameters<typeof adaptJestRun>[0],\n  storyReports: Parameters<typeof adaptJestRun>[1],\n  adapterOptions?: Parameters<typeof adaptJestRun>[2],\n  canonicalizeOptions?: CanonicalizeOptions\n): TestRunResult {\n  const raw: RawRun = adaptJestRun(jestResults, storyReports, adapterOptions);\n  return canonicalizeRun(raw, canonicalizeOptions);\n}\n\n/**\n * Normalize Vitest results to canonical TestRunResult.\n *\n * Combines adaptVitestRun + canonicalizeRun.\n */\nexport function normalizeVitestResults(\n  testModules: Parameters<typeof adaptVitestRun>[0],\n  adapterOptions?: Parameters<typeof adaptVitestRun>[1],\n  canonicalizeOptions?: CanonicalizeOptions\n): TestRunResult {\n  const raw: RawRun = adaptVitestRun(testModules, adapterOptions);\n  return canonicalizeRun(raw, canonicalizeOptions);\n}\n\n/**\n * Normalize Playwright results to canonical TestRunResult.\n *\n * Combines adaptPlaywrightRun + canonicalizeRun.\n */\nexport function normalizePlaywrightResults(\n  testResults: Parameters<typeof adaptPlaywrightRun>[0],\n  adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1],\n  canonicalizeOptions?: CanonicalizeOptions\n): TestRunResult {\n  const raw: RawRun = adaptPlaywrightRun(testResults, adapterOptions);\n  return canonicalizeRun(raw, canonicalizeOptions);\n}\n\nexport type { DeploymentEntry, DeploymentLedger } from \"./deploy/ledger\";\nexport type { DeploymentStatus, EnvironmentDrift, RecordDeploymentArgs, RecordDeploymentResult } from \"./deploy/deployments\";\nexport { recordDeployment, getDeploymentStatus, getEnvironmentDrift } from \"./deploy/deployments\";\nexport { ReleaseManifestFormatter, toReleaseManifest, type ReleaseManifest } from \"./formatters/release-manifest\";\nexport {\n  TraceabilityMatrixFormatter,\n  TraceabilityCsvFormatter,\n  toTraceabilityMatrix,\n  type TraceabilityMatrix,\n  type TraceabilityRequirement,\n} from \"./formatters/traceability-matrix\";\n","import type { DocEntry, NormalizedTicket, StoryStep } from \"executable-stories-core/types/story\";\nimport type { Attachment, TestCaseResult, TestRunResult, TestStatus } from \"executable-stories-core/types/test-result\";\n\nexport type ScenarioChangeKind =\n  | \"added\"\n  | \"removed\"\n  | \"renamed\"\n  | \"moved\"\n  | \"regressed\"\n  | \"fixed\"\n  | \"changed\"\n  | \"unchanged\";\n\nexport interface ScenarioChangeFlags {\n  status: boolean;\n  steps: boolean;\n  docs: boolean;\n  tags: boolean;\n  tickets: boolean;\n  source: boolean;\n  duration: boolean;\n  attachments: boolean;\n  error: boolean;\n  titlePath: boolean;\n}\n\nexport interface ScenarioSnapshot {\n  id: string;\n  scenario: string;\n  sourceFile: string;\n  sourceLine: number;\n  status: TestStatus;\n  durationMs: number;\n  tags: string[];\n  titlePath: string[];\n  steps: StoryStep[];\n  docs: DocEntry[];\n  tickets: NormalizedTicket[];\n  attachments: Attachment[];\n  errorMessage?: string;\n}\n\nexport interface ScenarioDiff {\n  kind: ScenarioChangeKind;\n  id: string;\n  scenario: string;\n  sourceFile: string;\n  sourceLine: number;\n  baseline?: ScenarioSnapshot;\n  current?: ScenarioSnapshot;\n  flags: ScenarioChangeFlags;\n  changedFields: string[];\n  durationDeltaMs?: number;\n  /** For `renamed`/`moved`: the baseline test-case id this behaviour was matched from. */\n  previousId?: string;\n  /** For `renamed`/`moved`: match confidence in 0..1 (1 = exact content fingerprint). */\n  matchConfidence?: number;\n  /** For `renamed`/`moved`: how the baseline/current pair was re-identified. */\n  matchedBy?: \"fingerprint\" | \"similarity\";\n}\n\nexport interface RunDiffSummary {\n  totalBaseline: number;\n  totalCurrent: number;\n  added: number;\n  removed: number;\n  /** Behaviours re-identified across a title change (content preserved). */\n  renamed: number;\n  /** Behaviours re-identified across a file move (content preserved). */\n  moved: number;\n  changed: number;\n  regressed: number;\n  fixed: number;\n  unchanged: number;\n  /**\n   * Baseline scenarios skipped because the current run is partial and never\n   * touched their source file. Always 0 for a full-run diff.\n   */\n  notRun: number;\n}\n\nexport interface RunDiffResult {\n  baseline: TestRunResult;\n  current: TestRunResult;\n  summary: RunDiffSummary;\n  scenarios: ScenarioDiff[];\n}\n\nexport type CompareFormat = \"html\" | \"markdown\" | \"changelog\";\n\nexport interface CompareFormatterOptions {\n  title?: string;\n}\n\nexport function toScenarioSnapshot(tc: TestCaseResult): ScenarioSnapshot {\n  return {\n    id: tc.id,\n    scenario: tc.story.scenario,\n    sourceFile: tc.sourceFile,\n    sourceLine: tc.sourceLine,\n    status: tc.status,\n    durationMs: tc.durationMs,\n    tags: tc.tags,\n    titlePath: tc.titlePath,\n    steps: tc.story.steps,\n    docs: tc.story.docs ?? [],\n    tickets: tc.story.tickets ?? [],\n    attachments: tc.attachments,\n    errorMessage: tc.errorMessage,\n  };\n}\n","import type { TestCaseResult, TestRunResult } from \"executable-stories-core/types/test-result\";\nimport type {\n  RunDiffResult,\n  ScenarioChangeFlags,\n  ScenarioChangeKind,\n  ScenarioDiff,\n} from \"../types/compare\";\nimport { toScenarioSnapshot } from \"../types/compare\";\nimport {\n  behaviourFingerprint, pairByFingerprint,\n  behaviourSimilarity,\n  type BehaviourIdentityInput,\n} from \"executable-stories-core/converters/acl/ids\";\n\nfunction compareStringArrays(a: string[], b: string[]): boolean {\n  if (a.length !== b.length) return false;\n  return a.every((value, index) => value === b[index]);\n}\n\nfunction stableJson(value: unknown): string {\n  return JSON.stringify(value);\n}\n\nfunction isFailedStatus(status: TestCaseResult[\"status\"]): boolean {\n  return status === \"failed\";\n}\n\nfunction getPrimaryKind(\n  baseline: TestCaseResult,\n  current: TestCaseResult,\n  hasChanges: boolean\n): ScenarioChangeKind {\n  if (isFailedStatus(current.status) && !isFailedStatus(baseline.status)) {\n    return \"regressed\";\n  }\n  if (!isFailedStatus(current.status) && isFailedStatus(baseline.status)) {\n    return \"fixed\";\n  }\n  return hasChanges ? \"changed\" : \"unchanged\";\n}\n\nfunction buildFlags(\n  baseline: TestCaseResult,\n  current: TestCaseResult\n): ScenarioChangeFlags {\n  const baselineDocs = baseline.story.docs ?? [];\n  const currentDocs = current.story.docs ?? [];\n\n  return {\n    status: baseline.status !== current.status,\n    steps: stableJson(baseline.story.steps) !== stableJson(current.story.steps),\n    docs: stableJson(baselineDocs) !== stableJson(currentDocs),\n    tags: !compareStringArrays(baseline.tags, current.tags),\n    tickets: stableJson(baseline.story.tickets ?? []) !== stableJson(current.story.tickets ?? []),\n    source:\n      baseline.sourceFile !== current.sourceFile ||\n      baseline.sourceLine !== current.sourceLine,\n    duration: baseline.durationMs !== current.durationMs,\n    attachments:\n      stableJson(baseline.attachments) !== stableJson(current.attachments),\n    error:\n      (baseline.errorMessage ?? \"\") !== (current.errorMessage ?? \"\"),\n    titlePath: !compareStringArrays(baseline.titlePath, current.titlePath),\n  };\n}\n\nfunction sortDiffs(scenarios: ScenarioDiff[]): ScenarioDiff[] {\n  const rank: Record<ScenarioChangeKind, number> = {\n    regressed: 0,\n    fixed: 1,\n    added: 2,\n    removed: 3,\n    renamed: 4,\n    moved: 5,\n    changed: 6,\n    unchanged: 7,\n  };\n\n  return [...scenarios].sort((a, b) => {\n    if (rank[a.kind] !== rank[b.kind]) {\n      return rank[a.kind] - rank[b.kind];\n    }\n    if (a.sourceFile !== b.sourceFile) {\n      return a.sourceFile.localeCompare(b.sourceFile);\n    }\n    if (a.sourceLine !== b.sourceLine) {\n      return a.sourceLine - b.sourceLine;\n    }\n    return a.scenario.localeCompare(b.scenario);\n  });\n}\n\n/** Only re-pair fuzzy matches at or above this content similarity (0..1). */\nconst SIMILARITY_THRESHOLD = 0.75;\n\nfunction identityInput(tc: TestCaseResult): BehaviourIdentityInput {\n  return {\n    scenario: tc.story.scenario,\n    sourceFile: tc.sourceFile,\n    steps: tc.story.steps,\n    covers: tc.story.covers,\n  };\n}\n\nfunction changedFieldsOf(flags: ScenarioChangeFlags): string[] {\n  return Object.entries(flags)\n    .filter(([, changed]) => changed)\n    .map(([field]) => field);\n}\n\n/** Flags for a wholesale add/remove — every dimension differs from nothing. */\nfunction allChangedFlags(errorMessage?: string): ScenarioChangeFlags {\n  return {\n    status: true,\n    steps: true,\n    docs: true,\n    tags: true,\n    tickets: true,\n    source: true,\n    duration: true,\n    attachments: true,\n    error: Boolean(errorMessage),\n    titlePath: true,\n  };\n}\n\ninterface IdentityPair {\n  before: TestCaseResult;\n  after: TestCaseResult;\n  confidence: number;\n  matchedBy: \"fingerprint\" | \"similarity\";\n}\n\n/**\n * Re-pair id-unmatched removals and additions that are the same behaviour relabelled or\n * relocated. Conservative by design — a wrong pairing would hide a real deletion inside a\n * release gate, so we only match (1) one-to-one exact content fingerprints, then (2) a\n * unique fuzzy best above {@link SIMILARITY_THRESHOLD}. Anything ambiguous stays add/remove.\n */\nfunction matchIdentities(\n  removed: TestCaseResult[],\n  added: TestCaseResult[]\n): { pairs: IdentityPair[]; unmatchedRemoved: TestCaseResult[]; unmatchedAdded: TestCaseResult[] } {\n  const pairs: IdentityPair[] = [];\n  const remainingRemoved = new Set(removed);\n  const remainingAdded = new Set(added);\n\n  // Pass 1 — exact content fingerprint. `pairByFingerprint` carries the rules\n  // (the empty fingerprint never matches, and an ambiguous group is declined\n  // rather than guessed) so every consumer of behaviourFingerprint agrees on\n  // what counts as a rename.\n  for (const { removed: before, added: after } of pairByFingerprint(\n    [...remainingRemoved],\n    [...remainingAdded],\n    (tc) => behaviourFingerprint(identityInput(tc)),\n  )) {\n    pairs.push({ before, after, confidence: 1, matchedBy: \"fingerprint\" });\n    remainingRemoved.delete(before);\n    remainingAdded.delete(after);\n  }\n\n  // Pass 2 — guarded fuzzy: a unique best match above threshold.\n  for (const before of [...remainingRemoved]) {\n    let best: TestCaseResult | undefined;\n    let bestScore = 0;\n    let tied = false;\n    for (const after of remainingAdded) {\n      const score = behaviourSimilarity(identityInput(before), identityInput(after));\n      if (score > bestScore) {\n        bestScore = score;\n        best = after;\n        tied = false;\n      } else if (score === bestScore) {\n        tied = true;\n      }\n    }\n    if (best && !tied && bestScore >= SIMILARITY_THRESHOLD) {\n      pairs.push({ before, after: best, confidence: Math.round(bestScore * 100) / 100, matchedBy: \"similarity\" });\n      remainingRemoved.delete(before);\n      remainingAdded.delete(best);\n    }\n  }\n\n  return {\n    pairs,\n    unmatchedRemoved: [...remainingRemoved],\n    unmatchedAdded: [...remainingAdded],\n  };\n}\n\n/** A content-preserving identity change is a move when only the file differs, else a rename. */\nfunction identityKind(before: TestCaseResult, after: TestCaseResult): \"renamed\" | \"moved\" {\n  const titleChanged = before.story.scenario !== after.story.scenario;\n  const fileChanged = before.sourceFile !== after.sourceFile;\n  return fileChanged && !titleChanged ? \"moved\" : \"renamed\";\n}\n\nexport interface DiffRunsOptions {\n  /**\n   * The current run covers only some test files (a filtered local run, a CI\n   * shard, or a push from a watch session). A baseline scenario in a file the\n   * current run never touched is then \"not run\", not \"removed\" — without this\n   * a one-file run against a full baseline reports the whole suite as deleted.\n   *\n   * Deliberately opt-in: a file that is absent because it was deleted looks\n   * exactly like a file that is absent because it was not selected, and\n   * guessing wrong hides a real deletion from a release gate.\n   */\n  partialCurrent?: boolean;\n}\n\nexport function diffRuns(\n  baseline: TestRunResult,\n  current: TestRunResult,\n  options: DiffRunsOptions = {}\n): RunDiffResult {\n  const baselineById = new Map(baseline.testCases.map((tc) => [tc.id, tc]));\n  const currentById = new Map(current.testCases.map((tc) => [tc.id, tc]));\n  const ids = new Set([...baselineById.keys(), ...currentById.keys()]);\n\n  // The current run's own scenarios define its scope: the files it covered.\n  const coveredFiles = options.partialCurrent\n    ? new Set(current.testCases.map((tc) => tc.sourceFile))\n    : undefined;\n\n  const scenarios: ScenarioDiff[] = [];\n  const removedCases: TestCaseResult[] = [];\n  const addedCases: TestCaseResult[] = [];\n  let notRun = 0;\n\n  // First pass: id-matched scenarios diff in place; id-unique ones are collected so we can\n  // try to re-pair renames/moves before declaring them genuine additions/deletions.\n  for (const id of ids) {\n    const before = baselineById.get(id);\n    const after = currentById.get(id);\n\n    if (!before && after) {\n      addedCases.push(after);\n      continue;\n    }\n    if (before && !after) {\n      // Out of a partial run's scope: not observed, so nothing can be said about\n      // it. It also stays out of rename/move matching, since the file that would\n      // prove the move was never run.\n      if (coveredFiles && !coveredFiles.has(before.sourceFile)) {\n        notRun += 1;\n        continue;\n      }\n      removedCases.push(before);\n      continue;\n    }\n    if (!before || !after) continue;\n\n    const flags = buildFlags(before, after);\n    const changedFields = changedFieldsOf(flags);\n    const kind = getPrimaryKind(before, after, changedFields.length > 0);\n\n    scenarios.push({\n      kind,\n      id,\n      scenario: after.story.scenario,\n      sourceFile: after.sourceFile,\n      sourceLine: after.sourceLine,\n      baseline: toScenarioSnapshot(before),\n      current: toScenarioSnapshot(after),\n      flags,\n      changedFields,\n      durationDeltaMs: after.durationMs - before.durationMs,\n    });\n  }\n\n  // Second pass: re-pair relabelled/relocated behaviours so a rename is not a false\n  // delete + add. Matched pairs become `renamed`/`moved`; leftovers stay added/removed.\n  const { pairs, unmatchedRemoved, unmatchedAdded } = matchIdentities(removedCases, addedCases);\n\n  for (const { before, after, confidence, matchedBy } of pairs) {\n    const flags = buildFlags(before, after);\n    scenarios.push({\n      kind: identityKind(before, after),\n      id: after.id,\n      previousId: before.id,\n      scenario: after.story.scenario,\n      sourceFile: after.sourceFile,\n      sourceLine: after.sourceLine,\n      baseline: toScenarioSnapshot(before),\n      current: toScenarioSnapshot(after),\n      flags,\n      changedFields: changedFieldsOf(flags),\n      durationDeltaMs: after.durationMs - before.durationMs,\n      matchConfidence: confidence,\n      matchedBy,\n    });\n  }\n\n  for (const after of unmatchedAdded) {\n    const flags = allChangedFlags(after.errorMessage);\n    scenarios.push({\n      kind: \"added\",\n      id: after.id,\n      scenario: after.story.scenario,\n      sourceFile: after.sourceFile,\n      sourceLine: after.sourceLine,\n      current: toScenarioSnapshot(after),\n      flags,\n      changedFields: changedFieldsOf(flags),\n    });\n  }\n\n  for (const before of unmatchedRemoved) {\n    const flags = allChangedFlags(before.errorMessage);\n    scenarios.push({\n      kind: \"removed\",\n      id: before.id,\n      scenario: before.story.scenario,\n      sourceFile: before.sourceFile,\n      sourceLine: before.sourceLine,\n      baseline: toScenarioSnapshot(before),\n      flags,\n      changedFields: changedFieldsOf(flags),\n    });\n  }\n\n  const sorted = sortDiffs(scenarios);\n  const summary = {\n    totalBaseline: baseline.testCases.length,\n    totalCurrent: current.testCases.length,\n    added: sorted.filter((s) => s.kind === \"added\").length,\n    removed: sorted.filter((s) => s.kind === \"removed\").length,\n    renamed: sorted.filter((s) => s.kind === \"renamed\").length,\n    moved: sorted.filter((s) => s.kind === \"moved\").length,\n    changed: sorted.filter((s) => s.kind === \"changed\").length,\n    regressed: sorted.filter((s) => s.kind === \"regressed\").length,\n    fixed: sorted.filter((s) => s.kind === \"fixed\").length,\n    unchanged: sorted.filter((s) => s.kind === \"unchanged\").length,\n    notRun,\n  };\n\n  return {\n    baseline,\n    current,\n    summary,\n    scenarios: sorted,\n  };\n}\n\n","import type { TestRunResult } from \"executable-stories-core/types/test-result\";\n\nimport type { RunDiffResult, ScenarioChangeKind, ScenarioDiff } from \"../types/compare\";\n\nexport interface RunDiffChangelogOptions {\n  title?: string;\n}\n\n/**\n * Release-notes sections in reader order: what the release delivers first,\n * then what it repaired, broke, and dropped; refactors last because they\n * change no behavior.\n */\nconst SECTIONS: Array<{ kinds: ScenarioChangeKind[]; heading: string }> = [\n  { kinds: [\"added\"], heading: \"New behavior\" },\n  { kinds: [\"fixed\"], heading: \"Fixed\" },\n  { kinds: [\"regressed\"], heading: \"Broken\" },\n  { kinds: [\"removed\"], heading: \"Removed\" },\n  { kinds: [\"renamed\", \"moved\"], heading: \"Renamed or moved\" },\n  { kinds: [\"changed\"], heading: \"Changed\" },\n];\n\nfunction describeRun(run: TestRunResult): string {\n  const parts: string[] = [];\n  if (run.packageVersion) parts.push(run.packageVersion);\n  const sha = run.gitSha ?? run.ci?.commitSha;\n  if (sha) parts.push(`\\`${sha.slice(0, 8)}\\``);\n  parts.push(new Date(run.startedAtMs).toISOString().slice(0, 10));\n  return parts.join(\" · \");\n}\n\nfunction scenarioLine(diff: ScenarioDiff): string {\n  const title = diff.current?.scenario ?? diff.scenario;\n  const source = `\\`${diff.sourceFile}\\``;\n  switch (diff.kind) {\n    case \"renamed\":\n      return `- ${diff.baseline?.scenario ?? \"?\"} → **${title}** (${source})`;\n    case \"moved\":\n      return `- **${title}** moved from \\`${diff.baseline?.sourceFile ?? \"?\"}\\` to ${source}`;\n    case \"regressed\":\n      return `- **${title}** (${source})${diff.current?.errorMessage ? ` — ${firstLine(diff.current.errorMessage)}` : \"\"}`;\n    case \"changed\":\n      return `- **${title}** (${source}) — ${diff.changedFields.join(\", \")}`;\n    default:\n      return `- **${title}** (${source})`;\n  }\n}\n\nfunction firstLine(text: string): string {\n  return text.split(\"\\n\", 1)[0]!.trim();\n}\n\n/**\n * Behavior changelog between two runs: release-notes-style Markdown built\n * from the same RunDiffResult as `compare`'s review outputs, but written for\n * the reader of a release (\"what can the product do now\") rather than the\n * reviewer of a diff. New behaviors include their Given/When/Then steps so\n * the entry reads as a specification, not a test name.\n */\nexport class RunDiffChangelogFormatter {\n  private readonly title: string;\n\n  constructor(options: RunDiffChangelogOptions = {}) {\n    this.title = options.title ?? \"Behavior Changelog\";\n  }\n\n  format(diff: RunDiffResult): string {\n    const lines: string[] = [];\n    lines.push(`# ${this.title}`);\n    lines.push(\"\");\n    lines.push(`${describeRun(diff.baseline)} → ${describeRun(diff.current)}`);\n    if (diff.current.ci?.branch) lines.push(`Branch: \\`${diff.current.ci.branch}\\``);\n    lines.push(\"\");\n\n    let hasEntries = false;\n    for (const section of SECTIONS) {\n      const scenarios = diff.scenarios.filter((s) => section.kinds.includes(s.kind));\n      if (scenarios.length === 0) continue;\n      hasEntries = true;\n\n      lines.push(`## ${section.heading} (${scenarios.length})`);\n      lines.push(\"\");\n      for (const scenario of scenarios) {\n        lines.push(scenarioLine(scenario));\n        if (scenario.kind === \"added\" && scenario.current) {\n          for (const step of scenario.current.steps) {\n            lines.push(`  - _${step.keyword}_ ${step.text}`);\n          }\n        }\n      }\n      lines.push(\"\");\n    }\n\n    if (!hasEntries) {\n      lines.push(\"No behavior changes between these runs.\");\n      lines.push(\"\");\n    }\n\n    lines.push(`_${diff.summary.unchanged} unchanged scenario${diff.summary.unchanged === 1 ? \"\" : \"s\"}._`);\n\n    return lines.join(\"\\n\");\n  }\n}\n","import type { RunDiffResult, ScenarioDiff } from \"../types/compare\";\nimport type { DocEntry, StoryStep } from \"executable-stories-core/types/story\";\nimport { isLocalFsPath, safeImageUrl } from \"executable-stories-core\";\nimport { REPORT_THEME_CSS } from \"./report-theme-css\";\nimport { REPORT_FAVICON_LINK } from \"executable-stories-core/utils/report-favicon\";\n\nexport interface RunDiffHtmlOptions {\n  title?: string;\n  /** Enable dark mode toggle. Default: true */\n  darkMode?: boolean;\n}\n\nfunction escapeHtml(value: string): string {\n  return value\n    .replace(/&/g, \"&amp;\")\n    .replace(/</g, \"&lt;\")\n    .replace(/>/g, \"&gt;\")\n    .replace(/\"/g, \"&quot;\");\n}\n\nfunction statusLabel(kind: ScenarioDiff[\"kind\"]): string {\n  switch (kind) {\n    case \"regressed\":\n      return \"Regressed\";\n    case \"fixed\":\n      return \"Fixed\";\n    case \"added\":\n      return \"Added\";\n    case \"removed\":\n      return \"Removed\";\n    case \"renamed\":\n      return \"Renamed\";\n    case \"moved\":\n      return \"Moved\";\n    case \"changed\":\n      return \"Changed\";\n    default:\n      return \"Unchanged\";\n  }\n}\n\nfunction formatStep(step: StoryStep): string {\n  let content = `<strong>${escapeHtml(step.keyword)}</strong> ${escapeHtml(step.text)}`;\n  if (step.mode && step.mode !== \"normal\") {\n    content += ` <span class=\"field-pill\">${escapeHtml(step.mode)}</span>`;\n  }\n  if (step.docs && step.docs.length > 0) {\n    content += `<ul class=\"doc-list\">${step.docs.map((d) => `<li>${formatDocEntry(d)}</li>`).join(\"\")}</ul>`;\n  }\n  return `<li>${content}</li>`;\n}\n\nfunction formatSteps(steps: StoryStep[]): string {\n  if (steps.length === 0) return \"&nbsp;\";\n  return `<ul class=\"step-list\">${steps.map(formatStep).join(\"\")}</ul>`;\n}\n\nfunction formatDocEntry(doc: DocEntry): string {\n  switch (doc.kind) {\n    case \"note\":\n      return escapeHtml(doc.text);\n    case \"tag\":\n      return escapeHtml(doc.names.join(\", \"));\n    case \"kv\":\n      return `${escapeHtml(doc.label)}: ${escapeHtml(typeof doc.value === \"object\" && doc.value !== null ? JSON.stringify(doc.value) : String(doc.value))}`;\n    case \"code\":\n      return `${escapeHtml(doc.label)}${doc.lang ? ` (${escapeHtml(doc.lang)})` : \"\"}: <code>${escapeHtml(doc.content)}</code>`;\n    case \"table\": {\n      const header = `<tr>${doc.columns.map((c) => `<th>${escapeHtml(c)}</th>`).join(\"\")}</tr>`;\n      const rows = doc.rows.map((row) => `<tr>${row.map((cell) => `<td>${escapeHtml(cell)}</td>`).join(\"\")}</tr>`).join(\"\");\n      return `${escapeHtml(doc.label)}<table>${header}${rows}</table>`;\n    }\n    case \"link\":\n      return `${escapeHtml(doc.label)}: ${escapeHtml(doc.url)}`;\n    case \"section\":\n      return `${escapeHtml(doc.title)}: ${escapeHtml(doc.markdown)}`;\n    case \"mermaid\":\n      return `${escapeHtml(doc.title ?? \"mermaid diagram\")}: <code>${escapeHtml(doc.code)}</code>`;\n    case \"screenshot\":\n      return `${doc.alt ? `${escapeHtml(doc.alt)}: ` : \"\"}${escapeHtml(doc.path)}`;\n    case \"video\":\n      return `${doc.caption ? `${escapeHtml(doc.caption)}: ` : \"\"}${escapeHtml(doc.path)}`;\n    case \"html\":\n      return `${doc.title ? `${escapeHtml(doc.title)}: ` : \"\"}${escapeHtml(doc.url ?? doc.path ?? \"(inline html)\")}`;\n    case \"custom\":\n      return `${escapeHtml(doc.type)}: ${escapeHtml(JSON.stringify(doc.data))}`;\n    case \"state\":\n      return `${escapeHtml(doc.label ?? \"State\")}: <code>${escapeHtml(JSON.stringify(doc.value) ?? \"null\")}</code>`;\n  }\n}\n\nfunction formatDocs(docs: DocEntry[]): string {\n  if (docs.length === 0) return \"&nbsp;\";\n  return `<ul class=\"doc-list\">${docs.map((d) => `<li>${formatDocEntry(d)}</li>`).join(\"\")}</ul>`;\n}\n\n/** Depth-first search for the first screenshot doc on a step (covers grouped docs). */\nfunction firstScreenshot(docs: DocEntry[]): { path: string; alt?: string } | undefined {\n  for (const doc of docs) {\n    if (doc.kind === \"screenshot\") return doc;\n    if (doc.children) {\n      const nested = firstScreenshot(doc.children);\n      if (nested) return nested;\n    }\n  }\n  return undefined;\n}\n\n/**\n * Regression storyboard: for scenarios whose status flipped (regressed/fixed),\n * render the current run's step screenshots as a filmstrip so triage starts\n * from what the product looked like, not a stack trace. Frames come from the\n * same step-attached screenshots the report filmstrip uses; steps without a\n * browser-renderable screenshot contribute no frame.\n */\nfunction renderStoryboardStrip(scenario: ScenarioDiff): string {\n  if (scenario.kind !== \"regressed\" && scenario.kind !== \"fixed\") return \"\";\n  const steps = (scenario.current ?? scenario.baseline)?.steps ?? [];\n  const frames: string[] = [];\n  for (const step of steps) {\n    const shot = firstScreenshot(step.docs ?? []);\n    if (!shot || isLocalFsPath(shot.path)) continue;\n    const src = safeImageUrl(shot.path);\n    if (!src) continue;\n    frames.push(\n      `<figure class=\"storyboard-frame\"><img src=\"${escapeHtml(src)}\" alt=\"${escapeHtml(shot.alt ?? step.text)}\" loading=\"lazy\" /><figcaption><strong>${escapeHtml(step.keyword)}</strong> ${escapeHtml(step.text)}</figcaption></figure>`,\n    );\n  }\n  if (frames.length === 0) return \"\";\n  return `<div class=\"storyboard\" aria-label=\"Storyboard\">${frames.join(\"\")}</div>`;\n}\n\nfunction renderScenarioCard(scenario: ScenarioDiff): string {\n  const before = scenario.baseline;\n  const after = scenario.current;\n  const durationDelta = scenario.durationDeltaMs\n    ? `${scenario.durationDeltaMs > 0 ? \"+\" : \"\"}${scenario.durationDeltaMs}ms`\n    : \"\";\n\n  return `\n    <article class=\"scenario-card\" data-kind=\"${scenario.kind}\" data-search=\"${escapeHtml(\n      `${scenario.scenario} ${scenario.sourceFile} ${scenario.changedFields.join(\" \")}`\n    ).toLowerCase()}\">\n      <header class=\"scenario-header\">\n        <div>\n          <span class=\"kind-badge kind-${scenario.kind}\">${statusLabel(scenario.kind)}</span>\n          <h3>${escapeHtml(scenario.scenario)}</h3>\n          <p class=\"source\">${escapeHtml(`${scenario.sourceFile}:${scenario.sourceLine}`)}</p>\n        </div>\n        <div class=\"meta\">\n          ${\n            before && after\n              ? `<div class=\"status-pair\"><span>${escapeHtml(before.status)}</span><span>&rarr;</span><span>${escapeHtml(after.status)}</span></div>`\n              : before\n                ? `<div class=\"status-pair\"><span>${escapeHtml(before.status)}</span><span>&rarr;</span><span>removed</span></div>`\n                : `<div class=\"status-pair\"><span>new</span><span>&rarr;</span><span>${escapeHtml(after?.status ?? \"\")}</span></div>`\n          }\n          ${durationDelta ? `<div class=\"duration-delta\">${escapeHtml(durationDelta)}</div>` : \"\"}\n        </div>\n      </header>\n      ${renderStoryboardStrip(scenario)}\n      ${\n        scenario.changedFields.length > 0\n          ? `<div class=\"field-list\">${scenario.changedFields\n              .map((field) => `<span class=\"field-pill\">${escapeHtml(field)}</span>`)\n              .join(\"\")}</div>`\n          : \"\"\n      }\n      ${\n        before && after\n          ? `<div class=\"comparison-grid\">\n              <section>\n                <h4>Baseline</h4>\n                <dl>\n                  <dt>Tags</dt>\n                  <dd>${escapeHtml(before.tags.join(\", \")) || \"&nbsp;\"}</dd>\n                  <dt>Suite</dt>\n                  <dd>${escapeHtml(before.titlePath.join(\" > \")) || \"&nbsp;\"}</dd>\n                  <dt>Error</dt>\n                  <dd>${escapeHtml(before.errorMessage ?? \"\") || \"&nbsp;\"}</dd>\n                  ${scenario.flags.steps ? `<dt>Steps</dt><dd>${formatSteps(before.steps)}</dd>` : \"\"}\n                  ${scenario.flags.docs ? `<dt>Docs</dt><dd>${formatDocs(before.docs)}</dd>` : \"\"}\n                  ${scenario.flags.tickets ? `<dt>Tickets</dt><dd>${escapeHtml(before.tickets.map(t => t.id).join(\", \")) || \"&nbsp;\"}</dd>` : \"\"}\n                </dl>\n              </section>\n              <section>\n                <h4>Current</h4>\n                <dl>\n                  <dt>Tags</dt>\n                  <dd>${escapeHtml(after.tags.join(\", \")) || \"&nbsp;\"}</dd>\n                  <dt>Suite</dt>\n                  <dd>${escapeHtml(after.titlePath.join(\" > \")) || \"&nbsp;\"}</dd>\n                  <dt>Error</dt>\n                  <dd>${escapeHtml(after.errorMessage ?? \"\") || \"&nbsp;\"}</dd>\n                  ${scenario.flags.steps ? `<dt>Steps</dt><dd>${formatSteps(after.steps)}</dd>` : \"\"}\n                  ${scenario.flags.docs ? `<dt>Docs</dt><dd>${formatDocs(after.docs)}</dd>` : \"\"}\n                  ${scenario.flags.tickets ? `<dt>Tickets</dt><dd>${escapeHtml(after.tickets.map(t => t.id).join(\", \")) || \"&nbsp;\"}</dd>` : \"\"}\n                </dl>\n              </section>\n            </div>`\n          : (() => {\n              const snapshot = after ?? before;\n              if (!snapshot) return \"\";\n              const hasTags = snapshot.tags.length > 0;\n              const hasTickets = snapshot.tickets.length > 0;\n              const hasSteps = snapshot.steps.length > 0;\n              const hasDocs = snapshot.docs.length > 0;\n              if (!hasTags && !hasTickets && !hasSteps && !hasDocs) return \"\";\n              return `<div class=\"snapshot-detail\">\n                <dl>\n                  ${hasTags ? `<dt>Tags</dt><dd>${escapeHtml(snapshot.tags.join(\", \"))}</dd>` : \"\"}\n                  ${hasTickets ? `<dt>Tickets</dt><dd>${escapeHtml(snapshot.tickets.map(t => t.id).join(\", \"))}</dd>` : \"\"}\n                  ${hasSteps ? `<dt>Steps</dt><dd>${formatSteps(snapshot.steps)}</dd>` : \"\"}\n                  ${hasDocs ? `<dt>Docs</dt><dd>${formatDocs(snapshot.docs)}</dd>` : \"\"}\n                </dl>\n              </div>`;\n            })()\n      }\n    </article>\n  `;\n}\n\n/** Diff-specific CSS that references theme custom properties */\nconst DIFF_CSS = `\n      /* Diff layout — uses theme custom properties */\n      * { box-sizing: border-box; }\n      body {\n        margin: 0;\n        font-family: var(--font-sans, Georgia, \"Iowan Old Style\", serif);\n        background: var(--background);\n        color: var(--foreground);\n      }\n      main { max-width: 1200px; margin: 0 auto; padding: 32px 20px 80px; }\n      .diff-header {\n        display: flex;\n        justify-content: space-between;\n        align-items: center;\n        margin-bottom: 24px;\n      }\n      .diff-header-actions {\n        display: flex;\n        gap: 8px;\n        align-items: center;\n      }\n      .theme-toggle {\n        background: var(--secondary);\n        border: 1px solid var(--border);\n        border-radius: 8px;\n        padding: 8px 12px;\n        cursor: pointer;\n        font-size: 1.1rem;\n        color: var(--foreground);\n      }\n      .theme-toggle:hover { background: var(--accent); }\n      .hero { display: grid; gap: 16px; margin-bottom: 24px; }\n      .hero-card, .summary-card, .toolbar, .scenario-card {\n        background: var(--card);\n        border: 1px solid var(--border);\n        border-radius: var(--radius, 18px);\n        box-shadow: 0 1px 3px color-mix(in srgb, var(--foreground) 6%, transparent);\n      }\n      .hero-card { padding: 24px; }\n      h1, h2, h3, h4, p { margin: 0; }\n      .subtle { color: var(--muted-foreground); margin-top: 8px; }\n      .summary-grid {\n        display: grid;\n        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));\n        gap: 12px;\n        margin: 20px 0 24px;\n      }\n      .priority-banner {\n        padding: 18px 20px;\n        margin-bottom: 20px;\n        background: linear-gradient(135deg, color-mix(in srgb, var(--destructive) 9%, transparent), var(--card));\n      }\n      .summary-card { padding: 16px; }\n      .summary-card strong { display: block; font-size: 1.8rem; }\n      .toolbar {\n        position: sticky;\n        top: 12px;\n        z-index: 2;\n        display: flex;\n        flex-wrap: wrap;\n        gap: 10px;\n        padding: 14px;\n        margin-bottom: 20px;\n      }\n      .toolbar input {\n        flex: 1 1 260px;\n        border: 1px solid var(--border);\n        border-radius: 999px;\n        padding: 10px 14px;\n        font: inherit;\n        background: var(--background);\n        color: var(--foreground);\n      }\n      .toolbar button {\n        border: 1px solid var(--border);\n        background: var(--secondary);\n        border-radius: 999px;\n        padding: 10px 14px;\n        font: inherit;\n        cursor: pointer;\n        color: var(--foreground);\n      }\n      .toolbar button.active { background: var(--foreground); color: var(--background); }\n      .scenario-list { display: grid; gap: 14px; }\n      .scenario-card { padding: 18px; }\n      .scenario-header {\n        display: flex;\n        justify-content: space-between;\n        gap: 16px;\n        align-items: flex-start;\n      }\n      .kind-badge, .field-pill {\n        display: inline-flex;\n        align-items: center;\n        padding: 4px 10px;\n        border-radius: 999px;\n        font-size: 0.85rem;\n        margin-right: 8px;\n        margin-bottom: 8px;\n        background: var(--secondary);\n      }\n      .kind-regressed { background: color-mix(in srgb, var(--destructive) 15%, transparent); color: var(--destructive); }\n      .kind-fixed { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }\n      .kind-added { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }\n      .kind-removed { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }\n      .kind-changed { background: color-mix(in srgb, var(--ring, var(--primary)) 15%, transparent); color: var(--ring, var(--primary)); }\n      .source, .meta, dd { color: var(--muted-foreground); }\n      .status-pair { display: flex; gap: 8px; justify-content: flex-end; font-family: var(--font-mono, ui-monospace, monospace); }\n      .duration-delta { margin-top: 8px; text-align: right; color: var(--muted-foreground); }\n      .field-list { margin-top: 10px; }\n      .storyboard {\n        display: flex;\n        gap: 10px;\n        overflow-x: auto;\n        margin-top: 14px;\n        padding-bottom: 6px;\n      }\n      .storyboard-frame {\n        flex: 0 0 auto;\n        width: 220px;\n        margin: 0;\n        border: 1px solid var(--border);\n        border-radius: var(--radius, 10px);\n        overflow: hidden;\n        background: color-mix(in srgb, var(--card) 60%, var(--background));\n      }\n      .storyboard-frame img { width: 100%; height: 130px; object-fit: cover; object-position: top; display: block; }\n      .storyboard-frame figcaption {\n        padding: 6px 10px;\n        font-size: 0.8rem;\n        color: var(--muted-foreground);\n        white-space: nowrap;\n        overflow: hidden;\n        text-overflow: ellipsis;\n      }\n      .comparison-grid {\n        display: grid;\n        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n        gap: 12px;\n        margin-top: 16px;\n      }\n      .comparison-grid section {\n        background: color-mix(in srgb, var(--card) 60%, var(--background));\n        border: 1px solid var(--border);\n        border-radius: var(--radius, 14px);\n        padding: 12px;\n      }\n      dl {\n        margin: 10px 0 0;\n        display: grid;\n        grid-template-columns: minmax(70px, 90px) 1fr;\n        gap: 8px 12px;\n      }\n      @media (max-width: 720px) {\n        .scenario-header { flex-direction: column; }\n        .status-pair, .duration-delta { text-align: left; justify-content: flex-start; }\n      }\n`;\n\n/** Theme toggle JavaScript */\nconst JS_THEME_TOGGLE = `\nfunction getSystemTheme() {\n  return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n}\nfunction getEffectiveTheme() {\n  var saved = localStorage.getItem('diff-theme');\n  if (saved === 'dark' || saved === 'light') return saved;\n  return getSystemTheme();\n}\nfunction toggleTheme() {\n  var current = getEffectiveTheme();\n  var next = current === 'dark' ? 'light' : 'dark';\n  localStorage.setItem('diff-theme', next);\n  applyTheme(next);\n}\nfunction applyTheme(theme) {\n  document.documentElement.setAttribute('data-theme', theme);\n  var btn = document.querySelector('.theme-toggle');\n  if (btn) {\n    btn.textContent = theme === 'dark' ? '\\\\u2600\\\\ufe0f' : '\\\\ud83c\\\\udf19';\n    btn.setAttribute('aria-label', theme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode');\n  }\n}\n`;\n\nexport class RunDiffHtmlFormatter {\n  private title: string;\n  private darkMode: boolean;\n\n  constructor(options: RunDiffHtmlOptions = {}) {\n    this.title = options.title ?? \"Run Comparison\";\n    this.darkMode = options.darkMode ?? true;\n  }\n\n  format(diff: RunDiffResult): string {\n    const defaultFilter: \"all\" | \"regressed\" | \"fixed\" | \"added\" | \"removed\" | \"changed\" =\n      diff.summary.regressed > 0\n        ? \"regressed\"\n        : diff.summary.fixed > 0\n          ? \"fixed\"\n          : \"all\";\n    const scenarios = diff.scenarios\n      .filter((scenario) => scenario.kind !== \"unchanged\")\n      .map((scenario) => renderScenarioCard(scenario))\n      .join(\"\\n\");\n\n    const themeToggleHtml = this.darkMode\n      ? `<div class=\"diff-header-actions\"><button type=\"button\" class=\"theme-toggle\" onclick=\"toggleTheme()\" aria-label=\"Toggle theme\"></button></div>`\n      : \"\";\n\n    const themeInitJs = this.darkMode\n      ? `${JS_THEME_TOGGLE}\\napplyTheme(getEffectiveTheme());\\nwindow.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function() { if (!localStorage.getItem('diff-theme')) applyTheme(getSystemTheme()); });`\n      : \"\";\n\n    const themeAttr = this.darkMode ? ' data-theme=\"light\"' : '';\n\n    return `<!doctype html>\n<html lang=\"en\"${themeAttr}>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    ${REPORT_FAVICON_LINK}\n    <title>${escapeHtml(this.title)}</title>\n    <style>\n      ${REPORT_THEME_CSS}\n      ${DIFF_CSS}\n    </style>\n  </head>\n  <body>\n    <main>\n      <section class=\"hero\">\n        <div class=\"hero-card\">\n          <div class=\"diff-header\">\n            <h1>${escapeHtml(this.title)}</h1>\n            ${themeToggleHtml}\n          </div>\n          <p class=\"subtle\">Baseline ${escapeHtml(new Date(diff.baseline.startedAtMs).toISOString())} against current ${escapeHtml(new Date(diff.current.startedAtMs).toISOString())}</p>\n        </div>\n      </section>\n      <section class=\"summary-grid\">\n        <div class=\"summary-card\"><strong>${diff.summary.regressed}</strong><span>Regressed</span></div>\n        <div class=\"summary-card\"><strong>${diff.summary.fixed}</strong><span>Fixed</span></div>\n        <div class=\"summary-card\"><strong>${diff.summary.added}</strong><span>Added</span></div>\n        <div class=\"summary-card\"><strong>${diff.summary.removed}</strong><span>Removed</span></div>\n        <div class=\"summary-card\"><strong>${diff.summary.renamed}</strong><span>Renamed</span></div>\n        <div class=\"summary-card\"><strong>${diff.summary.moved}</strong><span>Moved</span></div>\n        <div class=\"summary-card\"><strong>${diff.summary.changed}</strong><span>Changed</span></div>\n        <div class=\"summary-card\"><strong>${diff.summary.unchanged}</strong><span>Unchanged</span></div>\n        ${diff.summary.notRun > 0 ? `<div class=\"summary-card\"><strong>${diff.summary.notRun}</strong><span>Not run</span></div>` : \"\"}\n      </section>\n      <section class=\"hero-card priority-banner\">\n        <h2>Priority Review</h2>\n        <p class=\"subtle\">${\n          diff.summary.regressed > 0\n            ? `${diff.summary.regressed} regression(s) detected. The view is pre-filtered to regressions.`\n            : diff.summary.fixed > 0\n              ? `No regressions detected. The view is pre-filtered to fixed scenarios.`\n              : \"No regressions or fixes detected. Review neutral changes as needed.\"\n        }</p>\n      </section>\n      <section class=\"toolbar\">\n        <input type=\"search\" placeholder=\"Filter by scenario, file, or changed field\" aria-label=\"Filter scenarios\" />\n        <button type=\"button\" class=\"${defaultFilter === \"all\" ? \"active\" : \"\"}\" data-filter=\"all\">All</button>\n        <button type=\"button\" class=\"${defaultFilter === \"regressed\" ? \"active\" : \"\"}\" data-filter=\"regressed\">Regressed</button>\n        <button type=\"button\" class=\"${defaultFilter === \"fixed\" ? \"active\" : \"\"}\" data-filter=\"fixed\">Fixed</button>\n        <button type=\"button\" data-filter=\"added\">Added</button>\n        <button type=\"button\" data-filter=\"removed\">Removed</button>\n        <button type=\"button\" data-filter=\"changed\">Changed</button>\n      </section>\n      <section class=\"scenario-list\">${scenarios || \"<div class=\\\"hero-card\\\"><p>No scenario changes detected.</p></div>\"}</section>\n    </main>\n    <script>\n      ${themeInitJs}\n      const input = document.querySelector('input[type=\"search\"]');\n      const buttons = Array.from(document.querySelectorAll('[data-filter]'));\n      const cards = Array.from(document.querySelectorAll('.scenario-card'));\n      let activeFilter = '${defaultFilter}';\n      function applyFilters() {\n        const query = (input.value || '').trim().toLowerCase();\n        cards.forEach((card) => {\n          const kind = card.getAttribute('data-kind');\n          const haystack = card.getAttribute('data-search') || '';\n          const matchesFilter = activeFilter === 'all' || kind === activeFilter;\n          const matchesSearch = !query || haystack.includes(query);\n          card.style.display = matchesFilter && matchesSearch ? '' : 'none';\n        });\n      }\n      // Filter state lives in the URL fragment so a refresh keeps the view and\n      // the link can be shared. The fragment, not the query string: this file is\n      // usually opened from disk, where Chrome blocks History API URL changes.\n      function writeUrl() {\n        const params = new URLSearchParams();\n        if (input.value) params.set('q', input.value);\n        if (activeFilter !== 'all') params.set('kind', activeFilter);\n        const next = params.toString() ? '#?' + params.toString() : '';\n        if (next === location.hash) return;\n        try {\n          history.replaceState(history.state, '', next || location.href.split('#')[0]);\n        } catch {\n          location.hash = next.slice(1);\n        }\n      }\n      function readUrl() {\n        const raw = location.hash.replace(/^#\\\\??/, '');\n        if (!raw) return;\n        const params = new URLSearchParams(raw);\n        input.value = params.get('q') || '';\n        const kind = params.get('kind');\n        if (kind && buttons.some((b) => b.getAttribute('data-filter') === kind)) {\n          activeFilter = kind;\n          buttons.forEach((b) => b.classList.toggle('active', b.getAttribute('data-filter') === kind));\n        }\n      }\n      let writeTimer;\n      input.addEventListener('input', () => {\n        applyFilters();\n        clearTimeout(writeTimer);\n        writeTimer = setTimeout(writeUrl, 250);\n      });\n      buttons.forEach((button) => {\n        button.addEventListener('click', () => {\n          activeFilter = button.getAttribute('data-filter');\n          buttons.forEach((candidate) => candidate.classList.toggle('active', candidate === button));\n          applyFilters();\n          writeUrl();\n        });\n      });\n      readUrl();\n      applyFilters();\n    </script>\n  </body>\n</html>`;\n  }\n}\n","/**\n * Standalone theme-token CSS for the string-built HTML reports\n * (Evidence Review `review-html` and run-diff `run-diff-html`).\n *\n * These reports build their own markup + component CSS and only need the shared\n * design tokens — the `--es-*` canonical tokens plus the shadcn-style semantic\n * tokens (`--background`, `--foreground`, `--card`, `--primary`, `--destructive`,\n * `--success`, `--warning`, `--border`, `--radius`, fonts, …) in light/dark.\n *\n * This is the source of those shadcn tokens *for the standalone string reports*\n * with their fixed cucumber palette. (The Astro docs site intentionally re-maps\n * the same token names onto its Starlight-derived `--es-*` in `es.css`, so it\n * themes with the surrounding site instead.) Dark mode follows\n * `[data-theme=\"dark\"]` and the system preference, so the reports' dark-mode\n * toggles keep working.\n *\n * Override any token on `:root` (or any ancestor of the report) to re-theme.\n */\nimport { ES_THEME_TOKENS_CSS } from \"executable-stories-core/theme/tokens\";\n\n// Dark-mode token values, defined once and emitted into both the explicit\n// `[data-theme=\"dark\"]` toggle and the system-preference fallback below — the\n// two selectors differ, but the values must not drift.\nconst DARK_TOKENS = `\n  --background: hsl(0 0% 6%);\n  --foreground: hsl(0 0% 95%);\n  --card: hsl(0 0% 9%);\n  --card-foreground: hsl(0 0% 95%);\n  --popover: hsl(0 0% 9%);\n  --popover-foreground: hsl(0 0% 95%);\n\n  --primary: hsl(145 63% 50%);\n  --primary-foreground: hsl(0 0% 6%);\n\n  --secondary: hsl(0 0% 13%);\n  --secondary-foreground: hsl(0 0% 95%);\n  --muted: hsl(0 0% 13%);\n  --muted-foreground: hsl(0 0% 55%);\n  --accent: hsl(0 0% 13%);\n  --accent-foreground: hsl(0 0% 95%);\n  --destructive: hsl(0 72% 55%);\n  --destructive-foreground: hsl(0 0% 100%);\n  --border: hsl(0 0% 16%);\n  --input: hsl(0 0% 16%);\n  --ring: hsl(145 63% 50%);\n\n  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);\n  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.35);\n  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.35);\n  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.45), 0 4px 6px -4px rgb(0 0 0 / 0.35);\n\n  --success: hsl(145 63% 55%);\n  --success-light: hsl(145 35% 14%);\n  --success-border: hsl(145 35% 22%);\n  --error: hsl(0 72% 60%);\n  --error-light: hsl(0 35% 14%);\n  --error-border: hsl(0 35% 22%);\n  --warning: hsl(38 92% 55%);\n  --warning-light: hsl(38 35% 14%);\n  --warning-border: hsl(38 35% 22%);\n  --pending: hsl(262 60% 65%);\n  --pending-light: hsl(262 25% 14%);\n  --pending-border: hsl(262 25% 22%);\n\n  --keyword-color: hsl(145 63% 60%);\n  --tag-bg: hsl(145 35% 14%);\n  --tag-color: hsl(145 63% 60%);\n  --tag-border: hsl(145 35% 22%);\n  --step-param-color: hsl(220 70% 70%);\n\n  --accordion-header-hover: hsl(0 0% 11%);\n  --accordion-content-bg: hsl(0 0% 7%);`;\n\nexport const REPORT_THEME_CSS = `\n@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');\n\n/* executable-stories canonical tokens (--es-*), shared with executable-stories-react. */\n${ES_THEME_TOKENS_CSS}\n\n/* Light mode (default) — shadcn/ui base with cucumber accent. */\n:root {\n  /* Reference the canonical --es-* tokens (defined just above via\n     ES_THEME_TOKENS_CSS) instead of restating the font stack, so the report\n     shell and the shared token contract can't drift. */\n  --font-sans: var(--es-font-body);\n  --font-mono: var(--es-font-mono);\n\n  --background: hsl(0 0% 100%);\n  --foreground: hsl(0 0% 9%);\n  --card: hsl(0 0% 100%);\n  --card-foreground: hsl(0 0% 9%);\n  --popover: hsl(0 0% 100%);\n  --popover-foreground: hsl(0 0% 9%);\n\n  --primary: hsl(145 63% 42%);\n  --primary-foreground: hsl(0 0% 100%);\n\n  --secondary: hsl(0 0% 96.5%);\n  --secondary-foreground: hsl(0 0% 9%);\n  --muted: hsl(0 0% 96.5%);\n  --muted-foreground: hsl(0 0% 45%);\n  --accent: hsl(0 0% 96.5%);\n  --accent-foreground: hsl(0 0% 9%);\n  --destructive: hsl(0 84% 60%);\n  --destructive-foreground: hsl(0 0% 100%);\n  --border: hsl(0 0% 90%);\n  --input: hsl(0 0% 90%);\n  --ring: hsl(145 63% 42%);\n  --radius: var(--es-radius);\n\n  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.03);\n  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);\n  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);\n  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);\n\n  --success: hsl(145 63% 42%);\n  --success-light: hsl(145 55% 96%);\n  --success-border: hsl(145 55% 88%);\n  --error: hsl(0 72% 51%);\n  --error-light: hsl(0 86% 97%);\n  --error-border: hsl(0 72% 92%);\n  --warning: hsl(38 92% 50%);\n  --warning-light: hsl(48 100% 96%);\n  --warning-border: hsl(48 96% 88%);\n  --pending: hsl(262 60% 55%);\n  --pending-light: hsl(262 55% 97%);\n  --pending-border: hsl(262 55% 90%);\n\n  --keyword-color: hsl(145 63% 32%);\n  --tag-bg: hsl(145 55% 95%);\n  --tag-color: hsl(145 63% 30%);\n  --tag-border: hsl(145 55% 85%);\n  --step-param-color: hsl(220 70% 50%);\n\n  --accordion-header-hover: hsl(0 0% 98%);\n  --accordion-content-bg: hsl(0 0% 98.5%);\n}\n\n/* Dark mode (explicit toggle). */\n[data-theme=\"dark\"] {${DARK_TOKENS}\n}\n\n/* Auto dark mode based on system preference (unless light is forced). */\n@media (prefers-color-scheme: dark) {\n  :root:not([data-theme=\"light\"]) {${DARK_TOKENS}\n  }\n}\n`;\n","import type { RunDiffResult, ScenarioDiff, ScenarioSnapshot } from \"../types/compare\";\nimport type { DocEntry, StoryStep } from \"executable-stories-core/types/story\";\n\nexport interface RunDiffMarkdownOptions {\n  title?: string;\n}\n\nfunction formatStatus(kind: ScenarioDiff[\"kind\"]): string {\n  switch (kind) {\n    case \"regressed\":\n      return \"Regressed\";\n    case \"fixed\":\n      return \"Fixed\";\n    case \"added\":\n      return \"Added\";\n    case \"removed\":\n      return \"Removed\";\n    case \"renamed\":\n      return \"Renamed\";\n    case \"moved\":\n      return \"Moved\";\n    case \"changed\":\n      return \"Changed\";\n    default:\n      return \"Unchanged\";\n  }\n}\n\nfunction formatDurationDelta(deltaMs?: number): string | null {\n  if (deltaMs === undefined || deltaMs === 0) return null;\n  return `${deltaMs > 0 ? \"+\" : \"\"}${deltaMs}ms`;\n}\n\nfunction renderScenario(lines: string[], scenario: ScenarioDiff): void {\n  const before = scenario.baseline;\n  const after = scenario.current;\n\n  lines.push(`## ${formatStatus(scenario.kind)}: ${scenario.scenario}`);\n  lines.push(\"\");\n  lines.push(`- File: \\`${scenario.sourceFile}:${scenario.sourceLine}\\``);\n  if (before && after) {\n    lines.push(`- Status: \\`${before.status}\\` -> \\`${after.status}\\``);\n  } else if (after) {\n    lines.push(`- Status: new \\`${after.status}\\``);\n  } else if (before) {\n    lines.push(`- Status: removed \\`${before.status}\\``);\n  }\n  if (scenario.changedFields.length > 0) {\n    lines.push(`- Changed: ${scenario.changedFields.map((field) => `\\`${field}\\``).join(\", \")}`);\n  }\n  const durationDelta = formatDurationDelta(scenario.durationDeltaMs);\n  if (durationDelta) {\n    lines.push(`- Duration delta: ${durationDelta}`);\n  }\n  lines.push(\"\");\n\n  if (before && after) {\n    lines.push(\"| Field | Baseline | Current |\");\n    lines.push(\"| --- | --- | --- |\");\n    lines.push(`| Scenario | ${escapeCell(before.scenario)} | ${escapeCell(after.scenario)} |`);\n    lines.push(`| Tags | ${escapeCell(before.tags.join(\", \"))} | ${escapeCell(after.tags.join(\", \"))} |`);\n    lines.push(`| Suite | ${escapeCell(before.titlePath.join(\" > \"))} | ${escapeCell(after.titlePath.join(\" > \"))} |`);\n    lines.push(`| Error | ${escapeCell(before.errorMessage ?? \"\")} | ${escapeCell(after.errorMessage ?? \"\")} |`);\n    if (scenario.flags.steps) {\n      lines.push(`| Steps | ${escapeCell(formatSteps(before.steps))} | ${escapeCell(formatSteps(after.steps))} |`);\n    }\n    if (scenario.flags.docs) {\n      lines.push(`| Docs | ${escapeCell(formatDocs(before.docs))} | ${escapeCell(formatDocs(after.docs))} |`);\n    }\n    if (scenario.flags.tickets) {\n      lines.push(`| Tickets | ${escapeCell(before.tickets.map(t => t.id).join(\", \"))} | ${escapeCell(after.tickets.map(t => t.id).join(\", \"))} |`);\n    }\n    lines.push(\"\");\n  } else {\n    const snapshot = after ?? before;\n    if (snapshot) {\n      renderSnapshotDetail(lines, snapshot);\n    }\n  }\n}\n\nfunction renderSnapshotDetail(lines: string[], snapshot: ScenarioSnapshot): void {\n  if (snapshot.tags.length > 0) {\n    lines.push(`**Tags:** ${snapshot.tags.join(\", \")}`);\n    lines.push(\"\");\n  }\n  if (snapshot.tickets.length > 0) {\n    lines.push(`**Tickets:** ${snapshot.tickets.map(t => t.id).join(\", \")}`);\n    lines.push(\"\");\n  }\n  if (snapshot.steps.length > 0) {\n    lines.push(\"**Steps:**\");\n    lines.push(\"\");\n    for (const step of snapshot.steps) {\n      lines.push(`- ${formatStep(step)}`);\n    }\n    lines.push(\"\");\n  }\n  if (snapshot.docs.length > 0) {\n    lines.push(\"**Docs:**\");\n    lines.push(\"\");\n    for (const doc of snapshot.docs) {\n      lines.push(`- ${formatDocEntry(doc)}`);\n    }\n    lines.push(\"\");\n  }\n}\n\nfunction escapeCell(value: string): string {\n  return value.replace(/\\|/g, \"\\\\|\").replace(/\\n/g, \"<br>\");\n}\n\nfunction formatStep(step: StoryStep): string {\n  let result = `**${step.keyword}** ${step.text}`;\n  if (step.mode && step.mode !== \"normal\") {\n    result += ` [${step.mode}]`;\n  }\n  if (step.docs && step.docs.length > 0) {\n    result += ` (${step.docs.map(formatDocEntry).join(\"; \")})`;\n  }\n  return result;\n}\n\nfunction formatSteps(steps: StoryStep[]): string {\n  if (steps.length === 0) return \"(none)\";\n  return steps.map(formatStep).join(\"; \");\n}\n\nfunction formatDocEntry(doc: DocEntry): string {\n  switch (doc.kind) {\n    case \"note\":\n      return doc.text;\n    case \"tag\":\n      return doc.names.join(\", \");\n    case \"kv\":\n      return `${doc.label}: ${typeof doc.value === \"object\" && doc.value !== null ? JSON.stringify(doc.value) : String(doc.value)}`;\n    case \"code\":\n      return `${doc.label}${doc.lang ? ` (${doc.lang})` : \"\"}: \\`${doc.content}\\``;\n    case \"table\":\n      return `${doc.label}: [${doc.columns.join(\", \")}] ${doc.rows.map((row) => row.join(\", \")).join(\"; \")}`;\n    case \"link\":\n      return `${doc.label}: ${doc.url}`;\n    case \"section\":\n      return `${doc.title}: ${doc.markdown}`;\n    case \"mermaid\":\n      return `${doc.title ?? \"mermaid diagram\"}: \\`${doc.code}\\``;\n    case \"screenshot\":\n      return `${doc.alt ? `${doc.alt}: ` : \"\"}${doc.path}`;\n    case \"video\":\n      return `${doc.caption ? `${doc.caption}: ` : \"\"}${doc.path}`;\n    case \"html\":\n      return `${doc.title ? `${doc.title}: ` : \"\"}${doc.url ?? doc.path ?? \"(inline html)\"}`;\n    case \"custom\":\n      return `${doc.type}: ${JSON.stringify(doc.data)}`;\n    case \"state\":\n      return `${doc.label ?? \"State\"}: ${JSON.stringify(doc.value) ?? \"null\"}`;\n  }\n}\n\nfunction formatDocs(docs: DocEntry[]): string {\n  if (docs.length === 0) return \"(none)\";\n  return docs.map(formatDocEntry).join(\"; \");\n}\n\nexport class RunDiffMarkdownFormatter {\n  private title: string;\n\n  constructor(options: RunDiffMarkdownOptions = {}) {\n    this.title = options.title ?? \"Run Comparison\";\n  }\n\n  format(diff: RunDiffResult): string {\n    const lines: string[] = [];\n\n    lines.push(`# ${this.title}`);\n    lines.push(\"\");\n    lines.push(`Baseline: \\`${new Date(diff.baseline.startedAtMs).toISOString()}\\``);\n    lines.push(`Current: \\`${new Date(diff.current.startedAtMs).toISOString()}\\``);\n    lines.push(\"\");\n    lines.push(\"## Review Priority\");\n    lines.push(\"\");\n    if (diff.summary.regressed > 0) {\n      lines.push(`Review regressions first: ${diff.summary.regressed} scenario(s) got worse.`);\n    } else if (diff.summary.fixed > 0) {\n      lines.push(`No regressions detected. Review ${diff.summary.fixed} fixed scenario(s) next.`);\n    } else {\n      lines.push(\"No regressions or fixes detected. Remaining changes are neutral.\");\n    }\n    lines.push(\"\");\n    lines.push(\"| Added | Removed | Renamed | Moved | Regressed | Fixed | Changed | Unchanged |\");\n    lines.push(\"| ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |\");\n    lines.push(\n      `| ${diff.summary.added} | ${diff.summary.removed} | ${diff.summary.renamed} | ${diff.summary.moved} | ${diff.summary.regressed} | ${diff.summary.fixed} | ${diff.summary.changed} | ${diff.summary.unchanged} |`\n    );\n    lines.push(\"\");\n    if (diff.summary.notRun > 0) {\n      lines.push(\n        `Partial run: ${diff.summary.notRun} baseline scenario(s) in files this run did not cover are excluded from the diff.`\n      );\n      lines.push(\"\");\n    }\n\n    for (const kind of [\"regressed\", \"fixed\", \"added\", \"removed\", \"renamed\", \"moved\", \"changed\"] as const) {\n      const scenarios = diff.scenarios.filter((scenario) => scenario.kind === kind);\n      if (scenarios.length === 0) continue;\n      lines.push(`## ${formatStatus(kind)} (${scenarios.length})`);\n      lines.push(\"\");\n      for (const scenario of scenarios) {\n        renderScenario(lines, scenario);\n      }\n    }\n\n    return lines.join(\"\\n\").trimEnd();\n  }\n}\n","/**\n * CI environment auto-detection utility.\n *\n * Detects known CI providers from environment variables and populates\n * branch, commit SHA, PR number, build number, and URL metadata.\n *\n * Precedence (checked in order, first match wins):\n *   1. TF_BUILD=True        -> azure\n *   2. BUILDKITE=true        -> buildkite\n *   3. GITHUB_ACTIONS=true   -> github\n *   4. GITLAB_CI=true        -> gitlab\n *   5. CIRCLECI=true         -> circleci\n *   6. JENKINS_URL defined   -> jenkins\n *   7. TRAVIS=true           -> travis\n *   8. CI=true               -> unknown (generic fallback; note: fires in dev shells too)\n *   9. Nothing               -> undefined (not in CI)\n */\n\nimport type { RawCIInfo } from \"executable-stories-core/types/raw\";\n\n/**\n * Detect CI environment from process.env.\n * Returns undefined when not running in CI.\n */\nexport function detectCI(\n  env: Record<string, string | undefined> = process.env,\n): RawCIInfo | undefined {\n  // 1. Azure DevOps (TF_BUILD is \"True\" with capital T)\n  if (env.TF_BUILD === \"True\") {\n    const branch = env.BUILD_SOURCEBRANCH?.replace(/^refs\\/heads\\//, \"\");\n\n    // URL requires all three components\n    const serverUri = env.SYSTEM_TEAMFOUNDATIONSERVERURI;\n    const teamProject = env.SYSTEM_TEAMPROJECT;\n    const buildId = env.BUILD_BUILDID;\n    const url =\n      serverUri && teamProject && buildId\n        ? `${serverUri}${teamProject}/_build/results?buildId=${buildId}`\n        : undefined;\n\n    return {\n      name: \"azure\",\n      provider: \"azure\",\n      buildNumber: buildId,\n      url,\n      branch,\n      commitSha: env.BUILD_SOURCEVERSION,\n      prNumber: env.SYSTEM_PULLREQUEST_PULLREQUESTID,\n    };\n  }\n\n  // 2. Buildkite\n  if (env.BUILDKITE === \"true\") {\n    const prRaw = env.BUILDKITE_PULL_REQUEST;\n    const prNumber = prRaw && prRaw !== \"false\" ? prRaw : undefined;\n\n    return {\n      name: \"buildkite\",\n      provider: \"buildkite\",\n      buildNumber: env.BUILDKITE_BUILD_NUMBER,\n      url: env.BUILDKITE_BUILD_URL,\n      branch: env.BUILDKITE_BRANCH,\n      commitSha: env.BUILDKITE_COMMIT,\n      prNumber,\n    };\n  }\n\n  // 3. GitHub Actions\n  if (env.GITHUB_ACTIONS === \"true\") {\n    const url =\n      env.GITHUB_SERVER_URL && env.GITHUB_REPOSITORY && env.GITHUB_RUN_ID\n        ? `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}`\n        : undefined;\n\n    // GITHUB_HEAD_REF is set on pull_request events; GITHUB_REF_NAME is always set\n    const branch = env.GITHUB_HEAD_REF || env.GITHUB_REF_NAME;\n\n    // Parse PR number from GITHUB_REF: refs/pull/<n>/merge or refs/pull/<n>/head\n    const prMatch = env.GITHUB_REF?.match(/^refs\\/pull\\/(\\d+)\\/(merge|head)$/);\n    const prNumber = prMatch ? prMatch[1] : undefined;\n\n    return {\n      name: \"github\",\n      provider: \"github\",\n      buildNumber: env.GITHUB_RUN_NUMBER,\n      url,\n      branch,\n      commitSha: env.GITHUB_SHA,\n      prNumber,\n    };\n  }\n\n  // 4. GitLab CI\n  if (env.GITLAB_CI === \"true\") {\n    return {\n      name: \"gitlab\",\n      provider: \"gitlab\",\n      buildNumber: env.CI_PIPELINE_IID,\n      url: env.CI_PIPELINE_URL,\n      branch: env.CI_COMMIT_REF_NAME,\n      commitSha: env.CI_COMMIT_SHA,\n      prNumber: env.CI_MERGE_REQUEST_IID,\n    };\n  }\n\n  // 5. CircleCI\n  if (env.CIRCLECI === \"true\") {\n    // Parse PR number from trailing digits of CIRCLE_PULL_REQUEST URL\n    // e.g. https://github.com/org/repo/pull/42 -> \"42\"\n    const prUrl = env.CIRCLE_PULL_REQUEST;\n    const prMatch = prUrl?.match(/\\/(\\d+)$/);\n    const prNumber = prMatch ? prMatch[1] : undefined;\n\n    return {\n      name: \"circleci\",\n      provider: \"circleci\",\n      buildNumber: env.CIRCLE_BUILD_NUM,\n      url: env.CIRCLE_BUILD_URL,\n      branch: env.CIRCLE_BRANCH,\n      commitSha: env.CIRCLE_SHA1,\n      prNumber,\n    };\n  }\n\n  // 6. Jenkins (detected by JENKINS_URL being defined, any value)\n  if (env.JENKINS_URL !== undefined) {\n    return {\n      name: \"jenkins\",\n      provider: \"jenkins\",\n      buildNumber: env.BUILD_NUMBER,\n      url: env.BUILD_URL,\n      branch: env.GIT_BRANCH,\n      commitSha: env.GIT_COMMIT,\n    };\n  }\n\n  // 7. Travis CI\n  if (env.TRAVIS === \"true\") {\n    const prRaw = env.TRAVIS_PULL_REQUEST;\n    const prNumber = prRaw && prRaw !== \"false\" ? prRaw : undefined;\n\n    return {\n      name: \"travis\",\n      provider: \"travis\",\n      buildNumber: env.TRAVIS_BUILD_NUMBER,\n      url: env.TRAVIS_BUILD_WEB_URL,\n      branch: env.TRAVIS_BRANCH,\n      commitSha: env.TRAVIS_COMMIT,\n      prNumber,\n    };\n  }\n\n  // 8. Generic CI fallback (note: CI=true fires in many dev shells too)\n  if (env.CI === \"true\") {\n    return {\n      name: \"ci\",\n      provider: \"unknown\",\n    };\n  }\n\n  // 9. Not in CI\n  return undefined;\n}\n","/**\n * Jest Adapter - Layer 1.\n *\n * Transforms Jest test results and story reports into RawRun.\n */\n\nimport type { StoryMeta } from \"executable-stories-core/types/story\";\nimport type { RawFeature, RawRun, RawTestCase, RawStatus } from \"executable-stories-core/types/raw\";\nimport { detectCI } from \"../../utils/ci-detect\";\n\n/** Jest test result shape (subset of what Jest provides) */\nexport interface JestTestResult {\n  fullName: string;\n  status: \"passed\" | \"failed\" | \"pending\" | \"todo\";\n  duration?: number;\n  failureMessages?: string[];\n}\n\n/** Jest file result shape */\nexport interface JestFileResult {\n  testFilePath: string;\n  testResults: JestTestResult[];\n}\n\n/** Jest aggregated result shape */\nexport interface JestAggregatedResult {\n  testResults: JestFileResult[];\n  startTime?: number;\n}\n\n/** Story file report written by story.init() */\nexport interface StoryFileReport {\n  testFilePath: string;\n  scenarios: StoryMeta[];\n  /** Feature declaration from story.feature(), when the file made one. */\n  feature?: Omit<RawFeature, \"sourceFile\">;\n}\n\n/** Options for Jest adapter */\nexport interface JestAdapterOptions {\n  /** Project root directory */\n  projectRoot?: string;\n  /** Package version */\n  packageVersion?: string;\n  /** Git SHA */\n  gitSha?: string;\n}\n\n/**\n * Map Jest status to RawStatus.\n */\nfunction mapJestStatus(status: JestTestResult[\"status\"]): RawStatus {\n  switch (status) {\n    case \"passed\":\n      return \"pass\";\n    case \"failed\":\n      return \"fail\";\n    case \"pending\":\n      return \"pending\";\n    case \"todo\":\n      return \"todo\";\n    default:\n      return \"unknown\";\n  }\n}\n\n/**\n * Adapt Jest results and story reports to RawRun.\n *\n * @param jestResults - Jest aggregated results\n * @param storyReports - Story reports from story.init()\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptJestRun(\n  jestResults: JestAggregatedResult,\n  storyReports: StoryFileReport[],\n  options: JestAdapterOptions = {}\n): RawRun {\n  const testCases: RawTestCase[] = [];\n  const features: RawFeature[] = [];\n\n  // Build map of Jest results by file for lookup\n  const fileResultsMap = new Map<string, JestFileResult>();\n  for (const fileResult of jestResults.testResults) {\n    fileResultsMap.set(fileResult.testFilePath, fileResult);\n  }\n\n  // Process each story report\n  for (const report of storyReports) {\n    const fileResult = fileResultsMap.get(report.testFilePath);\n\n    if (report.feature?.title) {\n      features.push({ ...report.feature, sourceFile: report.testFilePath });\n    }\n\n    for (const meta of report.scenarios) {\n      if (!meta?.scenario) continue;\n\n      // Find matching Jest test result\n      const matchingTest = findMatchingJestTest(fileResult, meta);\n\n      testCases.push({\n        externalId: matchingTest?.fullName,\n        title: meta.scenario,\n        titlePath: meta.suitePath\n          ? [...meta.suitePath, meta.scenario]\n          : [meta.scenario],\n        story: meta,\n        sourceFile: report.testFilePath,\n        sourceLine: undefined, // Jest doesn't provide line numbers\n        status: matchingTest ? mapJestStatus(matchingTest.status) : \"unknown\",\n        durationMs: matchingTest?.duration,\n        error: matchingTest?.failureMessages?.length\n          ? { message: matchingTest.failureMessages.join(\"\\n\") }\n          : undefined,\n        stepEvents: undefined, // Jest doesn't provide step-level results\n        attachments: undefined, // Jest doesn't capture attachments\n        meta: { jestStatus: matchingTest?.status },\n        retry: 0,\n        retries: 0,\n        projectName: undefined,\n      });\n    }\n  }\n\n  return {\n    testCases,\n    ...(features.length > 0 ? { features } : {}),\n    startedAtMs: jestResults.startTime,\n    finishedAtMs: Date.now(),\n    projectRoot: options.projectRoot ?? process.cwd(),\n    packageVersion: options.packageVersion,\n    gitSha: options.gitSha,\n    ci: detectCI(),\n  };\n}\n\n/**\n * Find matching Jest test result for a story.\n *\n * Matches by constructing fullName from suitePath and scenario.\n */\nfunction findMatchingJestTest(\n  fileResult: JestFileResult | undefined,\n  meta: StoryMeta\n): JestTestResult | undefined {\n  if (!fileResult) return undefined;\n\n  // Construct expected fullName\n  const expectedFullName = meta.suitePath\n    ? [...meta.suitePath, meta.scenario].join(\" > \")\n    : meta.scenario;\n\n  return fileResult.testResults.find((test) => test.fullName === expectedFullName);\n}\n\n","/**\n * Vitest Adapter - Layer 1.\n *\n * Transforms Vitest test results into RawRun.\n */\n\nimport type { StoryMeta } from \"executable-stories-core/types/story\";\nimport type { RawRun, RawTestCase, RawStatus } from \"executable-stories-core/types/raw\";\nimport { detectCI } from \"../../utils/ci-detect\";\n\n/** Vitest test state */\nexport type VitestState = \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n\n/** Vitest serialized error */\nexport interface VitestSerializedError {\n  message?: string;\n  stack?: string;\n  diff?: string;\n}\n\n/** Vitest test result shape */\nexport interface VitestTestResult {\n  state?: VitestState;\n  duration?: number;\n  errors?: VitestSerializedError[];\n}\n\n/** Vitest test case shape (minimal) */\nexport interface VitestTestCase {\n  name: string;\n  meta: () => Record<string, unknown>;\n  result: () => VitestTestResult | undefined;\n}\n\n/** Vitest test module shape (minimal) */\nexport interface VitestTestModule {\n  moduleId?: string;\n  relativeModuleId?: string;\n  children?: {\n    allTests: () => Iterable<VitestTestCase>;\n  };\n}\n\n/** Options for Vitest adapter */\nexport interface VitestAdapterOptions {\n  /** Project root directory */\n  projectRoot?: string;\n  /** Package version */\n  packageVersion?: string;\n  /** Git SHA */\n  gitSha?: string;\n  /** Start time (epoch ms) */\n  startedAtMs?: number;\n}\n\n/**\n * Map Vitest state to RawStatus.\n */\nfunction mapVitestStatus(state?: VitestState): RawStatus {\n  switch (state) {\n    case \"passed\":\n      return \"pass\";\n    case \"failed\":\n      return \"fail\";\n    case \"skipped\":\n      return \"skip\";\n    case \"pending\":\n      return \"pending\";\n    default:\n      return \"unknown\";\n  }\n}\n\n/**\n * Adapt Vitest test modules to RawRun.\n *\n * @param testModules - Vitest test modules\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptVitestRun(\n  testModules: ReadonlyArray<VitestTestModule>,\n  options: VitestAdapterOptions = {}\n): RawRun {\n  const testCases: RawTestCase[] = [];\n  const projectRoot = options.projectRoot ?? process.cwd();\n\n  for (const mod of testModules) {\n    const collection = mod.children;\n    if (!collection) continue;\n\n    // Get module path\n    const moduleId = mod.moduleId ?? mod.relativeModuleId ?? \"\";\n    const sourcePath = moduleId.startsWith(\"/\")\n      ? moduleId\n      : `${projectRoot}/${moduleId}`;\n\n    for (const test of collection.allTests()) {\n      const meta = test.meta();\n      const story = meta?.[\"story\"] as StoryMeta | undefined;\n\n      if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n      const result = test.result();\n      const state = result?.state;\n      const errors = state === \"failed\" && result ? result.errors : undefined;\n\n      testCases.push({\n        externalId: test.name,\n        title: story.scenario,\n        titlePath: story.suitePath\n          ? [...story.suitePath, story.scenario]\n          : [story.scenario],\n        story,\n        sourceFile: sourcePath,\n        sourceLine: undefined, // Vitest doesn't provide line numbers easily\n        status: mapVitestStatus(state),\n        durationMs: result?.duration,\n        error: errors?.length\n          ? {\n              message: formatVitestError(errors[0]),\n              stack: errors[0].stack,\n            }\n          : undefined,\n        stepEvents: undefined, // Vitest doesn't provide step-level results\n        attachments: undefined, // Vitest doesn't capture attachments\n        meta: { vitestState: state },\n        retry: 0,\n        retries: 0,\n        projectName: undefined,\n      });\n    }\n  }\n\n  return {\n    testCases,\n    startedAtMs: options.startedAtMs,\n    finishedAtMs: Date.now(),\n    projectRoot,\n    packageVersion: options.packageVersion,\n    gitSha: options.gitSha,\n    ci: detectCI(),\n  };\n}\n\n/**\n * Format Vitest error message.\n */\nfunction formatVitestError(error: VitestSerializedError): string {\n  const parts: string[] = [];\n\n  if (error.message) {\n    parts.push(error.message);\n  }\n\n  if (error.diff) {\n    parts.push(\"\", error.diff);\n  }\n\n  return parts.join(\"\\n\") || \"Unknown error\";\n}\n\n","/**\n * Playwright Adapter - Layer 1.\n *\n * Transforms Playwright test results into RawRun.\n */\n\nimport type { StoryMeta } from \"executable-stories-core/types/story\";\nimport type { RawFeature, RawRun, RawTestCase, RawStatus, RawAttachment } from \"executable-stories-core/types/raw\";\nimport { detectCI } from \"../../utils/ci-detect\";\n\n/** Playwright test status */\nexport type PlaywrightStatus =\n  | \"passed\"\n  | \"failed\"\n  | \"skipped\"\n  | \"timedOut\"\n  | \"interrupted\";\n\n/** Playwright test error */\nexport interface PlaywrightError {\n  message?: string;\n  stack?: string;\n}\n\n/** Playwright attachment */\nexport interface PlaywrightAttachment {\n  name: string;\n  contentType: string;\n  path?: string;\n  body?: Buffer;\n}\n\n/** Playwright test result */\nexport interface PlaywrightTestResult {\n  status: PlaywrightStatus;\n  duration: number;\n  errors: PlaywrightError[];\n  attachments: PlaywrightAttachment[];\n  retry: number;\n  /** Optional step events if caller captures Playwright step timing. */\n  stepEvents?: Array<{\n    index?: number;\n    stepId?: string;\n    title?: string;\n    status?: RawStatus;\n    durationMs?: number;\n    errorMessage?: string;\n  }>;\n}\n\n/** Playwright test case annotation */\nexport interface PlaywrightAnnotation {\n  type: string;\n  description?: string;\n}\n\n/** Playwright test location */\nexport interface PlaywrightLocation {\n  file: string;\n  line: number;\n  column: number;\n}\n\n/** Playwright test case shape (minimal) */\nexport interface PlaywrightTestCase {\n  title: string;\n  titlePath: () => string[];\n  annotations: PlaywrightAnnotation[];\n  location: PlaywrightLocation;\n  retries: number;\n}\n\n/** Options for Playwright adapter */\nexport interface PlaywrightAdapterOptions {\n  /** Project root directory */\n  projectRoot?: string;\n  /** Package version */\n  packageVersion?: string;\n  /** Git SHA */\n  gitSha?: string;\n  /** Start time (epoch ms) */\n  startedAtMs?: number;\n  /** Playwright project name */\n  projectName?: string;\n}\n\n/**\n * Map Playwright status to RawStatus.\n */\nfunction mapPlaywrightStatus(status: PlaywrightStatus): RawStatus {\n  switch (status) {\n    case \"passed\":\n      return \"pass\";\n    case \"failed\":\n      return \"fail\";\n    case \"skipped\":\n      return \"skip\";\n    case \"timedOut\":\n      return \"timeout\";\n    case \"interrupted\":\n      return \"interrupted\";\n    default:\n      return \"unknown\";\n  }\n}\n\n/**\n * Adapt Playwright test results to RawRun.\n *\n * @param testResults - Array of [testCase, result] tuples\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptPlaywrightRun(\n  testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>,\n  options: PlaywrightAdapterOptions = {}\n): RawRun {\n  const testCases: RawTestCase[] = [];\n  const featuresByFile = new Map<string, RawFeature>();\n  const projectRoot = options.projectRoot ?? process.cwd();\n\n  for (const [test, result] of testResults) {\n    // Find story-meta annotation\n    const storyAnnotation = test.annotations.find((a) => a.type === \"story-meta\");\n    if (!storyAnnotation?.description) continue;\n\n    const featureAnnotation = test.annotations.find((a) => a.type === \"story-feature\");\n    if (featureAnnotation?.description && !featuresByFile.has(test.location.file)) {\n      try {\n        const declared = JSON.parse(featureAnnotation.description) as RawFeature;\n        if (declared?.title) {\n          featuresByFile.set(test.location.file, { ...declared, sourceFile: test.location.file });\n        }\n      } catch {\n        // A malformed annotation should not lose the run's test cases.\n      }\n    }\n\n    let story: StoryMeta;\n    try {\n      story = JSON.parse(storyAnnotation.description);\n    } catch {\n      continue; // Skip if annotation is not valid JSON\n    }\n\n    if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n    // Convert attachments\n    const attachments = convertAttachments(result.attachments);\n\n    // Get error info\n    const error = result.errors?.length\n      ? {\n          message: result.errors[0].message,\n          stack: result.errors[0].stack,\n        }\n      : undefined;\n\n    const stepEvents =\n      result.stepEvents?.length\n        ? result.stepEvents\n        : story.steps\n            .map((step, index) =>\n              step.durationMs !== undefined\n                ? {\n                    index,\n                    stepId: step.id,\n                    title: step.text,\n                    durationMs: step.durationMs,\n                  }\n                : undefined,\n            )\n            .filter((e): e is NonNullable<typeof e> => e !== undefined);\n\n    testCases.push({\n      externalId: test.titlePath().join(\" > \"),\n      title: story.scenario,\n      titlePath: test.titlePath(),\n      story,\n      sourceFile: test.location.file,\n      sourceLine: test.location.line,\n      status: mapPlaywrightStatus(result.status),\n      durationMs: result.duration,\n      error,\n      stepEvents: stepEvents.length > 0 ? stepEvents : undefined,\n      attachments,\n      meta: {\n        playwrightStatus: result.status,\n        column: test.location.column,\n      },\n      retry: result.retry,\n      retries: test.retries,\n      projectName: options.projectName,\n    });\n  }\n\n  return {\n    testCases,\n    ...(featuresByFile.size > 0 ? { features: [...featuresByFile.values()] } : {}),\n    startedAtMs: options.startedAtMs,\n    finishedAtMs: Date.now(),\n    projectRoot,\n    packageVersion: options.packageVersion,\n    gitSha: options.gitSha,\n    ci: detectCI(),\n  };\n}\n\n/**\n * Convert Playwright attachments to raw attachments.\n */\nfunction convertAttachments(\n  attachments: PlaywrightAttachment[]\n): RawAttachment[] {\n  return attachments.map((att) => ({\n    name: att.name,\n    mediaType: att.contentType,\n    path: att.path,\n    body: att.body ? att.body.toString(\"base64\") : undefined,\n    encoding: att.body ? \"BASE64\" as const : undefined,\n    byteLength: att.body?.length,\n  }));\n}\n","/**\n * Provider-agnostic sync engine.\n *\n * Everything that is not a vendor API call lives here: projecting stories into\n * case bodies, binding them to remote cases, classifying what the provider\n * holds, building the plan, and applying it. Adapters stay thin.\n *\n * Two phases, deliberately separate so `--dry-run` and a real run share one code\n * path: {@link analyzeSync} reads and decides, {@link applySync} writes.\n *\n * fn(args, deps) throughout.\n */\n\nimport { assertNever } from \"executable-stories-core/utils/assert-never\";\nimport { behaviourFingerprint, behaviourSimilarity } from \"executable-stories-core/converters/acl/ids\";\nimport type { TestCaseResult, TestRunResult, Attachment } from \"executable-stories-core/types/test-result\";\nimport type { DocEntry } from \"executable-stories-core/types/story\";\n\nimport type {\n  CaseBody,\n  CaseResult,\n  RemoteCase,\n  ResultAttachment,\n  SyncProvider,\n} from \"./port\";\nimport {\n  entriesFor,\n  hashCaseBody,\n  setEntry,\n  type Lockfile,\n  type LockEntry,\n} from \"./lockfile\";\n\n/** Which executions get their evidence uploaded. */\nexport type AttachPolicy = \"failed\" | \"all\" | \"none\";\n\nexport interface SyncEngineConfig {\n  /**\n   * Ticket-id prefix that marks a `story.tickets` entry as this provider's case\n   * id (TestRail's \"C1234\"). Without it, only the lockfile binds.\n   */\n  ticketPrefix?: string;\n  /**\n   * Whether the prefix is decoration to strip (\"C1234\" -> \"1234\", TestRail) or\n   * part of the id itself (\"PROJ-42\" stays whole, Xray/Jira). Default true.\n   */\n  ticketPrefixStrip?: boolean;\n  /** Base URL of the published HTML report, used for links back from cases. */\n  reportUrl?: string;\n  /**\n   * Turns a scenario into the fragment appended to `reportUrl`, for a link that\n   * lands on the scenario rather than the top of the page.\n   *\n   * Caller-supplied for the same reason the markdown formatter's option is\n   * (`types/options.ts`): the correct slug depends on how the docs site routes,\n   * and guessing it produces links that 404. Without it, cases link to the\n   * report page itself.\n   */\n  scenarioAnchor?: (tc: TestCaseResult) => string | undefined;\n  /** Default \"failed\": nobody watches a passing test's video, and quotas are real. */\n  attach?: AttachPolicy;\n  /** Similarity at or above which an unlinked case is flagged as a possible duplicate. */\n  duplicateThreshold?: number;\n}\n\n/** A story, ready to be a case. */\nexport interface LocalBehaviour {\n  fingerprint: string;\n  testCase: TestCaseResult;\n  body: CaseBody;\n}\n\nexport type CoverageClass = \"automated\" | \"duplicated\" | \"possible-duplicate\" | \"manual-only\";\n\nexport interface ClassifiedCase {\n  case: RemoteCase;\n  classification: CoverageClass;\n  /** Scenario title this case resembles or duplicates, when one was found. */\n  resembles?: string;\n  /** 0..1, present for \"possible-duplicate\". */\n  similarity?: number;\n}\n\nexport interface PlanCreate {\n  fingerprint: string;\n  scenario: string;\n  body: CaseBody;\n}\n\nexport interface PlanUpdate {\n  fingerprint: string;\n  caseId: string;\n  url: string;\n  scenario: string;\n  body: CaseBody;\n}\n\nexport interface PlanSkip {\n  fingerprint: string;\n  caseId: string;\n  url: string;\n  title: string;\n  reason: \"remote-edited\" | \"case-missing\";\n}\n\nexport interface PlanOrphan {\n  fingerprint: string;\n  caseId: string;\n  url: string;\n  title: string;\n}\n\nexport interface AttachmentSummary {\n  files: number;\n  bytes: number;\n  oversized: Array<{ filename: string; bytes: number; limit: number }>;\n  byRole: Record<string, number>;\n}\n\nexport interface SyncAnalysis {\n  provider: string;\n  target?: string;\n  local: LocalBehaviour[];\n  remote: ClassifiedCase[];\n  create: PlanCreate[];\n  update: PlanUpdate[];\n  unchanged: PlanUpdate[];\n  /** Human-authored cases bound via `story.tickets`. Executions only, body untouched. */\n  adopted: PlanUpdate[];\n  skipped: PlanSkip[];\n  orphaned: PlanOrphan[];\n  /** Results for behaviours already bound. Newly created cases add theirs at apply time. */\n  results: CaseResult[];\n  attachments: AttachmentSummary;\n  /** Capabilities this provider lacks that the plan would otherwise use. */\n  unsupported: string[];\n  /**\n   * Bound cases the provider would not hand back a body for, so a human edit to\n   * them cannot be detected. Reported rather than assumed safe.\n   */\n  driftUncheckable: number;\n  /** Set when the orphan count suggests the run was filtered rather than complete. */\n  partialRunWarning?: string;\n}\n\nexport interface SyncApplyResult {\n  created: Array<{ scenario: string; caseId: string; url: string }>;\n  updated: Array<{ scenario: string; caseId: string; url: string }>;\n  resultsRecorded: number;\n  resultsSkipped: Array<{ caseId: string; reason: string }>;\n  attachmentsUploaded: number;\n  runUrl?: string;\n  errors: string[];\n}\n\n/**\n * `behaviourSimilarity` weights steps at 0.7 and the title at 0.3, so two cases\n * with byte-identical steps and unrelated titles score exactly 0.7. That is the\n * floor worth surfacing: identical steps is the strongest duplicate signal there\n * is, and a stricter default hid it behind a reworded title.\n *\n * Sensitivity is the right bias here because this label never binds anything. A\n * false flag costs a reviewer a few seconds; a missed one leaves a manual case\n * nobody ever retires, which is the cost this whole report exists to remove.\n */\nconst DEFAULT_DUPLICATE_THRESHOLD = 0.7;\n/** Above this share of bindings orphaning at once, assume a filtered run, not deletions. */\nconst PARTIAL_RUN_ORPHAN_RATIO = 0.25;\n\n// --- projection -------------------------------------------------------------\n\nfunction normalizeTitle(text: string): string {\n  return text\n    .toLowerCase()\n    .replace(/[^\\p{L}\\p{N}\\s]/gu, \" \")\n    .replace(/\\s+/g, \" \")\n    .trim();\n}\n\n/** Render doc entries to markdown-ish plain text. Adapters convert to their own markup. */\nexport function renderDocs(docs: readonly DocEntry[] | undefined, depth = 0): string {\n  if (!docs || docs.length === 0) return \"\";\n  const lines: string[] = [];\n\n  for (const doc of docs) {\n    switch (doc.kind) {\n      case \"note\":\n        lines.push(doc.text);\n        break;\n      case \"kv\":\n        lines.push(`**${doc.label}:** ${formatValue(doc.value)}`);\n        break;\n      case \"state\":\n        lines.push(`**${doc.label ?? \"State\"}:** ${formatValue(doc.value)}`);\n        break;\n      case \"code\":\n        lines.push(`**${doc.label}**`, \"\", \"```\" + (doc.lang ?? \"\"), doc.content, \"```\");\n        break;\n      case \"table\":\n        lines.push(\n          `**${doc.label}**`,\n          \"\",\n          `| ${doc.columns.join(\" | \")} |`,\n          `| ${doc.columns.map(() => \"---\").join(\" | \")} |`,\n          ...doc.rows.map((row) => `| ${row.join(\" | \")} |`),\n        );\n        break;\n      case \"link\":\n        lines.push(`[${doc.label}](${doc.url})`);\n        break;\n      case \"section\":\n        lines.push(`${\"#\".repeat(Math.min(6, depth + 3))} ${doc.title}`, \"\", doc.markdown);\n        break;\n      case \"mermaid\":\n        lines.push(...(doc.title ? [`**${doc.title}**`, \"\"] : []), \"```mermaid\", doc.code, \"```\");\n        break;\n      case \"screenshot\":\n        lines.push(`_Screenshot: ${doc.alt ?? doc.path}_`);\n        break;\n      case \"video\":\n        lines.push(`_Video: ${doc.caption ?? doc.path}_`);\n        break;\n      case \"html\":\n        lines.push(`_Embedded: ${doc.title ?? doc.url ?? doc.path ?? \"html\"}_`);\n        break;\n      case \"custom\":\n        lines.push(`_${doc.type}_: ${formatValue(doc.data)}`);\n        break;\n      case \"tag\":\n        // Tags reach the case through their own field, not the description.\n        break;\n\n      default:\n        assertNever(doc, \"Sync description: unhandled doc kind\");\n    }\n\n    const children = renderDocs(doc.children, depth + 1);\n    if (children) lines.push(children);\n  }\n\n  return lines.join(\"\\n\");\n}\n\nfunction formatValue(value: unknown): string {\n  if (typeof value === \"string\") return value;\n  return JSON.stringify(value);\n}\n\n/** Link into the published report, deep-linked when an anchor function is supplied. */\nfunction scenarioUrl(config: SyncEngineConfig, tc: TestCaseResult): string | undefined {\n  if (!config.reportUrl) return undefined;\n  const base = config.reportUrl.replace(/\\/$/, \"\");\n  const anchor = config.scenarioAnchor?.(tc);\n  return anchor ? `${base}#${anchor}` : base;\n}\n\n/** Project one canonical test case into provider-neutral case content. */\nexport function toCaseBody(tc: TestCaseResult, config: SyncEngineConfig): CaseBody {\n  const sections: string[] = [];\n\n  const docs = renderDocs(tc.story.docs);\n  if (docs) sections.push(docs);\n\n  const tickets = tc.story.tickets ?? [];\n  if (tickets.length > 0) {\n    sections.push(\n      `**Requirements:** ${tickets.map((t) => (t.url ? `[${t.id}](${t.url})` : t.id)).join(\", \")}`,\n    );\n  }\n  if (tc.story.covers?.length) {\n    sections.push(`**Covers:** ${tc.story.covers.join(\", \")}`);\n  }\n  sections.push(`_Generated from ${tc.sourceFile}:${tc.sourceLine} by executable-stories. Edit the test, not this case._`);\n\n  const links: Array<{ label: string; url: string }> = [];\n  const report = scenarioUrl(config, tc);\n  if (report) links.push({ label: \"Living documentation\", url: report });\n  for (const ticket of tickets) {\n    if (ticket.url) links.push({ label: ticket.id, url: ticket.url });\n  }\n\n  return {\n    title: tc.story.scenario,\n    steps: tc.story.steps.map((s) => ({ keyword: s.keyword, text: s.text })),\n    description: sections.join(\"\\n\\n\"),\n    links,\n  };\n}\n\n/**\n * Project a run into fingerprinted behaviours.\n *\n * `behaviourFingerprint` returns \"\" for a scenario with no steps and no\n * `covers`, and two scenarios with identical steps collide. Both fall back to\n * the canonical test-case id, which is unique within a run — less\n * rename-resilient, but a stable binding beats a shared one.\n */\nexport function projectBehaviours(\n  run: TestRunResult,\n  config: SyncEngineConfig,\n): LocalBehaviour[] {\n  const fingerprints = run.testCases.map((tc) =>\n    behaviourFingerprint({\n      scenario: tc.story.scenario,\n      sourceFile: tc.sourceFile,\n      steps: tc.story.steps.map((s) => ({ keyword: s.keyword, text: s.text })),\n      covers: tc.story.covers,\n    }),\n  );\n\n  const counts = new Map<string, number>();\n  for (const fp of fingerprints) {\n    if (fp) counts.set(fp, (counts.get(fp) ?? 0) + 1);\n  }\n\n  return run.testCases.map((tc, index) => {\n    const fp = fingerprints[index]!;\n    const unique = fp !== \"\" && counts.get(fp) === 1;\n    return {\n      fingerprint: unique ? fp : tc.id,\n      testCase: tc,\n      body: toCaseBody(tc, config),\n    };\n  });\n}\n\n// --- attachments ------------------------------------------------------------\n\nfunction roleFor(attachment: Attachment): ResultAttachment[\"role\"] {\n  const type = attachment.mediaType.toLowerCase();\n  if (type.startsWith(\"image/\")) return \"screenshot\";\n  if (type.startsWith(\"video/\")) return \"video\";\n  if (attachment.name.toLowerCase().includes(\"trace\")) return \"trace\";\n  return \"log\";\n}\n\nfunction decode(attachment: Attachment): Uint8Array {\n  return attachment.contentEncoding === \"BASE64\"\n    ? Uint8Array.from(Buffer.from(attachment.body, \"base64\"))\n    : new TextEncoder().encode(attachment.body);\n}\n\n/** Attachments for one test, filtered by policy and the provider's size limit. */\nexport function collectAttachments(\n  args: { testCase: TestCaseResult; policy: AttachPolicy; maxBytes?: number },\n): { attachments: ResultAttachment[]; oversized: Array<{ filename: string; bytes: number; limit: number }> } {\n  const { testCase, policy, maxBytes } = args;\n  if (policy === \"none\") return { attachments: [], oversized: [] };\n  if (policy === \"failed\" && testCase.status !== \"failed\") return { attachments: [], oversized: [] };\n\n  const attachments: ResultAttachment[] = [];\n  const oversized: Array<{ filename: string; bytes: number; limit: number }> = [];\n\n  for (const raw of testCase.attachments) {\n    const body = decode(raw);\n    if (maxBytes !== undefined && body.byteLength > maxBytes) {\n      oversized.push({ filename: raw.name, bytes: body.byteLength, limit: maxBytes });\n      continue;\n    }\n    attachments.push({\n      filename: raw.name,\n      mediaType: raw.mediaType,\n      body,\n      role: roleFor(raw),\n    });\n  }\n\n  return { attachments, oversized };\n}\n\nfunction toCaseResult(\n  args: { behaviour: LocalBehaviour; caseId: string; provider: SyncProvider; config: SyncEngineConfig },\n): { result: CaseResult; oversized: Array<{ filename: string; bytes: number; limit: number }> } | undefined {\n  const { behaviour, caseId, provider, config } = args;\n  const tc = behaviour.testCase;\n  // \"pending\" is a planned scenario (it.todo) — no execution happened, so there\n  // is nothing to record. Reporting it as skipped would misrepresent a spec as a\n  // test that ran and was ignored.\n  if (tc.status === \"pending\") return undefined;\n\n  const { attachments, oversized } = collectAttachments({\n    testCase: tc,\n    policy: config.attach ?? \"failed\",\n    maxBytes: provider.maxAttachmentBytes,\n  });\n\n  return {\n    result: {\n      caseId,\n      status: tc.status,\n      durationMs: tc.durationMs,\n      message: tc.errorMessage,\n      url: scenarioUrl(config, tc),\n      attachments: attachments.length > 0 ? attachments : undefined,\n    },\n    oversized,\n  };\n}\n\n// --- binding and classification ---------------------------------------------\n\n/** Case id carried on the story itself, e.g. `story.tickets` holding \"C1234\". */\nfunction ticketBinding(tc: TestCaseResult, config: SyncEngineConfig): string | undefined {\n  const prefix = config.ticketPrefix;\n  if (!prefix) return undefined;\n  const match = (tc.story.tickets ?? []).find((t) => t.id.startsWith(prefix));\n  if (!match) return undefined;\n  return config.ticketPrefixStrip === false ? match.id : match.id.slice(prefix.length);\n}\n\n// --- analysis ---------------------------------------------------------------\n\nexport interface AnalyzeSyncArgs {\n  run: TestRunResult;\n  provider: SyncProvider;\n  lockfile: Lockfile;\n  config: SyncEngineConfig;\n}\n\nexport async function analyzeSync(args: AnalyzeSyncArgs): Promise<SyncAnalysis> {\n  const { run, provider, lockfile, config } = args;\n\n  const local = projectBehaviours(run, config);\n  const remoteCases = await provider.listCases();\n  const remoteById = new Map(remoteCases.map((c) => [c.id, c]));\n  const locked = entriesFor(lockfile, provider.name);\n\n  const create: PlanCreate[] = [];\n  const update: PlanUpdate[] = [];\n  const unchanged: PlanUpdate[] = [];\n  const adopted: PlanUpdate[] = [];\n  const skipped: PlanSkip[] = [];\n  const results: CaseResult[] = [];\n  const oversized: AttachmentSummary[\"oversized\"] = [];\n  const boundCaseIds = new Set<string>();\n  let driftUncheckable = 0;\n\n  for (const behaviour of local) {\n    const entry = locked[behaviour.fingerprint];\n    const caseId = entry?.caseId ?? ticketBinding(behaviour.testCase, config);\n    const remote = caseId ? remoteById.get(caseId) : undefined;\n\n    if (!caseId) {\n      create.push({\n        fingerprint: behaviour.fingerprint,\n        scenario: behaviour.body.title,\n        body: behaviour.body,\n      });\n      continue;\n    }\n\n    if (!remote) {\n      // Bound to a case that is gone. Never silently re-create: someone deleted\n      // it on purpose, or the config points at the wrong project.\n      skipped.push({\n        fingerprint: behaviour.fingerprint,\n        caseId,\n        url: entry?.url ?? \"\",\n        title: entry?.title ?? behaviour.body.title,\n        reason: \"case-missing\",\n      });\n      continue;\n    }\n\n    boundCaseIds.add(caseId);\n\n    const pending = toCaseResult({ behaviour, caseId, provider, config });\n    if (pending) {\n      results.push(pending.result);\n      oversized.push(...pending.oversized);\n    }\n\n    const planned: PlanUpdate = {\n      fingerprint: behaviour.fingerprint,\n      caseId,\n      url: remote.url,\n      scenario: behaviour.body.title,\n      body: behaviour.body,\n    };\n\n    // Reached through a story ticket rather than a case we created: a human owns\n    // this body. Record the binding, push executions against it, leave the\n    // content alone.\n    if (!entry?.owned) {\n      adopted.push(planned);\n      continue;\n    }\n\n    // Drift guard: compare the provider's current copy against the hash of what\n    // it held right after our last write. Different means a human edited it.\n    const remoteHash = remote.body ? hashCaseBody(remote.body) : undefined;\n    if (remoteHash !== undefined && remoteHash !== entry.hash) {\n      skipped.push({\n        fingerprint: behaviour.fingerprint,\n        caseId,\n        url: remote.url,\n        title: remote.title,\n        reason: \"remote-edited\",\n      });\n      continue;\n    }\n\n    // A provider that cannot hand back a case body leaves nothing to compare\n    // against, so fall back to the stored hash: equal means nothing has changed\n    // on our side since the last write either, and re-sending an identical body\n    // every run would bury the real changes in a plan nobody reads. It cannot\n    // detect a human edit — only the provider's own copy can do that — so the\n    // plan says so rather than implying a guarantee it is not making.\n    const baseline = remoteHash ?? entry.hash;\n    if (baseline !== \"\" && hashCaseBody(behaviour.body) === baseline) {\n      unchanged.push(planned);\n    } else {\n      update.push(planned);\n    }\n    if (remoteHash === undefined) driftUncheckable += 1;\n  }\n\n  // Classify everything the provider holds that no story claims.\n  const byNormalizedTitle = new Map<string, LocalBehaviour>();\n  for (const behaviour of local) byNormalizedTitle.set(normalizeTitle(behaviour.body.title), behaviour);\n  const threshold = config.duplicateThreshold ?? DEFAULT_DUPLICATE_THRESHOLD;\n\n  const remote: ClassifiedCase[] = remoteCases.map((remoteCase) => {\n    if (boundCaseIds.has(remoteCase.id)) {\n      return { case: remoteCase, classification: \"automated\" as const };\n    }\n\n    const titleMatch = byNormalizedTitle.get(normalizeTitle(remoteCase.title));\n    if (titleMatch) {\n      return {\n        case: remoteCase,\n        classification: \"duplicated\" as const,\n        resembles: titleMatch.body.title,\n      };\n    }\n\n    // Similarity only ever labels. It never binds: auto-linking on a guess is\n    // how these tools corrupt someone's instance.\n    if (remoteCase.body && remoteCase.body.steps.length > 0) {\n      let best: { behaviour: LocalBehaviour; score: number } | undefined;\n      for (const behaviour of local) {\n        const score = behaviourSimilarity(\n          {\n            scenario: remoteCase.title,\n            sourceFile: \"\",\n            steps: remoteCase.body.steps,\n          },\n          {\n            scenario: behaviour.body.title,\n            sourceFile: behaviour.testCase.sourceFile,\n            steps: behaviour.body.steps,\n          },\n        );\n        if (!best || score > best.score) best = { behaviour, score };\n      }\n      if (best && best.score >= threshold) {\n        return {\n          case: remoteCase,\n          classification: \"possible-duplicate\" as const,\n          resembles: best.behaviour.body.title,\n          similarity: Number(best.score.toFixed(2)),\n        };\n      }\n    }\n\n    return { case: remoteCase, classification: \"manual-only\" as const };\n  });\n\n  // Orphans: bindings whose behaviour no longer exists in the codebase.\n  const localFingerprints = new Set(local.map((b) => b.fingerprint));\n  const orphaned: PlanOrphan[] = Object.entries(locked)\n    .filter(([fingerprint]) => !localFingerprints.has(fingerprint))\n    .map(([fingerprint, entry]) => ({\n      fingerprint,\n      caseId: entry.caseId,\n      url: entry.url,\n      title: entry.title,\n    }));\n\n  const lockedCount = Object.keys(locked).length;\n  const partialRunWarning =\n    lockedCount > 0 && orphaned.length / lockedCount > PARTIAL_RUN_ORPHAN_RATIO\n      ? `${orphaned.length} of ${lockedCount} bindings have no matching story. If this run was filtered (a -t/--grep flag, a single file), those are not deletions. Nothing is removed either way.`\n      : undefined;\n\n  const unsupported: string[] = [];\n  if (create.length > 0 && !provider.createCase) unsupported.push(\"createCase\");\n  if (update.length > 0 && !provider.updateCase) unsupported.push(\"updateCase\");\n  if (results.length > 0 && !provider.recordResults) unsupported.push(\"recordResults\");\n\n  const byRole: Record<string, number> = {};\n  let files = 0;\n  let bytes = 0;\n  for (const result of results) {\n    for (const attachment of result.attachments ?? []) {\n      files += 1;\n      bytes += attachment.body.byteLength;\n      const role = attachment.role ?? \"log\";\n      byRole[role] = (byRole[role] ?? 0) + 1;\n    }\n  }\n\n  return {\n    provider: provider.name,\n    target: provider.describeTarget?.(),\n    local,\n    remote,\n    create,\n    update,\n    unchanged,\n    adopted,\n    skipped,\n    orphaned,\n    results,\n    attachments: { files, bytes, oversized, byRole },\n    unsupported,\n    driftUncheckable,\n    partialRunWarning,\n  };\n}\n\n// --- apply ------------------------------------------------------------------\n\nexport interface ApplySyncArgs {\n  analysis: SyncAnalysis;\n  provider: SyncProvider;\n  lockfile: Lockfile;\n  config: SyncEngineConfig;\n}\n\nexport interface ApplySyncDeps {\n  logger: { warn(msg: string): void };\n}\n\n/**\n * Execute the plan. Mutates the passed lockfile so the caller can persist it\n * even when a later stage fails — a created case whose binding was lost would\n * be re-created on the next run, which is the one duplicate we can actually\n * cause.\n */\nexport async function applySync(\n  args: ApplySyncArgs,\n  deps: ApplySyncDeps,\n): Promise<SyncApplyResult> {\n  const { analysis, provider, lockfile, config } = args;\n\n  const result: SyncApplyResult = {\n    created: [],\n    updated: [],\n    resultsRecorded: 0,\n    resultsSkipped: [],\n    attachmentsUploaded: 0,\n    errors: [],\n  };\n\n  const byFingerprint = new Map(analysis.local.map((b) => [b.fingerprint, b]));\n  const results = [...analysis.results];\n\n  if (analysis.create.length > 0 && provider.createCase) {\n    for (const planned of analysis.create) {\n      try {\n        // Sequential on purpose. Providers rate-limit case creation hard, and a\n        // case created twice cannot be undone from here — there is no id to\n        // delete, because the duplicate is the one we failed to record.\n        const created = await provider.createCase(planned.body);\n        setEntry(lockfile, provider.name, planned.fingerprint, {\n          caseId: created.id,\n          url: created.url,\n          hash: hashCaseBody(created.body ?? planned.body),\n          title: created.title,\n          owned: true,\n        });\n        result.created.push({ scenario: planned.scenario, caseId: created.id, url: created.url });\n\n        const behaviour = byFingerprint.get(planned.fingerprint);\n        if (behaviour) {\n          const pending = toCaseResult({ behaviour, caseId: created.id, provider, config });\n          if (pending) results.push(pending.result);\n        }\n      } catch (err) {\n        result.errors.push(`create \"${planned.scenario}\": ${(err as Error).message}`);\n      }\n    }\n  }\n\n  if (analysis.update.length > 0 && provider.updateCase) {\n    for (const planned of analysis.update) {\n      try {\n        const updated = await provider.updateCase(planned.caseId, planned.body);\n        setEntry(lockfile, provider.name, planned.fingerprint, {\n          caseId: updated.id,\n          url: updated.url,\n          hash: hashCaseBody(updated.body ?? planned.body),\n          title: updated.title,\n          owned: true,\n        });\n        result.updated.push({ scenario: planned.scenario, caseId: updated.id, url: updated.url });\n      } catch (err) {\n        result.errors.push(`update \"${planned.scenario}\" (${planned.caseId}): ${(err as Error).message}`);\n      }\n    }\n  }\n\n  // Keep unchanged bindings' urls fresh without disturbing ownership or the\n  // stored hash the drift guard compares against.\n  for (const planned of analysis.unchanged) {\n    const existing: LockEntry | undefined = entriesFor(lockfile, provider.name)[planned.fingerprint];\n    if (existing) {\n      setEntry(lockfile, provider.name, planned.fingerprint, { ...existing, url: planned.url });\n    }\n  }\n\n  // Record ticket-bound cases so the binding survives a ticket id being removed\n  // from the test later. `hash` stays empty: we did not write this body and must\n  // never be tempted to compare against it.\n  for (const planned of analysis.adopted) {\n    setEntry(lockfile, provider.name, planned.fingerprint, {\n      caseId: planned.caseId,\n      url: planned.url,\n      hash: \"\",\n      title: planned.scenario,\n      owned: false,\n    });\n  }\n\n  if (results.length > 0 && provider.recordResults) {\n    try {\n      const summary = await provider.recordResults(results);\n      result.resultsRecorded = summary.recorded;\n      result.resultsSkipped = summary.skipped;\n      result.attachmentsUploaded = summary.attachmentsUploaded;\n      result.runUrl = summary.runUrl;\n    } catch (err) {\n      result.errors.push(`record results: ${(err as Error).message}`);\n    }\n  } else if (results.length > 0) {\n    deps.logger.warn(\n      `${provider.name} does not support recording results — ${results.length} execution(s) not pushed.`,\n    );\n  }\n\n  return result;\n}\n","/**\n * The sync lockfile: the binding between a behaviour in the codebase and a case\n * in someone else's system.\n *\n * Committed to the repo on purpose. When CI creates a case, the lockfile diff\n * shows up in the pull request that caused it, so a reviewer sees the new case\n * and its link before it lands anywhere else.\n *\n * Keyed on `behaviourFingerprint` (content-derived) rather than the canonical\n * test-case id (`sha1(sourceFile::scenario)`), which changes the moment someone\n * renames a test or moves a file. Keying on the volatile id would orphan every\n * case on the first rename, which is exactly how these integrations lose trust.\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { createHash } from \"node:crypto\";\n\nimport type { CaseBody } from \"./port\";\n\nexport const DEFAULT_LOCKFILE_PATH = \".executable-stories/sync.lock.json\";\n\nconst LOCKFILE_VERSION = 1;\n\n/** One behaviour-to-case binding. */\nexport interface LockEntry {\n  /** Provider-native case id. */\n  caseId: string;\n  url: string;\n  /**\n   * Hash of the provider's normalized copy as of our last write. A mismatch on\n   * the next run means a human edited the case in the provider's UI.\n   */\n  hash: string;\n  /** Last known title, so orphan reports are readable without a remote lookup. */\n  title: string;\n  /**\n   * True only for cases this tool created.\n   *\n   * A case reached through a `story.tickets` id was authored by a human, so we\n   * push executions against it and never touch its body. Without this flag the\n   * first sync would silently overwrite hand-written cases, which is the single\n   * fastest way to lose a QA team.\n   */\n  owned: boolean;\n}\n\nexport interface Lockfile {\n  version: number;\n  /** provider name -> behaviour fingerprint -> entry */\n  providers: Record<string, Record<string, LockEntry>>;\n}\n\nexport function emptyLockfile(): Lockfile {\n  return { version: LOCKFILE_VERSION, providers: {} };\n}\n\n/**\n * Hash provider-normalized case content.\n *\n * Deliberately excludes `links`: those embed report URLs that change with every\n * CI run (build number, artifact host), and treating that churn as a human edit\n * would make the drift guard fire constantly and get switched off.\n */\nexport function hashCaseBody(body: CaseBody): string {\n  const canonical = JSON.stringify({\n    title: body.title.trim(),\n    steps: body.steps.map((s) => `${s.keyword.toLowerCase()}:${s.text.trim()}`),\n    description: body.description.trim(),\n  });\n  return createHash(\"sha1\").update(canonical).digest(\"hex\").slice(0, 16);\n}\n\n/**\n * Parse lockfile text. `label` names the source in errors, so the caller decides\n * whether that is a path, a URL, or something else entirely.\n *\n * Split from {@link readLockfile} so the CLI can route every read and write\n * through its injected file dependencies and still share these error messages.\n */\nexport function parseLockfile(contents: string, label: string): Lockfile {\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(contents);\n  } catch (err) {\n    throw new Error(\n      `Sync lockfile at ${label} is not valid JSON: ${(err as Error).message}\\n` +\n        `Fix or delete it — deleting orphans every existing case binding, so prefer fixing.`,\n      { cause: err },\n    );\n  }\n\n  if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n    throw new Error(`Sync lockfile at ${label} must contain an object.`);\n  }\n\n  const lock = parsed as Partial<Lockfile>;\n  if (lock.version !== LOCKFILE_VERSION) {\n    throw new Error(\n      `Sync lockfile at ${label} has version ${String(lock.version)}, expected ${LOCKFILE_VERSION}.`,\n    );\n  }\n\n  return { version: LOCKFILE_VERSION, providers: lock.providers ?? {} };\n}\n\n/** Serialize with sorted keys so the diff a reviewer sees is minimal and stable. */\nexport function serializeLockfile(lock: Lockfile): string {\n  const providers: Lockfile[\"providers\"] = {};\n  for (const provider of Object.keys(lock.providers).sort()) {\n    const entries = lock.providers[provider] ?? {};\n    const sorted: Record<string, LockEntry> = {};\n    for (const key of Object.keys(entries).sort()) sorted[key] = entries[key]!;\n    providers[provider] = sorted;\n  }\n\n  return `${JSON.stringify({ version: LOCKFILE_VERSION, providers }, null, 2)}\\n`;\n}\n\nexport function readLockfile(file: string): Lockfile {\n  if (!fs.existsSync(file)) return emptyLockfile();\n  return parseLockfile(fs.readFileSync(file, \"utf8\"), file);\n}\n\nexport function writeLockfile(file: string, lock: Lockfile): void {\n  fs.mkdirSync(path.dirname(path.resolve(file)), { recursive: true });\n  fs.writeFileSync(file, serializeLockfile(lock), \"utf8\");\n}\n\nexport function entriesFor(lock: Lockfile, provider: string): Record<string, LockEntry> {\n  return lock.providers[provider] ?? {};\n}\n\nexport function setEntry(\n  lock: Lockfile,\n  provider: string,\n  fingerprint: string,\n  entry: LockEntry,\n): void {\n  lock.providers[provider] ??= {};\n  lock.providers[provider]![fingerprint] = entry;\n}\n","/**\n * Rendering for the two things a human reads: the coverage report and the plan.\n *\n * Coverage answers \"what does my test-management system hold that my tests\n * already cover?\", which needs no write access and is the whole reason to try\n * this. The plan borrows `terraform plan` deliberately: the idiom is already in\n * everyone's head, and it is what makes pointing this at a company's TestRail\n * feel safe.\n *\n * Pure functions of a {@link SyncAnalysis}. No IO here.\n */\n\nimport type { ClassifiedCase, SyncAnalysis, SyncApplyResult } from \"./engine\";\n\n/**\n * Manual-only cases are the automation backlog, so they get listed rather than\n * merely counted. Capped because a first run against a real instance can return\n * hundreds, and the overflow is stated rather than silently dropped.\n */\nconst MANUAL_ONLY_LIMIT = 50;\n\nexport interface CoverageSummary {\n  provider: string;\n  target?: string;\n  totalCases: number;\n  automated: number;\n  duplicated: number;\n  possibleDuplicate: number;\n  manualOnly: number;\n  /** Stories with no case in the provider. */\n  untracked: number;\n  /** Stories whose case was reached through a human-authored ticket id. */\n  adopted: number;\n}\n\nexport interface CoverageJson extends CoverageSummary {\n  schema: \"executable-stories/sync-coverage/v1\";\n  cases: Array<{\n    id: string;\n    url: string;\n    title: string;\n    section?: string;\n    classification: ClassifiedCase[\"classification\"];\n    resembles?: string;\n    similarity?: number;\n  }>;\n  untrackedScenarios: string[];\n  orphaned: Array<{ caseId: string; url: string; title: string }>;\n  sections: Array<{ name: string; total: number; automated: number }>;\n}\n\nfunction summarize(analysis: SyncAnalysis): CoverageSummary {\n  const count = (kind: ClassifiedCase[\"classification\"]) =>\n    analysis.remote.filter((c) => c.classification === kind).length;\n\n  return {\n    provider: analysis.provider,\n    target: analysis.target,\n    totalCases: analysis.remote.length,\n    automated: count(\"automated\"),\n    duplicated: count(\"duplicated\"),\n    possibleDuplicate: count(\"possible-duplicate\"),\n    manualOnly: count(\"manual-only\"),\n    untracked: analysis.create.length,\n    adopted: analysis.adopted.length,\n  };\n}\n\nfunction sectionBreakdown(analysis: SyncAnalysis): Array<{ name: string; total: number; automated: number }> {\n  const sections = new Map<string, { total: number; automated: number }>();\n  for (const entry of analysis.remote) {\n    const name = entry.case.section ?? \"(no section)\";\n    const bucket = sections.get(name) ?? { total: 0, automated: 0 };\n    bucket.total += 1;\n    if (entry.classification === \"automated\") bucket.automated += 1;\n    sections.set(name, bucket);\n  }\n  return [...sections.entries()]\n    .map(([name, value]) => ({ name, ...value }))\n    .sort((a, b) => b.automated - a.automated || b.total - a.total);\n}\n\n/** Human-readable coverage, the first thing anyone sees. */\nexport function renderCoverageText(analysis: SyncAnalysis): string {\n  const summary = summarize(analysis);\n  const lines: string[] = [];\n\n  lines.push(`${analysis.provider}: ${analysis.target ?? \"(target not described)\"} (${summary.totalCases} cases)`);\n  lines.push(\"\");\n  lines.push(`  ${pad(summary.automated)}  automated        already covered by a story`);\n  lines.push(`  ${pad(summary.duplicated)}  duplicated       manual case duplicates an automated story`);\n  if (summary.possibleDuplicate > 0) {\n    lines.push(`  ${pad(summary.possibleDuplicate)}  possible dupe    similar to a story, needs a human to confirm`);\n  }\n  lines.push(`  ${pad(summary.manualOnly)}  manual only      no automated equivalent`);\n  lines.push(`  ${pad(summary.untracked)}  untracked        story with no case`);\n  if (summary.adopted > 0) {\n    lines.push(`  ${pad(summary.adopted)}  linked           story bound to a hand-authored case`);\n  }\n\n  const sections = sectionBreakdown(analysis).filter((s) => s.automated > 0);\n  if (sections.length > 0) {\n    const top = sections[0]!;\n    lines.push(\"\");\n    lines.push(`Biggest overlap: \"${top.name}\" section, ${top.automated} of ${top.total} automated.`);\n  }\n\n  if (analysis.orphaned.length > 0) {\n    lines.push(\"\");\n    lines.push(`${analysis.orphaned.length} case(s) bound to a story that no longer exists. Nothing was removed.`);\n  }\n  if (analysis.partialRunWarning) {\n    lines.push(\"\");\n    lines.push(`Note: ${analysis.partialRunWarning}`);\n  }\n\n  return lines.join(\"\\n\");\n}\n\nfunction pad(value: number): string {\n  return String(value).padStart(4, \" \");\n}\n\n/** The same content as Markdown, so it can be pasted, published, or PR-commented. */\nexport function renderCoverageMarkdown(analysis: SyncAnalysis): string {\n  const summary = summarize(analysis);\n  const lines: string[] = [];\n\n  lines.push(`# Test coverage vs ${analysis.provider}`);\n  lines.push(\"\");\n  if (analysis.target) lines.push(`**Target:** ${analysis.target}`, \"\");\n  lines.push(\"| Cases | Count | Meaning |\");\n  lines.push(\"| --- | ---: | --- |\");\n  lines.push(`| Automated | ${summary.automated} | Already covered by a story |`);\n  lines.push(`| Duplicated | ${summary.duplicated} | Manual case duplicates an automated story |`);\n  lines.push(`| Possible duplicate | ${summary.possibleDuplicate} | Similar to a story, needs review |`);\n  lines.push(`| Manual only | ${summary.manualOnly} | No automated equivalent |`);\n  lines.push(`| Untracked stories | ${summary.untracked} | Story with no case |`);\n  lines.push(\"\");\n\n  const duplicates = analysis.remote.filter(\n    (c) => c.classification === \"duplicated\" || c.classification === \"possible-duplicate\",\n  );\n  if (duplicates.length > 0) {\n    lines.push(\"## Retire these first\");\n    lines.push(\"\");\n    lines.push(\"Manual cases an automated story already covers.\");\n    lines.push(\"\");\n    lines.push(\"| Case | Title | Covered by | Confidence |\");\n    lines.push(\"| --- | --- | --- | --- |\");\n    for (const entry of duplicates) {\n      const confidence = entry.classification === \"duplicated\" ? \"exact title\" : `similarity ${entry.similarity}`;\n      lines.push(\n        `| [${entry.case.id}](${entry.case.url}) | ${escapeCell(entry.case.title)} | ${escapeCell(entry.resembles ?? \"\")} | ${confidence} |`,\n      );\n    }\n    lines.push(\"\");\n  }\n\n  const manualOnly = analysis.remote.filter((c) => c.classification === \"manual-only\");\n  if (manualOnly.length > 0) {\n    lines.push(\"## Not automated yet\");\n    lines.push(\"\");\n    lines.push(\"Cases with no automated equivalent. This is the backlog.\");\n    lines.push(\"\");\n    lines.push(\"| Case | Title | Section |\");\n    lines.push(\"| --- | --- | --- |\");\n    for (const entry of manualOnly.slice(0, MANUAL_ONLY_LIMIT)) {\n      lines.push(\n        `| [${entry.case.id}](${entry.case.url}) | ${escapeCell(entry.case.title)} | ${escapeCell(entry.case.section ?? \"\")} |`,\n      );\n    }\n    if (manualOnly.length > MANUAL_ONLY_LIMIT) {\n      lines.push(\"\");\n      lines.push(\n        `_${manualOnly.length - MANUAL_ONLY_LIMIT} more not listed here. The JSON artifact has all ${manualOnly.length}._`,\n      );\n    }\n    lines.push(\"\");\n  }\n\n  if (analysis.create.length > 0) {\n    lines.push(\"## Stories with no case\");\n    lines.push(\"\");\n    for (const planned of analysis.create) lines.push(`- ${planned.scenario}`);\n    lines.push(\"\");\n  }\n\n  if (analysis.orphaned.length > 0) {\n    lines.push(\"## Cases with no story\");\n    lines.push(\"\");\n    lines.push(\"Bound to a story that has since been deleted. Nothing was removed automatically.\");\n    lines.push(\"\");\n    for (const orphan of analysis.orphaned) {\n      lines.push(`- [${orphan.caseId}](${orphan.url}) ${escapeCell(orphan.title)}`);\n    }\n    lines.push(\"\");\n  }\n\n  const sections = sectionBreakdown(analysis);\n  if (sections.length > 1) {\n    lines.push(\"## By section\");\n    lines.push(\"\");\n    lines.push(\"| Section | Automated | Total |\");\n    lines.push(\"| --- | ---: | ---: |\");\n    for (const section of sections) {\n      lines.push(`| ${escapeCell(section.name)} | ${section.automated} | ${section.total} |`);\n    }\n    lines.push(\"\");\n  }\n\n  if (analysis.partialRunWarning) {\n    lines.push(`> ${analysis.partialRunWarning}`, \"\");\n  }\n\n  return lines.join(\"\\n\");\n}\n\nfunction escapeCell(text: string): string {\n  return text.replace(/\\|/g, \"\\\\|\");\n}\n\nexport function buildCoverageJson(analysis: SyncAnalysis): CoverageJson {\n  return {\n    schema: \"executable-stories/sync-coverage/v1\",\n    ...summarize(analysis),\n    cases: analysis.remote.map((entry) => ({\n      id: entry.case.id,\n      url: entry.case.url,\n      title: entry.case.title,\n      section: entry.case.section,\n      classification: entry.classification,\n      resembles: entry.resembles,\n      similarity: entry.similarity,\n    })),\n    untrackedScenarios: analysis.create.map((c) => c.scenario),\n    orphaned: analysis.orphaned.map((o) => ({ caseId: o.caseId, url: o.url, title: o.title })),\n    sections: sectionBreakdown(analysis),\n  };\n}\n\n// --- plan -------------------------------------------------------------------\n\nfunction formatBytes(bytes: number): string {\n  if (bytes < 1024) return `${bytes} B`;\n  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n  return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\n/** terraform-plan-shaped output. Read before anything is written. */\nexport function renderPlan(analysis: SyncAnalysis, opts: { dryRun: boolean }): string {\n  const lines: string[] = [];\n\n  lines.push(`${analysis.provider}: ${analysis.target ?? \"(target not described)\"}`);\n  lines.push(\"\");\n  lines.push(`  + create    ${pad(analysis.create.length)} cases`);\n  lines.push(`  ~ update    ${pad(analysis.update.length)} cases`);\n  lines.push(`  = unchanged ${pad(analysis.unchanged.length)} cases`);\n  if (analysis.adopted.length > 0) {\n    lines.push(`  · linked    ${pad(analysis.adopted.length)} cases  (hand-authored, results only)`);\n  }\n  if (analysis.skipped.length > 0) {\n    const edited = analysis.skipped.filter((s) => s.reason === \"remote-edited\").length;\n    const missing = analysis.skipped.filter((s) => s.reason === \"case-missing\").length;\n    if (edited > 0) {\n      lines.push(`  ! skipped   ${pad(edited)} cases  (edited in ${analysis.provider} since last sync)`);\n    }\n    if (missing > 0) {\n      lines.push(`  ! skipped   ${pad(missing)} cases  (bound case no longer exists)`);\n    }\n  }\n  if (analysis.orphaned.length > 0) {\n    lines.push(`  ? orphaned  ${pad(analysis.orphaned.length)} cases  (story deleted from codebase, never removed)`);\n  }\n\n  lines.push(`  → results   ${pad(analysis.results.length)} executions`);\n\n  if (analysis.attachments.files > 0) {\n    const roles = Object.entries(analysis.attachments.byRole)\n      .map(([role, count]) => `${count} ${role}${count === 1 ? \"\" : \"s\"}`)\n      .join(\", \");\n    lines.push(\n      `  ↑ upload    ${pad(analysis.attachments.files)} attachments (${roles}, ${formatBytes(analysis.attachments.bytes)})`,\n    );\n  }\n  for (const oversized of analysis.attachments.oversized) {\n    lines.push(\n      `  ! oversized ${oversized.filename} (${formatBytes(oversized.bytes)}, provider limit ${formatBytes(oversized.limit)})`,\n    );\n  }\n\n  for (const capability of analysis.unsupported) {\n    lines.push(`  ! ${analysis.provider} does not support ${capability} — those changes are not applied`);\n  }\n\n  if (analysis.driftUncheckable > 0) {\n    lines.push(\n      `  ! ${analysis.driftUncheckable} case(s): ${analysis.provider} returned no body, so a hand edit to them cannot be detected`,\n    );\n  }\n\n  if (analysis.partialRunWarning) {\n    lines.push(\"\");\n    lines.push(`Note: ${analysis.partialRunWarning}`);\n  }\n\n  if (analysis.skipped.some((s) => s.reason === \"remote-edited\")) {\n    lines.push(\"\");\n    lines.push(\"Skipped cases were edited by hand after we last wrote them. Nothing overwrites them.\");\n    for (const skip of analysis.skipped.filter((s) => s.reason === \"remote-edited\")) {\n      lines.push(`  ${skip.caseId} ${skip.title} ${skip.url}`);\n    }\n  }\n\n  if (opts.dryRun && hasWork(analysis)) {\n    lines.push(\"\");\n    lines.push(\"Nothing was written. Run the same command with --apply to make these changes.\");\n  }\n\n  return lines.join(\"\\n\");\n}\n\nfunction hasWork(analysis: SyncAnalysis): boolean {\n  return (\n    analysis.create.length > 0 ||\n    analysis.update.length > 0 ||\n    analysis.results.length > 0\n  );\n}\n\n/** What actually happened, printed after a real run. */\nexport function renderApplyResult(result: SyncApplyResult): string {\n  const lines: string[] = [];\n\n  for (const created of result.created) {\n    lines.push(`  + ${created.caseId}  ${created.scenario}  ${created.url}`);\n  }\n  for (const updated of result.updated) {\n    lines.push(`  ~ ${updated.caseId}  ${updated.scenario}`);\n  }\n\n  lines.push(\"\");\n  lines.push(\n    `Created ${result.created.length}, updated ${result.updated.length}, recorded ${result.resultsRecorded} execution(s), uploaded ${result.attachmentsUploaded} attachment(s).`,\n  );\n  if (result.runUrl) lines.push(`Run: ${result.runUrl}`);\n\n  for (const skipped of result.resultsSkipped) {\n    lines.push(`  ! result for case ${skipped.caseId} not recorded: ${skipped.reason}`);\n  }\n  for (const error of result.errors) {\n    lines.push(`  ✗ ${error}`);\n  }\n\n  return lines.join(\"\\n\");\n}\n","/**\n * Text round-tripping shared by adapters.\n *\n * Test-management systems store a step as one string with no notion of a BDD\n * keyword, and have one description field with no notion of links. Both get\n * flattened on the way out and parsed back on the way in.\n *\n * These must stay exactly symmetrical: the drift guard hashes what we read back\n * from the provider, so an asymmetric encode/decode would report every case as\n * edited by a human on the very next run.\n */\n\nconst BDD_KEYWORDS = [\"Given\", \"When\", \"Then\", \"And\", \"But\"];\n\nexport function encodeStepText(step: { keyword: string; text: string }): string {\n  const keyword = step.keyword.trim();\n  return keyword ? `${keyword} ${step.text}` : step.text;\n}\n\nexport function decodeStepText(content: string): { keyword: string; text: string } {\n  const trimmed = content.trim();\n  const firstSpace = trimmed.indexOf(\" \");\n  if (firstSpace > 0) {\n    const head = trimmed.slice(0, firstSpace);\n    if (BDD_KEYWORDS.some((keyword) => keyword.toLowerCase() === head.toLowerCase())) {\n      return { keyword: head, text: trimmed.slice(firstSpace + 1) };\n    }\n  }\n  return { keyword: \"\", text: trimmed };\n}\n\n/** Links become a trailing markdown list so they survive a round trip. */\nexport function encodeDescription(body: {\n  description: string;\n  links: ReadonlyArray<{ label: string; url: string }>;\n}): string {\n  if (body.links.length === 0) return body.description;\n  const links = body.links.map((link) => `- [${link.label}](${link.url})`).join(\"\\n\");\n  return `${body.description}\\n\\n${links}`;\n}\n\nexport function decodeDescription(raw: string): {\n  description: string;\n  links: Array<{ label: string; url: string }>;\n} {\n  const links: Array<{ label: string; url: string }> = [];\n  const lines = raw.split(\"\\n\");\n  let cut = lines.length;\n\n  for (let index = lines.length - 1; index >= 0; index--) {\n    const line = lines[index]!.trim();\n    if (line === \"\") continue;\n    const match = /^- \\[([^\\]]+)\\]\\(([^)]+)\\)$/.exec(line);\n    if (!match) break;\n    links.unshift({ label: match[1]!, url: match[2]! });\n    cut = index;\n  }\n\n  return { description: lines.slice(0, cut).join(\"\\n\").trim(), links };\n}\n","/**\n * TestRail adapter.\n *\n * Translates between the sync port and TestRail's API v2. All decisions about\n * what to write live in the engine; this file only knows how TestRail spells\n * things.\n *\n * Case templates differ per instance, which is why the step and description\n * field names are configurable. The defaults match TestRail's stock\n * \"Test Case (Steps)\" template.\n *\n * Auth: basic, with an API key rather than a password. Generate one under\n * My Settings -> API Keys.\n */\n\nimport type {\n  AdapterDeps,\n  CaseBody,\n  CaseResult,\n  RecordResultsSummary,\n  RemoteCase,\n  SyncProvider,\n} from \"../port\";\nimport {\n  decodeDescription,\n  decodeStepText,\n  encodeDescription,\n  encodeStepText,\n} from \"./case-text\";\n\nexport interface TestRailConfig {\n  /** Instance URL, e.g. https://acme.testrail.io */\n  url: string;\n  projectId: number | string;\n  /** Required on multi-suite projects. */\n  suiteId?: number | string;\n  /** Target section for created cases. Without it, creation is refused. */\n  sectionId?: number | string;\n  /** Reuse an existing run instead of creating one per sync. */\n  runId?: number | string;\n  /** Name for created runs. A UTC timestamp is appended. */\n  runName?: string;\n  /** Close the run after recording results. */\n  closeRun?: boolean;\n  /** Case template to create against, when the project uses a non-default one. */\n  templateId?: number;\n  /**\n   * Result status ids. TestRail ships 1=Passed and 5=Failed; there is no stock\n   * \"skipped\", so skipped results are dropped unless an id is configured.\n   */\n  statusIds?: { passed?: number; failed?: number; skipped?: number };\n  /** Field names, for instances with customised case templates. */\n  fields?: { steps?: string; description?: string };\n  /**\n   * Per-file attachment limit. Conservative by default: instances have storage\n   * quotas, and a surprise 200 MB of video is a support ticket.\n   */\n  maxAttachmentBytes?: number;\n}\n\nexport interface TestRailAuth {\n  username: string;\n  apiKey: string;\n}\n\nconst DEFAULT_STEPS_FIELD = \"custom_steps_separated\";\nconst DEFAULT_DESCRIPTION_FIELD = \"custom_preconds\";\nconst DEFAULT_MAX_ATTACHMENT_BYTES = 64 * 1024 * 1024;\nconst PAGE_LIMIT = 250;\n/** Attempts per request before a 429 becomes an error. */\nconst MAX_ATTEMPTS = 3;\n\ninterface TestRailCase {\n  id: number;\n  title: string;\n  section_id?: number;\n  [field: string]: unknown;\n}\n\ninterface TestRailStep {\n  content?: string;\n  expected?: string;\n}\n\n/** `{ cases: [...] }` on current TestRail, a bare array on older instances. */\nfunction unwrapList<T>(payload: unknown, key: string): T[] {\n  if (Array.isArray(payload)) return payload as T[];\n  if (payload && typeof payload === \"object\") {\n    const list = (payload as Record<string, unknown>)[key];\n    if (Array.isArray(list)) return list as T[];\n  }\n  return [];\n}\n\n/** TestRail rejects an elapsed under one second, and \"0s\" outright. */\nfunction encodeElapsed(durationMs: number): string | undefined {\n  const seconds = Math.floor(durationMs / 1000);\n  if (seconds < 1) return undefined;\n  if (seconds < 60) return `${seconds}s`;\n  const minutes = Math.floor(seconds / 60);\n  const rest = seconds % 60;\n  return rest === 0 ? `${minutes}m` : `${minutes}m ${rest}s`;\n}\n\n/**\n * Turn the two failures every first run hits into something actionable.\n *\n * A bare \"401: Authentication failed\" sends people to check the password they\n * already checked. The real causes are narrow and worth naming: TestRail\n * rejects passwords outright once an instance enforces API keys, and the API\n * itself is off by default until an admin enables it.\n */\nfunction authHint(status: number): string {\n  if (status === 401) {\n    return \"\\n  TESTRAIL_USERNAME must be the login email and TESTRAIL_API_KEY an API key from My Settings -> API Keys. A password fails here when the instance enforces API keys.\";\n  }\n  if (status === 403) {\n    return \"\\n  The credentials were accepted but the request was refused. Usually the API is disabled: an admin enables it under Administration -> Site Settings -> API.\";\n  }\n  return \"\";\n}\n\nexport function createTestRailProvider(\n  config: TestRailConfig,\n  auth: TestRailAuth,\n  deps: AdapterDeps,\n): SyncProvider {\n  const base = config.url.replace(/\\/$/, \"\");\n  const stepsField = config.fields?.steps ?? DEFAULT_STEPS_FIELD;\n  const descriptionField = config.fields?.description ?? DEFAULT_DESCRIPTION_FIELD;\n  const basicAuth = Buffer.from(`${auth.username}:${auth.apiKey}`).toString(\"base64\");\n\n  let projectName: string | undefined;\n  let suiteName: string | undefined;\n  const sectionNames = new Map<number, string>();\n\n  async function api(method: string, init?: { body?: unknown; form?: FormData }): Promise<unknown> {\n    const url = `${base}/index.php?/api/v2/${method}`;\n    const headers: Record<string, string> = {\n      Authorization: `Basic ${basicAuth}`,\n    };\n    // Spelled out rather than `BodyInit`: that name only exists when the DOM lib\n    // is loaded, and this source is type-checked by packages that do not load it.\n    let body: string | FormData | undefined;\n\n    if (init?.form) {\n      // Let fetch set the multipart boundary.\n      body = init.form;\n    } else if (init?.body !== undefined) {\n      headers[\"Content-Type\"] = \"application/json\";\n      body = JSON.stringify(init.body);\n    }\n\n    // TestRail rate-limits hard on cloud plans and answers 429 with Retry-After.\n    // Three attempts, honouring the header rather than backing off blindly: the\n    // server states how long it wants, and a per-run sync never needs more.\n    for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {\n      const response = await deps.fetch(url, {\n        method: body === undefined ? \"GET\" : \"POST\",\n        headers,\n        body,\n      });\n\n      if (response.status === 429 && attempt < MAX_ATTEMPTS - 1) {\n        const retryAfter = Number(response.headers.get(\"retry-after\") ?? \"1\");\n        deps.logger.warn(`TestRail rate limit hit, retrying in ${retryAfter}s`);\n        await new Promise((resolve) => setTimeout(resolve, Math.max(1, retryAfter) * 1000));\n        continue;\n      }\n\n      const text = await response.text();\n      if (text.length === 0) {\n        if (response.ok) return undefined;\n        throw new Error(\n          `TestRail ${method} failed (${response.status}) with an empty response${authHint(response.status)}`,\n        );\n      }\n\n      // Parse before branching on `ok`. A misconfigured `url` gets a login page\n      // back with a 200, so checking the status first would leave the real\n      // failure to surface as \"Unexpected token '<'\" further down.\n      let parsed: unknown;\n      try {\n        parsed = JSON.parse(text);\n      } catch {\n        throw new Error(\n          `TestRail ${method} returned HTML rather than JSON (status ${response.status}).\\n` +\n            `  Check that sync.testrail.url is the instance root, e.g. https://acme.testrail.io, with no path after it.`,\n        );\n      }\n\n      if (!response.ok) {\n        const detail = (parsed as { error?: string }).error ?? text;\n        throw new Error(\n          `TestRail ${method} failed (${response.status}): ${detail}${authHint(response.status)}`,\n        );\n      }\n\n      return parsed;\n    }\n\n    throw new Error(`TestRail ${method} failed: rate limited after ${MAX_ATTEMPTS} attempts`);\n  }\n\n  /** Walk TestRail's offset pagination. */\n  async function paginate<T>(method: string, key: string): Promise<T[]> {\n    const all: T[] = [];\n    for (let offset = 0; ; offset += PAGE_LIMIT) {\n      // The base URL already carries the \"?\", so every parameter appends with \"&\".\n      const page = await api(`${method}&limit=${PAGE_LIMIT}&offset=${offset}`);\n      const items = unwrapList<T>(page, key);\n      all.push(...items);\n      if (items.length < PAGE_LIMIT) return all;\n    }\n  }\n\n  function caseUrl(id: number | string): string {\n    return `${base}/index.php?/cases/view/${id}`;\n  }\n\n  /**\n   * @param context The call this case came back from, named in the error when\n   * the response is not a case at all. Without it a partial response fails much\n   * later as a TypeError from inside the hashing, pointing at nothing useful.\n   */\n  function toRemoteCase(raw: TestRailCase, context: string): RemoteCase {\n    if (raw?.id === undefined) {\n      throw new Error(\n        `TestRail ${context} returned no case id. The response was: ${JSON.stringify(raw)?.slice(0, 200)}`,\n      );\n    }\n    const title = typeof raw.title === \"string\" ? raw.title : \"\";\n    const steps = Array.isArray(raw[stepsField]) ? (raw[stepsField] as TestRailStep[]) : [];\n    const rawDescription = typeof raw[descriptionField] === \"string\" ? (raw[descriptionField] as string) : \"\";\n    const { description, links } = decodeDescription(rawDescription);\n\n    return {\n      id: String(raw.id),\n      url: caseUrl(raw.id),\n      title,\n      section: raw.section_id === undefined ? undefined : sectionNames.get(raw.section_id),\n      body: {\n        title,\n        steps: steps.map((step) => decodeStepText(step.content ?? \"\")),\n        description,\n        links,\n      },\n    };\n  }\n\n  function bodyToPayload(body: CaseBody): Record<string, unknown> {\n    const payload: Record<string, unknown> = {\n      title: body.title,\n      [stepsField]: body.steps.map((step) => ({ content: encodeStepText(step), expected: \"\" })),\n      [descriptionField]: encodeDescription(body),\n    };\n    if (config.templateId !== undefined) payload[\"template_id\"] = config.templateId;\n    return payload;\n  }\n\n  const suiteQuery = config.suiteId === undefined ? \"\" : `&suite_id=${config.suiteId}`;\n\n  return {\n    name: \"testrail\",\n    maxAttachmentBytes: config.maxAttachmentBytes ?? DEFAULT_MAX_ATTACHMENT_BYTES,\n\n    describeTarget() {\n      const project = projectName ?? `project ${config.projectId}`;\n      const suite = suiteName ?? (config.suiteId === undefined ? undefined : `suite ${config.suiteId}`);\n      return suite ? `${project} / ${suite}` : project;\n    },\n\n    async listCases() {\n      // Names are cosmetic (plan header, section breakdown), so a permissions\n      // failure here must not sink the whole read.\n      try {\n        const project = (await api(`get_project/${config.projectId}`)) as { name?: string } | undefined;\n        projectName = project?.name;\n        if (config.suiteId !== undefined) {\n          const suite = (await api(`get_suite/${config.suiteId}`)) as { name?: string } | undefined;\n          suiteName = suite?.name;\n        }\n        const sections = await paginate<{ id: number; name: string }>(\n          `get_sections/${config.projectId}${suiteQuery}`,\n          \"sections\",\n        );\n        for (const section of sections) sectionNames.set(section.id, section.name);\n      } catch (err) {\n        deps.logger.warn(`TestRail metadata lookup failed, continuing without names: ${(err as Error).message}`);\n      }\n\n      const cases = await paginate<TestRailCase>(`get_cases/${config.projectId}${suiteQuery}`, \"cases\");\n      return cases.map((raw) => toRemoteCase(raw, \"get_cases\"));\n    },\n\n    async createCase(body) {\n      if (config.sectionId === undefined) {\n        throw new Error(\n          \"TestRail needs a sectionId to create cases. Set sync.testrail.sectionId to the section new cases should land in.\",\n        );\n      }\n      const created = (await api(`add_case/${config.sectionId}`, {\n        body: bodyToPayload(body),\n      })) as TestRailCase;\n      return toRemoteCase(created, `add_case/${config.sectionId}`);\n    },\n\n    async updateCase(id, body) {\n      const updated = (await api(`update_case/${id}`, { body: bodyToPayload(body) })) as TestRailCase;\n      return toRemoteCase(updated, `update_case/${id}`);\n    },\n\n    async recordResults(results): Promise<RecordResultsSummary> {\n      const statusIds = {\n        passed: config.statusIds?.passed ?? 1,\n        failed: config.statusIds?.failed ?? 5,\n        skipped: config.statusIds?.skipped,\n      };\n\n      const skipped: RecordResultsSummary[\"skipped\"] = [];\n      const sendable: Array<{ result: CaseResult; caseId: number; statusId: number }> = [];\n\n      for (const result of results) {\n        const caseId = Number(result.caseId);\n        if (!Number.isFinite(caseId)) {\n          skipped.push({ caseId: result.caseId, reason: \"case id is not numeric\" });\n          continue;\n        }\n        const statusId = result.status === \"skipped\" ? statusIds.skipped : statusIds[result.status];\n        if (statusId === undefined) {\n          skipped.push({\n            caseId: result.caseId,\n            reason: \"no TestRail status id configured for skipped (set sync.testrail.statusIds.skipped)\",\n          });\n          continue;\n        }\n        sendable.push({ result, caseId, statusId });\n      }\n\n      if (sendable.length === 0) {\n        return { recorded: 0, skipped, attachmentsUploaded: 0 };\n      }\n\n      let runId = config.runId;\n      if (runId === undefined) {\n        const name = `${config.runName ?? \"executable-stories\"} ${new Date().toISOString()}`;\n        const run = (await api(`add_run/${config.projectId}`, {\n          body: {\n            ...(config.suiteId === undefined ? {} : { suite_id: config.suiteId }),\n            name,\n            include_all: false,\n            // Deduplicated: two stories can carry the same ticket id, and\n            // TestRail rejects a run whose case list repeats one.\n            case_ids: [...new Set(sendable.map((s) => s.caseId))],\n          },\n        })) as { id: number };\n        runId = run.id;\n      }\n      const runUrl = `${base}/index.php?/runs/view/${runId}`;\n\n      const payload = sendable.map(({ result, caseId, statusId }) => {\n        const elapsed = encodeElapsed(result.durationMs);\n        const comment = [result.message, result.url ? `Living documentation: ${result.url}` : undefined]\n          .filter(Boolean)\n          .join(\"\\n\\n\");\n        return {\n          case_id: caseId,\n          status_id: statusId,\n          ...(comment ? { comment } : {}),\n          ...(elapsed ? { elapsed } : {}),\n        };\n      });\n\n      const recorded = unwrapList<{ id: number; case_id: number }>(\n        await api(`add_results_for_cases/${runId}`, { body: { results: payload } }),\n        \"results\",\n      );\n\n      // TestRail answers in submission order, so pair positionally rather than\n      // trusting case_id, which repeats when a case appears twice in a run.\n      let attachmentsUploaded = 0;\n      for (const [index, entry] of recorded.entries()) {\n        const source = sendable[index]?.result;\n        for (const attachment of source?.attachments ?? []) {\n          try {\n            const form = new FormData();\n            // Handed to Blob as a plain ArrayBuffer. `BlobPart` only exists with\n            // the DOM lib loaded, and a Uint8Array view is not assignable to it\n            // under this TypeScript version, so neither name works across every\n            // package that type-checks this source.\n            const bytes = attachment.body.buffer.slice(\n              attachment.body.byteOffset,\n              attachment.body.byteOffset + attachment.body.byteLength,\n            ) as ArrayBuffer;\n            form.append(\n              \"attachment\",\n              new Blob([bytes], { type: attachment.mediaType }),\n              attachment.filename,\n            );\n            await api(`add_attachment_to_result/${entry.id}`, { form });\n            attachmentsUploaded += 1;\n          } catch (err) {\n            // Evidence is additive. A rejected upload must not lose the result\n            // that was already recorded.\n            deps.logger.warn(\n              `TestRail attachment \"${attachment.filename}\" failed: ${(err as Error).message}`,\n            );\n          }\n        }\n      }\n\n      if (config.closeRun && config.runId === undefined) {\n        await api(`close_run/${runId}`, { body: {} });\n      }\n\n      return {\n        runId: String(runId),\n        runUrl,\n        recorded: recorded.length,\n        skipped,\n        attachmentsUploaded,\n      };\n    },\n  };\n}\n","/**\n * Xray (Jira Cloud) adapter.\n *\n * Xray splits its API in two and this adapter has to speak both: a GraphQL API\n * for test definitions, and a REST endpoint for importing execution results.\n * Evidence rides along with the results as base64, so screenshots and video\n * land on the execution without a separate upload call.\n *\n * A case id here is a Jira issue key (\"PROJ-42\"), not a number, which is why\n * `ticketPrefixStrip: false` is the right engine setting for this provider.\n *\n * Auth: an Xray API key pair (client id + secret) from Jira Settings -> Apps ->\n * Xray -> API Keys. Updating an existing test's summary or description also\n * needs Jira credentials, because those are Jira fields Xray does not own.\n */\n\nimport type {\n  AdapterDeps,\n  RecordResultsSummary,\n  RemoteCase,\n  SyncProvider,\n} from \"../port\";\nimport {\n  decodeDescription,\n  decodeStepText,\n  encodeDescription,\n  encodeStepText,\n} from \"./case-text\";\n\nexport interface XrayConfig {\n  /** Jira site URL, e.g. https://acme.atlassian.net */\n  jiraBaseUrl: string;\n  projectKey: string;\n  /** Xray Cloud API base. */\n  xrayBaseUrl?: string;\n  /** Selects the existing tests to reconcile against. */\n  jql?: string;\n  /** Xray test type for created tests. */\n  testType?: string;\n  /** Link created executions to this test plan. */\n  testPlanKey?: string;\n  /** Push results into an existing execution instead of creating one. */\n  testExecutionKey?: string;\n  /** Summary for created executions. A UTC timestamp is appended. */\n  executionSummary?: string;\n  statuses?: { passed?: string; failed?: string; skipped?: string };\n  maxAttachmentBytes?: number;\n}\n\nexport interface XrayAuth {\n  clientId: string;\n  clientSecret: string;\n  /** Atlassian account email, needed only to update Jira summary/description. */\n  jiraEmail?: string;\n  /** Atlassian API token, needed only to update Jira summary/description. */\n  jiraToken?: string;\n}\n\nconst DEFAULT_XRAY_BASE = \"https://xray.cloud.getxray.app\";\nconst DEFAULT_TEST_TYPE = \"Manual\";\n/** Xray embeds evidence as base64 in the results payload, so keep files modest. */\nconst DEFAULT_MAX_ATTACHMENT_BYTES = 32 * 1024 * 1024;\nconst PAGE_LIMIT = 100;\n\ninterface XrayStep {\n  id: string;\n  action?: string;\n  data?: string;\n  result?: string;\n}\n\ninterface XrayTest {\n  issueId: string;\n  jira?: { key?: string; summary?: string; description?: unknown };\n  steps?: XrayStep[];\n}\n\n/**\n * Jira Cloud stores descriptions as ADF, so plain text has to be wrapped going\n * out and flattened coming back. Only paragraphs are produced: the description\n * is generated from the test, so nothing is lost by keeping the markup flat.\n */\nfunction toAdf(text: string): Record<string, unknown> {\n  const paragraphs = text.split(\"\\n\\n\").filter((block) => block.trim() !== \"\");\n  return {\n    version: 1,\n    type: \"doc\",\n    content:\n      paragraphs.length === 0\n        ? [{ type: \"paragraph\", content: [] }]\n        : paragraphs.map((block) => ({\n            type: \"paragraph\",\n            content: [{ type: \"text\", text: block }],\n          })),\n  };\n}\n\nfunction fromAdf(value: unknown): string {\n  if (typeof value === \"string\") return value;\n  if (!value || typeof value !== \"object\") return \"\";\n\n  const blocks: string[] = [];\n  const walk = (node: unknown, collected: string[]): void => {\n    if (!node || typeof node !== \"object\") return;\n    const typed = node as { type?: string; text?: string; content?: unknown[] };\n    if (typed.type === \"text\" && typeof typed.text === \"string\") collected.push(typed.text);\n    for (const child of typed.content ?? []) walk(child, collected);\n  };\n\n  for (const node of ((value as { content?: unknown[] }).content ?? [])) {\n    const collected: string[] = [];\n    walk(node, collected);\n    blocks.push(collected.join(\"\"));\n  }\n\n  return blocks.join(\"\\n\\n\").trim();\n}\n\nexport function createXrayProvider(\n  config: XrayConfig,\n  auth: XrayAuth,\n  deps: AdapterDeps,\n): SyncProvider {\n  const xrayBase = (config.xrayBaseUrl ?? DEFAULT_XRAY_BASE).replace(/\\/$/, \"\");\n  const jiraBase = config.jiraBaseUrl.replace(/\\/$/, \"\");\n  const jql = config.jql ?? `project = \"${config.projectKey}\" AND issuetype = Test`;\n  /** Issue key -> Xray internal issue id, needed for step mutations. */\n  const issueIds = new Map<string, string>();\n  let token: string | undefined;\n\n  async function authenticate(): Promise<string> {\n    if (token) return token;\n    const response = await deps.fetch(`${xrayBase}/api/v2/authenticate`, {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application/json\" },\n      body: JSON.stringify({ client_id: auth.clientId, client_secret: auth.clientSecret }),\n    });\n    const text = await response.text();\n    if (!response.ok) {\n      // The commonest cause is reaching for the wrong pair of credentials: Jira\n      // API tokens and Xray API keys look alike and are not interchangeable.\n      throw new Error(\n        `Xray authentication failed (${response.status}): ${text}\\n` +\n          `  XRAY_CLIENT_ID and XRAY_CLIENT_SECRET come from Jira -> Apps -> Xray -> API Keys. A Jira API token is a different credential and is rejected here.`,\n      );\n    }\n    // The endpoint answers with a quoted JSON string, not an object.\n    token = (JSON.parse(text) as string).replace(/^\"|\"$/g, \"\");\n    return token;\n  }\n\n  async function graphql(query: string, variables?: Record<string, unknown>): Promise<unknown> {\n    const bearer = await authenticate();\n    const response = await deps.fetch(`${xrayBase}/api/v2/graphql`, {\n      method: \"POST\",\n      headers: {\n        Authorization: `Bearer ${bearer}`,\n        \"Content-Type\": \"application/json\",\n      },\n      body: JSON.stringify({ query, variables }),\n    });\n\n    const text = await response.text();\n    if (!response.ok) throw new Error(`Xray GraphQL failed (${response.status}): ${text}`);\n\n    const payload = JSON.parse(text) as { data?: unknown; errors?: Array<{ message: string }> };\n    if (payload.errors?.length) {\n      throw new Error(`Xray GraphQL error: ${payload.errors.map((e) => e.message).join(\"; \")}`);\n    }\n    return payload.data;\n  }\n\n  function issueUrl(key: string): string {\n    return `${jiraBase}/browse/${key}`;\n  }\n\n  function toRemoteCase(test: XrayTest): RemoteCase {\n    const key = test.jira?.key ?? test.issueId;\n    if (!key) {\n      // Named here rather than left to fail later inside the engine's hashing,\n      // where the message would point at nothing.\n      throw new Error(\n        `Xray returned a test with neither a Jira key nor an issue id: ${JSON.stringify(test)?.slice(0, 200)}`,\n      );\n    }\n    if (test.jira?.key) issueIds.set(test.jira.key, test.issueId);\n\n    const { description, links } = decodeDescription(fromAdf(test.jira?.description));\n\n    return {\n      id: key,\n      url: issueUrl(key),\n      title: test.jira?.summary ?? key,\n      body: {\n        title: test.jira?.summary ?? key,\n        steps: (test.steps ?? []).map((step) => decodeStepText(step.action ?? \"\")),\n        description,\n        links,\n      },\n    };\n  }\n\n  async function jiraUpdate(key: string, fields: Record<string, unknown>): Promise<void> {\n    if (!auth.jiraEmail || !auth.jiraToken) {\n      deps.logger.warn(\n        `Xray: summary/description for ${key} left unchanged. Set JIRA_EMAIL and JIRA_TOKEN to update Jira fields (steps are updated either way).`,\n      );\n      return;\n    }\n    const basic = Buffer.from(`${auth.jiraEmail}:${auth.jiraToken}`).toString(\"base64\");\n    const response = await deps.fetch(`${jiraBase}/rest/api/3/issue/${key}`, {\n      method: \"PUT\",\n      headers: { Authorization: `Basic ${basic}`, \"Content-Type\": \"application/json\" },\n      body: JSON.stringify({ fields }),\n    });\n    if (!response.ok) {\n      throw new Error(`Jira update of ${key} failed (${response.status}): ${await response.text()}`);\n    }\n  }\n\n  return {\n    name: \"xray\",\n    maxAttachmentBytes: config.maxAttachmentBytes ?? DEFAULT_MAX_ATTACHMENT_BYTES,\n\n    describeTarget() {\n      return `${config.projectKey} (${jiraBase})`;\n    },\n\n    async listCases() {\n      const tests: XrayTest[] = [];\n      for (let start = 0; ; start += PAGE_LIMIT) {\n        const data = (await graphql(\n          `query($jql: String!, $limit: Int!, $start: Int!) {\n             getTests(jql: $jql, limit: $limit, start: $start) {\n               total\n               results {\n                 issueId\n                 jira(fields: [\"key\", \"summary\", \"description\"])\n                 steps { id action data result }\n               }\n             }\n           }`,\n          { jql, limit: PAGE_LIMIT, start },\n        )) as { getTests?: { total?: number; results?: XrayTest[] } };\n\n        const page = data.getTests?.results ?? [];\n        tests.push(...page);\n        if (page.length < PAGE_LIMIT) break;\n      }\n\n      return tests.map(toRemoteCase);\n    },\n\n    async createCase(body) {\n      const data = (await graphql(\n        `mutation($testType: UpdateTestTypeInput!, $steps: [CreateStepInput], $jira: JSON!) {\n           createTest(testType: $testType, steps: $steps, jira: $jira) {\n             test { issueId jira(fields: [\"key\", \"summary\", \"description\"]) }\n             warnings\n           }\n         }`,\n        {\n          testType: { name: config.testType ?? DEFAULT_TEST_TYPE },\n          steps: body.steps.map((step) => ({ action: encodeStepText(step), result: \"\" })),\n          jira: {\n            fields: {\n              summary: body.title,\n              description: toAdf(encodeDescription(body)),\n              project: { key: config.projectKey },\n            },\n          },\n        },\n      )) as { createTest?: { test?: XrayTest; warnings?: string[] } };\n\n      const created = data.createTest?.test;\n      if (!created) throw new Error(`Xray createTest returned no test for \"${body.title}\"`);\n      for (const warning of data.createTest?.warnings ?? []) deps.logger.warn(`Xray: ${warning}`);\n\n      return toRemoteCase(created);\n    },\n\n    async updateCase(id, body) {\n      const issueId = issueIds.get(id);\n      if (!issueId) {\n        throw new Error(`Xray: no internal issue id cached for ${id}. Run listCases first.`);\n      }\n\n      // Xray has no \"replace all steps\" mutation, and these calls are neither\n      // batched nor transactional, so reconcile position by position rather than\n      // clearing and rebuilding: overwrite the steps that already exist, append\n      // what is new, remove only the surplus.\n      //\n      // That matters because a failure part-way through is a question of which\n      // half-written state the test is left in. Rebuilding leaves the case with\n      // no steps at all if the run dies between the deletes and the adds. This\n      // way every prefix is a correct prefix, and a rerun finishes the job.\n      const current = (await graphql(\n        `query($issueId: String!) { getTest(issueId: $issueId) { steps { id } } }`,\n        { issueId },\n      )) as { getTest?: { steps?: Array<{ id: string }> } };\n      const existing = current.getTest?.steps ?? [];\n\n      for (const [index, step] of body.steps.entries()) {\n        const action = encodeStepText(step);\n        const target = existing[index];\n        if (target) {\n          await graphql(\n            `mutation($stepId: String!, $step: UpdateStepInput!) {\n               updateTestStep(stepId: $stepId, step: $step)\n             }`,\n            { stepId: target.id, step: { action, result: \"\" } },\n          );\n        } else {\n          await graphql(\n            `mutation($issueId: String!, $step: CreateStepInput!) {\n               addTestStep(issueId: $issueId, step: $step) { id }\n             }`,\n            { issueId, step: { action, result: \"\" } },\n          );\n        }\n      }\n\n      // Trailing steps the story no longer has. Removed last, and back to front,\n      // so an interrupted run never renumbers a step it has yet to visit.\n      for (const surplus of existing.slice(body.steps.length).reverse()) {\n        await graphql(`mutation($stepId: String!) { removeTestStep(stepId: $stepId) }`, {\n          stepId: surplus.id,\n        });\n      }\n\n      await jiraUpdate(id, {\n        summary: body.title,\n        description: toAdf(encodeDescription(body)),\n      });\n\n      return {\n        id,\n        url: issueUrl(id),\n        title: body.title,\n        body,\n      };\n    },\n\n    async recordResults(results): Promise<RecordResultsSummary> {\n      const statuses = {\n        passed: config.statuses?.passed ?? \"PASSED\",\n        failed: config.statuses?.failed ?? \"FAILED\",\n        skipped: config.statuses?.skipped ?? \"TODO\",\n      };\n\n      let attachmentsUploaded = 0;\n      const tests = results.map((result) => {\n        const evidence = (result.attachments ?? []).map((attachment) => {\n          attachmentsUploaded += 1;\n          return {\n            data: Buffer.from(attachment.body).toString(\"base64\"),\n            filename: attachment.filename,\n            contentType: attachment.mediaType,\n          };\n        });\n\n        const comment = [result.message, result.url ? `Living documentation: ${result.url}` : undefined]\n          .filter(Boolean)\n          .join(\"\\n\\n\");\n\n        return {\n          testKey: result.caseId,\n          status: statuses[result.status],\n          ...(comment ? { comment } : {}),\n          ...(evidence.length > 0 ? { evidence } : {}),\n        };\n      });\n\n      const bearer = await authenticate();\n      const payload = {\n        ...(config.testExecutionKey ? { testExecutionKey: config.testExecutionKey } : {}),\n        info: {\n          summary: `${config.executionSummary ?? \"executable-stories\"} ${new Date().toISOString()}`,\n          project: config.projectKey,\n          ...(config.testPlanKey ? { testPlanKey: config.testPlanKey } : {}),\n        },\n        tests,\n      };\n\n      const response = await deps.fetch(`${xrayBase}/api/v2/import/execution`, {\n        method: \"POST\",\n        headers: { Authorization: `Bearer ${bearer}`, \"Content-Type\": \"application/json\" },\n        body: JSON.stringify(payload),\n      });\n\n      const text = await response.text();\n      if (!response.ok) {\n        throw new Error(`Xray import execution failed (${response.status}): ${text}`);\n      }\n\n      const imported = JSON.parse(text) as { id?: string; key?: string };\n      return {\n        runId: imported.key,\n        runUrl: imported.key ? issueUrl(imported.key) : undefined,\n        recorded: tests.length,\n        skipped: [],\n        attachmentsUploaded,\n      };\n    },\n  };\n}\n","/**\n * Provider registry.\n *\n * Adding a provider is one file next to this one plus one entry in the map\n * below. No dynamic import: the CLI ships as a Bun single binary, which cannot\n * see modules resolved at runtime, so adapters are in-tree by design.\n *\n * Credentials come from the environment only, never from the config file, so a\n * config can be committed without leaking anything.\n */\n\nimport type { AdapterDeps, SyncProvider } from \"../port\";\nimport type { SyncEngineConfig } from \"../engine\";\nimport { createTestRailProvider, type TestRailConfig } from \"./testrail\";\nimport { createXrayProvider, type XrayConfig } from \"./xray\";\n\nexport type ProviderName = \"testrail\" | \"xray\";\n\n/** Per-provider config as it appears under `sync` in executable-stories.config.mjs. */\nexport interface SyncTargets {\n  testrail?: TestRailConfig & Partial<SyncEngineConfig>;\n  xray?: XrayConfig & Partial<SyncEngineConfig>;\n}\n\nexport interface BuiltProvider {\n  provider: SyncProvider;\n  /** Engine defaults this provider implies, overridable per target in config. */\n  engineDefaults: SyncEngineConfig;\n}\n\nexport const PROVIDER_NAMES: ProviderName[] = [\"testrail\", \"xray\"];\n\nexport function isProviderName(value: string): value is ProviderName {\n  return (PROVIDER_NAMES as string[]).includes(value);\n}\n\nfunction required(env: Record<string, string | undefined>, name: string, hint: string): string {\n  const value = env[name];\n  if (!value) throw new Error(`Missing ${name}. ${hint}`);\n  return value;\n}\n\nexport function buildProvider(\n  args: { name: ProviderName; targets: SyncTargets; env: Record<string, string | undefined> },\n  deps: AdapterDeps,\n): BuiltProvider {\n  const { name, targets, env } = args;\n\n  if (name === \"testrail\") {\n    const config = targets.testrail;\n    if (!config) {\n      throw new Error(\n        'No TestRail config found. Add a `sync: { testrail: { url, projectId } }` block to executable-stories.config.mjs, or run \"executable-stories sync testrail --init\".',\n      );\n    }\n    const provider = createTestRailProvider(\n      config,\n      {\n        username: required(env, \"TESTRAIL_USERNAME\", \"This is the login email of the TestRail account.\"),\n        apiKey: required(\n          env,\n          \"TESTRAIL_API_KEY\",\n          \"Generate one in TestRail under My Settings -> API Keys. A password will not work when the instance requires API keys.\",\n        ),\n      },\n      deps,\n    );\n    return {\n      provider,\n      // TestRail ids are numeric and conventionally written \"C1234\" in a ticket,\n      // so the prefix is decoration and gets stripped.\n      engineDefaults: { ticketPrefix: \"C\", ticketPrefixStrip: true },\n    };\n  }\n\n  const config = targets.xray;\n  if (!config) {\n    throw new Error(\n      'No Xray config found. Add a `sync: { xray: { jiraBaseUrl, projectKey } }` block to executable-stories.config.mjs, or run \"executable-stories sync xray --init\".',\n    );\n  }\n  const provider = createXrayProvider(\n    config,\n    {\n      clientId: required(env, \"XRAY_CLIENT_ID\", \"Create an API key pair in Jira under Apps -> Xray -> API Keys.\"),\n      clientSecret: required(env, \"XRAY_CLIENT_SECRET\", \"This is the secret half of the Xray API key pair.\"),\n      jiraEmail: env[\"JIRA_EMAIL\"],\n      jiraToken: env[\"JIRA_TOKEN\"],\n    },\n    deps,\n  );\n  return {\n    provider,\n    // An Xray case id is a Jira issue key, so the project prefix is part of the\n    // id and must survive.\n    engineDefaults: { ticketPrefix: `${config.projectKey}-`, ticketPrefixStrip: false },\n  };\n}\n","/**\n * Cucumber JSON Formatter - Layer 3.\n *\n * Transforms canonical TestRunResult into Cucumber JSON format\n * compatible with cucumber-js v11.x output.\n */\n\nimport { assertNever } from \"executable-stories-core/utils/assert-never\";\nimport type { StoryStep, DocEntry } from \"executable-stories-core/types/story\";\nimport type {\n  TestRunResult,\n  TestCaseResult,\n  StepResult,\n  Attachment,\n} from \"executable-stories-core/types/test-result\";\nimport type {\n  IJsonFeature,\n  IJsonScenario,\n  IJsonStep,\n  IJsonTag,\n  IJsonEmbedding,\n  IJsonStepResult,\n} from \"../types/cucumber-json\";\nimport { generateFeatureId, generateScenarioId } from \"executable-stories-core/converters/acl/ids\";\nimport { createLineContext, advancePastFeature, advancePastScenario, generateStepLine } from \"executable-stories-core/converters/acl/lines\";\n\n/** Options for Cucumber JSON formatting */\nexport interface CucumberJsonOptions {\n  /** Pretty-print JSON output. Default: false */\n  pretty?: boolean;\n  /** Include trailing space in keywords. Default: true */\n  keywordSpacing?: boolean;\n}\n\n/**\n * Cucumber JSON Formatter.\n *\n * Transforms TestRunResult into an array of IJsonFeature objects\n * that match the Cucumber JSON format specification.\n */\nexport class CucumberJsonFormatter {\n  private options: Required<CucumberJsonOptions>;\n\n  constructor(options: CucumberJsonOptions = {}) {\n    this.options = {\n      pretty: options.pretty ?? false,\n      keywordSpacing: options.keywordSpacing ?? true,\n    };\n  }\n\n  /**\n   * Format a test run into Cucumber JSON features.\n   *\n   * Groups test cases by source file (one feature per file).\n   *\n   * @param run - Canonical test run result\n   * @returns Array of Cucumber JSON features\n   */\n  format(run: TestRunResult): IJsonFeature[] {\n    // Group test cases by source file\n    const byFile = new Map<string, TestCaseResult[]>();\n    for (const tc of run.testCases) {\n      const file = tc.sourceFile;\n      const existing = byFile.get(file);\n      if (existing) {\n        existing.push(tc);\n      } else {\n        byFile.set(file, [tc]);\n      }\n    }\n\n    // Build features\n    const features: IJsonFeature[] = [];\n    for (const [uri, testCases] of byFile) {\n      features.push(this.buildFeature(uri, testCases));\n    }\n\n    return features;\n  }\n\n  /**\n   * Format and serialize to JSON string.\n   *\n   * @param run - Canonical test run result\n   * @returns JSON string\n   */\n  formatToString(run: TestRunResult): string {\n    const features = this.format(run);\n    return this.options.pretty\n      ? JSON.stringify(features, null, 2)\n      : JSON.stringify(features);\n  }\n\n  /**\n   * Build a single feature from test cases in the same file.\n   */\n  private buildFeature(uri: string, testCases: TestCaseResult[]): IJsonFeature {\n    const featureName = this.extractFeatureName(uri, testCases);\n    const featureId = generateFeatureId(uri);\n\n    // Extract feature-level tags (union of all scenario tags)\n    const featureTags = this.extractFeatureTags(testCases);\n\n    // Build scenarios with deterministic line numbers\n    let lineCtx = createLineContext();\n    lineCtx = advancePastFeature(lineCtx);\n\n    const elements: IJsonScenario[] = [];\n    for (const tc of testCases) {\n      const [scenarioLine, nextCtx] = advancePastScenario(lineCtx, tc.story.steps.length);\n      elements.push(this.buildScenario(tc, featureId, scenarioLine));\n      lineCtx = nextCtx;\n    }\n\n    return {\n      description: \"\",\n      elements,\n      id: featureId,\n      keyword: \"Feature\",\n      line: 1,\n      name: featureName,\n      tags: featureTags,\n      uri,\n    };\n  }\n\n  /**\n   * Extract feature name from URI or test cases.\n   *\n   * Uses the top-level suite path if available, otherwise file name.\n   */\n  private extractFeatureName(uri: string, testCases: TestCaseResult[]): string {\n    // Try to get common suite path prefix\n    const suitePaths = testCases\n      .map((tc) => tc.titlePath)\n      .filter((p) => p.length > 0);\n\n    if (suitePaths.length > 0) {\n      // Use the first element of the first suite path as feature name\n      const firstPath = suitePaths[0];\n      if (firstPath.length > 0) {\n        return firstPath[0];\n      }\n    }\n\n    // Fall back to filename without extension\n    const filename = uri.split(\"/\").pop() ?? uri;\n    return filename.replace(/\\.[^.]+$/, \"\").replace(/[._-]/g, \" \");\n  }\n\n  /**\n   * Extract feature-level tags from all test cases.\n   */\n  private extractFeatureTags(testCases: TestCaseResult[]): IJsonTag[] {\n    // Collect all unique tags\n    const allTags = new Set<string>();\n    for (const tc of testCases) {\n      for (const tag of tc.tags) {\n        allTags.add(tag);\n      }\n    }\n\n    // Convert to IJsonTag format (with @ prefix if not present)\n    return [...allTags].sort().map((tag) => ({\n      name: tag.startsWith(\"@\") ? tag : `@${tag}`,\n      line: 1,\n    }));\n  }\n\n  /**\n   * Build a scenario from a test case.\n   */\n  private buildScenario(\n    tc: TestCaseResult,\n    featureId: string,\n    scenarioLine: number\n  ): IJsonScenario {\n    const scenarioName = tc.story.scenario;\n    const scenarioId = generateScenarioId(featureId, scenarioName);\n\n    // Build steps\n    const steps = this.buildSteps(tc, scenarioLine);\n\n    // Build scenario tags\n    const tags: IJsonTag[] = tc.tags.map((tag) => ({\n      name: tag.startsWith(\"@\") ? tag : `@${tag}`,\n      line: scenarioLine,\n    }));\n\n    return {\n      description: \"\",\n      id: scenarioId,\n      keyword: \"Scenario\",\n      line: scenarioLine,\n      name: scenarioName,\n      steps,\n      tags,\n      type: \"scenario\",\n    };\n  }\n\n  /**\n   * Build steps from story steps and step results.\n   */\n  private buildSteps(tc: TestCaseResult, scenarioLine: number): IJsonStep[] {\n    const storySteps = tc.story.steps;\n    const stepResults = tc.stepResults;\n\n    // Create a map of step results by index\n    const resultsByIndex = new Map<number, StepResult>();\n    for (const sr of stepResults) {\n      resultsByIndex.set(sr.index, sr);\n    }\n\n    // Check if any step failed (used to decide if last step gets attachments)\n    const hasFailedStep = stepResults.some(sr => sr.status === \"failed\");\n\n    const totalSteps = storySteps.length;\n    return storySteps.map((step, index) => {\n      const stepResult = resultsByIndex.get(index);\n      const stepLine = generateStepLine(scenarioLine, index);\n      const isLastStep = index === totalSteps - 1;\n      return this.buildStep(step, stepResult, stepLine, index, tc.attachments, isLastStep, hasFailedStep);\n    });\n  }\n\n  /**\n   * Build a single step.\n   */\n  private buildStep(\n    step: StoryStep,\n    result: StepResult | undefined,\n    line: number,\n    index: number,\n    attachments: Attachment[],\n    isLastStep: boolean,\n    hasFailedStep: boolean\n  ): IJsonStep {\n    // Keyword with optional trailing space\n    const keyword = this.options.keywordSpacing\n      ? `${step.keyword} `\n      : step.keyword;\n\n    // Build result\n    const stepResult = this.buildStepResult(result);\n\n    // Build embeddings for attachments (attach to failed step, or last step if no failure)\n    const embeddings = this.buildEmbeddings(attachments, result, isLastStep, hasFailedStep);\n\n    // Add screenshot docs as embeddings (always include with their step)\n    const screenshotEmbeddings = this.buildScreenshotEmbeddings(step);\n    embeddings.push(...screenshotEmbeddings);\n\n    const jsonStep: IJsonStep = {\n      keyword,\n      line,\n      name: step.text,\n      result: stepResult,\n    };\n\n    // Only include optional fields if they have values\n    if (embeddings.length > 0) {\n      jsonStep.embeddings = embeddings;\n    }\n\n    // Add step arguments (doc strings from docs, data tables)\n    const args = this.buildStepArguments(step);\n    if (args.length > 0) {\n      jsonStep.arguments = args;\n    }\n\n    return jsonStep;\n  }\n\n  /**\n   * Build embeddings from screenshot doc entries.\n   */\n  private buildScreenshotEmbeddings(step: StoryStep): IJsonEmbedding[] {\n    if (!step.docs) {\n      return [];\n    }\n\n    const embeddings: IJsonEmbedding[] = [];\n\n    for (const doc of step.docs) {\n      // Inline html content embeds as text/html — Cucumber HTML reporters\n      // render it natively. url/path variants degrade to step arguments.\n      if (doc.kind === \"html\" && doc.content !== undefined) {\n        embeddings.push({\n          data: Buffer.from(doc.content, \"utf8\").toString(\"base64\"),\n          mime_type: \"text/html\",\n          name: doc.title,\n        });\n        continue;\n      }\n\n      if (doc.kind !== \"screenshot\" || !doc.path.startsWith(\"data:\")) {\n        continue;\n      }\n\n      // Parse data URI: data:image/png;base64,ABC123...\n      const match = doc.path.match(/^data:([^;]+);base64,(.+)$/);\n      if (match) {\n        embeddings.push({\n          data: match[2],\n          mime_type: match[1],\n          name: doc.alt,\n        });\n      }\n    }\n\n    return embeddings;\n  }\n\n  /**\n   * Build step result.\n   */\n  private buildStepResult(result: StepResult | undefined): IJsonStepResult {\n    if (!result) {\n      return {\n        status: \"undefined\",\n        duration: 0,\n      };\n    }\n\n    // Map canonical status to Cucumber status\n    const statusMap: Record<string, IJsonStepResult[\"status\"]> = {\n      passed: \"passed\",\n      failed: \"failed\",\n      skipped: \"skipped\",\n      pending: \"pending\",\n    };\n\n    const stepResult: IJsonStepResult = {\n      status: statusMap[result.status] ?? \"undefined\",\n      // Duration in nanoseconds (Cucumber uses nanoseconds)\n      duration: result.durationMs * 1_000_000,\n    };\n\n    if (result.errorMessage) {\n      stepResult.error_message = result.errorMessage;\n    }\n\n    return stepResult;\n  }\n\n  /**\n   * Build embeddings (attachments) for a step.\n   *\n   * Cucumber convention: attach to the failing step, or last step if no failure.\n   */\n  private buildEmbeddings(\n    attachments: Attachment[],\n    result: StepResult | undefined,\n    isLastStep: boolean,\n    hasFailedStep: boolean\n  ): IJsonEmbedding[] {\n    const isFailed = result?.status === \"failed\";\n\n    // If this step failed, attach here\n    if (isFailed) {\n      // Continue to attach\n    } else if (isLastStep && !hasFailedStep) {\n      // No failed step in scenario, attach to last step\n    } else {\n      // Not a failed step, and either not last or there's a failed step elsewhere\n      return [];\n    }\n\n    // Only include BASE64 attachments - IDENTITY attachments are URLs/paths, not embeddable data\n    const base64Attachments = attachments.filter(\n      (att) => att.contentEncoding === \"BASE64\"\n    );\n\n    if (base64Attachments.length === 0) {\n      return [];\n    }\n\n    return base64Attachments.map((att) => ({\n      data: att.body,\n      mime_type: att.mediaType,\n      name: att.name,\n    }));\n  }\n\n  /**\n   * Build step arguments from step docs.\n   *\n   * Converts doc entries to Cucumber step arguments (doc strings, data tables).\n   */\n  private buildStepArguments(step: StoryStep): Array<{ doc_string?: { content: string; content_type?: string; line: number }; rows?: Array<{ cells: string[] }> }> {\n    if (!step.docs || step.docs.length === 0) {\n      return [];\n    }\n\n    const args: Array<{ doc_string?: { content: string; content_type?: string; line: number }; rows?: Array<{ cells: string[] }> }> = [];\n\n    for (const doc of step.docs) {\n      const arg = this.docEntryToArgument(doc);\n      if (arg) {\n        args.push(arg);\n      }\n    }\n\n    return args;\n  }\n\n  /**\n   * Convert a doc entry to a Cucumber step argument.\n   */\n  private docEntryToArgument(doc: DocEntry): { doc_string?: { content: string; content_type?: string; line: number }; rows?: Array<{ cells: string[] }> } | null {\n    switch (doc.kind) {\n      case \"code\":\n        return {\n          doc_string: {\n            content: doc.content,\n            content_type: doc.lang,\n            line: 0,\n          },\n        };\n\n      case \"table\":\n        return {\n          rows: [\n            { cells: doc.columns },\n            ...doc.rows.map((row) => ({ cells: row })),\n          ],\n        };\n\n      case \"note\":\n        return {\n          doc_string: {\n            content: doc.text,\n            content_type: \"text/plain\",\n            line: 0,\n          },\n        };\n\n      case \"mermaid\":\n        return {\n          doc_string: {\n            content: doc.code,\n            content_type: \"text/x-mermaid\",\n            line: 0,\n          },\n        };\n\n      case \"section\":\n        return {\n          doc_string: {\n            content: `# ${doc.title}\\n\\n${doc.markdown}`,\n            content_type: \"text/markdown\",\n            line: 0,\n          },\n        };\n\n      case \"link\":\n        return {\n          doc_string: {\n            content: `[${doc.label}](${doc.url})`,\n            content_type: \"text/markdown\",\n            line: 0,\n          },\n        };\n\n      case \"kv\": {\n        const value = typeof doc.value === \"string\"\n          ? doc.value\n          : JSON.stringify(doc.value, null, 2);\n        return {\n          doc_string: {\n            content: `${doc.label}: ${value}`,\n            content_type: \"text/plain\",\n            line: 0,\n          },\n        };\n      }\n\n      case \"custom\":\n        if (doc.type === \"visual\" && doc.data && typeof doc.data === \"object\") {\n          const data = doc.data as Record<string, unknown>;\n          const status = typeof data.status === \"string\" ? data.status : \"unknown\";\n          const lines = [`Visual Check (${status})`];\n          if (typeof data.baseline === \"string\") lines.push(`Baseline: ${data.baseline}`);\n          if (typeof data.actual === \"string\") lines.push(`Actual: ${data.actual}`);\n          if (typeof data.diff === \"string\") lines.push(`Diff: ${data.diff}`);\n          return {\n            doc_string: {\n              content: lines.join(\"\\n\"),\n              content_type: \"text/plain\",\n              line: 0,\n            },\n          };\n        }\n        return {\n          doc_string: {\n            content: JSON.stringify(doc.data, null, 2),\n            content_type: \"application/json\",\n            line: 0,\n          },\n        };\n\n      case \"tag\":\n        return {\n          doc_string: {\n            content: doc.names.map((n) => `@${n}`).join(\" \"),\n            content_type: \"text/plain\",\n            line: 0,\n          },\n        };\n\n      case \"screenshot\":\n        // A `data:` screenshot is embedded by buildScreenshotEmbeddings. One\n        // that names a file cannot be, and returning null for it dropped the\n        // artifact from the report entirely, so it degrades to a link the way\n        // html does.\n        if (doc.path.startsWith(\"data:\")) return null;\n        return {\n          doc_string: {\n            content: `[${doc.alt ?? \"Screenshot\"}](${doc.path})`,\n            content_type: \"text/markdown\",\n            line: 0,\n          },\n        };\n\n      case \"video\":\n        // Never embedded: a clip is too large for a base64 payload in a JSON\n        // report, so the reference is the whole value.\n        return {\n          doc_string: {\n            content: `[${doc.caption ?? \"Video\"}](${doc.path})`,\n            content_type: \"text/markdown\",\n            line: 0,\n          },\n        };\n\n      case \"state\":\n        // State snapshots embed as JSON doc strings, label included.\n        return {\n          doc_string: {\n            content: JSON.stringify({ state: doc.label ?? \"State\", value: doc.value ?? null }, null, 2),\n            content_type: \"application/json\",\n            line: 0,\n          },\n        };\n\n      case \"html\":\n        // Inline html content is handled as a text/html embedding; url/path\n        // degrade to a markdown link argument so the reference survives.\n        if (doc.url !== undefined || doc.path !== undefined) {\n          return {\n            doc_string: {\n              content: `[${doc.title ?? \"Embedded HTML\"}](${doc.url ?? doc.path})`,\n              content_type: \"text/markdown\",\n              line: 0,\n            },\n          };\n        }\n        return null;\n    }\n\n    return assertNever(doc, \"Cucumber JSON: unhandled doc kind\");\n  }\n}\n","/**\n * StoryReportJsonFormatter — emit the public StoryReport contract as JSON.\n *\n * Wraps toStoryReport with a Formatter-compatible class interface and a\n * pretty-print option.\n */\n\nimport { toStoryReport } from \"executable-stories-core/converters/story-report\";\nimport type { StoryReport } from \"executable-stories-core/types/story-report\";\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\n\nexport interface StoryReportJsonOptions {\n  /** Pretty-print JSON output with 2-space indent. Default: true. */\n  pretty?: boolean;\n  /**\n   * URL template for tickets that carry no URL of their own (`{ticket}` is the\n   * id). The same template the HTML report resolves with, so the contract an\n   * agent reads and the page a person opens link a ticket to the same place.\n   */\n  ticketUrlTemplate?: string;\n}\n\nexport class StoryReportJsonFormatter {\n  private options: StoryReportJsonOptions & { pretty: boolean };\n\n  constructor(options: StoryReportJsonOptions = {}) {\n    this.options = {\n      ...options,\n      pretty: options.pretty ?? true,\n    };\n  }\n\n  toReport(run: TestRunResult): StoryReport {\n    return toStoryReport(run, { ticketUrlTemplate: this.options.ticketUrlTemplate });\n  }\n\n  format(run: TestRunResult): string {\n    const report = this.toReport(run);\n    return this.options.pretty ? JSON.stringify(report, null, 2) : JSON.stringify(report);\n  }\n}\n","import { toStoryReport } from \"executable-stories-core/converters/story-report\";\nimport { scenarioContentHash } from \"executable-stories-core/explainer\";\nimport { assertionState } from \"executable-stories-core/utils/assertive-steps\";\nimport type { ReportFeature, ReportScenario, ReportStep, StoryReport, TestStatus } from \"executable-stories-core/types/story-report\";\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\n\nexport interface ScenarioIndex {\n  schemaVersion: \"1.0\";\n  runId: string;\n  generatedAtMs: number;\n  summary: StoryReport[\"summary\"];\n  scenarios: ScenarioIndexItem[];\n}\n\n/**\n * One scenario as this formatter emits it.\n *\n * This is an OUTPUT type: it describes what `toScenarioIndex` produces, which\n * is why `hash` and `assertionState` are required here while\n * `scenario-index-v1.json` marks both optional. The schema is deliberately the\n * laxer of the two so artifacts written before either field existed still\n * validate; every artifact written since carries them.\n *\n * The consequence, and it is intended: parsing an arbitrary v1 file and casting\n * it to this type is not sound for those two fields. Validate against the\n * schema and treat them as optional if you are reading files you did not just\n * write.\n */\nexport interface ScenarioIndexItem {\n  id: string;\n  title: string;\n  /**\n   * Content hash (title + step keywords/texts) for explainer provenance —\n   * copy into an explainer's frontmatter `scenarios[].hash` so\n   * `check-explainers` can detect drift. Status is deliberately excluded.\n   */\n  hash: string;\n  status: TestStatus;\n  feature: string;\n  sourceFile: string;\n  sourceLine?: number;\n  tags: string[];\n  tickets: Array<{ id: string; url?: string }>;\n  covers: string[];\n  durationMs: number;\n  steps: ScenarioIndexStep[];\n  docKinds: string[];\n  error?: { message: string; stack?: string };\n  /**\n   * Whether the scenario's claim was checked: `asserted`, `unasserted`, or\n   * `unobserved` where the adapter cannot count. A passing scenario that is\n   * `unasserted` ran and proved nothing.\n   */\n  assertionState: \"asserted\" | \"unasserted\" | \"unobserved\";\n}\n\nexport interface ScenarioIndexStep {\n  id: string;\n  index: number;\n  keyword: ReportStep[\"keyword\"];\n  text: string;\n  status: TestStatus;\n  durationMs: number;\n  errorMessage?: string;\n  docKinds: string[];\n  /**\n   * Assertions the framework observed. Absent means the adapter has no counter;\n   * `0` means it counted none. Never defaulted — the difference is the point.\n   */\n  assertions?: number;\n}\n\nexport interface ScenarioIndexFilters {\n  statuses?: TestStatus[];\n  tags?: string[];\n  sourceFiles?: string[];\n}\n\nexport interface ScenarioIndexJsonOptions {\n  pretty?: boolean;\n  filters?: ScenarioIndexFilters;\n}\n\nexport class ScenarioIndexJsonFormatter {\n  private options: Required<Pick<ScenarioIndexJsonOptions, \"pretty\">> & {\n    filters?: ScenarioIndexFilters;\n  };\n\n  constructor(options: ScenarioIndexJsonOptions = {}) {\n    this.options = {\n      pretty: options.pretty ?? true,\n      filters: options.filters,\n    };\n  }\n\n  toIndex(run: TestRunResult): ScenarioIndex {\n    return toScenarioIndex(toStoryReport(run), this.options.filters);\n  }\n\n  format(run: TestRunResult): string {\n    const index = this.toIndex(run);\n    return this.options.pretty ? JSON.stringify(index, null, 2) : JSON.stringify(index);\n  }\n}\n\nexport function toScenarioIndex(\n  report: StoryReport,\n  filters: ScenarioIndexFilters = {},\n): ScenarioIndex {\n  const scenarios = report.features\n    .flatMap((feature) =>\n      feature.scenarios.map((scenario) => toScenarioIndexItem(feature, scenario)),\n    )\n    .filter((scenario) => matchesFilters(scenario, filters));\n\n  return {\n    schemaVersion: \"1.0\",\n    runId: report.runId,\n    generatedAtMs: report.finishedAtMs,\n    summary: summarize(scenarios),\n    scenarios,\n  };\n}\n\nfunction toScenarioIndexItem(\n  feature: ReportFeature,\n  scenario: ReportScenario,\n): ScenarioIndexItem {\n  return {\n    id: scenario.id,\n    title: scenario.title,\n    hash: scenarioContentHash(scenario),\n    status: scenario.status,\n    feature: feature.title,\n    sourceFile: feature.sourceFile,\n    sourceLine: scenario.sourceLine,\n    tags: scenario.tags,\n    tickets: scenario.tickets ?? [],\n    covers: scenario.covers ?? [],\n    durationMs: scenario.durationMs,\n    steps: scenario.steps.map((step) => ({\n      id: step.id,\n      index: step.index,\n      keyword: step.keyword,\n      text: step.text,\n      status: step.status,\n      durationMs: step.durationMs,\n      errorMessage: step.errorMessage,\n      docKinds: step.docEntries.map((entry) => entry.kind),\n      assertions: step.assertions,\n    })),\n    docKinds: scenario.docEntries.map((entry) => entry.kind),\n    assertionState: assertionState(scenario.steps),\n    error: scenario.errorMessage\n      ? { message: scenario.errorMessage, stack: scenario.errorStack }\n      : undefined,\n  };\n}\n\nfunction matchesFilters(\n  scenario: ScenarioIndexItem,\n  filters: ScenarioIndexFilters,\n): boolean {\n  if (filters.statuses?.length && !filters.statuses.includes(scenario.status)) {\n    return false;\n  }\n  if (\n    filters.tags?.length &&\n    !filters.tags.some((tag) => scenario.tags.includes(tag))\n  ) {\n    return false;\n  }\n  if (\n    filters.sourceFiles?.length &&\n    !filters.sourceFiles.some((sourceFile) => scenario.sourceFile.includes(sourceFile))\n  ) {\n    return false;\n  }\n  return true;\n}\n\nfunction summarize(scenarios: ScenarioIndexItem[]): StoryReport[\"summary\"] {\n  return {\n    total: scenarios.length,\n    passed: scenarios.filter((scenario) => scenario.status === \"passed\").length,\n    failed: scenarios.filter((scenario) => scenario.status === \"failed\").length,\n    skipped: scenarios.filter((scenario) => scenario.status === \"skipped\").length,\n    pending: scenarios.filter((scenario) => scenario.status === \"pending\").length,\n    durationMs: scenarios.reduce((total, scenario) => total + scenario.durationMs, 0),\n  };\n}\n","import { toStoryReport } from \"executable-stories-core/converters/story-report\";\nimport type { ReportDocEntry, ReportScenario, StoryReport } from \"executable-stories-core/types/story-report\";\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\n\n/**\n * agent-text — the full behaviour of a run as flat, token-lean plain text for\n * pasting into an LLM. Same content as the Markdown report (steps, doc\n * entries, errors) minus everything a model never reads: ids, hashes,\n * durations, source lines, HTML/Markdown chrome, and JSON punctuation. For a\n * structured contract use story-report-json; this format optimizes tokens,\n * not parseability.\n */\n\nconst STATUS_WORD: Record<string, string> = {\n  passed: \"PASS\",\n  failed: \"FAIL\",\n  skipped: \"SKIP\",\n  pending: \"PEND\",\n};\n\nexport class AgentTextFormatter {\n  format(run: TestRunResult): string {\n    return toAgentText(toStoryReport(run));\n  }\n}\n\nexport function toAgentText(report: StoryReport): string {\n  const s = report.summary;\n  const counts = [\n    s.passed && `${s.passed} passed`,\n    s.failed && `${s.failed} failed`,\n    s.skipped && `${s.skipped} skipped`,\n    s.pending && `${s.pending} pending`,\n  ]\n    .filter(Boolean)\n    .join(\", \");\n  const lines: string[] = [\n    `Test run: ${s.total} scenarios (${counts || \"none\"}).`,\n    \"Each block: STATUS Scenario title [tags]. Indented lines are its Given/When/Then steps; deeper lines are docs captured at that step.\",\n    \"\",\n  ];\n\n  for (const feature of report.features) {\n    lines.push(`feature ${feature.title} · ${feature.sourceFile}`);\n    for (const scenario of feature.scenarios) {\n      lines.push(\"\", ...scenarioLines(scenario));\n    }\n    lines.push(\"\");\n  }\n  return lines.join(\"\\n\").replace(/\\n{3,}/g, \"\\n\\n\").trimEnd() + \"\\n\";\n}\n\nfunction scenarioLines(scenario: ReportScenario): string[] {\n  const tags = scenario.tags.length ? ` [${scenario.tags.join(\" \")}]` : \"\";\n  const lines = [`${STATUS_WORD[scenario.status] ?? scenario.status.toUpperCase()} ${scenario.title}${tags}`];\n  for (const ticket of scenario.tickets ?? []) lines.push(`  ticket ${ticket.id}${ticket.url ? ` ${ticket.url}` : \"\"}`);\n  if (scenario.covers?.length) lines.push(`  covers ${scenario.covers.join(\", \")}`);\n  for (const step of scenario.steps) {\n    const failed = step.status === \"failed\" ? \" !! FAILED\" : \"\";\n    lines.push(`  ${step.keyword} ${step.text}${failed}`);\n    if (step.errorMessage) lines.push(indent(step.errorMessage, \"    ! \"));\n    for (const entry of step.docEntries) lines.push(...docLines(entry, \"    \"));\n  }\n  for (const entry of scenario.docEntries) lines.push(...docLines(entry, \"  \"));\n  if (scenario.errorMessage) lines.push(indent(`error: ${scenario.errorMessage}`, \"  \"));\n  return lines;\n}\n\nfunction docLines(entry: ReportDocEntry, pad: string): string[] {\n  const lines = ownDocLines(entry, pad);\n  for (const child of entry.children ?? []) lines.push(...docLines(child, pad + \"  \"));\n  return lines;\n}\n\nfunction ownDocLines(entry: ReportDocEntry, pad: string): string[] {\n  switch (entry.kind) {\n    case \"note\":\n      return [indent(entry.text, pad)];\n    case \"tag\":\n      // `story.tag()` writes a doc entry and nothing else: it never reaches\n      // `scenario.tags`, so returning [] here lost a step-level tag from the\n      // one format agents read. A scenario-level tag repeating its own tag\n      // line is the cheaper mistake.\n      return [`${pad}tag ${entry.names.join(\", \")}`];\n    case \"kv\":\n      return [`${pad}${entry.label}: ${compact(entry.value)}`];\n    case \"code\":\n      return [`${pad}code ${entry.label}${entry.lang ? ` (${entry.lang})` : \"\"}:`, indent(entry.content, pad + \"  \")];\n    case \"table\":\n      return [\n        `${pad}table ${entry.label}: ${entry.columns.join(\" | \")}`,\n        ...entry.rows.map((row) => `${pad}  ${row.join(\" | \")}`),\n      ];\n    case \"link\":\n      return [`${pad}link ${entry.label}: ${entry.url}`];\n    case \"section\":\n      return [`${pad}section ${entry.title}:`, indent(entry.markdown, pad + \"  \")];\n    case \"mermaid\":\n      return [`${pad}mermaid${entry.title ? ` ${entry.title}` : \"\"}:`, indent(entry.code, pad + \"  \")];\n    case \"screenshot\":\n      return [`${pad}screenshot ${entry.path}${entry.alt ? ` — ${entry.alt}` : \"\"}`];\n    case \"video\":\n      return [`${pad}video ${entry.path}${entry.caption ? ` — ${entry.caption}` : \"\"}`];\n    case \"html\":\n      return [`${pad}html ${entry.title ?? entry.path ?? entry.url ?? \"(inline)\"}`];\n    case \"state\":\n      return [`${pad}state${entry.label ? ` ${entry.label}` : \"\"}: ${compact(entry.value)}`];\n    case \"custom\":\n      return [`${pad}custom ${entry.type}: ${compact(entry.data)}`];\n  }\n}\n\nfunction compact(value: unknown): string {\n  return typeof value === \"string\" ? value : JSON.stringify(value);\n}\n\nfunction indent(text: string, pad: string): string {\n  return text\n    .split(\"\\n\")\n    .map((line) => pad + line)\n    .join(\"\\n\");\n}\n","import { toScenarioIndex, type ScenarioIndex, type ScenarioIndexItem } from \"./scenario-index-json\";\nimport type { StoryReport } from \"executable-stories-core/types/story-report\";\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\nimport { toStoryReport } from \"executable-stories-core/converters/story-report\";\n\nexport interface BehaviorManifest {\n  schemaVersion: \"1.0\";\n  runId: string;\n  generatedAtMs: number;\n  summary: ScenarioIndex[\"summary\"];\n  sourceFiles: BehaviorSourceFile[];\n  tags: BehaviorTag[];\n  docCoverage: {\n    scenariosWithDocs: number;\n    scenariosWithoutDocs: number;\n    docKinds: string[];\n  };\n  debugger: BehaviorDebuggerIssue[];\n}\n\nexport interface BehaviorSourceFile {\n  path: string;\n  scenarioCount: number;\n  failed: number;\n  tags: string[];\n}\n\nexport interface BehaviorTag {\n  name: string;\n  scenarioCount: number;\n}\n\nexport interface BehaviorDebuggerIssue {\n  severity: \"warning\";\n  code: \"missing-docs\" | \"missing-tags\" | \"missing-covers\" | \"missing-source-line\";\n  scenarioId: string;\n  title: string;\n  message: string;\n}\n\nexport interface BehaviorManifestJsonOptions {\n  pretty?: boolean;\n}\n\nexport class BehaviorManifestJsonFormatter {\n  private pretty: boolean;\n\n  constructor(options: BehaviorManifestJsonOptions = {}) {\n    this.pretty = options.pretty ?? true;\n  }\n\n  toManifest(run: TestRunResult): BehaviorManifest {\n    return toBehaviorManifest(toStoryReport(run));\n  }\n\n  format(run: TestRunResult): string {\n    const manifest = this.toManifest(run);\n    return this.pretty ? JSON.stringify(manifest, null, 2) : JSON.stringify(manifest);\n  }\n}\n\nexport function toBehaviorManifest(report: StoryReport): BehaviorManifest {\n  const index = toScenarioIndex(report);\n  const bySource = new Map<string, BehaviorSourceFile>();\n  const byTag = new Map<string, BehaviorTag>();\n  const docKinds = new Set<string>();\n  const debuggerIssues: BehaviorDebuggerIssue[] = [];\n\n  for (const scenario of index.scenarios) {\n    const source = bySource.get(scenario.sourceFile) ?? {\n      path: scenario.sourceFile,\n      scenarioCount: 0,\n      failed: 0,\n      tags: [],\n    };\n    source.scenarioCount += 1;\n    if (scenario.status === \"failed\") source.failed += 1;\n    source.tags = [...new Set([...source.tags, ...scenario.tags])].sort();\n    bySource.set(scenario.sourceFile, source);\n\n    for (const tag of scenario.tags) {\n      const tagEntry = byTag.get(tag) ?? { name: tag, scenarioCount: 0 };\n      tagEntry.scenarioCount += 1;\n      byTag.set(tag, tagEntry);\n    }\n\n    for (const kind of scenario.docKinds) docKinds.add(kind);\n    for (const step of scenario.steps) {\n      for (const kind of step.docKinds) docKinds.add(kind);\n    }\n\n    if (!scenarioHasDocs(scenario)) {\n      debuggerIssues.push({\n        severity: \"warning\",\n        code: \"missing-docs\",\n        scenarioId: scenario.id,\n        title: scenario.title,\n        message: \"Scenario has no doc entries.\",\n      });\n    }\n    if (scenario.tags.length === 0) {\n      debuggerIssues.push({\n        severity: \"warning\",\n        code: \"missing-tags\",\n        scenarioId: scenario.id,\n        title: scenario.title,\n        message: \"Scenario has no tags.\",\n      });\n    }\n    if (scenario.covers.length === 0) {\n      debuggerIssues.push({\n        severity: \"warning\",\n        code: \"missing-covers\",\n        scenarioId: scenario.id,\n        title: scenario.title,\n        message: \"Scenario declares no covers (product-code paths), so code→scenario lookup cannot find it.\",\n      });\n    }\n    if (scenario.sourceLine === undefined) {\n      debuggerIssues.push({\n        severity: \"warning\",\n        code: \"missing-source-line\",\n        scenarioId: scenario.id,\n        title: scenario.title,\n        message: \"Scenario has no source line.\",\n      });\n    }\n  }\n\n  const scenariosWithDocs = index.scenarios.filter(scenarioHasDocs).length;\n\n  return {\n    schemaVersion: \"1.0\",\n    runId: report.runId,\n    generatedAtMs: report.finishedAtMs,\n    summary: index.summary,\n    sourceFiles: [...bySource.values()].sort((a, b) => a.path.localeCompare(b.path)),\n    tags: [...byTag.values()].sort((a, b) => a.name.localeCompare(b.name)),\n    docCoverage: {\n      scenariosWithDocs,\n      scenariosWithoutDocs: index.scenarios.length - scenariosWithDocs,\n      docKinds: [...docKinds].sort(),\n    },\n    debugger: debuggerIssues,\n  };\n}\n\nfunction scenarioHasDocs(scenario: ScenarioIndexItem): boolean {\n  return (\n    scenario.docKinds.length > 0 ||\n    scenario.steps.some((step) => step.docKinds.length > 0)\n  );\n}\n","import type { SortTestCasesMode, Logger } from \"./types/options\";\nimport type { TestCaseResult } from \"executable-stories-core/types/test-result\";\n\nexport interface SelectTestCasesArgs {\n  testCases: TestCaseResult[];\n  include?: string[];\n  exclude?: string[];\n  includeTags?: string[];\n  excludeTags?: string[];\n  sortTestCases?: SortTestCasesMode;\n}\n\nexport interface SelectTestCasesDeps {\n  logger: Logger;\n}\n\nexport function matchesPattern(pattern: string, sourceFile: string): boolean {\n  const normalizedPattern = pattern.replace(/\\\\/g, \"/\");\n  const normalizedFile = sourceFile.replace(/\\\\/g, \"/\");\n\n  const regexStr = normalizedPattern\n    .replace(/[.+^${}()|[\\]\\\\]/g, \"\\\\$&\")\n    .replace(/\\*\\*/g, \"{{GLOBSTAR}}\")\n    .replace(/\\*/g, \"[^/]*\")\n    .replace(/{{GLOBSTAR}}/g, \".*\");\n\n  const regex = new RegExp(`^${regexStr}$`);\n  return regex.test(normalizedFile);\n}\n\nfunction filterTestCasesByGlobs(\n  testCases: TestCaseResult[],\n  include: string[],\n  exclude: string[],\n  logger: Logger\n): TestCaseResult[] {\n  if (include.length === 0 && exclude.length === 0) return testCases;\n\n  const filtered: TestCaseResult[] = [];\n  for (const tc of testCases) {\n    const sourceFile = tc.sourceFile.replace(/\\\\/g, \"/\");\n\n    if (include.length > 0) {\n      const included = include.some((pattern) => matchesPattern(pattern, sourceFile));\n      if (!included) continue;\n    }\n\n    if (exclude.length > 0) {\n      const excluded = exclude.some((pattern) => matchesPattern(pattern, sourceFile));\n      if (excluded) continue;\n    }\n\n    filtered.push(tc);\n  }\n\n  const dropped = testCases.length - filtered.length;\n  if (dropped > 0) {\n    logger.warn(\n      `Filtered ${dropped} test case(s) by include/exclude globs (${filtered.length} included)`\n    );\n  }\n\n  return filtered;\n}\n\nfunction filterTestCasesByTags(\n  testCases: TestCaseResult[],\n  includeTags: string[],\n  excludeTags: string[],\n  logger: Logger\n): TestCaseResult[] {\n  if (includeTags.length === 0 && excludeTags.length === 0) return testCases;\n\n  const filtered: TestCaseResult[] = [];\n  for (const tc of testCases) {\n    if (includeTags.length > 0) {\n      const included = tc.tags.some((tag) => includeTags.includes(tag));\n      if (!included) continue;\n    }\n\n    if (excludeTags.length > 0) {\n      const excluded = tc.tags.some((tag) => excludeTags.includes(tag));\n      if (excluded) continue;\n    }\n\n    filtered.push(tc);\n  }\n\n  const dropped = testCases.length - filtered.length;\n  if (dropped > 0) {\n    logger.warn(\n      `Filtered ${dropped} test case(s) by include/exclude tags (${filtered.length} included)`\n    );\n  }\n\n  return filtered;\n}\n\nfunction sortTestCases(\n  testCases: TestCaseResult[],\n  sortMode: SortTestCasesMode\n): TestCaseResult[] {\n  if (sortMode === \"none\") return testCases;\n\n  return [...testCases].sort((a, b) => {\n    if (sortMode === \"id\") {\n      return a.id.localeCompare(b.id);\n    }\n\n    if (a.sourceFile !== b.sourceFile) {\n      return a.sourceFile.localeCompare(b.sourceFile);\n    }\n    if (a.sourceLine !== b.sourceLine) {\n      return a.sourceLine - b.sourceLine;\n    }\n    if (a.story.scenario !== b.story.scenario) {\n      return a.story.scenario.localeCompare(b.story.scenario);\n    }\n    return a.id.localeCompare(b.id);\n  });\n}\n\n/**\n * A selector that matches nothing filters nothing, and says so to no one: the\n * run looks filtered, the report is the whole suite, and the usual cause is a\n * path that moved or a tag that was renamed since the flag was written. Name\n * every such selector once, so a stale filter is visible instead of silent.\n */\nfunction warnUnmatchedSelectors(\n  testCases: TestCaseResult[],\n  selectors: { flag: string; values: string[]; matches: (value: string, tc: TestCaseResult) => boolean }[],\n  logger: Logger\n): void {\n  const unmatched: string[] = [];\n  for (const { flag, values, matches } of selectors) {\n    for (const value of values) {\n      if (!testCases.some((tc) => matches(value, tc))) {\n        unmatched.push(`${flag} \"${value}\"`);\n      }\n    }\n  }\n  if (unmatched.length === 0) return;\n\n  logger.warn(\n    `${unmatched.length} selector(s) matched no test case and filtered nothing: ${unmatched.join(\", \")}. ` +\n      `The path or tag each names may have moved or been renamed.`\n  );\n}\n\nexport function selectTestCases(\n  args: SelectTestCasesArgs,\n  deps: SelectTestCasesDeps\n): TestCaseResult[] {\n  const include = args.include ?? [];\n  const exclude = args.exclude ?? [];\n  const includeTags = args.includeTags ?? [];\n  const excludeTags = args.excludeTags ?? [];\n  const sortMode = args.sortTestCases ?? \"none\";\n\n  const byGlob = (pattern: string, tc: TestCaseResult) =>\n    matchesPattern(pattern, tc.sourceFile.replace(/\\\\/g, \"/\"));\n  const byTag = (tag: string, tc: TestCaseResult) => tc.tags.includes(tag);\n  warnUnmatchedSelectors(\n    args.testCases,\n    [\n      { flag: \"--include\", values: include, matches: byGlob },\n      { flag: \"--exclude\", values: exclude, matches: byGlob },\n      { flag: \"--include-tags\", values: includeTags, matches: byTag },\n      { flag: \"--exclude-tags\", values: excludeTags, matches: byTag },\n    ],\n    deps.logger\n  );\n\n  let selected = filterTestCasesByGlobs(\n    args.testCases,\n    include,\n    exclude,\n    deps.logger\n  );\n\n  selected = filterTestCasesByTags(\n    selected,\n    includeTags,\n    excludeTags,\n    deps.logger\n  );\n\n  return sortTestCases(selected, sortMode);\n}\n","import { matchesPattern } from \"./select-test-cases\";\nimport type { ScenarioIndex, ScenarioIndexItem } from \"./formatters/scenario-index-json\";\n\n/** Strip a leading \"./\" so query paths and covers globs compare on equal footing. */\nfunction normalizePath(path: string): string {\n  return path.replace(/^\\.\\//, \"\");\n}\n\n/**\n * Return scenarios whose declared `covers` globs match any of the given paths.\n * Accepts many paths so callers can pass a whole changed-file list (e.g. a git diff).\n * Results are deduped (filter preserves index order, so each scenario appears once).\n */\nexport function scenariosCoveringPaths(\n  index: ScenarioIndex,\n  paths: string[],\n): ScenarioIndexItem[] {\n  const queries = paths.map(normalizePath);\n  return index.scenarios.filter((scenario) =>\n    scenario.covers.some((glob) =>\n      queries.some((path) => matchesPattern(normalizePath(glob), path)),\n    ),\n  );\n}\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\nimport { canonicalizeRun } from \"executable-stories-core/converters/acl/canonicalize\";\nimport { synthesizeStories } from \"executable-stories-core/converters/synthesize\";\nimport { ReportGenerator } from \"./report-generator\";\nimport type { OutputFormat } from \"./types/options\";\nimport type { RawRun } from \"executable-stories-core/types/raw\";\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\n\nexport interface WatchOptions {\n  /** Path to the raw-run (or canonical) JSON the framework adapter writes. */\n  input: string;\n  outputDir: string;\n  outputName: string;\n  formats: OutputFormat[];\n  /** Input is \"raw\" (default) or already-canonical \"canonical\". */\n  inputType?: \"raw\" | \"canonical\";\n  /** Synthesize story metadata for plain tests (raw input only). Default true. */\n  synthesize?: boolean;\n  /** Coalesce rapid change events. Default 150ms. */\n  debounceMs?: number;\n}\n\nexport interface RegenerateDeps {\n  readFile?: (filePath: string) => string;\n}\n\nfunction toRun(data: unknown, inputType: \"raw\" | \"canonical\", synthesize: boolean): TestRunResult {\n  if (inputType === \"canonical\") return data as TestRunResult;\n  let raw = data as RawRun;\n  if (synthesize) raw = synthesizeStories(raw);\n  return canonicalizeRun(raw);\n}\n\n/**\n * Read a raw-run (or canonical) file once, canonicalize it, and regenerate the\n * requested agent artifacts via the canonical {@link ReportGenerator}. Returns\n * both the written file paths and the canonical run, so a caller that also needs\n * the run (e.g. `serve`, to diff it) does not read and canonicalize a second\n * time. This is the unit of work the watcher repeats.\n */\nexport async function regenerateRun(\n  options: WatchOptions,\n  deps: RegenerateDeps = {},\n): Promise<{ files: string[]; run: TestRunResult }> {\n  const read = deps.readFile ?? ((filePath: string) => fs.readFileSync(filePath, \"utf8\"));\n  const data: unknown = JSON.parse(read(path.resolve(options.input)));\n  const run = toRun(data, options.inputType ?? \"raw\", options.synthesize !== false);\n\n  const generator = new ReportGenerator({\n    formats: options.formats,\n    outputDir: options.outputDir,\n    outputName: options.outputName,\n  });\n  const result = await generator.generate(run);\n  // The generator folds this run into what earlier runs accumulated, so the\n  // rendered run is what the artifacts on disk describe. A caller diffing or\n  // reporting against the run it handed in would see only the fraction this\n  // invocation read.\n  return { files: [...result.values()].flat(), run: generator.renderedRun ?? run };\n}\n\n/** Regenerate artifacts and return just the written file paths. */\nexport async function regenerateArtifacts(\n  options: WatchOptions,\n  deps: RegenerateDeps = {},\n): Promise<string[]> {\n  return (await regenerateRun(options, deps)).files;\n}\n\nexport interface WatchDeps extends RegenerateDeps {\n  /** Watch a path, calling the listener on every change. Injectable for tests. */\n  watch?: (filePath: string, listener: () => void) => { close: () => void };\n  /** Override the regenerate step (tests). */\n  regenerate?: (input: string) => Promise<string[]>;\n  log?: (message: string) => void;\n}\n\nexport interface WatchHandle {\n  close: () => void;\n}\n\n/**\n * Keep the agent artifacts fresh: regenerate them whenever the framework\n * rewrites its raw-run file. Language-agnostic — any adapter that emits a\n * raw-run drives it. Pair with the host framework's own `--watch` to get a\n * behavior index that tracks the code.\n */\nexport function startWatch(options: WatchOptions, deps: WatchDeps = {}): WatchHandle {\n  const log = deps.log ?? ((message: string) => console.log(message));\n  const regenerate =\n    deps.regenerate ?? ((input: string) => regenerateArtifacts({ ...options, input }, deps));\n  const watchFn =\n    deps.watch ?? ((filePath: string, listener: () => void) => fs.watch(filePath, listener));\n  const debounceMs = options.debounceMs ?? 150;\n\n  let timer: ReturnType<typeof setTimeout> | undefined;\n  let running = false;\n  let pending = false;\n\n  const run = async (): Promise<void> => {\n    // A regenerate is already in flight; remember to run once more when it ends.\n    if (running) {\n      pending = true;\n      return;\n    }\n    running = true;\n    try {\n      const files = await regenerate(options.input);\n      log(`Regenerated ${files.length} artifact file(s) from ${options.input}`);\n    } catch (error) {\n      log(`Watch regeneration failed: ${(error as Error).message}`);\n    } finally {\n      running = false;\n      if (pending) {\n        pending = false;\n        trigger();\n      }\n    }\n  };\n\n  const trigger = (): void => {\n    if (timer) clearTimeout(timer);\n    timer = setTimeout(() => void run(), debounceMs);\n  };\n\n  trigger(); // initial build\n  const watcher = watchFn(path.resolve(options.input), trigger);\n\n  return {\n    close: () => {\n      if (timer) clearTimeout(timer);\n      watcher.close();\n    },\n  };\n}\n","/**\n * ReportGenerator — turns a canonical TestRunResult into report files.\n *\n * Its own module rather than part of the package barrel: `watch.ts` needs the\n * generator, and reaching for it through `./index` would pull every formatter\n * and the React SSR path into that module's graph.\n */\n\nimport * as path from \"node:path\";\nimport * as fs from \"node:fs\";\nimport * as fsPromises from \"node:fs/promises\";\nimport { toStoryReportWithIndex } from \"executable-stories-core/converters/story-report\";\nimport type { ScenarioRunEvent } from \"executable-stories-react/ssr\";\nimport type { TestRunResult, TestCaseResult } from \"executable-stories-core/types/test-result\";\nimport type { FormatterOptions, ResolvedFormatterOptions, OutputFormat, FormatInput, OutputMode, ColocatedStyle, OutputRule, Logger, WriteFile } from \"./types/options\";\nimport type { RunDiffResult } from \"./types/compare\";\nimport { reactReportCss, reactIslandScript } from \"./generated/react-assets\";\nimport { CucumberJsonFormatter } from \"./formatters/cucumber-json\";\nimport { StoryReportJsonFormatter } from \"./formatters/story-report-json\";\nimport { ScenarioIndexJsonFormatter } from \"./formatters/scenario-index-json\";\nimport { BehaviorManifestJsonFormatter } from \"./formatters/behavior-manifest-json\";\nimport { AgentTextFormatter } from \"./formatters/agent-text\";\nimport { SpanGraphFormatter } from \"./formatters/span-graph\";\nimport { JUnitFormatter } from \"./formatters/junit-xml\";\nimport { MarkdownFormatter } from \"./formatters/markdown\";\nimport { ReleaseManifestFormatter } from \"./formatters/release-manifest\";\nimport { TraceabilityCsvFormatter, TraceabilityMatrixFormatter } from \"./formatters/traceability-matrix\";\nimport { CucumberMessagesFormatter } from \"./formatters/cucumber-messages/formatter\";\nimport { CucumberHtmlFormatter } from \"./formatters/cucumber-html\";\nimport { buildIndexEntries, renderColocatedIndex } from \"./colocated-index\";\nimport { updateFileReports } from \"./file-reports\";\nimport { matchesPattern, selectTestCases } from \"./select-test-cases\";\nimport { AstroFormatter } from \"./formatters/astro\";\nimport { cleanTestStem } from \"executable-stories-core/utils/source-file\";\nimport { ConfluenceFormatter } from \"./formatters/confluence\";\nimport { copyMarkdownAssets } from \"./formatters/astro-assets\";\nimport { bundleAssets } from \"./bundler/bundle-assets\";\n\n// ============================================================================\n// ReportGenerator Types (fn(args, deps) pattern)\n// ============================================================================\n\n/** Arguments for generate function */\nexport interface GenerateArgs {\n  /** Canonical test run result */\n  run: TestRunResult;\n  /** Optional options override */\n  options?: FormatterOptions;\n}\n\n/** Dependencies for generate function (injectable for testing) */\nexport interface GenerateDeps {\n  /** Logger for warnings */\n  logger: Logger;\n  /** File writer function */\n  writeFile: WriteFile;\n  /** Read a file. Throws when it is not there, like `fs.readFileSync`. */\n  readFile: (filePath: string) => string;\n  /** List a directory's entries, or undefined when it is not one. */\n  listDir: (dir: string) => string[] | undefined;\n  /** True when the path is present in the working tree. */\n  fileExists: (filePath: string) => boolean;\n  /** Delete a file. Absent paths are not an error. */\n  removeFile: (filePath: string) => Promise<void>;\n}\n\n/** Options for one `generate` call. */\nexport interface GenerateOptions {\n  /**\n   * Whether this run owns the reports of the files it covers and should update\n   * them. True for a test run. False when rendering an already-assembled run,\n   * such as the aggregate of a shard directory, which owns nothing.\n   */\n  persist?: boolean;\n}\n\n/**\n * Formats that describe one execution rather than the documented behaviour of a\n * suite. CI dashboards and Cucumber tooling read these as \"what this build ran\",\n * so they are rendered from the run in hand, never from accumulated reports.\n */\nconst EXECUTION_FORMATS: ReadonlySet<OutputFormat> = new Set<OutputFormat>([\n  \"junit\",\n  \"cucumber-json\",\n  \"cucumber-messages\",\n  \"cucumber-html\",\n  \"release-manifest\",\n]);\n\n/** Result of generate function: Map of format to array of file paths */\nexport type GenerateResult = Map<OutputFormat, string[]>;\n\nexport interface GenerateCompareResult {\n  files: string[];\n  diff: RunDiffResult;\n}\n\n/** Extension map for output formats */\n/**\n * Formats whose empty output means \"nothing to report\", not \"an empty report\".\n * Every other format writes its file even when the run is empty, and changing\n * that would silently stop producing artifacts CI expects to find.\n */\nconst SKIP_WHEN_EMPTY: ReadonlySet<string> = new Set([\"span-graph\"]);\n\nconst FORMAT_EXTENSIONS: Record<OutputFormat, string> = {\n  \"agent-text\": \".agent.txt\",\n  \"span-graph\": \".span-graph.md\",\n  \"astro-markdown\": \".md\",\n  \"behavior-manifest-json\": \".behavior-manifest.json\",\n  markdown: \".md\",\n  \"release-manifest\": \".release-manifest.md\",\n  \"traceability-matrix\": \".traceability-matrix.md\",\n  \"traceability-csv\": \".traceability.csv\",\n  html: \".html\",\n  \"cucumber-html\": \".cucumber.html\",\n  junit: \".junit.xml\",\n  \"cucumber-json\": \".cucumber.json\",\n  \"cucumber-messages\": \".ndjson\",\n  confluence: \".adf.json\",\n  \"scenario-index-json\": \".scenario-index.json\",\n  \"story-report-json\": \".story-report.json\",\n};\n\n/**\n * Join an output name with a format extension, collapsing a stutter when the\n * chosen name already carries the format's tag. With the default name \"index\",\n * `story-report-json` writes `index.story-report.json`; but if the caller names\n * the file `story-report`, this yields `story-report.json`, not\n * `story-report.story-report.json`.\n */\nexport function joinNameAndExt(name: string, ext: string): string {\n  const stutter = `.${name}.`;\n  return ext.startsWith(stutter) ? `${name}.${ext.slice(stutter.length)}` : `${name}${ext}`;\n}\n\nfunction quoteShellArgument(value: string): string {\n  return /^[a-zA-Z0-9_./:-]+$/.test(value)\n    ? value\n    : \"'\" + value.replaceAll(\"'\", \"'\\\"'\\\"'\") + \"'\";\n}\n\n/** Known test file extensions to strip for colocated naming */\nconst TEST_EXTENSIONS = [\n  \".test.ts\", \".test.tsx\", \".spec.ts\", \".spec.tsx\",\n  \".test.js\", \".spec.js\", \".story.test.ts\", \".story.spec.ts\",\n];\n\n// ============================================================================\n// Pure Functions for Output Routing\n// ============================================================================\n\n/**\n * Find the first matching rule for a source file.\n */\nfunction findMatchingRule(\n  sourceFile: string,\n  rules: OutputRule[]\n): OutputRule | undefined {\n  for (const rule of rules) {\n    if (matchesPattern(rule.match, sourceFile)) {\n      return rule;\n    }\n  }\n  return undefined;\n}\n\n/**\n * Effective output mode for a source file: the matching rule's mode, else the\n * global default. Mirrors the resolution in groupTestCasesByOutput, including\n * the fallback where a colocated file with no known source aggregates instead.\n */\nfunction effectiveOutputMode(\n  sourceFile: string,\n  options: ResolvedFormatterOptions\n): OutputMode {\n  const rule = findMatchingRule(sourceFile, options.output.rules);\n  const mode = rule?.mode ?? options.output.mode;\n  return mode === \"colocated\" && sourceFile === \"unknown\" ? \"aggregated\" : mode;\n}\n\n/**\n * Normalize path to posix format (forward slashes).\n */\nexport function toPosix(p: string): string {\n  return p.replace(/\\\\/g, \"/\");\n}\n\n/**\n * Compute output path for a test case based on mode and settings.\n */\nfunction computeOutputPath(\n  sourceFile: string,\n  format: OutputFormat,\n  mode: OutputMode,\n  colocatedStyle: ColocatedStyle,\n  baseOutputDir: string,\n  outputName: string,\n  outputNameSuffix?: string\n): string {\n  const ext = FORMAT_EXTENSIONS[format];\n  const effectiveName = outputName + (outputNameSuffix ?? \"\");\n\n  if (mode === \"aggregated\") {\n    // Aggregated: single file in outputDir\n    return toPosix(path.join(baseOutputDir, joinNameAndExt(effectiveName, ext)));\n  }\n\n  // Colocated mode - normalize source file to posix first\n  const normalizedSource = toPosix(sourceFile);\n  const dirOfSource = path.posix.dirname(normalizedSource);\n  let baseName = path.posix.basename(normalizedSource);\n\n  // Strip test extension\n  for (const testExt of TEST_EXTENSIONS) {\n    if (baseName.endsWith(testExt)) {\n      baseName = baseName.slice(0, -testExt.length);\n      break;\n    }\n  }\n\n  const fileName = `${baseName}.${effectiveName}${ext}`;\n\n  if (colocatedStyle === \"adjacent\") {\n    // Adjacent: write next to source file (ignores outputDir)\n    return toPosix(path.posix.join(dirOfSource, fileName));\n  }\n\n  if (colocatedStyle === \"flat\") {\n    // Flat: one cleanly-named page per file directly under outputDir, for a\n    // browsable docs nav with tidy URLs (e.g. /stories/convert-currency/).\n    return toPosix(path.posix.join(baseOutputDir, `${cleanTestStem(normalizedSource)}${ext}`));\n  }\n\n  // Mirrored: preserve directory structure under outputDir\n  return toPosix(path.posix.join(baseOutputDir, dirOfSource, fileName));\n}\n\n/**\n * Group test cases by their computed output path.\n */\nfunction groupTestCasesByOutput(\n  testCases: TestCaseResult[],\n  format: OutputFormat,\n  options: ResolvedFormatterOptions,\n  logger: Logger,\n  outputNameSuffix?: string\n): Map<string, TestCaseResult[]> {\n  const groups = new Map<string, TestCaseResult[]>();\n  const rules = options.output.rules;\n  const defaultMode = options.output.mode;\n  const defaultColocatedStyle = options.output.colocatedStyle;\n  const defaultFormats = options.formats;\n  const defaultOutputDir = options.outputDir;\n  const defaultOutputName = options.outputName;\n\n  for (const tc of testCases) {\n    const sourceFile = tc.sourceFile;\n\n    // Check if colocated mode but missing sourceFile\n    if (defaultMode === \"colocated\" && sourceFile === \"unknown\") {\n      logger.warn(\n        `Test case \"${tc.story.scenario}\" missing sourceFile, falling back to aggregated`\n      );\n    }\n\n    // Find matching rule\n    const rule = findMatchingRule(sourceFile, rules);\n\n    // Determine effective settings (first match wins, fall back to defaults)\n    const mode = rule?.mode ?? defaultMode;\n    const colocatedStyle = rule?.colocatedStyle ?? defaultColocatedStyle;\n    const formats = normalizeFormats(rule?.formats ?? defaultFormats);\n    const outputDir = rule?.outputDir ?? defaultOutputDir;\n    const outputName = rule?.outputName ?? options.output.outputName ?? defaultOutputName;\n\n    // Warn if rule sets both adjacent style and outputDir\n    if (\n      rule &&\n      rule.colocatedStyle === \"adjacent\" &&\n      rule.outputDir !== undefined\n    ) {\n      logger.warn(\n        `Rule for \"${rule.match}\" sets both colocatedStyle: \"adjacent\" and outputDir. outputDir will be ignored for adjacent mode.`\n      );\n    }\n\n    // Skip if format not in effective formats\n    if (!formats.includes(format)) {\n      continue;\n    }\n\n    // Handle missing sourceFile in colocated mode\n    const effectiveMode =\n      mode === \"colocated\" && sourceFile === \"unknown\" ? \"aggregated\" : mode;\n\n    const outputPath = computeOutputPath(\n      sourceFile,\n      format,\n      effectiveMode,\n      colocatedStyle,\n      outputDir,\n      outputName,\n      outputNameSuffix\n    );\n\n    const existing = groups.get(outputPath);\n    if (existing) {\n      existing.push(tc);\n    } else {\n      groups.set(outputPath, [tc]);\n    }\n  }\n\n  return groups;\n}\n\n// ============================================================================\n// ReportGenerator\n// ============================================================================\n\n/**\n * High-level report generator that combines multiple formatters.\n *\n * Accepts ONLY canonical TestRunResult - use adapters + canonicalizeRun first.\n *\n * Supports output routing:\n * - Aggregated: All test cases in a single file\n * - Colocated mirrored: Files mirrored under outputDir preserving directory structure\n * - Colocated adjacent: Files written next to source files\n * - Rule-based: Different routing based on source file patterns\n */\n\nlet astroAliasWarned = false;\n\n/**\n * Normalise input formats to canonical {@link OutputFormat}s. Accepts the\n * deprecated `\"astro\"` alias (renamed to `\"astro-markdown\"`) and warns once per\n * process — so programmatic/config callers passing `\"astro\"` keep working\n * instead of throwing, matching the CLI's deprecation behaviour.\n */\nexport function normalizeFormats(formats: ReadonlyArray<FormatInput>): OutputFormat[] {\n  return formats.map((f) => {\n    if (f === \"astro\") {\n      if (!astroAliasWarned) {\n        astroAliasWarned = true;\n        console.warn(\n          \"⚠ The 'astro' output format was renamed to 'astro-markdown'. '\\\"astro\\\"' still works but \" +\n            \"will be removed in a future major; use 'astro-markdown'.\",\n        );\n      }\n      return \"astro-markdown\";\n    }\n    return f;\n  });\n}\n\nexport class ReportGenerator {\n  private options: ResolvedFormatterOptions;\n  private deps: GenerateDeps;\n  /**\n   * The run the last `generate()` actually rendered: this run folded into what\n   * previous runs accumulated. Callers that report on the output (the CLI's\n   * summary line) need to describe what was written, not just what was handed\n   * in. Undefined before the first generate.\n   */\n  private lastRenderedRun?: TestRunResult;\n  /**\n   * What the execution formats rendered: this run after the same selection the\n   * documentation set gets. The CLI counts whichever set its output actually\n   * contains, so an excluded scenario is not reported as written.\n   */\n  private lastExecutedRun?: TestRunResult;\n\n  constructor(options: FormatterOptions = {}, deps?: Partial<GenerateDeps>) {\n    this.options = this.resolveOptions(options);\n    this.deps = {\n      logger: deps?.logger ?? console,\n      writeFile: deps?.writeFile ?? ((p, c) => fsPromises.writeFile(p, c, \"utf8\")),\n      readFile: deps?.readFile ?? ((p) => fs.readFileSync(p, \"utf8\")),\n      listDir:\n        deps?.listDir ??\n        ((dir) => {\n          try {\n            return fs.readdirSync(dir);\n          } catch {\n            return undefined;\n          }\n        }),\n      fileExists: deps?.fileExists ?? ((p) => fs.existsSync(p)),\n      removeFile: deps?.removeFile ?? ((p) => fsPromises.rm(p, { force: true })),\n    };\n  }\n\n  /** The run the last `generate()` rendered, stored reports included. */\n  get renderedRun(): TestRunResult | undefined {\n    return this.lastRenderedRun;\n  }\n\n  /** What the last `generate()` handed the execution formats. */\n  get executedRun(): TestRunResult | undefined {\n    return this.lastExecutedRun;\n  }\n\n  /**\n   * Resolve options with defaults.\n   */\n  private resolveOptions(options: FormatterOptions): ResolvedFormatterOptions {\n    return {\n      include: options.include ?? [],\n      exclude: options.exclude ?? [],\n      includeTags: options.includeTags ?? [],\n      excludeTags: options.excludeTags ?? [],\n      formats: normalizeFormats(options.formats ?? [\"html\"]),\n      outputDir: options.outputDir ?? \"reports\",\n      outputName: options.outputName ?? \"index\",\n      outputNameTimestamp: options.outputNameTimestamp ?? false,\n      sortTestCases: options.sortTestCases ?? \"none\",\n      output: {\n        mode: options.output?.mode ?? \"aggregated\",\n        colocatedStyle: options.output?.colocatedStyle ?? \"mirrored\",\n        rules: options.output?.rules ?? [],\n        outputName: options.output?.outputName,\n      },\n      cucumberJson: {\n        pretty: options.cucumberJson?.pretty ?? false,\n      },\n      storyReportJson: {\n        pretty: options.storyReportJson?.pretty ?? true,\n      },\n      scenarioIndexJson: {\n        pretty: options.scenarioIndexJson?.pretty ?? true,\n      },\n      behaviorManifestJson: {\n        pretty: options.behaviorManifestJson?.pretty ?? true,\n      },\n      cucumberMessages: {\n        uriStrategy: options.cucumberMessages?.uriStrategy ?? \"sourceFile\",\n        includeSynthetics: options.cucumberMessages?.includeSynthetics ?? true,\n        idSalt: options.cucumberMessages?.idSalt ?? \"\",\n        meta: options.cucumberMessages?.meta,\n      },\n      // Top-level link templates are the default for every format that renders a\n      // link; a per-format option of the same name still wins below.\n      permalinkBaseUrl: options.permalinkBaseUrl,\n      ticketUrlTemplate: options.ticketUrlTemplate,\n      traceUrlTemplate: options.traceUrlTemplate,\n      html: {\n        title: options.html?.title ?? \"Test Results\",\n        syntaxHighlighting: options.html?.syntaxHighlighting ?? true,\n        mermaidEnabled: options.html?.mermaidEnabled ?? true,\n        staleAfterDays: options.html?.staleAfterDays ?? 7,\n        share: options.html?.share ?? false,\n        shareCommand: options.html?.shareCommand,\n        architecture: options.html?.architecture ?? false,\n      },\n      historyStore: options.historyStore,\n      junit: {\n        suiteName: options.junit?.suiteName ?? \"Test Suite\",\n        includeOutput: options.junit?.includeOutput ?? true,\n      },\n      markdown: {\n        title: options.markdown?.title ?? \"User Stories\",\n        includeStatusIcons: options.markdown?.includeStatusIcons ?? true,\n        includeMetadata: options.markdown?.includeMetadata ?? true,\n        includeErrors: options.markdown?.includeErrors ?? true,\n        scenarioHeadingLevel: options.markdown?.scenarioHeadingLevel ?? 3,\n        stepStyle: options.markdown?.stepStyle ?? \"bullets\",\n        groupBy: options.markdown?.groupBy ?? \"file\",\n        sortScenarios: options.markdown?.sortScenarios ?? \"source\",\n        suiteSeparator: options.markdown?.suiteSeparator ?? \" - \",\n        includeFrontMatter: options.markdown?.includeFrontMatter ?? false,\n        includeSummaryTable: options.markdown?.includeSummaryTable ?? false,\n        permalinkBaseUrl: options.markdown?.permalinkBaseUrl ?? options.permalinkBaseUrl,\n        ticketUrlTemplate: options.markdown?.ticketUrlTemplate ?? options.ticketUrlTemplate,\n        traceUrlTemplate: options.markdown?.traceUrlTemplate ?? options.traceUrlTemplate,\n        includeSourceLinks: options.markdown?.includeSourceLinks ?? true,\n        customRenderers: options.markdown?.customRenderers,\n        attachImages: options.markdown?.attachImages ?? false,\n      },\n      spanGraph: {\n        ...(options.spanGraph?.title === undefined ? {} : { title: options.spanGraph.title }),\n        ...(options.spanGraph?.delta === undefined ? {} : { delta: options.spanGraph.delta }),\n      },\n      confluence: {\n        title: options.confluence?.title ?? \"User Stories\",\n        includeStatusIcons: options.confluence?.includeStatusIcons ?? true,\n        includeMetadata: options.confluence?.includeMetadata ?? true,\n        includeSummaryTable: options.confluence?.includeSummaryTable ?? true,\n        includeErrors: options.confluence?.includeErrors ?? true,\n        scenarioHeadingLevel: options.confluence?.scenarioHeadingLevel ?? 3,\n        groupBy: options.confluence?.groupBy ?? \"file\",\n        sortScenarios: options.confluence?.sortScenarios ?? \"source\",\n        pretty: options.confluence?.pretty ?? true,\n        permalinkBaseUrl: options.confluence?.permalinkBaseUrl ?? options.permalinkBaseUrl,\n        ticketUrlTemplate: options.confluence?.ticketUrlTemplate ?? options.ticketUrlTemplate,\n      },\n      astro: {\n        assetsDir: options.astro?.assetsDir ?? \"public/stories/assets\",\n        assetsBaseUrl: options.astro?.assetsBaseUrl ?? \"/stories/assets\",\n        markdown: {\n          title: options.astro?.markdown?.title ?? \"User Stories\",\n          includeStatusIcons: options.astro?.markdown?.includeStatusIcons ?? true,\n          includeErrors: options.astro?.markdown?.includeErrors ?? true,\n          scenarioHeadingLevel: options.astro?.markdown?.scenarioHeadingLevel ?? 3,\n          groupBy: options.astro?.markdown?.groupBy ?? \"file\",\n          sortScenarios: options.astro?.markdown?.sortScenarios ?? \"source\",\n          suiteSeparator: options.astro?.markdown?.suiteSeparator ?? \" - \",\n          includeSourceLinks: options.astro?.markdown?.includeSourceLinks ?? true,\n          permalinkBaseUrl: options.astro?.markdown?.permalinkBaseUrl ?? options.permalinkBaseUrl,\n          ticketUrlTemplate: options.astro?.markdown?.ticketUrlTemplate ?? options.ticketUrlTemplate,\n          traceUrlTemplate: options.astro?.markdown?.traceUrlTemplate ?? options.traceUrlTemplate,\n          customRenderers: options.astro?.markdown?.customRenderers,\n          scenarioAnchor: options.astro?.markdown?.scenarioAnchor,\n          scenarioBadge: options.astro?.markdown?.scenarioBadge,\n          scenarioNoteLink: options.astro?.markdown?.scenarioNoteLink,\n        },\n      },\n      assetMode: options.assetMode ?? \"none\",\n      allowMissingAssets: options.allowMissingAssets ?? false,\n    };\n  }\n\n  /**\n   * Generate reports for a test run.\n   *\n   * @param run - Canonical TestRunResult (use canonicalizeRun to create from RawRun)\n   * @returns Map of output format to generated file paths\n   */\n  async generate(\n    run: TestRunResult,\n    options: GenerateOptions = {}\n  ): Promise<GenerateResult> {\n    // Two operations, deliberately kept apart.\n    //\n    // A test run owns the reports of the files it covered: it updates those,\n    // then renders. Rendering an already-assembled run (the shard directory)\n    // owns nothing, so it must not write reports or restamp anything — doing\n    // both from one path made reading a directory destroy the freshness data\n    // the whole design exists to protect.\n    const persist = options.persist ?? true;\n    const accumulated = persist\n      ? await updateFileReports({ run, outputDir: this.options.outputDir }, this.deps)\n      : run;\n\n    const testCases = selectTestCases(\n      {\n        testCases: accumulated.testCases,\n        include: this.options.include,\n        exclude: this.options.exclude,\n        includeTags: this.options.includeTags,\n        excludeTags: this.options.excludeTags,\n        sortTestCases: this.options.sortTestCases,\n      },\n      { logger: this.deps.logger }\n    );\n\n    const filteredRun: TestRunResult = { ...accumulated, testCases };\n    this.lastRenderedRun = filteredRun;\n\n    // Execution formats are a record of what this build ran. Handing them\n    // scenarios carried over from earlier runs would report tests to CI as\n    // having just passed when they did not run at all.\n    const executedRun: TestRunResult = {\n      ...run,\n      testCases: selectTestCases(\n        {\n          testCases: run.testCases,\n          include: this.options.include,\n          exclude: this.options.exclude,\n          includeTags: this.options.includeTags,\n          excludeTags: this.options.excludeTags,\n          sortTestCases: this.options.sortTestCases,\n        },\n        { logger: this.deps.logger }\n      ),\n    };\n\n    this.lastExecutedRun = executedRun;\n\n    const results: GenerateResult = new Map();\n\n    for (const format of this.options.formats) {\n      const source = EXECUTION_FORMATS.has(format) ? executedRun : filteredRun;\n      const paths = await this.generateFormat(source, format);\n      results.set(format, paths);\n    }\n\n    // Colocated output writes one HTML report per source file, which leaves a\n    // directory of files with no front door — someone handed the folder has\n    // nothing to open. Write an index listing them (failures first). An\n    // aggregated group is a single file that IS its own entry point, so only\n    // colocated groups are indexed. A per-rule colocated mode counts too, even\n    // when the global mode is aggregated (writeColocatedIndex filters to the\n    // colocated groups and returns undefined when there are none).\n    const htmlPaths = results.get(\"html\") ?? [];\n    if (this.hasColocatedOutput() && htmlPaths.length > 0) {\n      const indexPath = await this.writeColocatedIndex(filteredRun, htmlPaths);\n      if (indexPath) results.set(\"html\", [...htmlPaths, indexPath]);\n    }\n\n    if (this.options.assetMode === \"copy\") {\n      // The html report references screenshots/videos by path — DocScreenshot\n      // and DocVideo emit <img>/<video src=...> rather than inlining bytes — so\n      // a moved or hosted report would 404 its media. Bundle them: copy\n      // referenced local media into assets/ beside the report and rewrite the\n      // paths in both the static markup and the embedded report JSON the\n      // interactive island re-renders from.\n      const htmlPaths = results.get(\"html\");\n      if (htmlPaths) {\n        for (const htmlPath of htmlPaths) {\n          bundleAssets(htmlPath, { allowMissing: this.options.allowMissingAssets });\n        }\n      }\n\n      // Markdown renders the same media the html does, from paths pointing into\n      // the runner's output dir — which the next run wipes.\n      await this.bundleMarkdownAssets(results.get(\"markdown\"), (markdownDir) => ({\n        assetsDir: path.join(markdownDir, \"assets\"),\n        assetsBaseUrl: \"assets\",\n      }));\n\n      await this.bundleMarkdownAssets(results.get(\"astro-markdown\"), () => ({\n        // assetsDir is resolved from CWD (same as outputDir), not relative to outputDir\n        assetsDir: path.resolve(this.options.astro.assetsDir),\n        assetsBaseUrl: this.options.astro.assetsBaseUrl,\n      }));\n    }\n\n    return results;\n  }\n\n  /**\n   * Copy every local asset these markdown reports reference into an assets\n   * directory and rewrite the refs. The destination is computed per report\n   * because colocated output writes one per source file.\n   */\n  private async bundleMarkdownAssets(\n    markdownPaths: string[] | undefined,\n    target: (markdownDir: string) => { assetsDir: string; assetsBaseUrl: string },\n  ): Promise<void> {\n    if (!markdownPaths) return;\n\n    for (const markdownPath of markdownPaths) {\n      const markdown = await fsPromises.readFile(markdownPath, \"utf8\");\n      const markdownDir = path.dirname(markdownPath);\n      const result = copyMarkdownAssets({\n        markdown,\n        markdownDir,\n        allowMissing: this.options.allowMissingAssets,\n        ...target(markdownDir),\n      });\n      if (result.copiedCount > 0 || result.missingCount > 0) {\n        await this.deps.writeFile(markdownPath, result.markdown);\n      }\n    }\n  }\n\n  /**\n   * Whether any output is colocated — the global mode, or any per-rule mode.\n   * A colocated rule under a global aggregated mode still writes per-file\n   * reports that need an index.\n   */\n  private hasColocatedOutput(): boolean {\n    return (\n      this.options.output.mode === \"colocated\" ||\n      this.options.output.rules.some((rule) => rule.mode === \"colocated\")\n    );\n  }\n\n  /**\n   * Write the entry-point page for a colocated HTML report tree. `htmlPaths` is\n   * every HTML report already written this run. Returns the path written, or\n   * undefined when there is nothing to index or the index would clobber a report\n   * already at `index.html` — a colocated source file that produces it, or, in\n   * mixed mode, the global aggregate (whose default output name is also index).\n   */\n  private async writeColocatedIndex(\n    run: TestRunResult,\n    htmlPaths: string[]\n  ): Promise<string | undefined> {\n    const outputNameSuffix = this.options.outputNameTimestamp\n      ? `-${Math.floor(run.startedAtMs / 1000)}`\n      : undefined;\n    // Recompute the same grouping generateFormat used so the index links\n    // exactly the files that were written (deterministic, so this cannot drift).\n    const groups = groupTestCasesByOutput(\n      run.testCases,\n      \"html\",\n      this.options,\n      this.deps.logger,\n      outputNameSuffix,\n    );\n    const bySourceFile = new Map<string, string>();\n    for (const [outputPath, testCases] of groups) {\n      const sourceFile = testCases[0]?.sourceFile;\n      if (!sourceFile) continue;\n      // Index colocated groups only. An aggregated group covers many source\n      // files in one report — it is its own front door, and mapping it to\n      // testCases[0].sourceFile would list it as if it belonged to that one\n      // file while hiding the rest.\n      if (effectiveOutputMode(sourceFile, this.options) !== \"colocated\") continue;\n      bySourceFile.set(sourceFile, outputPath);\n    }\n    if (bySourceFile.size === 0) return undefined;\n\n    const indexPath = toPosix(path.join(this.options.outputDir, \"index.html\"));\n    if (htmlPaths.some((p) => toPosix(p) === indexPath)) {\n      this.deps.logger.warn?.(\n        `Skipping colocated index: a report already occupies ${indexPath}.`,\n      );\n      return undefined;\n    }\n\n    const entries = buildIndexEntries(run, bySourceFile, path.dirname(indexPath));\n    const html = renderColocatedIndex(entries, this.options.html.title);\n    await fsPromises.mkdir(path.dirname(indexPath), { recursive: true });\n    await this.deps.writeFile(indexPath, html);\n    return indexPath;\n  }\n\n  /**\n   * Generate reports for a single format.\n   */\n  private async generateFormat(\n    run: TestRunResult,\n    format: OutputFormat\n  ): Promise<string[]> {\n    const outputNameSuffix = this.options.outputNameTimestamp\n      ? `-${Math.floor(run.startedAtMs / 1000)}`\n      : undefined;\n\n    // Group test cases by output path\n    const groups = groupTestCasesByOutput(\n      run.testCases,\n      format,\n      this.options,\n      this.deps.logger,\n      outputNameSuffix\n    );\n\n    // Handle empty runs in aggregated mode - write a single empty file\n    if (groups.size === 0 && this.options.output.mode === \"aggregated\") {\n      const ext = FORMAT_EXTENSIONS[format];\n      const effectiveName = this.options.outputName + (outputNameSuffix ?? \"\");\n      const outputPath = toPosix(path.join(this.options.outputDir, joinNameAndExt(effectiveName, ext)));\n      const content = await this.formatContent(run, format, outputPath);\n      if (content === \"\" && SKIP_WHEN_EMPTY.has(format)) return [];\n      const dir = path.dirname(outputPath);\n      await fsPromises.mkdir(dir, { recursive: true });\n      await this.deps.writeFile(outputPath, content);\n      return [outputPath];\n    }\n\n    const writtenPaths: string[] = [];\n\n    for (const [outputPath, testCases] of groups) {\n      // Create a run with just these test cases\n      const groupRun: TestRunResult = {\n        ...run,\n        testCases,\n      };\n\n      // Format content\n      const content = await this.formatContent(groupRun, format, outputPath);\n      // A format that has nothing to say writes nothing: span-graph on an\n      // uninstrumented suite would otherwise leave a page saying \"no diagram\"\n      // in every report forever.\n      if (content === \"\" && SKIP_WHEN_EMPTY.has(format)) continue;\n\n      // Ensure directory exists\n      const dir = path.dirname(outputPath);\n      await fsPromises.mkdir(dir, { recursive: true });\n\n      // Write file\n      await this.deps.writeFile(outputPath, content);\n      writtenPaths.push(outputPath);\n    }\n\n    return writtenPaths;\n  }\n\n  /**\n   * Format content for a specific format.\n   */\n  private formatContent(run: TestRunResult, format: OutputFormat, outputPath: string): string | Promise<string> {\n    switch (format) {\n      case \"cucumber-json\": {\n        const formatter = new CucumberJsonFormatter({\n          pretty: this.options.cucumberJson.pretty,\n        });\n        return formatter.formatToString(run);\n      }\n\n      case \"html\": {\n        // The HTML report renders via executable-stories-react (the single\n        // report renderer). Lazy import keeps React + executable-stories-react\n        // out of the eager import graph (and the Bun single binary) unless the\n        // html format is requested.\n        return this.formatHtmlReact(run, outputPath);\n      }\n\n      case \"cucumber-html\": {\n        const formatter = new CucumberHtmlFormatter({\n          messages: {\n            uriStrategy: this.options.cucumberMessages.uriStrategy,\n            includeSynthetics: this.options.cucumberMessages.includeSynthetics,\n            idSalt: this.options.cucumberMessages.idSalt,\n            meta: this.options.cucumberMessages.meta,\n          },\n        });\n        return formatter.formatToString(run);\n      }\n\n      case \"junit\": {\n        const formatter = new JUnitFormatter({\n          suiteName: this.options.junit.suiteName,\n          includeOutput: this.options.junit.includeOutput,\n        });\n        return formatter.format(run);\n      }\n\n      case \"cucumber-messages\": {\n        const formatter = new CucumberMessagesFormatter({\n          uriStrategy: this.options.cucumberMessages.uriStrategy,\n          includeSynthetics: this.options.cucumberMessages.includeSynthetics,\n          idSalt: this.options.cucumberMessages.idSalt,\n          meta: this.options.cucumberMessages.meta,\n        });\n        return formatter.formatToString(run);\n      }\n\n      case \"astro-markdown\": {\n        const formatter = new AstroFormatter({\n          assetsBaseUrl: this.options.astro.assetsBaseUrl,\n          // Colocated = one page per file, so title each by its own suite/file.\n          perFileTitle: this.options.output.mode === \"colocated\",\n          markdown: this.options.astro.markdown,\n        });\n        return formatter.format(run);\n      }\n\n      case \"confluence\": {\n        const formatter = new ConfluenceFormatter({\n          title: this.options.confluence.title,\n          includeStatusIcons: this.options.confluence.includeStatusIcons,\n          includeMetadata: this.options.confluence.includeMetadata,\n          includeSummaryTable: this.options.confluence.includeSummaryTable,\n          includeErrors: this.options.confluence.includeErrors,\n          scenarioHeadingLevel: this.options.confluence.scenarioHeadingLevel,\n          groupBy: this.options.confluence.groupBy,\n          sortScenarios: this.options.confluence.sortScenarios,\n          pretty: this.options.confluence.pretty,\n          permalinkBaseUrl: this.options.confluence.permalinkBaseUrl,\n          ticketUrlTemplate: this.options.confluence.ticketUrlTemplate,\n        });\n        return formatter.format(run);\n      }\n\n      case \"markdown\": {\n        const formatter = new MarkdownFormatter({\n          title: this.options.markdown.title,\n          includeStatusIcons: this.options.markdown.includeStatusIcons,\n          includeMetadata: this.options.markdown.includeMetadata,\n          includeErrors: this.options.markdown.includeErrors,\n          scenarioHeadingLevel: this.options.markdown.scenarioHeadingLevel,\n          stepStyle: this.options.markdown.stepStyle,\n          groupBy: this.options.markdown.groupBy,\n          sortScenarios: this.options.markdown.sortScenarios,\n          suiteSeparator: this.options.markdown.suiteSeparator,\n          includeFrontMatter: this.options.markdown.includeFrontMatter,\n          includeSummaryTable: this.options.markdown.includeSummaryTable,\n          permalinkBaseUrl: this.options.markdown.permalinkBaseUrl,\n          ticketUrlTemplate: this.options.markdown.ticketUrlTemplate,\n          traceUrlTemplate: this.options.markdown.traceUrlTemplate,\n          includeSourceLinks: this.options.markdown.includeSourceLinks,\n          customRenderers: this.options.markdown.customRenderers,\n          attachImages: this.options.markdown.attachImages,\n        });\n        return formatter.format(run);\n      }\n\n      case \"release-manifest\": {\n        const formatter = new ReleaseManifestFormatter();\n        return formatter.format(run);\n      }\n\n      case \"traceability-matrix\": {\n        const formatter = new TraceabilityMatrixFormatter();\n        return formatter.format(run);\n      }\n\n      case \"traceability-csv\": {\n        const formatter = new TraceabilityCsvFormatter();\n        return formatter.format(run);\n      }\n\n      case \"story-report-json\": {\n        const formatter = new StoryReportJsonFormatter({\n          pretty: this.options.storyReportJson.pretty,\n          ticketUrlTemplate: this.options.ticketUrlTemplate,\n        });\n        return formatter.format(run);\n      }\n\n      case \"scenario-index-json\": {\n        const formatter = new ScenarioIndexJsonFormatter({\n          pretty: this.options.scenarioIndexJson.pretty,\n        });\n        return formatter.format(run);\n      }\n\n      case \"behavior-manifest-json\": {\n        const formatter = new BehaviorManifestJsonFormatter({\n          pretty: this.options.behaviorManifestJson.pretty,\n        });\n        return formatter.format(run);\n      }\n\n      case \"agent-text\": {\n        const formatter = new AgentTextFormatter();\n        return formatter.format(run);\n      }\n\n      case \"span-graph\": {\n        const formatter = new SpanGraphFormatter(this.options.spanGraph);\n        return formatter.format(run);\n      }\n\n      default:\n        throw new Error(`Unknown format: ${format}`);\n    }\n  }\n\n  /**\n   * Render a standalone HTML report via the shared React component tree\n   * (executable-stories-react). This is the same renderer the Astro docs site\n   * uses, so the two outputs cannot drift. Imported lazily so React stays out\n   * of the eager bundle unless this format is requested.\n   */\n  private async formatHtmlReact(run: TestRunResult, outputPath: string): Promise<string> {\n    // Lazy on purpose (see above): a static import would pull React into every\n    // bundle that touches this module, HTML output requested or not.\n    // eslint-disable-next-line no-restricted-syntax\n    const { renderReportToHtml } = await import(\"executable-stories-react/ssr\");\n    const { report, index } = toStoryReportWithIndex(run, {\n      ticketUrlTemplate: this.options.ticketUrlTemplate,\n    });\n\n    // Join the run-keyed history store onto report scenario ids so the\n    // interactive report can render a per-scenario run timeline.\n    let scenarioHistory: Record<string, ScenarioRunEvent[]> | undefined;\n    const store = this.options.historyStore;\n    if (store) {\n      scenarioHistory = {};\n      for (const [tcId, scenarioId] of Object.entries(index.scenarioIdByTestCaseId)) {\n        const entries = store.tests[tcId]?.entries;\n        if (!entries || entries.length === 0) continue;\n        scenarioHistory[scenarioId] = entries.map((e) => {\n          const event: ScenarioRunEvent = { timestamp: e.timestamp, status: e.status };\n          if (e.runId) event.runId = e.runId;\n          if (e.durationMs !== undefined) event.durationMs = e.durationMs;\n          if (e.ci?.commitSha) event.commitSha = e.ci.commitSha;\n          if (e.ci?.branch) event.branch = e.ci.branch;\n          return event;\n        });\n      }\n      if (Object.keys(scenarioHistory).length === 0) scenarioHistory = undefined;\n    }\n\n    return renderReportToHtml(report, {\n      title: this.options.html.title,\n      css: readReactReportCss(),\n      theme: \"light\",\n      syntaxHighlighting: this.options.html.syntaxHighlighting,\n      mermaid: this.options.html.mermaidEnabled,\n      staleAfterDays: this.options.html.staleAfterDays,\n      share: this.options.html.share,\n      architecture: this.options.html.architecture,\n      shareCommand:\n        this.options.html.shareCommand ??\n        `npx --package executable-stories-formatters executable-stories share ${quoteShellArgument(outputPath)}`,\n      scenarioHistory,\n      islandScript: readReactIslandScript(),\n    });\n  }\n}\n\n/**\n * The compiled Tailwind/shadcn stylesheet and the self-contained interactive\n * island IIFE shipped by executable-stories-react, embedded at build time by\n * scripts/embed-react-assets.mjs. Embedding (rather than resolving from\n * node_modules at runtime) is what lets `--format html` work from the\n * bun-compiled single-file binary, which has no node_modules. The reporters and\n * the binary therefore inline the version of these assets that formatters was\n * built against.\n */\nfunction readReactReportCss(): string {\n  return reactReportCss;\n}\n\nfunction readReactIslandScript(): string {\n  return reactIslandScript;\n}\n\n/**\n * Factory function to create a ReportGenerator with dependency injection.\n *\n * Useful for testing and custom configurations.\n */\nexport function createReportGenerator(\n  options?: FormatterOptions,\n  deps?: Partial<GenerateDeps>\n): ReportGenerator {\n  return new ReportGenerator(options, deps);\n}\n","/* eslint-disable */\n// AUTO-GENERATED by scripts/embed-react-assets.mjs — do not edit.\n// Regenerated on every build/type-check/test/compile from the built\n// executable-stories-react assets.\nexport const reactReportCss = \"/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\\n@layer properties,theme,base,components,utilities;@import \\\"https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Geist:wght@400;500;600;700&display=swap\\\";@layer theme{:root,:host{--font-sans:var(--es-font-body);--font-mono:var(--es-font-mono);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer utilities{.\\\\@container\\\\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1\\\\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-\\\\[50\\\\%\\\\]{top:50%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\\\\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-2\\\\.5{left:calc(var(--spacing) * 2.5)}.left-\\\\[50\\\\%\\\\]{left:50%}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.m-auto{margin:auto}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.my-1{margin-block:var(--spacing)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);margin-top:1.2em;margin-bottom:1.2em;font-size:1.25em;line-height:1.6}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:decimal}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=\\\"1\\\"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:disc}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.25em;font-weight:600}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:\\\"“\\\"\\\"”\\\"\\\"‘\\\"\\\"’\\\";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;font-style:italic;font-weight:500}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:0;margin-bottom:.888889em;font-size:2.25em;font-weight:800;line-height:1.11111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:900}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:2em;margin-bottom:1em;font-size:1.5em;font-weight:700;line-height:1.33333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:800}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.6em;margin-bottom:.6em;font-size:1.25em;font-weight:600;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.5em;margin-bottom:.5em;font-weight:600;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em;display:block}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows), 0 3px 0 var(--tw-prose-kbd-shadows);padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;border-radius:.3125rem;padding-inline-start:.375em;font-family:inherit;font-size:.875em;font-weight:500}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:\\\"`\\\"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);padding-top:.857143em;padding-inline-end:1.14286em;padding-bottom:.857143em;border-radius:.375rem;margin-top:1.71429em;margin-bottom:1.71429em;padding-inline-start:1.14286em;font-size:.875em;font-weight:400;line-height:1.71429;overflow-x:auto}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;background-color:#0000;border-width:0;border-radius:0;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){table-layout:auto;width:100%;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.71429}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);vertical-align:bottom;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em;font-weight:600}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);margin-top:.857143em;font-size:.875em;line-height:1.42857}.prose{--tw-prose-body:oklch(37.3% .034 259.733);--tw-prose-headings:oklch(21% .034 264.665);--tw-prose-lead:oklch(44.6% .03 256.802);--tw-prose-links:oklch(21% .034 264.665);--tw-prose-bold:oklch(21% .034 264.665);--tw-prose-counters:oklch(55.1% .027 264.364);--tw-prose-bullets:oklch(87.2% .01 258.338);--tw-prose-hr:oklch(92.8% .006 264.531);--tw-prose-quotes:oklch(21% .034 264.665);--tw-prose-quote-borders:oklch(92.8% .006 264.531);--tw-prose-captions:oklch(55.1% .027 264.364);--tw-prose-kbd:oklch(21% .034 264.665);--tw-prose-kbd-shadows:oklab(21% -.00316127 -.0338527/.1);--tw-prose-code:oklch(21% .034 264.665);--tw-prose-pre-code:oklch(92.8% .006 264.531);--tw-prose-pre-bg:oklch(27.8% .033 256.848);--tw-prose-th-borders:oklch(87.2% .01 258.338);--tw-prose-td-borders:oklch(92.8% .006 264.531);--tw-prose-invert-body:oklch(87.2% .01 258.338);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.7% .022 261.325);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.7% .022 261.325);--tw-prose-invert-bullets:oklch(44.6% .03 256.802);--tw-prose-invert-hr:oklch(37.3% .034 259.733);--tw-prose-invert-quotes:oklch(96.7% .003 264.542);--tw-prose-invert-quote-borders:oklch(37.3% .034 259.733);--tw-prose-invert-captions:oklch(70.7% .022 261.325);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:#ffffff1a;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(87.2% .01 258.338);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .03 256.802);--tw-prose-invert-td-borders:oklch(37.3% .034 259.733);font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.571429em;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.71429}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.888889em;margin-bottom:.888889em;font-size:1.28571em;line-height:1.55556}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.33333em;margin-bottom:1.33333em;padding-inline-start:1.11111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:.8em;font-size:2.14286em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6em;margin-bottom:.8em;font-size:1.42857em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.55556em;margin-bottom:.444444em;font-size:1.28571em;line-height:1.55556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.42857em;margin-bottom:.571429em;line-height:1.42857}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.142857em;padding-inline-end:.357143em;padding-bottom:.142857em;border-radius:.3125rem;padding-inline-start:.357143em;font-size:.857143em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.857143em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.666667em;padding-inline-end:1em;padding-bottom:.666667em;border-radius:.25rem;margin-top:1.66667em;margin-bottom:1.66667em;padding-inline-start:1em;font-size:.857143em;line-height:1.66667}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em;padding-inline-start:1.57143em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.285714em;margin-bottom:.285714em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.428571em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.571429em;margin-bottom:.571429em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.14286em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.14286em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.571429em;margin-bottom:.571429em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.285714em;padding-inline-start:1.57143em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.85714em;margin-bottom:2.85714em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.857143em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.666667em;padding-inline-end:1em;padding-bottom:.666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.666667em;font-size:.857143em;line-height:1.33333}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.mt-0\\\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mb-1{margin-bottom:var(--spacing)}.mb-1\\\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-1\\\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-3\\\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.h-3{height:calc(var(--spacing) * 3)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-24{height:calc(var(--spacing) * 24)}.h-\\\\[1\\\\.15rem\\\\]{height:1.15rem}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-\\\\[300px\\\\]{max-height:300px}.max-h-\\\\[var\\\\(--available-height\\\\)\\\\]{max-height:var(--available-height)}.max-h-none{max-height:none}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-6{min-height:calc(var(--spacing) * 6)}.w-1\\\\/2{width:50%}.w-4{width:calc(var(--spacing) * 4)}.w-8{width:calc(var(--spacing) * 8)}.w-16{width:calc(var(--spacing) * 16)}.w-40{width:calc(var(--spacing) * 40)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\\\\[min\\\\(90vw\\\\,28rem\\\\)\\\\]{width:min(90vw,28rem)}.w-\\\\[min\\\\(90vw\\\\,32rem\\\\)\\\\]{width:min(90vw,32rem)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\\\[80vw\\\\]{max-width:80vw}.max-w-\\\\[calc\\\\(100\\\\%-2rem\\\\)\\\\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.min-w-6{min-width:calc(var(--spacing) * 6)}.min-w-\\\\[8rem\\\\]{min-width:8rem}.min-w-\\\\[11rem\\\\]{min-width:11rem}.min-w-\\\\[52px\\\\]{min-width:52px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-48{flex-basis:calc(var(--spacing) * 48)}.border-collapse{border-collapse:collapse}.origin-\\\\[var\\\\(--transform-origin\\\\)\\\\]{transform-origin:var(--transform-origin)}.-translate-x-1\\\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\\\[-50\\\\%\\\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\\\[-50\\\\%\\\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.scroll-py-1{scroll-padding-block:var(--spacing)}.list-none{list-style-type:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\\\\[0_1fr\\\\]{grid-template-columns:0 1fr}.grid-cols-\\\\[auto_1fr\\\\]{grid-template-columns:auto 1fr}.grid-cols-\\\\[max-content_1fr\\\\]{grid-template-columns:max-content 1fr}.grid-cols-subgrid{grid-template-columns:subgrid}.grid-rows-\\\\[auto_auto\\\\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-items-start{justify-items:start}.gap-0{gap:0}.gap-0\\\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-\\\\[3px\\\\]{gap:3px}:where(.space-y-0\\\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-0\\\\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\\\\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-2\\\\.5{row-gap:calc(var(--spacing) * 2.5)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.justify-self-start{justify-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.\\\\[overscroll-behavior\\\\:contain\\\\]{overscroll-behavior:contain}.rounded{border-radius:var(--es-radius)}.rounded-\\\\[4px\\\\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border,.border-border\\\\/60{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\\\/60{border-color:color-mix(in oklab, var(--border) 60%, transparent)}}.border-destructive\\\\/40{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\\\\/40{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.border-fail-border{border-color:var(--es-fail-border)}.border-input{border-color:var(--input)}.border-pass-border{border-color:var(--es-pass-border)}.border-pend-border{border-color:var(--es-pend-border)}.border-primary,.border-primary\\\\/40{border-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.border-primary\\\\/40{border-color:color-mix(in oklab, var(--primary) 40%, transparent)}}.border-skip-border{border-color:var(--es-skip-border)}.border-transparent{border-color:#0000}.bg-background{background-color:var(--background)}.bg-black\\\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\\\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-border,.bg-border\\\\/40{background-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.bg-border\\\\/40{background-color:color-mix(in oklab, var(--border) 40%, transparent)}}.bg-card{background-color:var(--card)}.bg-destructive,.bg-destructive\\\\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\\\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-fail{background-color:var(--es-fail)}.bg-fail-bg{background-color:var(--es-fail-bg)}.bg-foreground{background-color:var(--foreground)}.bg-muted{background-color:var(--muted)}.bg-muted-foreground\\\\/50{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\\\/50{background-color:color-mix(in oklab, var(--muted-foreground) 50%, transparent)}}.bg-muted\\\\/30{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\\\/30{background-color:color-mix(in oklab, var(--muted) 30%, transparent)}}.bg-muted\\\\/40{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\\\/40{background-color:color-mix(in oklab, var(--muted) 40%, transparent)}}.bg-muted\\\\/50{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\\\/50{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.bg-pass{background-color:var(--es-pass)}.bg-pass-bg{background-color:var(--es-pass-bg)}.bg-pend{background-color:var(--es-pend)}.bg-pend-bg{background-color:var(--es-pend-bg)}.bg-popover{background-color:var(--popover)}.bg-primary,.bg-primary\\\\/5{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\\\\/5{background-color:color-mix(in oklab, var(--primary) 5%, transparent)}}.bg-secondary{background-color:var(--secondary)}.bg-skip{background-color:var(--es-skip)}.bg-skip-bg{background-color:var(--es-skip-bg)}.bg-transparent{background-color:#0000}.object-cover{object-fit:cover}.object-top{object-position:top}.p-0{padding:0}.p-0\\\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\\\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\\\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0{padding-block:0}.py-0\\\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-0{padding-top:0}.pt-3{padding-top:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-0{padding-left:0}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\\\\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-top{vertical-align:top}.font-mono{font-family:var(--es-font-mono)}.font-sans{font-family:var(--es-font-body)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-sm\\\\/relaxed{font-size:var(--text-sm);line-height:var(--leading-relaxed)}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\\\[0\\\\.82rem\\\\]{font-size:.82rem}.text-\\\\[0\\\\.625rem\\\\]{font-size:.625rem}.text-\\\\[0\\\\.6875rem\\\\]{font-size:.6875rem}.text-\\\\[0\\\\.8125rem\\\\]{font-size:.8125rem}.text-\\\\[10px\\\\]{font-size:10px}.text-\\\\[11px\\\\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-background{color:var(--background)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-fail{color:var(--es-fail)}.text-foreground{color:var(--foreground)}.text-keyword{color:var(--es-keyword)}.text-link{color:var(--es-link)}.text-muted-foreground{color:var(--muted-foreground)}.text-pass{color:var(--es-pass)}.text-pend{color:var(--es-pend)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-skip{color:var(--es-skip)}.text-step-param{color:var(--es-step-param)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-border{--tw-ring-color:var(--border)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.ring-offset-card{--tw-ring-offset-color:var(--card)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\\\\[color\\\\,background-color\\\\,border-color\\\\,box-shadow\\\\]{transition-property:color,background-color,border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\\\[color\\\\,background-color\\\\,box-shadow\\\\]{transition-property:color,background-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\\\[color\\\\,box-shadow\\\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\\\[opacity\\\\,transform\\\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-open\\\\:rotate-90:is(:where(.group):is([open],:popover-open,:open) *){rotate:90deg}.selection\\\\:bg-primary ::selection{background-color:var(--primary)}.selection\\\\:bg-primary::selection{background-color:var(--primary)}.selection\\\\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\\\\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\\\\:inline-flex::file-selector-button{display:inline-flex}.file\\\\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\\\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\\\:bg-transparent::file-selector-button{background-color:#0000}.file\\\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\\\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\\\\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\\\\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.backdrop\\\\:bg-black\\\\/40::backdrop{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.backdrop\\\\:bg-black\\\\/40::backdrop{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}@media (hover:hover){.hover\\\\:border-ring:hover{border-color:var(--ring)}.hover\\\\:bg-accent:hover{background-color:var(--accent)}.hover\\\\:bg-destructive\\\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\\\:bg-destructive\\\\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\\\\:bg-muted:hover{background-color:var(--muted)}.hover\\\\:bg-primary\\\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\\\:bg-primary\\\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\\\\:bg-secondary\\\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\\\:bg-secondary\\\\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\\\\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\\\\:text-foreground:hover,.hover\\\\:text-foreground\\\\/80:hover{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.hover\\\\:text-foreground\\\\/80:hover{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.hover\\\\:no-underline:hover{text-decoration-line:none}.hover\\\\:underline:hover{text-decoration-line:underline}.hover\\\\:opacity-100:hover{opacity:1}}.focus\\\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\\\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\\\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\\\\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\\\\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\\\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\\\:ring-\\\\[3px\\\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\\\:ring-destructive\\\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\\\:ring-destructive\\\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\\\\:ring-ring:focus-visible,.focus-visible\\\\:ring-ring\\\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\\\:ring-ring\\\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\\\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\\\:pointer-events-none:disabled{pointer-events:none}.disabled\\\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\\\:opacity-50:disabled{opacity:.5}.has-data-\\\\[slot\\\\=card-action\\\\]\\\\:grid-cols-\\\\[1fr_auto\\\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\\\\[\\\\>svg\\\\]\\\\:grid-cols-\\\\[calc\\\\(var\\\\(--spacing\\\\)\\\\*4\\\\)_1fr\\\\]:has(>svg){grid-template-columns:calc(var(--spacing) * 4) 1fr}.has-\\\\[\\\\>svg\\\\]\\\\:gap-x-3:has(>svg){column-gap:calc(var(--spacing) * 3)}.has-\\\\[\\\\>svg\\\\]\\\\:px-1\\\\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\\\\[\\\\>svg\\\\]\\\\:px-2\\\\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\\\\[\\\\>svg\\\\]\\\\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\\\\[\\\\>svg\\\\]\\\\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\\\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\\\:ring-destructive\\\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\\\:ring-destructive\\\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\\\\[checked\\\\]\\\\:translate-x-\\\\[calc\\\\(100\\\\%-2px\\\\)\\\\][data-checked]{--tw-translate-x:calc(100% - 2px);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\\\[checked\\\\]\\\\:border-primary[data-checked]{border-color:var(--primary)}.data-\\\\[checked\\\\]\\\\:bg-primary[data-checked]{background-color:var(--primary)}.data-\\\\[checked\\\\]\\\\:text-primary-foreground[data-checked]{color:var(--primary-foreground)}.data-\\\\[disabled\\\\]\\\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\\\[disabled\\\\]\\\\:opacity-50[data-disabled]{opacity:.5}.data-\\\\[disabled\\\\=true\\\\]\\\\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\\\\[disabled\\\\=true\\\\]\\\\:opacity-50[data-disabled=true]{opacity:.5}.data-\\\\[ending-style\\\\]\\\\:-translate-x-full[data-ending-style]{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\\\[ending-style\\\\]\\\\:scale-95[data-ending-style]{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\\\[ending-style\\\\]\\\\:opacity-0[data-ending-style]{opacity:0}.data-\\\\[highlighted\\\\]\\\\:bg-accent[data-highlighted]{background-color:var(--accent)}.data-\\\\[highlighted\\\\]\\\\:text-accent-foreground[data-highlighted]{color:var(--accent-foreground)}.data-\\\\[orientation\\\\=horizontal\\\\]\\\\:h-px[data-orientation=horizontal]{height:1px}.data-\\\\[orientation\\\\=horizontal\\\\]\\\\:w-full[data-orientation=horizontal]{width:100%}.data-\\\\[orientation\\\\=vertical\\\\]\\\\:h-full[data-orientation=vertical]{height:100%}.data-\\\\[orientation\\\\=vertical\\\\]\\\\:w-px[data-orientation=vertical]{width:1px}.data-\\\\[placeholder\\\\]\\\\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\\\\[pressed\\\\]\\\\:bg-background[data-pressed]{background-color:var(--background)}.data-\\\\[pressed\\\\]\\\\:text-foreground[data-pressed]{color:var(--foreground)}.data-\\\\[pressed\\\\]\\\\:shadow-sm[data-pressed]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\\\[selected\\\\=true\\\\]\\\\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\\\\[selected\\\\=true\\\\]\\\\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\\\\[size\\\\=default\\\\]\\\\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\\\\[size\\\\=sm\\\\]\\\\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\\\\*\\\\:data-\\\\[slot\\\\=alert-description\\\\]\\\\:text-destructive\\\\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.\\\\*\\\\:data-\\\\[slot\\\\=alert-description\\\\]\\\\:text-destructive\\\\/90>*)[data-slot=alert-description]{color:color-mix(in oklab, var(--destructive) 90%, transparent)}}:is(.\\\\*\\\\*\\\\:data-\\\\[slot\\\\=command-input-wrapper\\\\]\\\\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\\\\*\\\\:data-\\\\[slot\\\\=select-value\\\\]\\\\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\\\\*\\\\:data-\\\\[slot\\\\=select-value\\\\]\\\\:flex>*)[data-slot=select-value]{display:flex}:is(.\\\\*\\\\:data-\\\\[slot\\\\=select-value\\\\]\\\\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\\\\*\\\\:data-\\\\[slot\\\\=select-value\\\\]\\\\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\\\\[starting-style\\\\]\\\\:-translate-x-full[data-starting-style]{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\\\[starting-style\\\\]\\\\:scale-95[data-starting-style]{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\\\[starting-style\\\\]\\\\:opacity-0[data-starting-style]{opacity:0}.data-\\\\[unchecked\\\\]\\\\:translate-x-0[data-unchecked]{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\\\[unchecked\\\\]\\\\:bg-input[data-unchecked]{background-color:var(--input)}@media (min-width:40rem){.sm\\\\:not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.sm\\\\:inline-flex{display:inline-flex}.sm\\\\:w-72{width:calc(var(--spacing) * 72)}.sm\\\\:max-w-lg{max-width:var(--container-lg)}.sm\\\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\\\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\\\\:flex-row{flex-direction:row}.sm\\\\:justify-end{justify-content:flex-end}.sm\\\\:text-left{text-align:left}}@media (min-width:48rem){.md\\\\:inline{display:inline}.md\\\\:p-12{padding:calc(var(--spacing) * 12)}.md\\\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (min-width:64rem){.lg\\\\:block{display:block}.lg\\\\:hidden{display:none}}.dark\\\\:border-input:where([data-theme=dark],[data-theme=dark] *){border-color:var(--input)}.dark\\\\:bg-destructive\\\\/60:where([data-theme=dark],[data-theme=dark] *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\\\:bg-destructive\\\\/60:where([data-theme=dark],[data-theme=dark] *){background-color:color-mix(in oklab, var(--destructive) 60%, transparent)}}.dark\\\\:bg-input\\\\/30:where([data-theme=dark],[data-theme=dark] *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\\\:bg-input\\\\/30:where([data-theme=dark],[data-theme=dark] *){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\\\\:hover\\\\:bg-accent\\\\/50:where([data-theme=dark],[data-theme=dark] *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark\\\\:hover\\\\:bg-accent\\\\/50:where([data-theme=dark],[data-theme=dark] *):hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.dark\\\\:hover\\\\:bg-input\\\\/50:where([data-theme=dark],[data-theme=dark] *):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\\\:hover\\\\:bg-input\\\\/50:where([data-theme=dark],[data-theme=dark] *):hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}}.dark\\\\:focus-visible\\\\:ring-destructive\\\\/40:where([data-theme=dark],[data-theme=dark] *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\\\:focus-visible\\\\:ring-destructive\\\\/40:where([data-theme=dark],[data-theme=dark] *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\\\\:aria-invalid\\\\:ring-destructive\\\\/40:where([data-theme=dark],[data-theme=dark] *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\\\:aria-invalid\\\\:ring-destructive\\\\/40:where([data-theme=dark],[data-theme=dark] *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.\\\\[\\\\&_\\\\[cmdk-group-heading\\\\]\\\\]\\\\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\\\\[\\\\&_\\\\[cmdk-group-heading\\\\]\\\\]\\\\:py-1\\\\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\\\\[\\\\&_\\\\[cmdk-group-heading\\\\]\\\\]\\\\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\\\\[\\\\&_\\\\[cmdk-group-heading\\\\]\\\\]\\\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\\\\[\\\\&_\\\\[cmdk-group-heading\\\\]\\\\]\\\\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\\\\[\\\\&_\\\\[cmdk-group\\\\]\\\\]\\\\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\\\\[\\\\&_\\\\[cmdk-group\\\\]\\\\:not\\\\(\\\\[hidden\\\\]\\\\)_\\\\~\\\\[cmdk-group\\\\]\\\\]\\\\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\\\[\\\\&_\\\\[cmdk-input-wrapper\\\\]_svg\\\\]\\\\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\\\\[\\\\&_\\\\[cmdk-input-wrapper\\\\]_svg\\\\]\\\\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\\\\[\\\\&_\\\\[cmdk-input\\\\]\\\\]\\\\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\\\\[\\\\&_\\\\[cmdk-item\\\\]\\\\]\\\\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\\\\[\\\\&_\\\\[cmdk-item\\\\]\\\\]\\\\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\\\\[\\\\&_\\\\[cmdk-item\\\\]_svg\\\\]\\\\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\\\\[\\\\&_\\\\[cmdk-item\\\\]_svg\\\\]\\\\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\\\\[\\\\&_p\\\\]\\\\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\\\\[\\\\&_svg\\\\]\\\\:pointer-events-none svg{pointer-events:none}.\\\\[\\\\&_svg\\\\]\\\\:mx-auto svg{margin-inline:auto}.\\\\[\\\\&_svg\\\\]\\\\:size-3\\\\.5 svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\\\[\\\\&_svg\\\\]\\\\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\\\[\\\\&_svg\\\\]\\\\:h-auto svg{height:auto}.\\\\[\\\\&_svg\\\\]\\\\:max-w-full svg{max-width:100%}.\\\\[\\\\&_svg\\\\]\\\\:shrink-0 svg{flex-shrink:0}.\\\\[\\\\&_svg\\\\:not\\\\(\\\\[class\\\\*\\\\=\\\\'size-\\\\'\\\\]\\\\)\\\\]\\\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\\\[\\\\&_svg\\\\:not\\\\(\\\\[class\\\\*\\\\=\\\\'size-\\\\'\\\\]\\\\)\\\\]\\\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\\\[\\\\&_svg\\\\:not\\\\(\\\\[class\\\\*\\\\=\\\\'size-\\\\'\\\\]\\\\)\\\\]\\\\:size-6 svg:not([class*=size-]){width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.\\\\[\\\\&_svg\\\\:not\\\\(\\\\[class\\\\*\\\\=\\\\'text-\\\\'\\\\]\\\\)\\\\]\\\\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\\\\[\\\\&\\\\:\\\\:-webkit-details-marker\\\\]\\\\:hidden::-webkit-details-marker{display:none}.\\\\[\\\\.border-b\\\\]\\\\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\\\\[\\\\.border-t\\\\]\\\\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\\\\*\\\\:\\\\[span\\\\]\\\\:last\\\\:flex>*):is(span):last-child{display:flex}:is(.\\\\*\\\\:\\\\[span\\\\]\\\\:last\\\\:items-center>*):is(span):last-child{align-items:center}:is(.\\\\*\\\\:\\\\[span\\\\]\\\\:last\\\\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}.\\\\[\\\\&\\\\>a\\\\]\\\\:underline>a{text-decoration-line:underline}.\\\\[\\\\&\\\\>a\\\\]\\\\:underline-offset-4>a{text-underline-offset:4px}.\\\\[\\\\&\\\\>a\\\\:hover\\\\]\\\\:text-primary>a:hover{color:var(--primary)}.\\\\[\\\\&\\\\>svg\\\\]\\\\:pointer-events-none>svg{pointer-events:none}.\\\\[\\\\&\\\\>svg\\\\]\\\\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\\\[\\\\&\\\\>svg\\\\]\\\\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\\\[\\\\&\\\\>svg\\\\]\\\\:translate-y-0\\\\.5>svg{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\\\\[\\\\&\\\\>svg\\\\]\\\\:text-current>svg{color:currentColor}@media (hover:hover){a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:bg-accent:hover{background-color:var(--accent)}a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:bg-destructive\\\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:bg-destructive\\\\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:bg-muted:hover{background-color:var(--muted)}a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:bg-primary\\\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:bg-primary\\\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:bg-secondary\\\\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:bg-secondary\\\\/90:hover{background-color:color-mix(in oklab, var(--secondary) 90%, transparent)}}a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:text-accent-foreground:hover{color:var(--accent-foreground)}a.\\\\[a\\\\&\\\\]\\\\:hover\\\\:underline:hover{text-decoration-line:underline}}}:root,[data-theme=light]{--es-color-bg:#fff;--es-color-fg:#111827;--es-color-muted:#6b7280;--es-color-border:#e5e7eb;--es-color-surface:#f9fafb;--es-color-link:#2563eb;--es-color-passed:#16a34a;--es-color-failed:#dc2626;--es-color-skipped:#9ca3af;--es-color-pending:#d97706;--es-color-passed-bg:#f0fdf4;--es-color-failed-bg:#fef2f2;--es-color-skipped-bg:#f3f4f6;--es-color-pending-bg:#fffbeb;--es-warn-fg:#92400e;--es-font-body:\\\"Geist\\\", -apple-system, BlinkMacSystemFont, \\\"Segoe UI\\\", system-ui, sans-serif;--es-font-mono:\\\"Geist Mono\\\", ui-monospace, SFMono-Regular, \\\"SF Mono\\\", Menlo, monospace;--es-size-base:1rem;--es-size-sm:.875rem;--es-size-xs:.75rem;--es-size-h1:1.875rem;--es-size-h2:1.5rem;--es-size-h3:1.25rem;--es-space-1:.25rem;--es-space-2:.5rem;--es-space-3:.75rem;--es-space-4:1rem;--es-space-6:1.5rem;--es-space-8:2rem;--es-radius:.625rem;--es-line:1.6;--es-measure:72ch}@media (prefers-color-scheme:dark){:root{--es-color-bg:#0b0f17;--es-color-fg:#e5e7eb;--es-color-muted:#9ca3af;--es-color-border:#1f2937;--es-color-surface:#111827;--es-color-link:#60a5fa;--es-color-passed:#4ade80;--es-color-failed:#f87171;--es-color-skipped:#6b7280;--es-color-pending:#fbbf24;--es-color-passed-bg:#4ade8014;--es-color-failed-bg:#f8717114;--es-color-skipped-bg:#6b728014;--es-color-pending-bg:#fbbf2414;--es-warn-fg:#fbbf24}}[data-theme=dark]{--es-color-bg:#0b0f17;--es-color-fg:#e5e7eb;--es-color-muted:#9ca3af;--es-color-border:#1f2937;--es-color-surface:#111827;--es-color-link:#60a5fa;--es-color-passed:#4ade80;--es-color-failed:#f87171;--es-color-skipped:#6b7280;--es-color-pending:#fbbf24;--es-color-passed-bg:#4ade8014;--es-color-failed-bg:#f8717114;--es-color-skipped-bg:#6b728014;--es-color-pending-bg:#fbbf2414;--es-warn-fg:#fbbf24}.es-report{background:var(--es-color-bg);color:var(--es-color-fg);font-family:var(--es-font-body);font-size:var(--es-size-base);line-height:var(--es-line);padding:var(--es-space-6);max-width:1100px;margin-inline:auto}.es-report-header{gap:var(--es-space-4);flex-direction:column;margin-block-end:var(--es-space-6);display:flex}.es-report-header h1{font-size:var(--es-size-h1);margin:0}.es-report-summary{color:var(--es-color-muted);font-size:var(--es-size-sm);margin:0 0 var(--es-space-6)}.es-report-summary [data-status]{margin-inline-end:var(--es-space-3)}.es-report-summary [data-status=passed]{color:var(--es-color-passed)}.es-report-summary [data-status=failed]{color:var(--es-color-failed)}.es-report-summary [data-status=skipped]{color:var(--es-color-skipped)}.es-report-summary [data-status=pending]{color:var(--es-color-pending)}.es-feature{border:1px solid var(--es-color-border);border-radius:var(--es-radius);padding:var(--es-space-6);margin-block-end:var(--es-space-6)}.es-feature-title{font-size:var(--es-size-h2);margin:0 0 var(--es-space-2)}.es-feature-source{color:var(--es-color-muted);font-family:var(--es-font-mono);font-size:var(--es-size-xs);margin:0 0 var(--es-space-4)}.es-feature-summary{color:var(--es-color-muted);font-size:var(--es-size-sm);margin-block-end:var(--es-space-4)}.es-scenario{padding:var(--es-space-4) 0;border-block-start:1px solid var(--es-color-border);scroll-margin-block-start:var(--es-space-8)}.es-scenario:first-of-type{border-block-start:0}.es-scenario-title{font-size:var(--es-size-h3);margin:0 0 var(--es-space-2);align-items:baseline;gap:var(--es-space-2);display:flex}.es-scenario-status{font-size:var(--es-size-xs);text-transform:uppercase;letter-spacing:.04em;border-radius:4px;padding:2px 6px}.es-status-passed .es-scenario-status{color:var(--es-color-passed);background:var(--es-color-passed-bg)}.es-status-failed .es-scenario-status{color:var(--es-color-failed);background:var(--es-color-failed-bg)}.es-status-skipped .es-scenario-status{color:var(--es-color-skipped);background:var(--es-color-skipped-bg)}.es-status-pending .es-scenario-status{color:var(--es-color-pending);background:var(--es-color-pending-bg)}.es-scenario-error{background:var(--es-color-failed-bg);color:var(--es-color-failed);padding:var(--es-space-3) var(--es-space-4);border-radius:var(--es-radius);font-family:var(--es-font-mono);font-size:var(--es-size-sm);white-space:pre-wrap}.es-steps{margin:var(--es-space-4) 0 0;padding:0;list-style:none}.es-step{padding:var(--es-space-2) 0}.es-step-keyword{color:var(--es-color-muted);margin-inline-end:var(--es-space-2);font-weight:600}.es-step-failed{color:var(--es-color-failed)}.es-step-skipped{color:var(--es-color-skipped)}.es-tags{gap:var(--es-space-2);margin:var(--es-space-2) 0;flex-wrap:wrap;padding:0;list-style:none;display:flex}.es-tags li{font-size:var(--es-size-xs);background:var(--es-color-surface);color:var(--es-color-muted);border-radius:999px;padding:2px 8px}.es-doc{margin-block:var(--es-space-3);max-width:var(--es-measure)}.es-doc-kv dt{color:var(--es-color-muted);font-weight:600;font-size:var(--es-size-sm)}.es-doc-kv dd{margin-inline-start:0}.es-doc-code{background:var(--es-color-surface);border-radius:var(--es-radius);padding:var(--es-space-3);overflow-x:auto}.es-doc-code pre{font-family:var(--es-font-mono);font-size:var(--es-size-sm);margin:0}.es-doc-code figcaption{color:var(--es-color-muted);font-size:var(--es-size-xs);margin-block-end:var(--es-space-2)}.es-doc-table table{border-collapse:collapse;width:100%}.es-doc-table th,.es-doc-table td{text-align:start;padding:var(--es-space-2);border-block-end:1px solid var(--es-color-border)}.es-doc-link{color:var(--es-color-link)}.es-doc-section{background:var(--es-color-surface);padding:var(--es-space-4);border-radius:var(--es-radius)}.es-doc-mermaid pre{font-family:var(--es-font-mono);font-size:var(--es-size-sm);background:var(--es-color-surface);padding:var(--es-space-3);border-radius:var(--es-radius);overflow-x:auto}.es-doc-screenshot img{border-radius:var(--es-radius);max-width:100%;height:auto}.es-doc-custom{background:var(--es-color-surface);padding:var(--es-space-3);border-radius:var(--es-radius);font-family:var(--es-font-mono);font-size:var(--es-size-sm)}.es-empty,.es-schema-error{text-align:center;padding:var(--es-space-8);color:var(--es-color-muted)}.es-schema-error{background:var(--es-color-failed-bg);color:var(--es-fail,#b91c1c);border-radius:var(--es-radius)}.es-schema-error pre{font-family:var(--es-font-mono);font-size:var(--es-size-sm);text-align:start;margin-block-start:var(--es-space-3)}.es-failure-banner{align-items:center;gap:var(--es-space-3);padding:var(--es-space-3) var(--es-space-4);background:var(--es-color-failed-bg);color:var(--es-fail,#b91c1c);border:1px solid var(--es-color-failed);border-radius:var(--es-radius);flex-wrap:wrap;margin-block-end:var(--es-space-4);display:flex}.es-failure-banner-jump{color:inherit;border-radius:var(--es-radius);padding:var(--es-space-1) var(--es-space-3);cursor:pointer;font:inherit;background:0 0;border:1px solid}.es-failure-banner-jump:focus-visible{outline:2px solid var(--es-color-failed);outline-offset:2px}.es-freshness{color:var(--es-color-muted);font-size:var(--es-size-xs);margin:0}.es-freshness a{color:inherit}.es-stale-banner{justify-content:space-between;align-items:center;gap:var(--es-space-3);padding:var(--es-space-3) var(--es-space-4);border:1px solid var(--es-color-pending);border-radius:var(--es-radius);background:var(--es-color-pending-bg);color:var(--es-warn-fg,#92400e);font-size:var(--es-size-sm);display:flex}.es-stale-banner a{color:inherit;white-space:nowrap}.es-failure-banner-jump{touch-action:manipulation}@media print{.es-report{max-width:100%;padding:0}.es-feature,.es-scenario{break-inside:avoid}.es-failure-banner,.es-shortcuts-trigger,.es-search{display:none}}@layer base{.es-report-island,.es-report-island *,.es-report-island :before,.es-report-island :after{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--border)}.es-report-island button{appearance:none;font:inherit;color:inherit;cursor:pointer;background-color:#0000;background-image:none;padding:0}.es-report-island :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,figure,pre,blockquote){margin:0}.es-report-island :where(ul,ol){padding:0;list-style:none}[data-detail-level=minimal] [data-es-docs]{display:none}}:root,[data-theme=light]{--background:#fff;--foreground:#171717;--card:#fff;--card-foreground:#171717;--popover:#fff;--popover-foreground:#171717;--primary:#229652;--primary-foreground:#fff;--secondary:#f6f6f6;--secondary-foreground:#171717;--muted:#f6f6f6;--muted-foreground:#616161;--accent:#e8e8e8;--accent-foreground:#171717;--destructive:#b81e1e;--destructive-foreground:#fff;--border:#e6e6e6;--input:#e6e6e6;--ring:#28af60;--es-pass:#1a7440;--es-pass-bg:#effaf4;--es-pass-border:#b3e6c8;--es-fail:#ad1f1f;--es-fail-bg:#fef1f1;--es-fail-border:#f4c2c2;--es-skip:#72501d;--es-skip-bg:#fffae6;--es-skip-border:#eedba0;--es-pend:#5d389f;--es-pend-bg:#f6f3fc;--es-pend-border:#d4c8ea;--es-keyword:#1a7440;--es-step-param:#2662d9;--es-link:#1a7440}[data-theme=dark]{--background:#0f0f0f;--foreground:#f2f2f2;--card:#171717;--card-foreground:#f2f2f2;--popover:#171717;--popover-foreground:#f2f2f2;--primary:#2fd072;--primary-foreground:#0f0f0f;--secondary:#212121;--secondary-foreground:#f2f2f2;--muted:#212121;--muted-foreground:#a3a3a3;--accent:#383838;--accent-foreground:#f2f2f2;--destructive:#e14747;--destructive-foreground:#fff;--border:#2b2b2b;--input:#2b2b2b;--ring:#2fd072;--es-pass:#64d894;--es-pass-bg:#0f291a;--es-pass-border:#255639;--es-fail:#f17e7e;--es-fail-bg:#2e0f0f;--es-fail-border:#6b2424;--es-skip:#f2cc5a;--es-skip-bg:#272211;--es-skip-border:#5a4e2b;--es-pend:#b697ed;--es-pend-bg:#231934;--es-pend-border:#4b396a;--es-keyword:#59d98e;--es-step-param:#7da1e8;--es-link:#61db94}.es-doc-prose{--tw-prose-body:var(--muted-foreground);--tw-prose-headings:var(--foreground);--tw-prose-lead:var(--muted-foreground);--tw-prose-links:var(--es-link);--tw-prose-bold:var(--foreground);--tw-prose-counters:var(--muted-foreground);--tw-prose-bullets:var(--border);--tw-prose-hr:var(--border);--tw-prose-quotes:var(--foreground);--tw-prose-quote-borders:var(--border);--tw-prose-captions:var(--muted-foreground);--tw-prose-kbd:var(--foreground);--tw-prose-code:var(--foreground);--tw-prose-pre-code:var(--foreground);--tw-prose-pre-bg:var(--muted);--tw-prose-th-borders:var(--border);--tw-prose-td-borders:var(--border);font-family:var(--font-sans)}.es-doc-prose :where(code):not(:where(pre code)){font-family:var(--font-mono);background:var(--muted);border-radius:4px;padding:.1em .3em}.es-doc-prose :where(code):before,.es-doc-prose :where(code):after{content:none}.es-doc-prose :where(a){text-underline-offset:2px}@property --tw-translate-x{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\\\"*\\\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\\\"*\\\";inherits:false}@property --tw-font-weight{syntax:\\\"*\\\";inherits:false}@property --tw-tracking{syntax:\\\"*\\\";inherits:false}@property --tw-ordinal{syntax:\\\"*\\\";inherits:false}@property --tw-slashed-zero{syntax:\\\"*\\\";inherits:false}@property --tw-numeric-figure{syntax:\\\"*\\\";inherits:false}@property --tw-numeric-spacing{syntax:\\\"*\\\";inherits:false}@property --tw-numeric-fraction{syntax:\\\"*\\\";inherits:false}@property --tw-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\\\"*\\\";inherits:false}@property --tw-shadow-alpha{syntax:\\\"<percentage>\\\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\\\"*\\\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\\\"<percentage>\\\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\\\"*\\\";inherits:false}@property --tw-ring-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\\\"*\\\";inherits:false}@property --tw-inset-ring-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\\\"*\\\";inherits:false}@property --tw-ring-offset-width{syntax:\\\"<length>\\\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\\\"*\\\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:\\\"*\\\";inherits:false;initial-value:solid}@property --tw-blur{syntax:\\\"*\\\";inherits:false}@property --tw-brightness{syntax:\\\"*\\\";inherits:false}@property --tw-contrast{syntax:\\\"*\\\";inherits:false}@property --tw-grayscale{syntax:\\\"*\\\";inherits:false}@property --tw-hue-rotate{syntax:\\\"*\\\";inherits:false}@property --tw-invert{syntax:\\\"*\\\";inherits:false}@property --tw-opacity{syntax:\\\"*\\\";inherits:false}@property --tw-saturate{syntax:\\\"*\\\";inherits:false}@property --tw-sepia{syntax:\\\"*\\\";inherits:false}@property --tw-drop-shadow{syntax:\\\"*\\\";inherits:false}@property --tw-drop-shadow-color{syntax:\\\"*\\\";inherits:false}@property --tw-drop-shadow-alpha{syntax:\\\"<percentage>\\\";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:\\\"*\\\";inherits:false}@property --tw-duration{syntax:\\\"*\\\";inherits:false}@property --tw-scale-x{syntax:\\\"*\\\";inherits:false;initial-value:1}@property --tw-scale-y{syntax:\\\"*\\\";inherits:false;initial-value:1}@property --tw-scale-z{syntax:\\\"*\\\";inherits:false;initial-value:1}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}\";\nexport const reactIslandScript = \"\\\"use strict\\\";var EsReportIsland=(()=>{var lD=Object.create;var jc=Object.defineProperty;var iD=Object.getOwnPropertyDescriptor;var uD=Object.getOwnPropertyNames;var cD=Object.getPrototypeOf,fD=Object.prototype.hasOwnProperty;var ha=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Oo=(e,t)=>{for(var a in t)jc(e,a,{get:t[a],enumerable:!0})},XS=(e,t,a,o)=>{if(t&&typeof t==\\\"object\\\"||typeof t==\\\"function\\\")for(let n of uD(t))!fD.call(e,n)&&n!==a&&jc(e,n,{get:()=>t[n],enumerable:!(o=iD(t,n))||o.enumerable});return e};var S=(e,t,a)=>(a=e!=null?lD(cD(e)):{},XS(t||!e||!e.__esModule?jc(a,\\\"default\\\",{value:e,enumerable:!0}):a,e)),dD=e=>XS(jc({},\\\"__esModule\\\",{value:!0}),e);var aC=ha(ke=>{\\\"use strict\\\";var Mg=Symbol.for(\\\"react.transitional.element\\\"),pD=Symbol.for(\\\"react.portal\\\"),mD=Symbol.for(\\\"react.fragment\\\"),gD=Symbol.for(\\\"react.strict_mode\\\"),hD=Symbol.for(\\\"react.profiler\\\"),xD=Symbol.for(\\\"react.consumer\\\"),bD=Symbol.for(\\\"react.context\\\"),yD=Symbol.for(\\\"react.forward_ref\\\"),SD=Symbol.for(\\\"react.suspense\\\"),CD=Symbol.for(\\\"react.memo\\\"),WS=Symbol.for(\\\"react.lazy\\\"),LD=Symbol.for(\\\"react.activity\\\"),jS=Symbol.iterator;function RD(e){return e===null||typeof e!=\\\"object\\\"?null:(e=jS&&e[jS]||e[\\\"@@iterator\\\"],typeof e==\\\"function\\\"?e:null)}var ZS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},QS=Object.assign,JS={};function al(e,t,a){this.props=e,this.context=t,this.refs=JS,this.updater=a||ZS}al.prototype.isReactComponent={};al.prototype.setState=function(e,t){if(typeof e!=\\\"object\\\"&&typeof e!=\\\"function\\\"&&e!=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,e,t,\\\"setState\\\")};al.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\\\"forceUpdate\\\")};function eC(){}eC.prototype=al.prototype;function Ag(e,t,a){this.props=e,this.context=t,this.refs=JS,this.updater=a||ZS}var Dg=Ag.prototype=new eC;Dg.constructor=Ag;QS(Dg,al.prototype);Dg.isPureReactComponent=!0;var YS=Array.isArray;function Eg(){}var ct={H:null,A:null,T:null,S:null},tC=Object.prototype.hasOwnProperty;function Og(e,t,a){var o=a.ref;return{$$typeof:Mg,type:e,key:t,ref:o!==void 0?o:null,props:a}}function vD(e,t){return Og(e.type,t,e.props)}function Pg(e){return typeof e==\\\"object\\\"&&e!==null&&e.$$typeof===Mg}function ID(e){var t={\\\"=\\\":\\\"=0\\\",\\\":\\\":\\\"=2\\\"};return\\\"$\\\"+e.replace(/[=:]/g,function(a){return t[a]})}var KS=/\\\\/+/g;function Tg(e,t){return typeof e==\\\"object\\\"&&e!==null&&e.key!=null?ID(\\\"\\\"+e.key):t.toString(36)}function wD(e){switch(e.status){case\\\"fulfilled\\\":return e.value;case\\\"rejected\\\":throw e.reason;default:switch(typeof e.status==\\\"string\\\"?e.then(Eg,Eg):(e.status=\\\"pending\\\",e.then(function(t){e.status===\\\"pending\\\"&&(e.status=\\\"fulfilled\\\",e.value=t)},function(t){e.status===\\\"pending\\\"&&(e.status=\\\"rejected\\\",e.reason=t)})),e.status){case\\\"fulfilled\\\":return e.value;case\\\"rejected\\\":throw e.reason}}throw e}function tl(e,t,a,o,n){var r=typeof e;(r===\\\"undefined\\\"||r===\\\"boolean\\\")&&(e=null);var s=!1;if(e===null)s=!0;else switch(r){case\\\"bigint\\\":case\\\"string\\\":case\\\"number\\\":s=!0;break;case\\\"object\\\":switch(e.$$typeof){case Mg:case pD:s=!0;break;case WS:return s=e._init,tl(s(e._payload),t,a,o,n)}}if(s)return n=n(e),s=o===\\\"\\\"?\\\".\\\"+Tg(e,0):o,YS(n)?(a=\\\"\\\",s!=null&&(a=s.replace(KS,\\\"$&/\\\")+\\\"/\\\"),tl(n,t,a,\\\"\\\",function(u){return u})):n!=null&&(Pg(n)&&(n=vD(n,a+(n.key==null||e&&e.key===n.key?\\\"\\\":(\\\"\\\"+n.key).replace(KS,\\\"$&/\\\")+\\\"/\\\")+s)),t.push(n)),1;s=0;var l=o===\\\"\\\"?\\\".\\\":o+\\\":\\\";if(YS(e))for(var i=0;i<e.length;i++)o=e[i],r=l+Tg(o,i),s+=tl(o,t,a,r,n);else if(i=RD(e),typeof i==\\\"function\\\")for(e=i.call(e),i=0;!(o=e.next()).done;)o=o.value,r=l+Tg(o,i++),s+=tl(o,t,a,r,n);else if(r===\\\"object\\\"){if(typeof e.then==\\\"function\\\")return tl(wD(e),t,a,o,n);throw t=String(e),Error(\\\"Objects are not valid as a React child (found: \\\"+(t===\\\"[object Object]\\\"?\\\"object with keys {\\\"+Object.keys(e).join(\\\", \\\")+\\\"}\\\":t)+\\\"). If you meant to render a collection of children, use an array instead.\\\")}return s}function Yc(e,t,a){if(e==null)return e;var o=[],n=0;return tl(e,o,\\\"\\\",\\\"\\\",function(r){return t.call(a,r,n++)}),o}function kD(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var $S=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)},TD={map:Yc,forEach:function(e,t,a){Yc(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Yc(e,function(){t++}),t},toArray:function(e){return Yc(e,function(t){return t})||[]},only:function(e){if(!Pg(e))throw Error(\\\"React.Children.only expected to receive a single React element child.\\\");return e}};ke.Activity=LD;ke.Children=TD;ke.Component=al;ke.Fragment=mD;ke.Profiler=hD;ke.PureComponent=Ag;ke.StrictMode=gD;ke.Suspense=SD;ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ct;ke.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ct.H.useMemoCache(e)}};ke.cache=function(e){return function(){return e.apply(null,arguments)}};ke.cacheSignal=function(){return null};ke.cloneElement=function(e,t,a){if(e==null)throw Error(\\\"The argument must be a React element, but you passed \\\"+e+\\\".\\\");var o=QS({},e.props),n=e.key;if(t!=null)for(r in t.key!==void 0&&(n=\\\"\\\"+t.key),t)!tC.call(t,r)||r===\\\"key\\\"||r===\\\"__self\\\"||r===\\\"__source\\\"||r===\\\"ref\\\"&&t.ref===void 0||(o[r]=t[r]);var r=arguments.length-2;if(r===1)o.children=a;else if(1<r){for(var s=Array(r),l=0;l<r;l++)s[l]=arguments[l+2];o.children=s}return Og(e.type,n,o)};ke.createContext=function(e){return e={$$typeof:bD,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:xD,_context:e},e};ke.createElement=function(e,t,a){var o,n={},r=null;if(t!=null)for(o in t.key!==void 0&&(r=\\\"\\\"+t.key),t)tC.call(t,o)&&o!==\\\"key\\\"&&o!==\\\"__self\\\"&&o!==\\\"__source\\\"&&(n[o]=t[o]);var s=arguments.length-2;if(s===1)n.children=a;else if(1<s){for(var l=Array(s),i=0;i<s;i++)l[i]=arguments[i+2];n.children=l}if(e&&e.defaultProps)for(o in s=e.defaultProps,s)n[o]===void 0&&(n[o]=s[o]);return Og(e,r,n)};ke.createRef=function(){return{current:null}};ke.forwardRef=function(e){return{$$typeof:yD,render:e}};ke.isValidElement=Pg;ke.lazy=function(e){return{$$typeof:WS,_payload:{_status:-1,_result:e},_init:kD}};ke.memo=function(e,t){return{$$typeof:CD,type:e,compare:t===void 0?null:t}};ke.startTransition=function(e){var t=ct.T,a={};ct.T=a;try{var o=e(),n=ct.S;n!==null&&n(a,o),typeof o==\\\"object\\\"&&o!==null&&typeof o.then==\\\"function\\\"&&o.then(Eg,$S)}catch(r){$S(r)}finally{t!==null&&a.types!==null&&(t.types=a.types),ct.T=t}};ke.unstable_useCacheRefresh=function(){return ct.H.useCacheRefresh()};ke.use=function(e){return ct.H.use(e)};ke.useActionState=function(e,t,a){return ct.H.useActionState(e,t,a)};ke.useCallback=function(e,t){return ct.H.useCallback(e,t)};ke.useContext=function(e){return ct.H.useContext(e)};ke.useDebugValue=function(){};ke.useDeferredValue=function(e,t){return ct.H.useDeferredValue(e,t)};ke.useEffect=function(e,t){return ct.H.useEffect(e,t)};ke.useEffectEvent=function(e){return ct.H.useEffectEvent(e)};ke.useId=function(){return ct.H.useId()};ke.useImperativeHandle=function(e,t,a){return ct.H.useImperativeHandle(e,t,a)};ke.useInsertionEffect=function(e,t){return ct.H.useInsertionEffect(e,t)};ke.useLayoutEffect=function(e,t){return ct.H.useLayoutEffect(e,t)};ke.useMemo=function(e,t){return ct.H.useMemo(e,t)};ke.useOptimistic=function(e,t){return ct.H.useOptimistic(e,t)};ke.useReducer=function(e,t,a){return ct.H.useReducer(e,t,a)};ke.useRef=function(e){return ct.H.useRef(e)};ke.useState=function(e){return ct.H.useState(e)};ke.useSyncExternalStore=function(e,t,a){return ct.H.useSyncExternalStore(e,t,a)};ke.useTransition=function(){return ct.H.useTransition()};ke.version=\\\"19.2.7\\\"});var T=ha((Ez,oC)=>{\\\"use strict\\\";oC.exports=aC()});var pC=ha(gt=>{\\\"use strict\\\";function _g(e,t){var a=e.length;e.push(t);e:for(;0<a;){var o=a-1>>>1,n=e[o];if(0<Kc(n,t))e[o]=t,e[a]=n,a=o;else break e}}function Po(e){return e.length===0?null:e[0]}function Wc(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var o=0,n=e.length,r=n>>>1;o<r;){var s=2*(o+1)-1,l=e[s],i=s+1,u=e[i];if(0>Kc(l,a))i<n&&0>Kc(u,l)?(e[o]=u,e[i]=a,o=i):(e[o]=l,e[s]=a,o=s);else if(i<n&&0>Kc(u,a))e[o]=u,e[i]=a,o=i;else break e}}return t}function Kc(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}gt.unstable_now=void 0;typeof performance==\\\"object\\\"&&typeof performance.now==\\\"function\\\"?(nC=performance,gt.unstable_now=function(){return nC.now()}):(Ng=Date,rC=Ng.now(),gt.unstable_now=function(){return Ng.now()-rC});var nC,Ng,rC,cn=[],jn=[],ED=1,Qa=null,Qt=3,Ug=!1,Ai=!1,Di=!1,Hg=!1,iC=typeof setTimeout==\\\"function\\\"?setTimeout:null,uC=typeof clearTimeout==\\\"function\\\"?clearTimeout:null,sC=typeof setImmediate<\\\"u\\\"?setImmediate:null;function $c(e){for(var t=Po(jn);t!==null;){if(t.callback===null)Wc(jn);else if(t.startTime<=e)Wc(jn),t.sortIndex=t.expirationTime,_g(cn,t);else break;t=Po(jn)}}function zg(e){if(Di=!1,$c(e),!Ai)if(Po(cn)!==null)Ai=!0,nl||(nl=!0,ol());else{var t=Po(jn);t!==null&&qg(zg,t.startTime-e)}}var nl=!1,Oi=-1,cC=5,fC=-1;function dC(){return Hg?!0:!(gt.unstable_now()-fC<cC)}function Bg(){if(Hg=!1,nl){var e=gt.unstable_now();fC=e;var t=!0;try{e:{Ai=!1,Di&&(Di=!1,uC(Oi),Oi=-1),Ug=!0;var a=Qt;try{t:{for($c(e),Qa=Po(cn);Qa!==null&&!(Qa.expirationTime>e&&dC());){var o=Qa.callback;if(typeof o==\\\"function\\\"){Qa.callback=null,Qt=Qa.priorityLevel;var n=o(Qa.expirationTime<=e);if(e=gt.unstable_now(),typeof n==\\\"function\\\"){Qa.callback=n,$c(e),t=!0;break t}Qa===Po(cn)&&Wc(cn),$c(e)}else Wc(cn);Qa=Po(cn)}if(Qa!==null)t=!0;else{var r=Po(jn);r!==null&&qg(zg,r.startTime-e),t=!1}}break e}finally{Qa=null,Qt=a,Ug=!1}t=void 0}}finally{t?ol():nl=!1}}}var ol;typeof sC==\\\"function\\\"?ol=function(){sC(Bg)}:typeof MessageChannel<\\\"u\\\"?(Fg=new MessageChannel,lC=Fg.port2,Fg.port1.onmessage=Bg,ol=function(){lC.postMessage(null)}):ol=function(){iC(Bg,0)};var Fg,lC;function qg(e,t){Oi=iC(function(){e(gt.unstable_now())},t)}gt.unstable_IdlePriority=5;gt.unstable_ImmediatePriority=1;gt.unstable_LowPriority=4;gt.unstable_NormalPriority=3;gt.unstable_Profiling=null;gt.unstable_UserBlockingPriority=2;gt.unstable_cancelCallback=function(e){e.callback=null};gt.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\\\"):cC=0<e?Math.floor(1e3/e):5};gt.unstable_getCurrentPriorityLevel=function(){return Qt};gt.unstable_next=function(e){switch(Qt){case 1:case 2:case 3:var t=3;break;default:t=Qt}var a=Qt;Qt=t;try{return e()}finally{Qt=a}};gt.unstable_requestPaint=function(){Hg=!0};gt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Qt;Qt=e;try{return t()}finally{Qt=a}};gt.unstable_scheduleCallback=function(e,t,a){var o=gt.unstable_now();switch(typeof a==\\\"object\\\"&&a!==null?(a=a.delay,a=typeof a==\\\"number\\\"&&0<a?o+a:o):a=o,e){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,e={id:ED++,callback:t,priorityLevel:e,startTime:a,expirationTime:n,sortIndex:-1},a>o?(e.sortIndex=a,_g(jn,e),Po(cn)===null&&e===Po(jn)&&(Di?(uC(Oi),Oi=-1):Di=!0,qg(zg,a-o))):(e.sortIndex=n,_g(cn,e),Ai||Ug||(Ai=!0,nl||(nl=!0,ol()))),e};gt.unstable_shouldYield=dC;gt.unstable_wrapCallback=function(e){var t=Qt;return function(){var a=Qt;Qt=t;try{return e.apply(this,arguments)}finally{Qt=a}}}});var gC=ha((Az,mC)=>{\\\"use strict\\\";mC.exports=pC()});var xC=ha(ca=>{\\\"use strict\\\";var MD=T();function hC(e){var t=\\\"https://react.dev/errors/\\\"+e;if(1<arguments.length){t+=\\\"?args[]=\\\"+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+=\\\"&args[]=\\\"+encodeURIComponent(arguments[a])}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 Yn(){}var ua={d:{f:Yn,r:function(){throw Error(hC(522))},D:Yn,C:Yn,L:Yn,m:Yn,X:Yn,S:Yn,M:Yn},p:0,findDOMNode:null},AD=Symbol.for(\\\"react.portal\\\");function DD(e,t,a){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:AD,key:o==null?null:\\\"\\\"+o,children:e,containerInfo:t,implementation:a}}var Pi=MD.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Zc(e,t){if(e===\\\"font\\\")return\\\"\\\";if(typeof t==\\\"string\\\")return t===\\\"use-credentials\\\"?t:\\\"\\\"}ca.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ua;ca.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(hC(299));return DD(e,t,null,a)};ca.flushSync=function(e){var t=Pi.T,a=ua.p;try{if(Pi.T=null,ua.p=2,e)return e()}finally{Pi.T=t,ua.p=a,ua.d.f()}};ca.preconnect=function(e,t){typeof e==\\\"string\\\"&&(t?(t=t.crossOrigin,t=typeof t==\\\"string\\\"?t===\\\"use-credentials\\\"?t:\\\"\\\":void 0):t=null,ua.d.C(e,t))};ca.prefetchDNS=function(e){typeof e==\\\"string\\\"&&ua.d.D(e)};ca.preinit=function(e,t){if(typeof e==\\\"string\\\"&&t&&typeof t.as==\\\"string\\\"){var a=t.as,o=Zc(a,t.crossOrigin),n=typeof t.integrity==\\\"string\\\"?t.integrity:void 0,r=typeof t.fetchPriority==\\\"string\\\"?t.fetchPriority:void 0;a===\\\"style\\\"?ua.d.S(e,typeof t.precedence==\\\"string\\\"?t.precedence:void 0,{crossOrigin:o,integrity:n,fetchPriority:r}):a===\\\"script\\\"&&ua.d.X(e,{crossOrigin:o,integrity:n,fetchPriority:r,nonce:typeof t.nonce==\\\"string\\\"?t.nonce:void 0})}};ca.preinitModule=function(e,t){if(typeof e==\\\"string\\\")if(typeof t==\\\"object\\\"&&t!==null){if(t.as==null||t.as===\\\"script\\\"){var a=Zc(t.as,t.crossOrigin);ua.d.M(e,{crossOrigin:a,integrity:typeof t.integrity==\\\"string\\\"?t.integrity:void 0,nonce:typeof t.nonce==\\\"string\\\"?t.nonce:void 0})}}else t==null&&ua.d.M(e)};ca.preload=function(e,t){if(typeof e==\\\"string\\\"&&typeof t==\\\"object\\\"&&t!==null&&typeof t.as==\\\"string\\\"){var a=t.as,o=Zc(a,t.crossOrigin);ua.d.L(e,a,{crossOrigin:o,integrity:typeof t.integrity==\\\"string\\\"?t.integrity:void 0,nonce:typeof t.nonce==\\\"string\\\"?t.nonce:void 0,type:typeof t.type==\\\"string\\\"?t.type:void 0,fetchPriority:typeof t.fetchPriority==\\\"string\\\"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==\\\"string\\\"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==\\\"string\\\"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==\\\"string\\\"?t.imageSizes:void 0,media:typeof t.media==\\\"string\\\"?t.media:void 0})}};ca.preloadModule=function(e,t){if(typeof e==\\\"string\\\")if(t){var a=Zc(t.as,t.crossOrigin);ua.d.m(e,{as:typeof t.as==\\\"string\\\"&&t.as!==\\\"script\\\"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity==\\\"string\\\"?t.integrity:void 0})}else ua.d.m(e)};ca.requestFormReset=function(e){ua.d.r(e)};ca.unstable_batchedUpdates=function(e,t){return e(t)};ca.useFormState=function(e,t,a){return Pi.H.useFormState(e,t,a)};ca.useFormStatus=function(){return Pi.H.useHostTransitionStatus()};ca.version=\\\"19.2.7\\\"});var fn=ha((Oz,yC)=>{\\\"use strict\\\";function bC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\\\"u\\\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\\\"function\\\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bC)}catch(e){console.error(e)}}bC(),yC.exports=xC()});var AI=ha(Rd=>{\\\"use strict\\\";var Pt=gC(),XL=T(),OD=fn();function z(e){var t=\\\"https://react.dev/errors/\\\"+e;if(1<arguments.length){t+=\\\"?args[]=\\\"+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+=\\\"&args[]=\\\"+encodeURIComponent(arguments[a])}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 jL(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Su(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function YL(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 KL(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 SC(e){if(Su(e)!==e)throw Error(z(188))}function PD(e){var t=e.alternate;if(!t){if(t=Su(e),t===null)throw Error(z(188));return t!==e?null:e}for(var a=e,o=t;;){var n=a.return;if(n===null)break;var r=n.alternate;if(r===null){if(o=n.return,o!==null){a=o;continue}break}if(n.child===r.child){for(r=n.child;r;){if(r===a)return SC(n),e;if(r===o)return SC(n),t;r=r.sibling}throw Error(z(188))}if(a.return!==o.return)a=n,o=r;else{for(var s=!1,l=n.child;l;){if(l===a){s=!0,a=n,o=r;break}if(l===o){s=!0,o=n,a=r;break}l=l.sibling}if(!s){for(l=r.child;l;){if(l===a){s=!0,a=r,o=n;break}if(l===o){s=!0,o=r,a=n;break}l=l.sibling}if(!s)throw Error(z(189))}}if(a.alternate!==o)throw Error(z(190))}if(a.tag!==3)throw Error(z(188));return a.stateNode.current===a?e:t}function $L(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=$L(e),t!==null)return t;e=e.sibling}return null}var pt=Object.assign,ND=Symbol.for(\\\"react.element\\\"),Qc=Symbol.for(\\\"react.transitional.element\\\"),qi=Symbol.for(\\\"react.portal\\\"),cl=Symbol.for(\\\"react.fragment\\\"),WL=Symbol.for(\\\"react.strict_mode\\\"),Lh=Symbol.for(\\\"react.profiler\\\"),ZL=Symbol.for(\\\"react.consumer\\\"),yn=Symbol.for(\\\"react.context\\\"),xx=Symbol.for(\\\"react.forward_ref\\\"),Rh=Symbol.for(\\\"react.suspense\\\"),vh=Symbol.for(\\\"react.suspense_list\\\"),bx=Symbol.for(\\\"react.memo\\\"),Kn=Symbol.for(\\\"react.lazy\\\"),Ih=Symbol.for(\\\"react.activity\\\"),BD=Symbol.for(\\\"react.memo_cache_sentinel\\\"),CC=Symbol.iterator;function Ni(e){return e===null||typeof e!=\\\"object\\\"?null:(e=CC&&e[CC]||e[\\\"@@iterator\\\"],typeof e==\\\"function\\\"?e:null)}var FD=Symbol.for(\\\"react.client.reference\\\");function wh(e){if(e==null)return null;if(typeof e==\\\"function\\\")return e.$$typeof===FD?null:e.displayName||e.name||null;if(typeof e==\\\"string\\\")return e;switch(e){case cl:return\\\"Fragment\\\";case Lh:return\\\"Profiler\\\";case WL:return\\\"StrictMode\\\";case Rh:return\\\"Suspense\\\";case vh:return\\\"SuspenseList\\\";case Ih:return\\\"Activity\\\"}if(typeof e==\\\"object\\\")switch(e.$$typeof){case qi:return\\\"Portal\\\";case yn:return e.displayName||\\\"Context\\\";case ZL:return(e._context.displayName||\\\"Context\\\")+\\\".Consumer\\\";case xx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||\\\"\\\",e=e!==\\\"\\\"?\\\"ForwardRef(\\\"+e+\\\")\\\":\\\"ForwardRef\\\"),e;case bx:return t=e.displayName||null,t!==null?t:wh(e.type)||\\\"Memo\\\";case Kn:t=e._payload,e=e._init;try{return wh(e(t))}catch{}}return null}var Vi=Array.isArray,Se=XL.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ke=OD.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,os={pending:!1,data:null,method:null,action:null},kh=[],fl=-1;function Uo(e){return{current:e}}function zt(e){0>fl||(e.current=kh[fl],kh[fl]=null,fl--)}function ut(e,t){fl++,kh[fl]=e.current,e.current=t}var _o=Uo(null),su=Uo(null),rr=Uo(null),Df=Uo(null);function Of(e,t){switch(ut(rr,t),ut(su,e),ut(_o,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?TL(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=TL(t),e=xI(t,e);else switch(e){case\\\"svg\\\":e=1;break;case\\\"math\\\":e=2;break;default:e=0}}zt(_o),ut(_o,e)}function El(){zt(_o),zt(su),zt(rr)}function Th(e){e.memoizedState!==null&&ut(Df,e);var t=_o.current,a=xI(t,e.type);t!==a&&(ut(su,e),ut(_o,a))}function Pf(e){su.current===e&&(zt(_o),zt(su)),Df.current===e&&(zt(Df),xu._currentValue=os)}var Vg,LC;function Jr(e){if(Vg===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\\\\n( *(at )?)/);Vg=t&&t[1]||\\\"\\\",LC=-1<a.stack.indexOf(`\\n    at`)?\\\" (<anonymous>)\\\":-1<a.stack.indexOf(\\\"@\\\")?\\\"@unknown:0:0\\\":\\\"\\\"}return`\\n`+Vg+e+LC}var Gg=!1;function Xg(e,t){if(!e||Gg)return\\\"\\\";Gg=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,\\\"props\\\",{set:function(){throw Error()}}),typeof Reflect==\\\"object\\\"&&Reflect.construct){try{Reflect.construct(f,[])}catch(p){var d=p}Reflect.construct(e,[],f)}else{try{f.call()}catch(p){d=p}e.call(f.prototype)}}else{try{throw Error()}catch(p){d=p}(f=e())&&typeof f.catch==\\\"function\\\"&&f.catch(function(){})}}catch(p){if(p&&d&&typeof p.stack==\\\"string\\\")return[p.stack,d.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName=\\\"DetermineComponentFrameRoot\\\";var n=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,\\\"name\\\");n&&n.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,\\\"name\\\",{value:\\\"DetermineComponentFrameRoot\\\"});var r=o.DetermineComponentFrameRoot(),s=r[0],l=r[1];if(s&&l){var i=s.split(`\\n`),u=l.split(`\\n`);for(n=o=0;o<i.length&&!i[o].includes(\\\"DetermineComponentFrameRoot\\\");)o++;for(;n<u.length&&!u[n].includes(\\\"DetermineComponentFrameRoot\\\");)n++;if(o===i.length||n===u.length)for(o=i.length-1,n=u.length-1;1<=o&&0<=n&&i[o]!==u[n];)n--;for(;1<=o&&0<=n;o--,n--)if(i[o]!==u[n]){if(o!==1||n!==1)do if(o--,n--,0>n||i[o]!==u[n]){var c=`\\n`+i[o].replace(\\\" at new \\\",\\\" at \\\");return e.displayName&&c.includes(\\\"<anonymous>\\\")&&(c=c.replace(\\\"<anonymous>\\\",e.displayName)),c}while(1<=o&&0<=n);break}}}finally{Gg=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:\\\"\\\")?Jr(a):\\\"\\\"}function _D(e,t){switch(e.tag){case 26:case 27:case 5:return Jr(e.type);case 16:return Jr(\\\"Lazy\\\");case 13:return e.child!==t&&t!==null?Jr(\\\"Suspense Fallback\\\"):Jr(\\\"Suspense\\\");case 19:return Jr(\\\"SuspenseList\\\");case 0:case 15:return Xg(e.type,!1);case 11:return Xg(e.type.render,!1);case 1:return Xg(e.type,!0);case 31:return Jr(\\\"Activity\\\");default:return\\\"\\\"}}function RC(e){try{var t=\\\"\\\",a=null;do t+=_D(e,a),a=e,e=e.return;while(e);return t}catch(o){return`\\nError generating stack: `+o.message+`\\n`+o.stack}}var Eh=Object.prototype.hasOwnProperty,yx=Pt.unstable_scheduleCallback,jg=Pt.unstable_cancelCallback,UD=Pt.unstable_shouldYield,HD=Pt.unstable_requestPaint,Ba=Pt.unstable_now,zD=Pt.unstable_getCurrentPriorityLevel,QL=Pt.unstable_ImmediatePriority,JL=Pt.unstable_UserBlockingPriority,Nf=Pt.unstable_NormalPriority,qD=Pt.unstable_LowPriority,eR=Pt.unstable_IdlePriority,VD=Pt.log,GD=Pt.unstable_setDisableYieldValue,Cu=null,Fa=null;function er(e){if(typeof VD==\\\"function\\\"&&GD(e),Fa&&typeof Fa.setStrictMode==\\\"function\\\")try{Fa.setStrictMode(Cu,e)}catch{}}var _a=Math.clz32?Math.clz32:YD,XD=Math.log,jD=Math.LN2;function YD(e){return e>>>=0,e===0?32:31-(XD(e)/jD|0)|0}var Jc=256,ef=262144,tf=4194304;function es(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 ld(e,t,a){var o=e.pendingLanes;if(o===0)return 0;var n=0,r=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var l=o&134217727;return l!==0?(o=l&~r,o!==0?n=es(o):(s&=l,s!==0?n=es(s):a||(a=l&~e,a!==0&&(n=es(a))))):(l=o&~r,l!==0?n=es(l):s!==0?n=es(s):a||(a=o&~e,a!==0&&(n=es(a)))),n===0?0:t!==0&&t!==n&&(t&r)===0&&(r=n&-n,a=t&-t,r>=a||r===32&&(a&4194048)!==0)?t:n}function Lu(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function KD(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 tR(){var e=tf;return tf<<=1,(tf&62914560)===0&&(tf=4194304),e}function Yg(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ru(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $D(e,t,a,o,n,r){var s=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,i=e.expirationTimes,u=e.hiddenUpdates;for(a=s&~a;0<a;){var c=31-_a(a),f=1<<c;l[c]=0,i[c]=-1;var d=u[c];if(d!==null)for(u[c]=null,c=0;c<d.length;c++){var p=d[c];p!==null&&(p.lane&=-536870913)}a&=~f}o!==0&&aR(e,o,0),r!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=r&~(s&~t))}function aR(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-_a(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|a&261930}function oR(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var o=31-_a(a),n=1<<o;n&t|e[o]&t&&(e[o]|=t),a&=~n}}function nR(e,t){var a=t&-t;return a=(a&42)!==0?1:Sx(a),(a&(e.suspendedLanes|t))!==0?0:a}function Sx(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 Cx(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function rR(){var e=Ke.p;return e!==0?e:(e=window.event,e===void 0?32:TI(e.type))}function vC(e,t){var a=Ke.p;try{return Ke.p=e,t()}finally{Ke.p=a}}var br=Math.random().toString(36).slice(2),jt=\\\"__reactFiber$\\\"+br,La=\\\"__reactProps$\\\"+br,Hl=\\\"__reactContainer$\\\"+br,Mh=\\\"__reactEvents$\\\"+br,WD=\\\"__reactListeners$\\\"+br,ZD=\\\"__reactHandles$\\\"+br,IC=\\\"__reactResources$\\\"+br,vu=\\\"__reactMarker$\\\"+br;function Lx(e){delete e[jt],delete e[La],delete e[Mh],delete e[WD],delete e[ZD]}function dl(e){var t=e[jt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Hl]||a[jt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=OL(e);e!==null;){if(a=e[jt])return a;e=OL(e)}return t}e=a,a=e.parentNode}return null}function zl(e){if(e=e[jt]||e[Hl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Gi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(z(33))}function Ll(e){var t=e[IC];return t||(t=e[IC]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ht(e){e[vu]=!0}var sR=new Set,lR={};function ps(e,t){Ml(e,t),Ml(e+\\\"Capture\\\",t)}function Ml(e,t){for(lR[e]=t,e=0;e<t.length;e++)sR.add(t[e])}var QD=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]*$\\\"),wC={},kC={};function JD(e){return Eh.call(kC,e)?!0:Eh.call(wC,e)?!1:QD.test(e)?kC[e]=!0:(wC[e]=!0,!1)}function xf(e,t,a){if(JD(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case\\\"undefined\\\":case\\\"function\\\":case\\\"symbol\\\":e.removeAttribute(t);return;case\\\"boolean\\\":var o=t.toLowerCase().slice(0,5);if(o!==\\\"data-\\\"&&o!==\\\"aria-\\\"){e.removeAttribute(t);return}}e.setAttribute(t,\\\"\\\"+a)}}function af(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case\\\"undefined\\\":case\\\"function\\\":case\\\"symbol\\\":case\\\"boolean\\\":e.removeAttribute(t);return}e.setAttribute(t,\\\"\\\"+a)}}function dn(e,t,a,o){if(o===null)e.removeAttribute(a);else{switch(typeof o){case\\\"undefined\\\":case\\\"function\\\":case\\\"symbol\\\":case\\\"boolean\\\":e.removeAttribute(a);return}e.setAttributeNS(t,a,\\\"\\\"+o)}}function eo(e){switch(typeof e){case\\\"bigint\\\":case\\\"boolean\\\":case\\\"number\\\":case\\\"string\\\":case\\\"undefined\\\":return e;case\\\"object\\\":return e;default:return\\\"\\\"}}function iR(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===\\\"input\\\"&&(t===\\\"checkbox\\\"||t===\\\"radio\\\")}function eO(e,t,a){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<\\\"u\\\"&&typeof o.get==\\\"function\\\"&&typeof o.set==\\\"function\\\"){var n=o.get,r=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(s){a=\\\"\\\"+s,r.call(this,s)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(s){a=\\\"\\\"+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ah(e){if(!e._valueTracker){var t=iR(e)?\\\"checked\\\":\\\"value\\\";e._valueTracker=eO(e,t,\\\"\\\"+e[t])}}function uR(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),o=\\\"\\\";return e&&(o=iR(e)?e.checked?\\\"true\\\":\\\"false\\\":e.value),e=o,e!==a?(t.setValue(e),!0):!1}function Bf(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 tO=/[\\\\n\\\"\\\\\\\\]/g;function oo(e){return e.replace(tO,function(t){return\\\"\\\\\\\\\\\"+t.charCodeAt(0).toString(16)+\\\" \\\"})}function Dh(e,t,a,o,n,r,s,l){e.name=\\\"\\\",s!=null&&typeof s!=\\\"function\\\"&&typeof s!=\\\"symbol\\\"&&typeof s!=\\\"boolean\\\"?e.type=s:e.removeAttribute(\\\"type\\\"),t!=null?s===\\\"number\\\"?(t===0&&e.value===\\\"\\\"||e.value!=t)&&(e.value=\\\"\\\"+eo(t)):e.value!==\\\"\\\"+eo(t)&&(e.value=\\\"\\\"+eo(t)):s!==\\\"submit\\\"&&s!==\\\"reset\\\"||e.removeAttribute(\\\"value\\\"),t!=null?Oh(e,s,eo(t)):a!=null?Oh(e,s,eo(a)):o!=null&&e.removeAttribute(\\\"value\\\"),n==null&&r!=null&&(e.defaultChecked=!!r),n!=null&&(e.checked=n&&typeof n!=\\\"function\\\"&&typeof n!=\\\"symbol\\\"),l!=null&&typeof l!=\\\"function\\\"&&typeof l!=\\\"symbol\\\"&&typeof l!=\\\"boolean\\\"?e.name=\\\"\\\"+eo(l):e.removeAttribute(\\\"name\\\")}function cR(e,t,a,o,n,r,s,l){if(r!=null&&typeof r!=\\\"function\\\"&&typeof r!=\\\"symbol\\\"&&typeof r!=\\\"boolean\\\"&&(e.type=r),t!=null||a!=null){if(!(r!==\\\"submit\\\"&&r!==\\\"reset\\\"||t!=null)){Ah(e);return}a=a!=null?\\\"\\\"+eo(a):\\\"\\\",t=t!=null?\\\"\\\"+eo(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}o=o??n,o=typeof o!=\\\"function\\\"&&typeof o!=\\\"symbol\\\"&&!!o,e.checked=l?e.checked:!!o,e.defaultChecked=!!o,s!=null&&typeof s!=\\\"function\\\"&&typeof s!=\\\"symbol\\\"&&typeof s!=\\\"boolean\\\"&&(e.name=s),Ah(e)}function Oh(e,t,a){t===\\\"number\\\"&&Bf(e.ownerDocument)===e||e.defaultValue===\\\"\\\"+a||(e.defaultValue=\\\"\\\"+a)}function Rl(e,t,a,o){if(e=e.options,t){t={};for(var n=0;n<a.length;n++)t[\\\"$\\\"+a[n]]=!0;for(a=0;a<e.length;a++)n=t.hasOwnProperty(\\\"$\\\"+e[a].value),e[a].selected!==n&&(e[a].selected=n),n&&o&&(e[a].defaultSelected=!0)}else{for(a=\\\"\\\"+eo(a),t=null,n=0;n<e.length;n++){if(e[n].value===a){e[n].selected=!0,o&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function fR(e,t,a){if(t!=null&&(t=\\\"\\\"+eo(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?\\\"\\\"+eo(a):\\\"\\\"}function dR(e,t,a,o){if(t==null){if(o!=null){if(a!=null)throw Error(z(92));if(Vi(o)){if(1<o.length)throw Error(z(93));o=o[0]}a=o}a==null&&(a=\\\"\\\"),t=a}a=eo(t),e.defaultValue=a,o=e.textContent,o===a&&o!==\\\"\\\"&&o!==null&&(e.value=o),Ah(e)}function Al(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var aO=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 TC(e,t,a){var o=t.indexOf(\\\"--\\\")===0;a==null||typeof a==\\\"boolean\\\"||a===\\\"\\\"?o?e.setProperty(t,\\\"\\\"):t===\\\"float\\\"?e.cssFloat=\\\"\\\":e[t]=\\\"\\\":o?e.setProperty(t,a):typeof a!=\\\"number\\\"||a===0||aO.has(t)?t===\\\"float\\\"?e.cssFloat=a:e[t]=(\\\"\\\"+a).trim():e[t]=a+\\\"px\\\"}function pR(e,t,a){if(t!=null&&typeof t!=\\\"object\\\")throw Error(z(62));if(e=e.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf(\\\"--\\\")===0?e.setProperty(o,\\\"\\\"):o===\\\"float\\\"?e.cssFloat=\\\"\\\":e[o]=\\\"\\\");for(var n in t)o=t[n],t.hasOwnProperty(n)&&a[n]!==o&&TC(e,n,o)}else for(var r in t)t.hasOwnProperty(r)&&TC(e,r,t[r])}function Rx(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 oO=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\\\"]]),nO=/^[\\\\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 bf(e){return nO.test(\\\"\\\"+e)?\\\"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\\\":e}function Sn(){}var Ph=null;function vx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pl=null,vl=null;function EC(e){var t=zl(e);if(t&&(e=t.stateNode)){var a=e[La]||null;e:switch(e=t.stateNode,t.type){case\\\"input\\\":if(Dh(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type===\\\"radio\\\"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name=\\\"'+oo(\\\"\\\"+t)+'\\\"][type=\\\"radio\\\"]'),t=0;t<a.length;t++){var o=a[t];if(o!==e&&o.form===e.form){var n=o[La]||null;if(!n)throw Error(z(90));Dh(o,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<a.length;t++)o=a[t],o.form===e.form&&uR(o)}break e;case\\\"textarea\\\":fR(e,a.value,a.defaultValue);break e;case\\\"select\\\":t=a.value,t!=null&&Rl(e,!!a.multiple,t,!1)}}}var Kg=!1;function mR(e,t,a){if(Kg)return e(t,a);Kg=!0;try{var o=e(t);return o}finally{if(Kg=!1,(pl!==null||vl!==null)&&(yd(),pl&&(t=pl,e=vl,vl=pl=null,EC(t),e)))for(t=0;t<e.length;t++)EC(e[t])}}function lu(e,t){var a=e.stateNode;if(a===null)return null;var o=a[La]||null;if(o===null)return null;a=o[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\\\":(o=!o.disabled)||(e=e.type,o=!(e===\\\"button\\\"||e===\\\"input\\\"||e===\\\"select\\\"||e===\\\"textarea\\\")),e=!o;break e;default:e=!1}if(e)return null;if(a&&typeof a!=\\\"function\\\")throw Error(z(231,t,typeof a));return a}var In=!(typeof window>\\\"u\\\"||typeof window.document>\\\"u\\\"||typeof window.document.createElement>\\\"u\\\"),Nh=!1;if(In)try{rl={},Object.defineProperty(rl,\\\"passive\\\",{get:function(){Nh=!0}}),window.addEventListener(\\\"test\\\",rl,rl),window.removeEventListener(\\\"test\\\",rl,rl)}catch{Nh=!1}var rl,tr=null,Ix=null,yf=null;function gR(){if(yf)return yf;var e,t=Ix,a=t.length,o,n=\\\"value\\\"in tr?tr.value:tr.textContent,r=n.length;for(e=0;e<a&&t[e]===n[e];e++);var s=a-e;for(o=1;o<=s&&t[a-o]===n[r-o];o++);return yf=n.slice(e,1<o?1-o:void 0)}function Sf(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 of(){return!0}function MC(){return!1}function Ra(e){function t(a,o,n,r,s){this._reactName=a,this._targetInst=n,this.type=o,this.nativeEvent=r,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(r):r[l]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?of:MC,this.isPropagationStopped=MC,this}return pt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!=\\\"unknown\\\"&&(a.returnValue=!1),this.isDefaultPrevented=of)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!=\\\"unknown\\\"&&(a.cancelBubble=!0),this.isPropagationStopped=of)},persist:function(){},isPersistent:of}),t}var ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},id=Ra(ms),Iu=pt({},ms,{view:0,detail:0}),rO=Ra(Iu),$g,Wg,Bi,ud=pt({},Iu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wx,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!==Bi&&(Bi&&e.type===\\\"mousemove\\\"?($g=e.screenX-Bi.screenX,Wg=e.screenY-Bi.screenY):Wg=$g=0,Bi=e),$g)},movementY:function(e){return\\\"movementY\\\"in e?e.movementY:Wg}}),AC=Ra(ud),sO=pt({},ud,{dataTransfer:0}),lO=Ra(sO),iO=pt({},Iu,{relatedTarget:0}),Zg=Ra(iO),uO=pt({},ms,{animationName:0,elapsedTime:0,pseudoElement:0}),cO=Ra(uO),fO=pt({},ms,{clipboardData:function(e){return\\\"clipboardData\\\"in e?e.clipboardData:window.clipboardData}}),dO=Ra(fO),pO=pt({},ms,{data:0}),DC=Ra(pO),mO={Esc:\\\"Escape\\\",Spacebar:\\\" \\\",Left:\\\"ArrowLeft\\\",Up:\\\"ArrowUp\\\",Right:\\\"ArrowRight\\\",Down:\\\"ArrowDown\\\",Del:\\\"Delete\\\",Win:\\\"OS\\\",Menu:\\\"ContextMenu\\\",Apps:\\\"ContextMenu\\\",Scroll:\\\"ScrollLock\\\",MozPrintableKey:\\\"Unidentified\\\"},gO={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\\\"},hO={Alt:\\\"altKey\\\",Control:\\\"ctrlKey\\\",Meta:\\\"metaKey\\\",Shift:\\\"shiftKey\\\"};function xO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hO[e])?!!t[e]:!1}function wx(){return xO}var bO=pt({},Iu,{key:function(e){if(e.key){var t=mO[e.key]||e.key;if(t!==\\\"Unidentified\\\")return t}return e.type===\\\"keypress\\\"?(e=Sf(e),e===13?\\\"Enter\\\":String.fromCharCode(e)):e.type===\\\"keydown\\\"||e.type===\\\"keyup\\\"?gO[e.keyCode]||\\\"Unidentified\\\":\\\"\\\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wx,charCode:function(e){return e.type===\\\"keypress\\\"?Sf(e):0},keyCode:function(e){return e.type===\\\"keydown\\\"||e.type===\\\"keyup\\\"?e.keyCode:0},which:function(e){return e.type===\\\"keypress\\\"?Sf(e):e.type===\\\"keydown\\\"||e.type===\\\"keyup\\\"?e.keyCode:0}}),yO=Ra(bO),SO=pt({},ud,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),OC=Ra(SO),CO=pt({},Iu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wx}),LO=Ra(CO),RO=pt({},ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),vO=Ra(RO),IO=pt({},ud,{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}),wO=Ra(IO),kO=pt({},ms,{newState:0,oldState:0}),TO=Ra(kO),EO=[9,13,27,32],kx=In&&\\\"CompositionEvent\\\"in window,Yi=null;In&&\\\"documentMode\\\"in document&&(Yi=document.documentMode);var MO=In&&\\\"TextEvent\\\"in window&&!Yi,hR=In&&(!kx||Yi&&8<Yi&&11>=Yi),PC=\\\" \\\",NC=!1;function xR(e,t){switch(e){case\\\"keyup\\\":return EO.indexOf(t.keyCode)!==-1;case\\\"keydown\\\":return t.keyCode!==229;case\\\"keypress\\\":case\\\"mousedown\\\":case\\\"focusout\\\":return!0;default:return!1}}function bR(e){return e=e.detail,typeof e==\\\"object\\\"&&\\\"data\\\"in e?e.data:null}var ml=!1;function AO(e,t){switch(e){case\\\"compositionend\\\":return bR(t);case\\\"keypress\\\":return t.which!==32?null:(NC=!0,PC);case\\\"textInput\\\":return e=t.data,e===PC&&NC?null:e;default:return null}}function DO(e,t){if(ml)return e===\\\"compositionend\\\"||!kx&&xR(e,t)?(e=gR(),yf=Ix=tr=null,ml=!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 hR&&t.locale!==\\\"ko\\\"?null:t.data;default:return null}}var OO={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 BC(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===\\\"input\\\"?!!OO[e.type]:t===\\\"textarea\\\"}function yR(e,t,a,o){pl?vl?vl.push(o):vl=[o]:pl=o,t=ed(t,\\\"onChange\\\"),0<t.length&&(a=new id(\\\"onChange\\\",\\\"change\\\",null,a,o),e.push({event:a,listeners:t}))}var Ki=null,iu=null;function PO(e){mI(e,0)}function cd(e){var t=Gi(e);if(uR(t))return e}function FC(e,t){if(e===\\\"change\\\")return t}var SR=!1;In&&(In?(rf=\\\"oninput\\\"in document,rf||(Qg=document.createElement(\\\"div\\\"),Qg.setAttribute(\\\"oninput\\\",\\\"return;\\\"),rf=typeof Qg.oninput==\\\"function\\\"),nf=rf):nf=!1,SR=nf&&(!document.documentMode||9<document.documentMode));var nf,rf,Qg;function _C(){Ki&&(Ki.detachEvent(\\\"onpropertychange\\\",CR),iu=Ki=null)}function CR(e){if(e.propertyName===\\\"value\\\"&&cd(iu)){var t=[];yR(t,iu,e,vx(e)),mR(PO,t)}}function NO(e,t,a){e===\\\"focusin\\\"?(_C(),Ki=t,iu=a,Ki.attachEvent(\\\"onpropertychange\\\",CR)):e===\\\"focusout\\\"&&_C()}function BO(e){if(e===\\\"selectionchange\\\"||e===\\\"keyup\\\"||e===\\\"keydown\\\")return cd(iu)}function FO(e,t){if(e===\\\"click\\\")return cd(t)}function _O(e,t){if(e===\\\"input\\\"||e===\\\"change\\\")return cd(t)}function UO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ha=typeof Object.is==\\\"function\\\"?Object.is:UO;function uu(e,t){if(Ha(e,t))return!0;if(typeof e!=\\\"object\\\"||e===null||typeof t!=\\\"object\\\"||t===null)return!1;var a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var n=a[o];if(!Eh.call(t,n)||!Ha(e[n],t[n]))return!1}return!0}function UC(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function HC(e,t){var a=UC(e);e=0;for(var o;a;){if(a.nodeType===3){if(o=e+a.textContent.length,e<=t&&o>=t)return{node:a,offset:t-e};e=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=UC(a)}}function LR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?LR(e,t.parentNode):\\\"contains\\\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function RR(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bf(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href==\\\"string\\\"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Bf(e.document)}return t}function Tx(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 HO=In&&\\\"documentMode\\\"in document&&11>=document.documentMode,gl=null,Bh=null,$i=null,Fh=!1;function zC(e,t,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Fh||gl==null||gl!==Bf(o)||(o=gl,\\\"selectionStart\\\"in o&&Tx(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),$i&&uu($i,o)||($i=o,o=ed(Bh,\\\"onSelect\\\"),0<o.length&&(t=new id(\\\"onSelect\\\",\\\"select\\\",null,t,a),e.push({event:t,listeners:o}),t.target=gl)))}function Qr(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a[\\\"Webkit\\\"+e]=\\\"webkit\\\"+t,a[\\\"Moz\\\"+e]=\\\"moz\\\"+t,a}var hl={animationend:Qr(\\\"Animation\\\",\\\"AnimationEnd\\\"),animationiteration:Qr(\\\"Animation\\\",\\\"AnimationIteration\\\"),animationstart:Qr(\\\"Animation\\\",\\\"AnimationStart\\\"),transitionrun:Qr(\\\"Transition\\\",\\\"TransitionRun\\\"),transitionstart:Qr(\\\"Transition\\\",\\\"TransitionStart\\\"),transitioncancel:Qr(\\\"Transition\\\",\\\"TransitionCancel\\\"),transitionend:Qr(\\\"Transition\\\",\\\"TransitionEnd\\\")},Jg={},vR={};In&&(vR=document.createElement(\\\"div\\\").style,\\\"AnimationEvent\\\"in window||(delete hl.animationend.animation,delete hl.animationiteration.animation,delete hl.animationstart.animation),\\\"TransitionEvent\\\"in window||delete hl.transitionend.transition);function gs(e){if(Jg[e])return Jg[e];if(!hl[e])return e;var t=hl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in vR)return Jg[e]=t[a];return e}var IR=gs(\\\"animationend\\\"),wR=gs(\\\"animationiteration\\\"),kR=gs(\\\"animationstart\\\"),zO=gs(\\\"transitionrun\\\"),qO=gs(\\\"transitionstart\\\"),VO=gs(\\\"transitioncancel\\\"),TR=gs(\\\"transitionend\\\"),ER=new Map,_h=\\\"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(\\\" \\\");_h.push(\\\"scrollEnd\\\");function Co(e,t){ER.set(e,t),ps(t,[e])}var Ff=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)},Ja=[],xl=0,Ex=0;function fd(){for(var e=xl,t=Ex=xl=0;t<e;){var a=Ja[t];Ja[t++]=null;var o=Ja[t];Ja[t++]=null;var n=Ja[t];Ja[t++]=null;var r=Ja[t];if(Ja[t++]=null,o!==null&&n!==null){var s=o.pending;s===null?n.next=n:(n.next=s.next,s.next=n),o.pending=n}r!==0&&MR(a,n,r)}}function dd(e,t,a,o){Ja[xl++]=e,Ja[xl++]=t,Ja[xl++]=a,Ja[xl++]=o,Ex|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Mx(e,t,a,o){return dd(e,t,a,o),_f(e)}function hs(e,t){return dd(e,null,null,t),_f(e)}function MR(e,t,a){e.lanes|=a;var o=e.alternate;o!==null&&(o.lanes|=a);for(var n=!1,r=e.return;r!==null;)r.childLanes|=a,o=r.alternate,o!==null&&(o.childLanes|=a),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(n=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,n&&t!==null&&(n=31-_a(a),e=r.hiddenUpdates,o=e[n],o===null?e[n]=[t]:o.push(t),t.lane=a|536870912),r):null}function _f(e){if(50<nu)throw nu=0,rx=null,Error(z(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bl={};function GO(e,t,a,o){this.tag=e,this.key=a,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pa(e,t,a,o){return new GO(e,t,a,o)}function Ax(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ln(e,t){var a=e.alternate;return a===null?(a=Pa(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function AR(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Cf(e,t,a,o,n,r){var s=0;if(o=e,typeof e==\\\"function\\\")Ax(e)&&(s=1);else if(typeof e==\\\"string\\\")s=YP(e,a,_o.current)?26:e===\\\"html\\\"||e===\\\"head\\\"||e===\\\"body\\\"?27:5;else e:switch(e){case Ih:return e=Pa(31,a,t,n),e.elementType=Ih,e.lanes=r,e;case cl:return ns(a.children,n,r,t);case WL:s=8,n|=24;break;case Lh:return e=Pa(12,a,t,n|2),e.elementType=Lh,e.lanes=r,e;case Rh:return e=Pa(13,a,t,n),e.elementType=Rh,e.lanes=r,e;case vh:return e=Pa(19,a,t,n),e.elementType=vh,e.lanes=r,e;default:if(typeof e==\\\"object\\\"&&e!==null)switch(e.$$typeof){case yn:s=10;break e;case ZL:s=9;break e;case xx:s=11;break e;case bx:s=14;break e;case Kn:s=16,o=null;break e}s=29,a=Error(z(130,e===null?\\\"null\\\":typeof e,\\\"\\\")),o=null}return t=Pa(s,a,t,n),t.elementType=e,t.type=o,t.lanes=r,t}function ns(e,t,a,o){return e=Pa(7,e,o,t),e.lanes=a,e}function eh(e,t,a){return e=Pa(6,e,null,t),e.lanes=a,e}function DR(e){var t=Pa(18,null,null,0);return t.stateNode=e,t}function th(e,t,a){return t=Pa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var qC=new WeakMap;function no(e,t){if(typeof e==\\\"object\\\"&&e!==null){var a=qC.get(e);return a!==void 0?a:(t={value:e,source:t,stack:RC(t)},qC.set(e,t),t)}return{value:e,source:t,stack:RC(t)}}var yl=[],Sl=0,Uf=null,cu=0,to=[],ao=0,mr=null,No=1,Bo=\\\"\\\";function xn(e,t){yl[Sl++]=cu,yl[Sl++]=Uf,Uf=e,cu=t}function OR(e,t,a){to[ao++]=No,to[ao++]=Bo,to[ao++]=mr,mr=e;var o=No;e=Bo;var n=32-_a(o)-1;o&=~(1<<n),a+=1;var r=32-_a(t)+n;if(30<r){var s=n-n%5;r=(o&(1<<s)-1).toString(32),o>>=s,n-=s,No=1<<32-_a(t)+n|a<<n|o,Bo=r+e}else No=1<<r|a<<n|o,Bo=e}function Dx(e){e.return!==null&&(xn(e,1),OR(e,1,0))}function Ox(e){for(;e===Uf;)Uf=yl[--Sl],yl[Sl]=null,cu=yl[--Sl],yl[Sl]=null;for(;e===mr;)mr=to[--ao],to[ao]=null,Bo=to[--ao],to[ao]=null,No=to[--ao],to[ao]=null}function PR(e,t){to[ao++]=No,to[ao++]=Bo,to[ao++]=mr,No=t.id,Bo=t.overflow,mr=e}var Yt=null,dt=null,Ve=!1,sr=null,ro=!1,Uh=Error(z(519));function gr(e){var t=Error(z(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?\\\"text\\\":\\\"HTML\\\",\\\"\\\"));throw fu(no(t,e)),Uh}function VC(e){var t=e.stateNode,a=e.type,o=e.memoizedProps;switch(t[jt]=e,t[La]=o,a){case\\\"dialog\\\":Ue(\\\"cancel\\\",t),Ue(\\\"close\\\",t);break;case\\\"iframe\\\":case\\\"object\\\":case\\\"embed\\\":Ue(\\\"load\\\",t);break;case\\\"video\\\":case\\\"audio\\\":for(a=0;a<gu.length;a++)Ue(gu[a],t);break;case\\\"source\\\":Ue(\\\"error\\\",t);break;case\\\"img\\\":case\\\"image\\\":case\\\"link\\\":Ue(\\\"error\\\",t),Ue(\\\"load\\\",t);break;case\\\"details\\\":Ue(\\\"toggle\\\",t);break;case\\\"input\\\":Ue(\\\"invalid\\\",t),cR(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case\\\"select\\\":Ue(\\\"invalid\\\",t);break;case\\\"textarea\\\":Ue(\\\"invalid\\\",t),dR(t,o.value,o.defaultValue,o.children)}a=o.children,typeof a!=\\\"string\\\"&&typeof a!=\\\"number\\\"&&typeof a!=\\\"bigint\\\"||t.textContent===\\\"\\\"+a||o.suppressHydrationWarning===!0||hI(t.textContent,a)?(o.popover!=null&&(Ue(\\\"beforetoggle\\\",t),Ue(\\\"toggle\\\",t)),o.onScroll!=null&&Ue(\\\"scroll\\\",t),o.onScrollEnd!=null&&Ue(\\\"scrollend\\\",t),o.onClick!=null&&(t.onclick=Sn),t=!0):t=!1,t||gr(e,!0)}function GC(e){for(Yt=e.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:ro=!1;return;case 27:case 3:ro=!0;return;default:Yt=Yt.return}}function sl(e){if(e!==Yt)return!1;if(!Ve)return GC(e),Ve=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!==\\\"form\\\"&&a!==\\\"button\\\")||cx(e.type,e.memoizedProps)),a=!a),a&&dt&&gr(e),GC(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));dt=DL(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));dt=DL(e)}else t===27?(t=dt,yr(e.type)?(e=mx,mx=null,dt=e):dt=t):dt=Yt?lo(e.stateNode.nextSibling):null;return!0}function is(){dt=Yt=null,Ve=!1}function ah(){var e=sr;return e!==null&&(Sa===null?Sa=e:Sa.push.apply(Sa,e),sr=null),e}function fu(e){sr===null?sr=[e]:sr.push(e)}var Hh=Uo(null),xs=null,Cn=null;function Wn(e,t,a){ut(Hh,t._currentValue),t._currentValue=a}function Rn(e){e._currentValue=Hh.current,zt(Hh)}function zh(e,t,a){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===a)break;e=e.return}}function qh(e,t,a,o){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var r=n.dependencies;if(r!==null){var s=n.child;r=r.firstContext;e:for(;r!==null;){var l=r;r=n;for(var i=0;i<t.length;i++)if(l.context===t[i]){r.lanes|=a,l=r.alternate,l!==null&&(l.lanes|=a),zh(r.return,a,e),o||(s=null);break e}r=l.next}}else if(n.tag===18){if(s=n.return,s===null)throw Error(z(341));s.lanes|=a,r=s.alternate,r!==null&&(r.lanes|=a),zh(s,a,e),s=null}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===e){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}}function ql(e,t,a,o){e=null;for(var n=t,r=!1;n!==null;){if(!r){if((n.flags&524288)!==0)r=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var s=n.alternate;if(s===null)throw Error(z(387));if(s=s.memoizedProps,s!==null){var l=n.type;Ha(n.pendingProps.value,s.value)||(e!==null?e.push(l):e=[l])}}else if(n===Df.current){if(s=n.alternate,s===null)throw Error(z(387));s.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(xu):e=[xu])}n=n.return}e!==null&&qh(t,e,a,o),t.flags|=262144}function Hf(e){for(e=e.firstContext;e!==null;){if(!Ha(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function us(e){xs=e,Cn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kt(e){return NR(xs,e)}function sf(e,t){return xs===null&&us(e),NR(e,t)}function NR(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Cn===null){if(e===null)throw Error(z(308));Cn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Cn=Cn.next=t;return a}var XO=typeof AbortController<\\\"u\\\"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},jO=Pt.unstable_scheduleCallback,YO=Pt.unstable_NormalPriority,Et={$$typeof:yn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Px(){return{controller:new XO,data:new Map,refCount:0}}function wu(e){e.refCount--,e.refCount===0&&jO(YO,function(){e.controller.abort()})}var Wi=null,Vh=0,Dl=0,Il=null;function KO(e,t){if(Wi===null){var a=Wi=[];Vh=0,Dl=rb(),Il={status:\\\"pending\\\",value:void 0,then:function(o){a.push(o)}}}return Vh++,t.then(XC,XC),t}function XC(){if(--Vh===0&&Wi!==null){Il!==null&&(Il.status=\\\"fulfilled\\\");var e=Wi;Wi=null,Dl=0,Il=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function $O(e,t){var a=[],o={status:\\\"pending\\\",value:null,reason:null,then:function(n){a.push(n)}};return e.then(function(){o.status=\\\"fulfilled\\\",o.value=t;for(var n=0;n<a.length;n++)(0,a[n])(t)},function(n){for(o.status=\\\"rejected\\\",o.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),o}var jC=Se.S;Se.S=function(e,t){$v=Ba(),typeof t==\\\"object\\\"&&t!==null&&typeof t.then==\\\"function\\\"&&KO(e,t),jC!==null&&jC(e,t)};var rs=Uo(null);function Nx(){var e=rs.current;return e!==null?e:st.pooledCache}function Lf(e,t){t===null?ut(rs,rs.current):ut(rs,t.pool)}function BR(){var e=Nx();return e===null?null:{parent:Et._currentValue,pool:e}}var Vl=Error(z(460)),Bx=Error(z(474)),pd=Error(z(542)),zf={then:function(){}};function YC(e){return e=e.status,e===\\\"fulfilled\\\"||e===\\\"rejected\\\"}function FR(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Sn,Sn),t=a),t.status){case\\\"fulfilled\\\":return t.value;case\\\"rejected\\\":throw e=t.reason,$C(e),e;default:if(typeof t.status==\\\"string\\\")t.then(Sn,Sn);else{if(e=st,e!==null&&100<e.shellSuspendCounter)throw Error(z(482));e=t,e.status=\\\"pending\\\",e.then(function(o){if(t.status===\\\"pending\\\"){var n=t;n.status=\\\"fulfilled\\\",n.value=o}},function(o){if(t.status===\\\"pending\\\"){var n=t;n.status=\\\"rejected\\\",n.reason=o}})}switch(t.status){case\\\"fulfilled\\\":return t.value;case\\\"rejected\\\":throw e=t.reason,$C(e),e}throw ss=t,Vl}}function ts(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a==\\\"object\\\"&&typeof a.then==\\\"function\\\"?(ss=a,Vl):a}}var ss=null;function KC(){if(ss===null)throw Error(z(459));var e=ss;return ss=null,e}function $C(e){if(e===Vl||e===pd)throw Error(z(483))}var wl=null,du=0;function lf(e){var t=du;return du+=1,wl===null&&(wl=[]),FR(wl,e,t)}function Fi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function uf(e,t){throw t.$$typeof===ND?Error(z(525)):(e=Object.prototype.toString.call(t),Error(z(31,e===\\\"[object Object]\\\"?\\\"object with keys {\\\"+Object.keys(t).join(\\\", \\\")+\\\"}\\\":e)))}function _R(e){function t(g,m){if(e){var h=g.deletions;h===null?(g.deletions=[m],g.flags|=16):h.push(m)}}function a(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function o(g){for(var m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function n(g,m){return g=Ln(g,m),g.index=0,g.sibling=null,g}function r(g,m,h){return g.index=h,e?(h=g.alternate,h!==null?(h=h.index,h<m?(g.flags|=67108866,m):h):(g.flags|=67108866,m)):(g.flags|=1048576,m)}function s(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function l(g,m,h,y){return m===null||m.tag!==6?(m=eh(h,g.mode,y),m.return=g,m):(m=n(m,h),m.return=g,m)}function i(g,m,h,y){var v=h.type;return v===cl?c(g,m,h.props.children,y,h.key):m!==null&&(m.elementType===v||typeof v==\\\"object\\\"&&v!==null&&v.$$typeof===Kn&&ts(v)===m.type)?(m=n(m,h.props),Fi(m,h),m.return=g,m):(m=Cf(h.type,h.key,h.props,null,g.mode,y),Fi(m,h),m.return=g,m)}function u(g,m,h,y){return m===null||m.tag!==4||m.stateNode.containerInfo!==h.containerInfo||m.stateNode.implementation!==h.implementation?(m=th(h,g.mode,y),m.return=g,m):(m=n(m,h.children||[]),m.return=g,m)}function c(g,m,h,y,v){return m===null||m.tag!==7?(m=ns(h,g.mode,y,v),m.return=g,m):(m=n(m,h),m.return=g,m)}function f(g,m,h){if(typeof m==\\\"string\\\"&&m!==\\\"\\\"||typeof m==\\\"number\\\"||typeof m==\\\"bigint\\\")return m=eh(\\\"\\\"+m,g.mode,h),m.return=g,m;if(typeof m==\\\"object\\\"&&m!==null){switch(m.$$typeof){case Qc:return h=Cf(m.type,m.key,m.props,null,g.mode,h),Fi(h,m),h.return=g,h;case qi:return m=th(m,g.mode,h),m.return=g,m;case Kn:return m=ts(m),f(g,m,h)}if(Vi(m)||Ni(m))return m=ns(m,g.mode,h,null),m.return=g,m;if(typeof m.then==\\\"function\\\")return f(g,lf(m),h);if(m.$$typeof===yn)return f(g,sf(g,m),h);uf(g,m)}return null}function d(g,m,h,y){var v=m!==null?m.key:null;if(typeof h==\\\"string\\\"&&h!==\\\"\\\"||typeof h==\\\"number\\\"||typeof h==\\\"bigint\\\")return v!==null?null:l(g,m,\\\"\\\"+h,y);if(typeof h==\\\"object\\\"&&h!==null){switch(h.$$typeof){case Qc:return h.key===v?i(g,m,h,y):null;case qi:return h.key===v?u(g,m,h,y):null;case Kn:return h=ts(h),d(g,m,h,y)}if(Vi(h)||Ni(h))return v!==null?null:c(g,m,h,y,null);if(typeof h.then==\\\"function\\\")return d(g,m,lf(h),y);if(h.$$typeof===yn)return d(g,m,sf(g,h),y);uf(g,h)}return null}function p(g,m,h,y,v){if(typeof y==\\\"string\\\"&&y!==\\\"\\\"||typeof y==\\\"number\\\"||typeof y==\\\"bigint\\\")return g=g.get(h)||null,l(m,g,\\\"\\\"+y,v);if(typeof y==\\\"object\\\"&&y!==null){switch(y.$$typeof){case Qc:return g=g.get(y.key===null?h:y.key)||null,i(m,g,y,v);case qi:return g=g.get(y.key===null?h:y.key)||null,u(m,g,y,v);case Kn:return y=ts(y),p(g,m,h,y,v)}if(Vi(y)||Ni(y))return g=g.get(h)||null,c(m,g,y,v,null);if(typeof y.then==\\\"function\\\")return p(g,m,h,lf(y),v);if(y.$$typeof===yn)return p(g,m,h,sf(m,y),v);uf(m,y)}return null}function x(g,m,h,y){for(var v=null,R=null,I=m,L=m=0,k=null;I!==null&&L<h.length;L++){I.index>L?(k=I,I=null):k=I.sibling;var w=d(g,I,h[L],y);if(w===null){I===null&&(I=k);break}e&&I&&w.alternate===null&&t(g,I),m=r(w,m,L),R===null?v=w:R.sibling=w,R=w,I=k}if(L===h.length)return a(g,I),Ve&&xn(g,L),v;if(I===null){for(;L<h.length;L++)I=f(g,h[L],y),I!==null&&(m=r(I,m,L),R===null?v=I:R.sibling=I,R=I);return Ve&&xn(g,L),v}for(I=o(I);L<h.length;L++)k=p(I,g,L,h[L],y),k!==null&&(e&&k.alternate!==null&&I.delete(k.key===null?L:k.key),m=r(k,m,L),R===null?v=k:R.sibling=k,R=k);return e&&I.forEach(function(A){return t(g,A)}),Ve&&xn(g,L),v}function b(g,m,h,y){if(h==null)throw Error(z(151));for(var v=null,R=null,I=m,L=m=0,k=null,w=h.next();I!==null&&!w.done;L++,w=h.next()){I.index>L?(k=I,I=null):k=I.sibling;var A=d(g,I,w.value,y);if(A===null){I===null&&(I=k);break}e&&I&&A.alternate===null&&t(g,I),m=r(A,m,L),R===null?v=A:R.sibling=A,R=A,I=k}if(w.done)return a(g,I),Ve&&xn(g,L),v;if(I===null){for(;!w.done;L++,w=h.next())w=f(g,w.value,y),w!==null&&(m=r(w,m,L),R===null?v=w:R.sibling=w,R=w);return Ve&&xn(g,L),v}for(I=o(I);!w.done;L++,w=h.next())w=p(I,g,L,w.value,y),w!==null&&(e&&w.alternate!==null&&I.delete(w.key===null?L:w.key),m=r(w,m,L),R===null?v=w:R.sibling=w,R=w);return e&&I.forEach(function(P){return t(g,P)}),Ve&&xn(g,L),v}function C(g,m,h,y){if(typeof h==\\\"object\\\"&&h!==null&&h.type===cl&&h.key===null&&(h=h.props.children),typeof h==\\\"object\\\"&&h!==null){switch(h.$$typeof){case Qc:e:{for(var v=h.key;m!==null;){if(m.key===v){if(v=h.type,v===cl){if(m.tag===7){a(g,m.sibling),y=n(m,h.props.children),y.return=g,g=y;break e}}else if(m.elementType===v||typeof v==\\\"object\\\"&&v!==null&&v.$$typeof===Kn&&ts(v)===m.type){a(g,m.sibling),y=n(m,h.props),Fi(y,h),y.return=g,g=y;break e}a(g,m);break}else t(g,m);m=m.sibling}h.type===cl?(y=ns(h.props.children,g.mode,y,h.key),y.return=g,g=y):(y=Cf(h.type,h.key,h.props,null,g.mode,y),Fi(y,h),y.return=g,g=y)}return s(g);case qi:e:{for(v=h.key;m!==null;){if(m.key===v)if(m.tag===4&&m.stateNode.containerInfo===h.containerInfo&&m.stateNode.implementation===h.implementation){a(g,m.sibling),y=n(m,h.children||[]),y.return=g,g=y;break e}else{a(g,m);break}else t(g,m);m=m.sibling}y=th(h,g.mode,y),y.return=g,g=y}return s(g);case Kn:return h=ts(h),C(g,m,h,y)}if(Vi(h))return x(g,m,h,y);if(Ni(h)){if(v=Ni(h),typeof v!=\\\"function\\\")throw Error(z(150));return h=v.call(h),b(g,m,h,y)}if(typeof h.then==\\\"function\\\")return C(g,m,lf(h),y);if(h.$$typeof===yn)return C(g,m,sf(g,h),y);uf(g,h)}return typeof h==\\\"string\\\"&&h!==\\\"\\\"||typeof h==\\\"number\\\"||typeof h==\\\"bigint\\\"?(h=\\\"\\\"+h,m!==null&&m.tag===6?(a(g,m.sibling),y=n(m,h),y.return=g,g=y):(a(g,m),y=eh(h,g.mode,y),y.return=g,g=y),s(g)):a(g,m)}return function(g,m,h,y){try{du=0;var v=C(g,m,h,y);return wl=null,v}catch(I){if(I===Vl||I===pd)throw I;var R=Pa(29,I,null,g.mode);return R.lanes=y,R.return=g,R}}}var cs=_R(!0),UR=_R(!1),$n=!1;function Fx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gh(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 lr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ir(e,t,a){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ye&2)!==0){var n=o.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),o.pending=t,t=_f(e),MR(e,null,a),t}return dd(e,o,t,a),_f(e)}function Zi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,a|=o,t.lanes=a,oR(e,a)}}function oh(e,t){var a=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var n=null,r=null;if(a=a.firstBaseUpdate,a!==null){do{var s={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};r===null?n=r=s:r=r.next=s,a=a.next}while(a!==null);r===null?n=r=t:r=r.next=t}else n=r=t;a={baseState:o.baseState,firstBaseUpdate:n,lastBaseUpdate:r,shared:o.shared,callbacks:o.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Xh=!1;function Qi(){if(Xh){var e=Il;if(e!==null)throw e}}function Ji(e,t,a,o){Xh=!1;var n=e.updateQueue;$n=!1;var r=n.firstBaseUpdate,s=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var i=l,u=i.next;i.next=null,s===null?r=u:s.next=u,s=i;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=i))}if(r!==null){var f=n.baseState;s=0,c=u=i=null,l=r;do{var d=l.lane&-536870913,p=d!==l.lane;if(p?(qe&d)===d:(o&d)===d){d!==0&&d===Dl&&(Xh=!0),c!==null&&(c=c.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var x=e,b=l;d=t;var C=a;switch(b.tag){case 1:if(x=b.payload,typeof x==\\\"function\\\"){f=x.call(C,f,d);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=b.payload,d=typeof x==\\\"function\\\"?x.call(C,f,d):x,d==null)break e;f=pt({},f,d);break e;case 2:$n=!0}}d=l.callback,d!==null&&(e.flags|=64,p&&(e.flags|=8192),p=n.callbacks,p===null?n.callbacks=[d]:p.push(d))}else p={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,i=f):c=c.next=p,s|=d;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;p=l,l=p.next,p.next=null,n.lastBaseUpdate=p,n.shared.pending=null}}while(!0);c===null&&(i=f),n.baseState=i,n.firstBaseUpdate=u,n.lastBaseUpdate=c,r===null&&(n.shared.lanes=0),xr|=s,e.lanes=s,e.memoizedState=f}}function HR(e,t){if(typeof e!=\\\"function\\\")throw Error(z(191,e));e.call(t)}function zR(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)HR(a[e],t)}var Ol=Uo(null),qf=Uo(0);function WC(e,t){e=En,ut(qf,e),ut(Ol,t),En=e|t.baseLanes}function jh(){ut(qf,En),ut(Ol,Ol.current)}function _x(){En=qf.current,zt(Ol),zt(qf)}var za=Uo(null),so=null;function Zn(e){var t=e.alternate;ut(vt,vt.current&1),ut(za,e),so===null&&(t===null||Ol.current!==null||t.memoizedState!==null)&&(so=e)}function Yh(e){ut(vt,vt.current),ut(za,e),so===null&&(so=e)}function qR(e){e.tag===22?(ut(vt,vt.current),ut(za,e),so===null&&(so=e)):Qn(e)}function Qn(){ut(vt,vt.current),ut(za,za.current)}function Oa(e){zt(za),so===e&&(so=null),zt(vt)}var vt=Uo(0);function Vf(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||dx(a)||px(a)))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 wn=0,Ee=null,et=null,kt=null,Gf=!1,kl=!1,fs=!1,Xf=0,pu=0,Tl=null,WO=0;function Ct(){throw Error(z(321))}function Ux(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Ha(e[a],t[a]))return!1;return!0}function Hx(e,t,a,o,n,r){return wn=r,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Se.H=e===null||e.memoizedState===null?yv:Zx,fs=!1,r=a(o,n),fs=!1,kl&&(r=GR(t,a,o,n)),VR(e),r}function VR(e){Se.H=mu;var t=et!==null&&et.next!==null;if(wn=0,kt=et=Ee=null,Gf=!1,pu=0,Tl=null,t)throw Error(z(300));e===null||Mt||(e=e.dependencies,e!==null&&Hf(e)&&(Mt=!0))}function GR(e,t,a,o){Ee=e;var n=0;do{if(kl&&(Tl=null),pu=0,kl=!1,25<=n)throw Error(z(301));if(n+=1,kt=et=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}Se.H=Sv,r=t(a,o)}while(kl);return r}function ZO(){var e=Se.H,t=e.useState()[0];return t=typeof t.then==\\\"function\\\"?ku(t):t,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&(Ee.flags|=1024),t}function zx(){var e=Xf!==0;return Xf=0,e}function qx(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Vx(e){if(Gf){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Gf=!1}wn=0,kt=et=Ee=null,kl=!1,pu=Xf=0,Tl=null}function fa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kt===null?Ee.memoizedState=kt=e:kt=kt.next=e,kt}function It(){if(et===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=kt===null?Ee.memoizedState:kt.next;if(t!==null)kt=t,et=e;else{if(e===null)throw Ee.alternate===null?Error(z(467)):Error(z(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},kt===null?Ee.memoizedState=kt=e:kt=kt.next=e}return kt}function md(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ku(e){var t=pu;return pu+=1,Tl===null&&(Tl=[]),e=FR(Tl,e,t),t=Ee,(kt===null?t.memoizedState:kt.next)===null&&(t=t.alternate,Se.H=t===null||t.memoizedState===null?yv:Zx),e}function gd(e){if(e!==null&&typeof e==\\\"object\\\"){if(typeof e.then==\\\"function\\\")return ku(e);if(e.$$typeof===yn)return Kt(e)}throw Error(z(438,String(e)))}function Gx(e){var t=null,a=Ee.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var o=Ee.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=md(),Ee.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),o=0;o<e;o++)a[o]=BD;return t.index++,a}function kn(e,t){return typeof t==\\\"function\\\"?t(e):t}function Rf(e){var t=It();return Xx(t,et,e)}function Xx(e,t,a){var o=e.queue;if(o===null)throw Error(z(311));o.lastRenderedReducer=a;var n=e.baseQueue,r=o.pending;if(r!==null){if(n!==null){var s=n.next;n.next=r.next,r.next=s}t.baseQueue=n=r,o.pending=null}if(r=e.baseState,n===null)e.memoizedState=r;else{t=n.next;var l=s=null,i=null,u=t,c=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(qe&f)===f:(wn&f)===f){var d=u.revertLane;if(d===0)i!==null&&(i=i.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Dl&&(c=!0);else if((wn&d)===d){u=u.next,d===Dl&&(c=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},i===null?(l=i=f,s=r):i=i.next=f,Ee.lanes|=d,xr|=d;f=u.action,fs&&a(r,f),r=u.hasEagerState?u.eagerState:a(r,f)}else d={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},i===null?(l=i=d,s=r):i=i.next=d,Ee.lanes|=f,xr|=f;u=u.next}while(u!==null&&u!==t);if(i===null?s=r:i.next=l,!Ha(r,e.memoizedState)&&(Mt=!0,c&&(a=Il,a!==null)))throw a;e.memoizedState=r,e.baseState=s,e.baseQueue=i,o.lastRenderedState=r}return n===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function nh(e){var t=It(),a=t.queue;if(a===null)throw Error(z(311));a.lastRenderedReducer=e;var o=a.dispatch,n=a.pending,r=t.memoizedState;if(n!==null){a.pending=null;var s=n=n.next;do r=e(r,s.action),s=s.next;while(s!==n);Ha(r,t.memoizedState)||(Mt=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),a.lastRenderedState=r}return[r,o]}function XR(e,t,a){var o=Ee,n=It(),r=Ve;if(r){if(a===void 0)throw Error(z(407));a=a()}else a=t();var s=!Ha((et||n).memoizedState,a);if(s&&(n.memoizedState=a,Mt=!0),n=n.queue,jx(KR.bind(null,o,n,e),[e]),n.getSnapshot!==t||s||kt!==null&&kt.memoizedState.tag&1){if(o.flags|=2048,Pl(9,{destroy:void 0},YR.bind(null,o,n,a,t),null),st===null)throw Error(z(349));r||(wn&127)!==0||jR(o,t,a)}return a}function jR(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ee.updateQueue,t===null?(t=md(),Ee.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function YR(e,t,a,o){t.value=a,t.getSnapshot=o,$R(t)&&WR(e)}function KR(e,t,a){return a(function(){$R(t)&&WR(e)})}function $R(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Ha(e,a)}catch{return!0}}function WR(e){var t=hs(e,2);t!==null&&Ca(t,e,2)}function Kh(e){var t=fa();if(typeof e==\\\"function\\\"){var a=e;if(e=a(),fs){er(!0);try{a()}finally{er(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:e},t}function ZR(e,t,a,o){return e.baseState=a,Xx(e,et,typeof o==\\\"function\\\"?o:kn)}function QO(e,t,a,o,n){if(xd(e))throw Error(z(485));if(e=t.action,e!==null){var r={payload:n,action:e,next:null,isTransition:!0,status:\\\"pending\\\",value:null,reason:null,listeners:[],then:function(s){r.listeners.push(s)}};Se.T!==null?a(!0):r.isTransition=!1,o(r),a=t.pending,a===null?(r.next=t.pending=r,QR(t,r)):(r.next=a.next,t.pending=a.next=r)}}function QR(e,t){var a=t.action,o=t.payload,n=e.state;if(t.isTransition){var r=Se.T,s={};Se.T=s;try{var l=a(n,o),i=Se.S;i!==null&&i(s,l),ZC(e,t,l)}catch(u){$h(e,t,u)}finally{r!==null&&s.types!==null&&(r.types=s.types),Se.T=r}}else try{r=a(n,o),ZC(e,t,r)}catch(u){$h(e,t,u)}}function ZC(e,t,a){a!==null&&typeof a==\\\"object\\\"&&typeof a.then==\\\"function\\\"?a.then(function(o){QC(e,t,o)},function(o){return $h(e,t,o)}):QC(e,t,a)}function QC(e,t,a){t.status=\\\"fulfilled\\\",t.value=a,JR(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,QR(e,a)))}function $h(e,t,a){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status=\\\"rejected\\\",t.reason=a,JR(t),t=t.next;while(t!==o)}e.action=null}function JR(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ev(e,t){return t}function JC(e,t){if(Ve){var a=st.formState;if(a!==null){e:{var o=Ee;if(Ve){if(dt){t:{for(var n=dt,r=ro;n.nodeType!==8;){if(!r){n=null;break t}if(n=lo(n.nextSibling),n===null){n=null;break t}}r=n.data,n=r===\\\"F!\\\"||r===\\\"F\\\"?n:null}if(n){dt=lo(n.nextSibling),o=n.data===\\\"F!\\\";break e}}gr(o)}o=!1}o&&(t=a[0])}}return a=fa(),a.memoizedState=a.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ev,lastRenderedState:t},a.queue=o,a=hv.bind(null,Ee,o),o.dispatch=a,o=Kh(!1),r=Wx.bind(null,Ee,!1,o.queue),o=fa(),n={state:t,dispatch:null,action:e,pending:null},o.queue=n,a=QO.bind(null,Ee,n,r,a),n.dispatch=a,o.memoizedState=e,[t,a,!1]}function eL(e){var t=It();return tv(t,et,e)}function tv(e,t,a){if(t=Xx(e,t,ev)[0],e=Rf(kn)[0],typeof t==\\\"object\\\"&&t!==null&&typeof t.then==\\\"function\\\")try{var o=ku(t)}catch(s){throw s===Vl?pd:s}else o=t;t=It();var n=t.queue,r=n.dispatch;return a!==t.memoizedState&&(Ee.flags|=2048,Pl(9,{destroy:void 0},JO.bind(null,n,a),null)),[o,r,e]}function JO(e,t){e.action=t}function tL(e){var t=It(),a=et;if(a!==null)return tv(t,a,e);It(),t=t.memoizedState,a=It();var o=a.queue.dispatch;return a.memoizedState=e,[t,o,!1]}function Pl(e,t,a,o){return e={tag:e,create:a,deps:o,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=md(),Ee.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(o=a.next,a.next=e,e.next=o,t.lastEffect=e),e}function av(){return It().memoizedState}function vf(e,t,a,o){var n=fa();Ee.flags|=e,n.memoizedState=Pl(1|t,{destroy:void 0},a,o===void 0?null:o)}function hd(e,t,a,o){var n=It();o=o===void 0?null:o;var r=n.memoizedState.inst;et!==null&&o!==null&&Ux(o,et.memoizedState.deps)?n.memoizedState=Pl(t,r,a,o):(Ee.flags|=e,n.memoizedState=Pl(1|t,r,a,o))}function aL(e,t){vf(8390656,8,e,t)}function jx(e,t){hd(2048,8,e,t)}function eP(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=md(),Ee.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function ov(e){var t=It().memoizedState;return eP({ref:t,nextImpl:e}),function(){if((Ye&2)!==0)throw Error(z(440));return t.impl.apply(void 0,arguments)}}function nv(e,t){return hd(4,2,e,t)}function rv(e,t){return hd(4,4,e,t)}function sv(e,t){if(typeof t==\\\"function\\\"){e=e();var a=t(e);return function(){typeof a==\\\"function\\\"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function lv(e,t,a){a=a!=null?a.concat([e]):null,hd(4,4,sv.bind(null,t,e),a)}function Yx(){}function iv(e,t){var a=It();t=t===void 0?null:t;var o=a.memoizedState;return t!==null&&Ux(t,o[1])?o[0]:(a.memoizedState=[e,t],e)}function uv(e,t){var a=It();t=t===void 0?null:t;var o=a.memoizedState;if(t!==null&&Ux(t,o[1]))return o[0];if(o=e(),fs){er(!0);try{e()}finally{er(!1)}}return a.memoizedState=[o,t],o}function Kx(e,t,a){return a===void 0||(wn&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Zv(),Ee.lanes|=e,xr|=e,a)}function cv(e,t,a,o){return Ha(a,t)?a:Ol.current!==null?(e=Kx(e,a,o),Ha(e,t)||(Mt=!0),e):(wn&42)===0||(wn&1073741824)!==0&&(qe&261930)===0?(Mt=!0,e.memoizedState=a):(e=Zv(),Ee.lanes|=e,xr|=e,t)}function fv(e,t,a,o,n){var r=Ke.p;Ke.p=r!==0&&8>r?r:8;var s=Se.T,l={};Se.T=l,Wx(e,!1,t,a);try{var i=n(),u=Se.S;if(u!==null&&u(l,i),i!==null&&typeof i==\\\"object\\\"&&typeof i.then==\\\"function\\\"){var c=$O(i,o);eu(e,t,c,Ua(e))}else eu(e,t,o,Ua(e))}catch(f){eu(e,t,{then:function(){},status:\\\"rejected\\\",reason:f},Ua())}finally{Ke.p=r,s!==null&&l.types!==null&&(s.types=l.types),Se.T=s}}function tP(){}function Wh(e,t,a,o){if(e.tag!==5)throw Error(z(476));var n=dv(e).queue;fv(e,n,t,os,a===null?tP:function(){return pv(e),a(o)})}function dv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:os,baseState:os,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:os},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pv(e){var t=dv(e);t.next===null&&(t=e.alternate.memoizedState),eu(e,t.next.queue,{},Ua())}function $x(){return Kt(xu)}function mv(){return It().memoizedState}function gv(){return It().memoizedState}function aP(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ua();e=lr(a);var o=ir(t,e,a);o!==null&&(Ca(o,t,a),Zi(o,t,a)),t={cache:Px()},e.payload=t;return}t=t.return}}function oP(e,t,a){var o=Ua();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},xd(e)?xv(t,a):(a=Mx(e,t,a,o),a!==null&&(Ca(a,e,o),bv(a,t,o)))}function hv(e,t,a){var o=Ua();eu(e,t,a,o)}function eu(e,t,a,o){var n={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(xd(e))xv(t,n);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var s=t.lastRenderedState,l=r(s,a);if(n.hasEagerState=!0,n.eagerState=l,Ha(l,s))return dd(e,t,n,0),st===null&&fd(),!1}catch{}if(a=Mx(e,t,n,o),a!==null)return Ca(a,e,o),bv(a,t,o),!0}return!1}function Wx(e,t,a,o){if(o={lane:2,revertLane:rb(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},xd(e)){if(t)throw Error(z(479))}else t=Mx(e,a,o,2),t!==null&&Ca(t,e,2)}function xd(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function xv(e,t){kl=Gf=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function bv(e,t,a){if((a&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,a|=o,t.lanes=a,oR(e,a)}}var mu={readContext:Kt,use:gd,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};mu.useEffectEvent=Ct;var yv={readContext:Kt,use:gd,useCallback:function(e,t){return fa().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:aL,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,vf(4194308,4,sv.bind(null,t,e),a)},useLayoutEffect:function(e,t){return vf(4194308,4,e,t)},useInsertionEffect:function(e,t){vf(4,2,e,t)},useMemo:function(e,t){var a=fa();t=t===void 0?null:t;var o=e();if(fs){er(!0);try{e()}finally{er(!1)}}return a.memoizedState=[o,t],o},useReducer:function(e,t,a){var o=fa();if(a!==void 0){var n=a(t);if(fs){er(!0);try{a(t)}finally{er(!1)}}}else n=t;return o.memoizedState=o.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},o.queue=e,e=e.dispatch=oP.bind(null,Ee,e),[o.memoizedState,e]},useRef:function(e){var t=fa();return e={current:e},t.memoizedState=e},useState:function(e){e=Kh(e);var t=e.queue,a=hv.bind(null,Ee,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Yx,useDeferredValue:function(e,t){var a=fa();return Kx(a,e,t)},useTransition:function(){var e=Kh(!1);return e=fv.bind(null,Ee,e.queue,!0,!1),fa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var o=Ee,n=fa();if(Ve){if(a===void 0)throw Error(z(407));a=a()}else{if(a=t(),st===null)throw Error(z(349));(qe&127)!==0||jR(o,t,a)}n.memoizedState=a;var r={value:a,getSnapshot:t};return n.queue=r,aL(KR.bind(null,o,r,e),[e]),o.flags|=2048,Pl(9,{destroy:void 0},YR.bind(null,o,r,a,t),null),a},useId:function(){var e=fa(),t=st.identifierPrefix;if(Ve){var a=Bo,o=No;a=(o&~(1<<32-_a(o)-1)).toString(32)+a,t=\\\"_\\\"+t+\\\"R_\\\"+a,a=Xf++,0<a&&(t+=\\\"H\\\"+a.toString(32)),t+=\\\"_\\\"}else a=WO++,t=\\\"_\\\"+t+\\\"r_\\\"+a.toString(32)+\\\"_\\\";return e.memoizedState=t},useHostTransitionStatus:$x,useFormState:JC,useActionState:JC,useOptimistic:function(e){var t=fa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Wx.bind(null,Ee,!0,a),a.dispatch=t,[e,t]},useMemoCache:Gx,useCacheRefresh:function(){return fa().memoizedState=aP.bind(null,Ee)},useEffectEvent:function(e){var t=fa(),a={impl:e};return t.memoizedState=a,function(){if((Ye&2)!==0)throw Error(z(440));return a.impl.apply(void 0,arguments)}}},Zx={readContext:Kt,use:gd,useCallback:iv,useContext:Kt,useEffect:jx,useImperativeHandle:lv,useInsertionEffect:nv,useLayoutEffect:rv,useMemo:uv,useReducer:Rf,useRef:av,useState:function(){return Rf(kn)},useDebugValue:Yx,useDeferredValue:function(e,t){var a=It();return cv(a,et.memoizedState,e,t)},useTransition:function(){var e=Rf(kn)[0],t=It().memoizedState;return[typeof e==\\\"boolean\\\"?e:ku(e),t]},useSyncExternalStore:XR,useId:mv,useHostTransitionStatus:$x,useFormState:eL,useActionState:eL,useOptimistic:function(e,t){var a=It();return ZR(a,et,e,t)},useMemoCache:Gx,useCacheRefresh:gv};Zx.useEffectEvent=ov;var Sv={readContext:Kt,use:gd,useCallback:iv,useContext:Kt,useEffect:jx,useImperativeHandle:lv,useInsertionEffect:nv,useLayoutEffect:rv,useMemo:uv,useReducer:nh,useRef:av,useState:function(){return nh(kn)},useDebugValue:Yx,useDeferredValue:function(e,t){var a=It();return et===null?Kx(a,e,t):cv(a,et.memoizedState,e,t)},useTransition:function(){var e=nh(kn)[0],t=It().memoizedState;return[typeof e==\\\"boolean\\\"?e:ku(e),t]},useSyncExternalStore:XR,useId:mv,useHostTransitionStatus:$x,useFormState:tL,useActionState:tL,useOptimistic:function(e,t){var a=It();return et!==null?ZR(a,et,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Gx,useCacheRefresh:gv};Sv.useEffectEvent=ov;function rh(e,t,a,o){t=e.memoizedState,a=a(o,t),a=a==null?t:pt({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Zh={enqueueSetState:function(e,t,a){e=e._reactInternals;var o=Ua(),n=lr(o);n.payload=t,a!=null&&(n.callback=a),t=ir(e,n,o),t!==null&&(Ca(t,e,o),Zi(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var o=Ua(),n=lr(o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=ir(e,n,o),t!==null&&(Ca(t,e,o),Zi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ua(),o=lr(a);o.tag=2,t!=null&&(o.callback=t),t=ir(e,o,a),t!==null&&(Ca(t,e,a),Zi(t,e,a))}};function oL(e,t,a,o,n,r,s){return e=e.stateNode,typeof e.shouldComponentUpdate==\\\"function\\\"?e.shouldComponentUpdate(o,r,s):t.prototype&&t.prototype.isPureReactComponent?!uu(a,o)||!uu(n,r):!0}function nL(e,t,a,o){e=t.state,typeof t.componentWillReceiveProps==\\\"function\\\"&&t.componentWillReceiveProps(a,o),typeof t.UNSAFE_componentWillReceiveProps==\\\"function\\\"&&t.UNSAFE_componentWillReceiveProps(a,o),t.state!==e&&Zh.enqueueReplaceState(t,t.state,null)}function ds(e,t){var a=t;if(\\\"ref\\\"in t){a={};for(var o in t)o!==\\\"ref\\\"&&(a[o]=t[o])}if(e=e.defaultProps){a===t&&(a=pt({},a));for(var n in e)a[n]===void 0&&(a[n]=e[n])}return a}function Cv(e){Ff(e)}function Lv(e){console.error(e)}function Rv(e){Ff(e)}function jf(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function rL(e,t,a){try{var o=e.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Qh(e,t,a){return a=lr(a),a.tag=3,a.payload={element:null},a.callback=function(){jf(e,t)},a}function vv(e){return e=lr(e),e.tag=3,e}function Iv(e,t,a,o){var n=a.type.getDerivedStateFromError;if(typeof n==\\\"function\\\"){var r=o.value;e.payload=function(){return n(r)},e.callback=function(){rL(t,a,o)}}var s=a.stateNode;s!==null&&typeof s.componentDidCatch==\\\"function\\\"&&(e.callback=function(){rL(t,a,o),typeof n!=\\\"function\\\"&&(ur===null?ur=new Set([this]):ur.add(this));var l=o.stack;this.componentDidCatch(o.value,{componentStack:l!==null?l:\\\"\\\"})})}function nP(e,t,a,o,n){if(a.flags|=32768,o!==null&&typeof o==\\\"object\\\"&&typeof o.then==\\\"function\\\"){if(t=a.alternate,t!==null&&ql(t,a,n,!0),a=za.current,a!==null){switch(a.tag){case 31:case 13:return so===null?Zf():a.alternate===null&&Lt===0&&(Lt=3),a.flags&=-257,a.flags|=65536,a.lanes=n,o===zf?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([o]):t.add(o),hh(e,o,n)),!1;case 22:return a.flags|=65536,o===zf?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([o]):a.add(o)),hh(e,o,n)),!1}throw Error(z(435,a.tag))}return hh(e,o,n),Zf(),!1}if(Ve)return t=za.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,o!==Uh&&(e=Error(z(422),{cause:o}),fu(no(e,a)))):(o!==Uh&&(t=Error(z(423),{cause:o}),fu(no(t,a))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,o=no(o,a),n=Qh(e.stateNode,o,n),oh(e,n),Lt!==4&&(Lt=2)),!1;var r=Error(z(520),{cause:o});if(r=no(r,a),ou===null?ou=[r]:ou.push(r),Lt!==4&&(Lt=2),t===null)return!0;o=no(o,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=n&-n,a.lanes|=e,e=Qh(a.stateNode,o,e),oh(a,e),!1;case 1:if(t=a.type,r=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError==\\\"function\\\"||r!==null&&typeof r.componentDidCatch==\\\"function\\\"&&(ur===null||!ur.has(r))))return a.flags|=65536,n&=-n,a.lanes|=n,n=vv(n),Iv(n,e,a,o),oh(a,n),!1}a=a.return}while(a!==null);return!1}var Qx=Error(z(461)),Mt=!1;function Xt(e,t,a,o){t.child=e===null?UR(t,null,a,o):cs(t,e.child,a,o)}function sL(e,t,a,o,n){a=a.render;var r=t.ref;if(\\\"ref\\\"in o){var s={};for(var l in o)l!==\\\"ref\\\"&&(s[l]=o[l])}else s=o;return us(t),o=Hx(e,t,a,s,r,n),l=zx(),e!==null&&!Mt?(qx(e,t,n),Tn(e,t,n)):(Ve&&l&&Dx(t),t.flags|=1,Xt(e,t,o,n),t.child)}function lL(e,t,a,o,n){if(e===null){var r=a.type;return typeof r==\\\"function\\\"&&!Ax(r)&&r.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=r,wv(e,t,r,o,n)):(e=Cf(a.type,null,o,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Jx(e,n)){var s=r.memoizedProps;if(a=a.compare,a=a!==null?a:uu,a(s,o)&&e.ref===t.ref)return Tn(e,t,n)}return t.flags|=1,e=Ln(r,o),e.ref=t.ref,e.return=t,t.child=e}function wv(e,t,a,o,n){if(e!==null){var r=e.memoizedProps;if(uu(r,o)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=o=r,Jx(e,n))(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,Tn(e,t,n)}return Jh(e,t,a,o,n)}function kv(e,t,a,o){var n=o.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode===\\\"hidden\\\"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|a:a,e!==null){for(o=t.child=e.child,n=0;o!==null;)n=n|o.lanes|o.childLanes,o=o.sibling;o=n&~r}else o=0,t.child=null;return iL(e,t,r,a,o)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Lf(t,r!==null?r.cachePool:null),r!==null?WC(t,r):jh(),qR(t);else return o=t.lanes=536870912,iL(e,t,r!==null?r.baseLanes|a:a,a,o)}else r!==null?(Lf(t,r.cachePool),WC(t,r),Qn(t),t.memoizedState=null):(e!==null&&Lf(t,null),jh(),Qn(t));return Xt(e,t,n,a),t.child}function Xi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function iL(e,t,a,o,n){var r=Nx();return r=r===null?null:{parent:Et._currentValue,pool:r},t.memoizedState={baseLanes:a,cachePool:r},e!==null&&Lf(t,null),jh(),qR(t),e!==null&&ql(e,t,o,!0),t.childLanes=n,null}function If(e,t){return t=Yf({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uL(e,t,a){return cs(t,e.child,null,a),e=If(t,t.pendingProps),e.flags|=2,Oa(t),t.memoizedState=null,e}function rP(e,t,a){var o=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ve){if(o.mode===\\\"hidden\\\")return e=If(t,o),t.lanes=536870912,Xi(null,e);if(Yh(t),(e=dt)?(e=yI(e,ro),e=e!==null&&e.data===\\\"&\\\"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mr!==null?{id:No,overflow:Bo}:null,retryLane:536870912,hydrationErrors:null},a=DR(e),a.return=t,t.child=a,Yt=t,dt=null)):e=null,e===null)throw gr(t);return t.lanes=536870912,null}return If(t,o)}var r=e.memoizedState;if(r!==null){var s=r.dehydrated;if(Yh(t),n)if(t.flags&256)t.flags&=-257,t=uL(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(z(558));else if(Mt||ql(e,t,a,!1),n=(a&e.childLanes)!==0,Mt||n){if(o=st,o!==null&&(s=nR(o,a),s!==0&&s!==r.retryLane))throw r.retryLane=s,hs(e,s),Ca(o,e,s),Qx;Zf(),t=uL(e,t,a)}else e=r.treeContext,dt=lo(s.nextSibling),Yt=t,Ve=!0,sr=null,ro=!1,e!==null&&PR(t,e),t=If(t,o),t.flags|=4096;return t}return e=Ln(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function wf(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!=\\\"function\\\"&&typeof a!=\\\"object\\\")throw Error(z(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Jh(e,t,a,o,n){return us(t),a=Hx(e,t,a,o,void 0,n),o=zx(),e!==null&&!Mt?(qx(e,t,n),Tn(e,t,n)):(Ve&&o&&Dx(t),t.flags|=1,Xt(e,t,a,n),t.child)}function cL(e,t,a,o,n,r){return us(t),t.updateQueue=null,a=GR(t,o,a,n),VR(e),o=zx(),e!==null&&!Mt?(qx(e,t,r),Tn(e,t,r)):(Ve&&o&&Dx(t),t.flags|=1,Xt(e,t,a,r),t.child)}function fL(e,t,a,o,n){if(us(t),t.stateNode===null){var r=bl,s=a.contextType;typeof s==\\\"object\\\"&&s!==null&&(r=Kt(s)),r=new a(o,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Zh,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=o,r.state=t.memoizedState,r.refs={},Fx(t),s=a.contextType,r.context=typeof s==\\\"object\\\"&&s!==null?Kt(s):bl,r.state=t.memoizedState,s=a.getDerivedStateFromProps,typeof s==\\\"function\\\"&&(rh(t,a,s,o),r.state=t.memoizedState),typeof a.getDerivedStateFromProps==\\\"function\\\"||typeof r.getSnapshotBeforeUpdate==\\\"function\\\"||typeof r.UNSAFE_componentWillMount!=\\\"function\\\"&&typeof r.componentWillMount!=\\\"function\\\"||(s=r.state,typeof r.componentWillMount==\\\"function\\\"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount==\\\"function\\\"&&r.UNSAFE_componentWillMount(),s!==r.state&&Zh.enqueueReplaceState(r,r.state,null),Ji(t,o,r,n),Qi(),r.state=t.memoizedState),typeof r.componentDidMount==\\\"function\\\"&&(t.flags|=4194308),o=!0}else if(e===null){r=t.stateNode;var l=t.memoizedProps,i=ds(a,l);r.props=i;var u=r.context,c=a.contextType;s=bl,typeof c==\\\"object\\\"&&c!==null&&(s=Kt(c));var f=a.getDerivedStateFromProps;c=typeof f==\\\"function\\\"||typeof r.getSnapshotBeforeUpdate==\\\"function\\\",l=t.pendingProps!==l,c||typeof r.UNSAFE_componentWillReceiveProps!=\\\"function\\\"&&typeof r.componentWillReceiveProps!=\\\"function\\\"||(l||u!==s)&&nL(t,r,o,s),$n=!1;var d=t.memoizedState;r.state=d,Ji(t,o,r,n),Qi(),u=t.memoizedState,l||d!==u||$n?(typeof f==\\\"function\\\"&&(rh(t,a,f,o),u=t.memoizedState),(i=$n||oL(t,a,i,o,d,u,s))?(c||typeof r.UNSAFE_componentWillMount!=\\\"function\\\"&&typeof r.componentWillMount!=\\\"function\\\"||(typeof r.componentWillMount==\\\"function\\\"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount==\\\"function\\\"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount==\\\"function\\\"&&(t.flags|=4194308)):(typeof r.componentDidMount==\\\"function\\\"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=u),r.props=o,r.state=u,r.context=s,o=i):(typeof r.componentDidMount==\\\"function\\\"&&(t.flags|=4194308),o=!1)}else{r=t.stateNode,Gh(e,t),s=t.memoizedProps,c=ds(a,s),r.props=c,f=t.pendingProps,d=r.context,u=a.contextType,i=bl,typeof u==\\\"object\\\"&&u!==null&&(i=Kt(u)),l=a.getDerivedStateFromProps,(u=typeof l==\\\"function\\\"||typeof r.getSnapshotBeforeUpdate==\\\"function\\\")||typeof r.UNSAFE_componentWillReceiveProps!=\\\"function\\\"&&typeof r.componentWillReceiveProps!=\\\"function\\\"||(s!==f||d!==i)&&nL(t,r,o,i),$n=!1,d=t.memoizedState,r.state=d,Ji(t,o,r,n),Qi();var p=t.memoizedState;s!==f||d!==p||$n||e!==null&&e.dependencies!==null&&Hf(e.dependencies)?(typeof l==\\\"function\\\"&&(rh(t,a,l,o),p=t.memoizedState),(c=$n||oL(t,a,c,o,d,p,i)||e!==null&&e.dependencies!==null&&Hf(e.dependencies))?(u||typeof r.UNSAFE_componentWillUpdate!=\\\"function\\\"&&typeof r.componentWillUpdate!=\\\"function\\\"||(typeof r.componentWillUpdate==\\\"function\\\"&&r.componentWillUpdate(o,p,i),typeof r.UNSAFE_componentWillUpdate==\\\"function\\\"&&r.UNSAFE_componentWillUpdate(o,p,i)),typeof r.componentDidUpdate==\\\"function\\\"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate==\\\"function\\\"&&(t.flags|=1024)):(typeof r.componentDidUpdate!=\\\"function\\\"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!=\\\"function\\\"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=p),r.props=o,r.state=p,r.context=i,o=c):(typeof r.componentDidUpdate!=\\\"function\\\"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!=\\\"function\\\"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),o=!1)}return r=o,wf(e,t),o=(t.flags&128)!==0,r||o?(r=t.stateNode,a=o&&typeof a.getDerivedStateFromError!=\\\"function\\\"?null:r.render(),t.flags|=1,e!==null&&o?(t.child=cs(t,e.child,null,n),t.child=cs(t,null,a,n)):Xt(e,t,a,n),t.memoizedState=r.state,e=t.child):e=Tn(e,t,n),e}function dL(e,t,a,o){return is(),t.flags|=256,Xt(e,t,a,o),t.child}var sh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lh(e){return{baseLanes:e,cachePool:BR()}}function ih(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Na),e}function Tv(e,t,a){var o=t.pendingProps,n=!1,r=(t.flags&128)!==0,s;if((s=r)||(s=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),s&&(n=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ve){if(n?Zn(t):Qn(t),(e=dt)?(e=yI(e,ro),e=e!==null&&e.data!==\\\"&\\\"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mr!==null?{id:No,overflow:Bo}:null,retryLane:536870912,hydrationErrors:null},a=DR(e),a.return=t,t.child=a,Yt=t,dt=null)):e=null,e===null)throw gr(t);return px(e)?t.lanes=32:t.lanes=536870912,null}var l=o.children;return o=o.fallback,n?(Qn(t),n=t.mode,l=Yf({mode:\\\"hidden\\\",children:l},n),o=ns(o,n,a,null),l.return=t,o.return=t,l.sibling=o,t.child=l,o=t.child,o.memoizedState=lh(a),o.childLanes=ih(e,s,a),t.memoizedState=sh,Xi(null,o)):(Zn(t),ex(t,l))}var i=e.memoizedState;if(i!==null&&(l=i.dehydrated,l!==null)){if(r)t.flags&256?(Zn(t),t.flags&=-257,t=uh(e,t,a)):t.memoizedState!==null?(Qn(t),t.child=e.child,t.flags|=128,t=null):(Qn(t),l=o.fallback,n=t.mode,o=Yf({mode:\\\"visible\\\",children:o.children},n),l=ns(l,n,a,null),l.flags|=2,o.return=t,l.return=t,o.sibling=l,t.child=o,cs(t,e.child,null,a),o=t.child,o.memoizedState=lh(a),o.childLanes=ih(e,s,a),t.memoizedState=sh,t=Xi(null,o));else if(Zn(t),px(l)){if(s=l.nextSibling&&l.nextSibling.dataset,s)var u=s.dgst;s=u,o=Error(z(419)),o.stack=\\\"\\\",o.digest=s,fu({value:o,source:null,stack:null}),t=uh(e,t,a)}else if(Mt||ql(e,t,a,!1),s=(a&e.childLanes)!==0,Mt||s){if(s=st,s!==null&&(o=nR(s,a),o!==0&&o!==i.retryLane))throw i.retryLane=o,hs(e,o),Ca(s,e,o),Qx;dx(l)||Zf(),t=uh(e,t,a)}else dx(l)?(t.flags|=192,t.child=e.child,t=null):(e=i.treeContext,dt=lo(l.nextSibling),Yt=t,Ve=!0,sr=null,ro=!1,e!==null&&PR(t,e),t=ex(t,o.children),t.flags|=4096);return t}return n?(Qn(t),l=o.fallback,n=t.mode,i=e.child,u=i.sibling,o=Ln(i,{mode:\\\"hidden\\\",children:o.children}),o.subtreeFlags=i.subtreeFlags&65011712,u!==null?l=Ln(u,l):(l=ns(l,n,a,null),l.flags|=2),l.return=t,o.return=t,o.sibling=l,t.child=o,Xi(null,o),o=t.child,l=e.child.memoizedState,l===null?l=lh(a):(n=l.cachePool,n!==null?(i=Et._currentValue,n=n.parent!==i?{parent:i,pool:i}:n):n=BR(),l={baseLanes:l.baseLanes|a,cachePool:n}),o.memoizedState=l,o.childLanes=ih(e,s,a),t.memoizedState=sh,Xi(e.child,o)):(Zn(t),a=e.child,e=a.sibling,a=Ln(a,{mode:\\\"visible\\\",children:o.children}),a.return=t,a.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=a,t.memoizedState=null,a)}function ex(e,t){return t=Yf({mode:\\\"visible\\\",children:t},e.mode),t.return=e,e.child=t}function Yf(e,t){return e=Pa(22,e,null,t),e.lanes=0,e}function uh(e,t,a){return cs(t,e.child,null,a),e=ex(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pL(e,t,a){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),zh(e.return,t,a)}function ch(e,t,a,o,n,r){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:n,treeForkCount:r}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=o,s.tail=a,s.tailMode=n,s.treeForkCount=r)}function Ev(e,t,a){var o=t.pendingProps,n=o.revealOrder,r=o.tail;o=o.children;var s=vt.current,l=(s&2)!==0;if(l?(s=s&1|2,t.flags|=128):s&=1,ut(vt,s),Xt(e,t,o,a),o=Ve?cu:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&pL(e,a,t);else if(e.tag===19)pL(e,a,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(a=t.child,n=null;a!==null;)e=a.alternate,e!==null&&Vf(e)===null&&(n=a),a=a.sibling;a=n,a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null),ch(t,!1,n,a,r,o);break;case\\\"backwards\\\":case\\\"unstable_legacy-backwards\\\":for(a=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Vf(e)===null){t.child=n;break}e=n.sibling,n.sibling=a,a=n,n=e}ch(t,!0,a,null,r,o);break;case\\\"together\\\":ch(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function Tn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),xr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(ql(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,a=Ln(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ln(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Jx(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Hf(e)))}function sP(e,t,a){switch(t.tag){case 3:Of(t,t.stateNode.containerInfo),Wn(t,Et,e.memoizedState.cache),is();break;case 27:case 5:Th(t);break;case 4:Of(t,t.stateNode.containerInfo);break;case 10:Wn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Yh(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Zn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Tv(e,t,a):(Zn(t),e=Tn(e,t,a),e!==null?e.sibling:null);Zn(t);break;case 19:var n=(e.flags&128)!==0;if(o=(a&t.childLanes)!==0,o||(ql(e,t,a,!1),o=(a&t.childLanes)!==0),n){if(o)return Ev(e,t,a);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),ut(vt,vt.current),o)break;return null;case 22:return t.lanes=0,kv(e,t,a,t.pendingProps);case 24:Wn(t,Et,e.memoizedState.cache)}return Tn(e,t,a)}function Mv(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!Jx(e,a)&&(t.flags&128)===0)return Mt=!1,sP(e,t,a);Mt=(e.flags&131072)!==0}else Mt=!1,Ve&&(t.flags&1048576)!==0&&OR(t,cu,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=ts(t.elementType),t.type=e,typeof e==\\\"function\\\")Ax(e)?(o=ds(e,o),t.tag=1,t=fL(null,t,e,o,a)):(t.tag=0,t=Jh(null,t,e,o,a));else{if(e!=null){var n=e.$$typeof;if(n===xx){t.tag=11,t=sL(null,t,e,o,a);break e}else if(n===bx){t.tag=14,t=lL(null,t,e,o,a);break e}}throw t=wh(e)||e,Error(z(306,t,\\\"\\\"))}}return t;case 0:return Jh(e,t,t.type,t.pendingProps,a);case 1:return o=t.type,n=ds(o,t.pendingProps),fL(e,t,o,n,a);case 3:e:{if(Of(t,t.stateNode.containerInfo),e===null)throw Error(z(387));o=t.pendingProps;var r=t.memoizedState;n=r.element,Gh(e,t),Ji(t,o,null,a);var s=t.memoizedState;if(o=s.cache,Wn(t,Et,o),o!==r.cache&&qh(t,[Et],a,!0),Qi(),o=s.element,r.isDehydrated)if(r={element:o,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=dL(e,t,o,a);break e}else if(o!==n){n=no(Error(z(424)),t),fu(n),t=dL(e,t,o,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName===\\\"HTML\\\"?e.ownerDocument.body:e,dt=lo(e.firstChild),Yt=t,Ve=!0,sr=null,ro=!0,a=UR(t,null,o,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(is(),o===n){t=Tn(e,t,a);break e}Xt(e,t,o,a)}t=t.child}return t;case 26:return wf(e,t),e===null?(a=NL(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ve||(a=t.type,e=t.pendingProps,o=td(rr.current).createElement(a),o[jt]=t,o[La]=e,$t(o,a,e),Ht(o),t.stateNode=o):t.memoizedState=NL(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Th(t),e===null&&Ve&&(o=t.stateNode=SI(t.type,t.pendingProps,rr.current),Yt=t,ro=!0,n=dt,yr(t.type)?(mx=n,dt=lo(o.firstChild)):dt=n),Xt(e,t,t.pendingProps.children,a),wf(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ve&&((n=o=dt)&&(o=PP(o,t.type,t.pendingProps,ro),o!==null?(t.stateNode=o,Yt=t,dt=lo(o.firstChild),ro=!1,n=!0):n=!1),n||gr(t)),Th(t),n=t.type,r=t.pendingProps,s=e!==null?e.memoizedProps:null,o=r.children,cx(n,r)?o=null:s!==null&&cx(n,s)&&(t.flags|=32),t.memoizedState!==null&&(n=Hx(e,t,ZO,null,null,a),xu._currentValue=n),wf(e,t),Xt(e,t,o,a),t.child;case 6:return e===null&&Ve&&((e=a=dt)&&(a=NP(a,t.pendingProps,ro),a!==null?(t.stateNode=a,Yt=t,dt=null,e=!0):e=!1),e||gr(t)),null;case 13:return Tv(e,t,a);case 4:return Of(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=cs(t,null,o,a):Xt(e,t,o,a),t.child;case 11:return sL(e,t,t.type,t.pendingProps,a);case 7:return Xt(e,t,t.pendingProps,a),t.child;case 8:return Xt(e,t,t.pendingProps.children,a),t.child;case 12:return Xt(e,t,t.pendingProps.children,a),t.child;case 10:return o=t.pendingProps,Wn(t,t.type,o.value),Xt(e,t,o.children,a),t.child;case 9:return n=t.type._context,o=t.pendingProps.children,us(t),n=Kt(n),o=o(n),t.flags|=1,Xt(e,t,o,a),t.child;case 14:return lL(e,t,t.type,t.pendingProps,a);case 15:return wv(e,t,t.type,t.pendingProps,a);case 19:return Ev(e,t,a);case 31:return rP(e,t,a);case 22:return kv(e,t,a,t.pendingProps);case 24:return us(t),o=Kt(Et),e===null?(n=Nx(),n===null&&(n=st,r=Px(),n.pooledCache=r,r.refCount++,r!==null&&(n.pooledCacheLanes|=a),n=r),t.memoizedState={parent:o,cache:n},Fx(t),Wn(t,Et,n)):((e.lanes&a)!==0&&(Gh(e,t),Ji(t,null,null,a),Qi()),n=e.memoizedState,r=t.memoizedState,n.parent!==o?(n={parent:o,cache:o},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),Wn(t,Et,o)):(o=r.cache,Wn(t,Et,o),o!==n.cache&&qh(t,[Et],a,!0))),Xt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(z(156,t.tag))}function pn(e){e.flags|=4}function fh(e,t,a,o,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(eI())e.flags|=8192;else throw ss=zf,Bx}else e.flags&=-16777217}function mL(e,t){if(t.type!==\\\"stylesheet\\\"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!RI(t))if(eI())e.flags|=8192;else throw ss=zf,Bx}function cf(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?tR():536870912,e.lanes|=t,Nl|=t)}function _i(e,t){if(!Ve)switch(e.tailMode){case\\\"hidden\\\":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case\\\"collapsed\\\":a=e.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,o=0;if(t)for(var n=e.child;n!==null;)a|=n.lanes|n.childLanes,o|=n.subtreeFlags&65011712,o|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)a|=n.lanes|n.childLanes,o|=n.subtreeFlags,o|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=o,e.childLanes=a,t}function lP(e,t,a){var o=t.pendingProps;switch(Ox(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return a=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),Rn(Et),El(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(sl(t)?pn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ah())),ft(t),null;case 26:var n=t.type,r=t.memoizedState;return e===null?(pn(t),r!==null?(ft(t),mL(t,r)):(ft(t),fh(t,n,null,o,a))):r?r!==e.memoizedState?(pn(t),ft(t),mL(t,r)):(ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&pn(t),ft(t),fh(t,n,e,o,a)),null;case 27:if(Pf(t),a=rr.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&pn(t);else{if(!o){if(t.stateNode===null)throw Error(z(166));return ft(t),null}e=_o.current,sl(t)?VC(t,e):(e=SI(n,o,a),t.stateNode=e,pn(t))}return ft(t),null;case 5:if(Pf(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&pn(t);else{if(!o){if(t.stateNode===null)throw Error(z(166));return ft(t),null}if(r=_o.current,sl(t))VC(t,r);else{var s=td(rr.current);switch(r){case 1:r=s.createElementNS(\\\"http://www.w3.org/2000/svg\\\",n);break;case 2:r=s.createElementNS(\\\"http://www.w3.org/1998/Math/MathML\\\",n);break;default:switch(n){case\\\"svg\\\":r=s.createElementNS(\\\"http://www.w3.org/2000/svg\\\",n);break;case\\\"math\\\":r=s.createElementNS(\\\"http://www.w3.org/1998/Math/MathML\\\",n);break;case\\\"script\\\":r=s.createElement(\\\"div\\\"),r.innerHTML=\\\"<script><\\\\/script>\\\",r=r.removeChild(r.firstChild);break;case\\\"select\\\":r=typeof o.is==\\\"string\\\"?s.createElement(\\\"select\\\",{is:o.is}):s.createElement(\\\"select\\\"),o.multiple?r.multiple=!0:o.size&&(r.size=o.size);break;default:r=typeof o.is==\\\"string\\\"?s.createElement(n,{is:o.is}):s.createElement(n)}}r[jt]=t,r[La]=o;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)r.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=r;e:switch($t(r,n,o),n){case\\\"button\\\":case\\\"input\\\":case\\\"select\\\":case\\\"textarea\\\":o=!!o.autoFocus;break e;case\\\"img\\\":o=!0;break e;default:o=!1}o&&pn(t)}}return ft(t),fh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&pn(t);else{if(typeof o!=\\\"string\\\"&&t.stateNode===null)throw Error(z(166));if(e=rr.current,sl(t)){if(e=t.stateNode,a=t.memoizedProps,o=null,n=Yt,n!==null)switch(n.tag){case 27:case 5:o=n.memoizedProps}e[jt]=t,e=!!(e.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||hI(e.nodeValue,a)),e||gr(t,!0)}else e=td(e).createTextNode(o),e[jt]=t,t.stateNode=e}return ft(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(o=sl(t),a!==null){if(e===null){if(!o)throw Error(z(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(557));e[jt]=t}else is(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),e=!1}else a=ah(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Oa(t),t):(Oa(t),null);if((t.flags&128)!==0)throw Error(z(558))}return ft(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=sl(t),o!==null&&o.dehydrated!==null){if(e===null){if(!n)throw Error(z(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(z(317));n[jt]=t}else is(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),n=!1}else n=ah(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(Oa(t),t):(Oa(t),null)}return Oa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=o!==null,e=e!==null&&e.memoizedState!==null,a&&(o=t.child,n=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(n=o.alternate.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==n&&(o.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),cf(t,t.updateQueue),ft(t),null);case 4:return El(),e===null&&sb(t.stateNode.containerInfo),ft(t),null;case 10:return Rn(t.type),ft(t),null;case 19:if(zt(vt),o=t.memoizedState,o===null)return ft(t),null;if(n=(t.flags&128)!==0,r=o.rendering,r===null)if(n)_i(o,!1);else{if(Lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Vf(e),r!==null){for(t.flags|=128,_i(o,!1),e=r.updateQueue,t.updateQueue=e,cf(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)AR(a,e),a=a.sibling;return ut(vt,vt.current&1|2),Ve&&xn(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Ba()>$f&&(t.flags|=128,n=!0,_i(o,!1),t.lanes=4194304)}else{if(!n)if(e=Vf(r),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,cf(t,e),_i(o,!0),o.tail===null&&o.tailMode===\\\"hidden\\\"&&!r.alternate&&!Ve)return ft(t),null}else 2*Ba()-o.renderingStartTime>$f&&a!==536870912&&(t.flags|=128,n=!0,_i(o,!1),t.lanes=4194304);o.isBackwards?(r.sibling=t.child,t.child=r):(e=o.last,e!==null?e.sibling=r:t.child=r,o.last=r)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ba(),e.sibling=null,a=vt.current,ut(vt,n?a&1|2:a&1),Ve&&xn(t,o.treeForkCount),e):(ft(t),null);case 22:case 23:return Oa(t),_x(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(a&536870912)!==0&&(t.flags&128)===0&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),a=t.updateQueue,a!==null&&cf(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==a&&(t.flags|=2048),e!==null&&zt(rs),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Rn(Et),ft(t),null;case 25:return null;case 30:return null}throw Error(z(156,t.tag))}function iP(e,t){switch(Ox(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rn(Et),El(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pf(t),null;case 31:if(t.memoizedState!==null){if(Oa(t),t.alternate===null)throw Error(z(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Oa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zt(vt),null;case 4:return El(),null;case 10:return Rn(t.type),null;case 22:case 23:return Oa(t),_x(),e!==null&&zt(rs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Rn(Et),null;case 25:return null;default:return null}}function Av(e,t){switch(Ox(t),t.tag){case 3:Rn(Et),El();break;case 26:case 27:case 5:Pf(t);break;case 4:El();break;case 31:t.memoizedState!==null&&Oa(t);break;case 13:Oa(t);break;case 19:zt(vt);break;case 10:Rn(t.type);break;case 22:case 23:Oa(t),_x(),e!==null&&zt(rs);break;case 24:Rn(Et)}}function Tu(e,t){try{var a=t.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var n=o.next;a=n;do{if((a.tag&e)===e){o=void 0;var r=a.create,s=a.inst;o=r(),s.destroy=o}a=a.next}while(a!==n)}}catch(l){We(t,t.return,l)}}function hr(e,t,a){try{var o=t.updateQueue,n=o!==null?o.lastEffect:null;if(n!==null){var r=n.next;o=r;do{if((o.tag&e)===e){var s=o.inst,l=s.destroy;if(l!==void 0){s.destroy=void 0,n=t;var i=a,u=l;try{u()}catch(c){We(n,i,c)}}}o=o.next}while(o!==r)}}catch(c){We(t,t.return,c)}}function Dv(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{zR(t,a)}catch(o){We(e,e.return,o)}}}function Ov(e,t,a){a.props=ds(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(o){We(e,t,o)}}function tu(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof a==\\\"function\\\"?e.refCleanup=a(o):a.current=o}}catch(n){We(e,t,n)}}function Fo(e,t){var a=e.ref,o=e.refCleanup;if(a!==null)if(typeof o==\\\"function\\\")try{o()}catch(n){We(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a==\\\"function\\\")try{a(null)}catch(n){We(e,t,n)}else a.current=null}function Pv(e){var t=e.type,a=e.memoizedProps,o=e.stateNode;try{e:switch(t){case\\\"button\\\":case\\\"input\\\":case\\\"select\\\":case\\\"textarea\\\":a.autoFocus&&o.focus();break e;case\\\"img\\\":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(n){We(e,e.return,n)}}function dh(e,t,a){try{var o=e.stateNode;TP(o,e.type,a,t),o[La]=t}catch(n){We(e,e.return,n)}}function Nv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&yr(e.type)||e.tag===4}function ph(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nv(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&&yr(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 tx(e,t,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName===\\\"HTML\\\"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName===\\\"HTML\\\"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Sn));else if(o!==4&&(o===27&&yr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(tx(e,t,a),e=e.sibling;e!==null;)tx(e,t,a),e=e.sibling}function Kf(e,t,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(o!==4&&(o===27&&yr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Kf(e,t,a),e=e.sibling;e!==null;)Kf(e,t,a),e=e.sibling}function Bv(e){var t=e.stateNode,a=e.memoizedProps;try{for(var o=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);$t(t,o,a),t[jt]=e,t[La]=a}catch(r){We(e,e.return,r)}}var bn=!1,Tt=!1,mh=!1,gL=typeof WeakSet==\\\"function\\\"?WeakSet:Set,Ut=null;function uP(e,t){if(e=e.containerInfo,ix=rd,e=RR(e),Tx(e)){if(\\\"selectionStart\\\"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var n=o.anchorOffset,r=o.focusNode;o=o.focusOffset;try{a.nodeType,r.nodeType}catch{a=null;break e}var s=0,l=-1,i=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var p;f!==a||n!==0&&f.nodeType!==3||(l=s+n),f!==r||o!==0&&f.nodeType!==3||(i=s+o),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===e)break t;if(d===a&&++u===n&&(l=s),d===r&&++c===o&&(i=s),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}a=l===-1||i===-1?null:{start:l,end:i}}else a=null}a=a||{start:0,end:0}}else a=null;for(ux={focusedElem:e,selectionRange:a},rd=!1,Ut=t;Ut!==null;)if(t=Ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ut=e;else for(;Ut!==null;){switch(t=Ut,r=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(a=0;a<e.length;a++)n=e[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,a=t,n=r.memoizedProps,r=r.memoizedState,o=a.stateNode;try{var x=ds(a.type,n);e=o.getSnapshotBeforeUpdate(x,r),o.__reactInternalSnapshotBeforeUpdate=e}catch(b){We(a,a.return,b)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)fx(e);else if(a===1)switch(e.nodeName){case\\\"HEAD\\\":case\\\"HTML\\\":case\\\"BODY\\\":fx(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(z(163))}if(e=t.sibling,e!==null){e.return=t.return,Ut=e;break}Ut=t.return}}function Fv(e,t,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:gn(e,a),o&4&&Tu(5,a);break;case 1:if(gn(e,a),o&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(s){We(a,a.return,s)}else{var n=ds(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){We(a,a.return,s)}}o&64&&Dv(a),o&512&&tu(a,a.return);break;case 3:if(gn(e,a),o&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{zR(e,t)}catch(s){We(a,a.return,s)}}break;case 27:t===null&&o&4&&Bv(a);case 26:case 5:gn(e,a),t===null&&o&4&&Pv(a),o&512&&tu(a,a.return);break;case 12:gn(e,a);break;case 31:gn(e,a),o&4&&Hv(e,a);break;case 13:gn(e,a),o&4&&zv(e,a),o&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=bP.bind(null,a),BP(e,a))));break;case 22:if(o=a.memoizedState!==null||bn,!o){t=t!==null&&t.memoizedState!==null||Tt,n=bn;var r=Tt;bn=o,(Tt=t)&&!r?hn(e,a,(a.subtreeFlags&8772)!==0):gn(e,a),bn=n,Tt=r}break;case 30:break;default:gn(e,a)}}function _v(e){var t=e.alternate;t!==null&&(e.alternate=null,_v(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Lx(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 ht=null,ya=!1;function mn(e,t,a){for(a=a.child;a!==null;)Uv(e,t,a),a=a.sibling}function Uv(e,t,a){if(Fa&&typeof Fa.onCommitFiberUnmount==\\\"function\\\")try{Fa.onCommitFiberUnmount(Cu,a)}catch{}switch(a.tag){case 26:Tt||Fo(a,t),mn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Tt||Fo(a,t);var o=ht,n=ya;yr(a.type)&&(ht=a.stateNode,ya=!1),mn(e,t,a),ru(a.stateNode),ht=o,ya=n;break;case 5:Tt||Fo(a,t);case 6:if(o=ht,n=ya,ht=null,mn(e,t,a),ht=o,ya=n,ht!==null)if(ya)try{(ht.nodeType===9?ht.body:ht.nodeName===\\\"HTML\\\"?ht.ownerDocument.body:ht).removeChild(a.stateNode)}catch(r){We(a,t,r)}else try{ht.removeChild(a.stateNode)}catch(r){We(a,t,r)}break;case 18:ht!==null&&(ya?(e=ht,ML(e.nodeType===9?e.body:e.nodeName===\\\"HTML\\\"?e.ownerDocument.body:e,a.stateNode),Ul(e)):ML(ht,a.stateNode));break;case 4:o=ht,n=ya,ht=a.stateNode.containerInfo,ya=!0,mn(e,t,a),ht=o,ya=n;break;case 0:case 11:case 14:case 15:hr(2,a,t),Tt||hr(4,a,t),mn(e,t,a);break;case 1:Tt||(Fo(a,t),o=a.stateNode,typeof o.componentWillUnmount==\\\"function\\\"&&Ov(a,t,o)),mn(e,t,a);break;case 21:mn(e,t,a);break;case 22:Tt=(o=Tt)||a.memoizedState!==null,mn(e,t,a),Tt=o;break;default:mn(e,t,a)}}function Hv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ul(e)}catch(a){We(t,t.return,a)}}}function zv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ul(e)}catch(a){We(t,t.return,a)}}function cP(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new gL),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new gL),t;default:throw Error(z(435,e.tag))}}function ff(e,t){var a=cP(e);t.forEach(function(o){if(!a.has(o)){a.add(o);var n=yP.bind(null,e,o);o.then(n,n)}})}function xa(e,t){var a=t.deletions;if(a!==null)for(var o=0;o<a.length;o++){var n=a[o],r=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 27:if(yr(l.type)){ht=l.stateNode,ya=!1;break e}break;case 5:ht=l.stateNode,ya=!1;break e;case 3:case 4:ht=l.stateNode.containerInfo,ya=!0;break e}l=l.return}if(ht===null)throw Error(z(160));Uv(r,s,n),ht=null,ya=!1,r=n.alternate,r!==null&&(r.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)qv(t,e),t=t.sibling}var So=null;function qv(e,t){var a=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xa(t,e),ba(e),o&4&&(hr(3,e,e.return),Tu(3,e),hr(5,e,e.return));break;case 1:xa(t,e),ba(e),o&512&&(Tt||a===null||Fo(a,a.return)),o&64&&bn&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var n=So;if(xa(t,e),ba(e),o&512&&(Tt||a===null||Fo(a,a.return)),o&4){var r=a!==null?a.memoizedState:null;if(o=e.memoizedState,a===null)if(o===null)if(e.stateNode===null){e:{o=e.type,a=e.memoizedProps,n=n.ownerDocument||n;t:switch(o){case\\\"title\\\":r=n.getElementsByTagName(\\\"title\\\")[0],(!r||r[vu]||r[jt]||r.namespaceURI===\\\"http://www.w3.org/2000/svg\\\"||r.hasAttribute(\\\"itemprop\\\"))&&(r=n.createElement(o),n.head.insertBefore(r,n.querySelector(\\\"head > title\\\"))),$t(r,o,a),r[jt]=e,Ht(r),o=r;break e;case\\\"link\\\":var s=FL(\\\"link\\\",\\\"href\\\",n).get(o+(a.href||\\\"\\\"));if(s){for(var l=0;l<s.length;l++)if(r=s[l],r.getAttribute(\\\"href\\\")===(a.href==null||a.href===\\\"\\\"?null:a.href)&&r.getAttribute(\\\"rel\\\")===(a.rel==null?null:a.rel)&&r.getAttribute(\\\"title\\\")===(a.title==null?null:a.title)&&r.getAttribute(\\\"crossorigin\\\")===(a.crossOrigin==null?null:a.crossOrigin)){s.splice(l,1);break t}}r=n.createElement(o),$t(r,o,a),n.head.appendChild(r);break;case\\\"meta\\\":if(s=FL(\\\"meta\\\",\\\"content\\\",n).get(o+(a.content||\\\"\\\"))){for(l=0;l<s.length;l++)if(r=s[l],r.getAttribute(\\\"content\\\")===(a.content==null?null:\\\"\\\"+a.content)&&r.getAttribute(\\\"name\\\")===(a.name==null?null:a.name)&&r.getAttribute(\\\"property\\\")===(a.property==null?null:a.property)&&r.getAttribute(\\\"http-equiv\\\")===(a.httpEquiv==null?null:a.httpEquiv)&&r.getAttribute(\\\"charset\\\")===(a.charSet==null?null:a.charSet)){s.splice(l,1);break t}}r=n.createElement(o),$t(r,o,a),n.head.appendChild(r);break;default:throw Error(z(468,o))}r[jt]=e,Ht(r),o=r}e.stateNode=o}else _L(n,e.type,e.stateNode);else e.stateNode=BL(n,o,e.memoizedProps);else r!==o?(r===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):r.count--,o===null?_L(n,e.type,e.stateNode):BL(n,o,e.memoizedProps)):o===null&&e.stateNode!==null&&dh(e,e.memoizedProps,a.memoizedProps)}break;case 27:xa(t,e),ba(e),o&512&&(Tt||a===null||Fo(a,a.return)),a!==null&&o&4&&dh(e,e.memoizedProps,a.memoizedProps);break;case 5:if(xa(t,e),ba(e),o&512&&(Tt||a===null||Fo(a,a.return)),e.flags&32){n=e.stateNode;try{Al(n,\\\"\\\")}catch(x){We(e,e.return,x)}}o&4&&e.stateNode!=null&&(n=e.memoizedProps,dh(e,n,a!==null?a.memoizedProps:n)),o&1024&&(mh=!0);break;case 6:if(xa(t,e),ba(e),o&4){if(e.stateNode===null)throw Error(z(162));o=e.memoizedProps,a=e.stateNode;try{a.nodeValue=o}catch(x){We(e,e.return,x)}}break;case 3:if(Ef=null,n=So,So=ad(t.containerInfo),xa(t,e),So=n,ba(e),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Ul(t.containerInfo)}catch(x){We(e,e.return,x)}mh&&(mh=!1,Vv(e));break;case 4:o=So,So=ad(e.stateNode.containerInfo),xa(t,e),ba(e),So=o;break;case 12:xa(t,e),ba(e);break;case 31:xa(t,e),ba(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ff(e,o)));break;case 13:xa(t,e),ba(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(bd=Ba()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ff(e,o)));break;case 22:n=e.memoizedState!==null;var i=a!==null&&a.memoizedState!==null,u=bn,c=Tt;if(bn=u||n,Tt=c||i,xa(t,e),Tt=c,bn=u,ba(e),o&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(a===null||i||bn||Tt||as(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){i=a=t;try{if(r=i.stateNode,n)s=r.style,typeof s.setProperty==\\\"function\\\"?s.setProperty(\\\"display\\\",\\\"none\\\",\\\"important\\\"):s.display=\\\"none\\\";else{l=i.stateNode;var f=i.memoizedProps.style,d=f!=null&&f.hasOwnProperty(\\\"display\\\")?f.display:null;l.style.display=d==null||typeof d==\\\"boolean\\\"?\\\"\\\":(\\\"\\\"+d).trim()}}catch(x){We(i,i.return,x)}}}else if(t.tag===6){if(a===null){i=t;try{i.stateNode.nodeValue=n?\\\"\\\":i.memoizedProps}catch(x){We(i,i.return,x)}}}else if(t.tag===18){if(a===null){i=t;try{var p=i.stateNode;n?AL(p,!0):AL(i.stateNode,!1)}catch(x){We(i,i.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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,ff(e,a))));break;case 19:xa(t,e),ba(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ff(e,o)));break;case 30:break;case 21:break;default:xa(t,e),ba(e)}}function ba(e){var t=e.flags;if(t&2){try{for(var a,o=e.return;o!==null;){if(Nv(o)){a=o;break}o=o.return}if(a==null)throw Error(z(160));switch(a.tag){case 27:var n=a.stateNode,r=ph(e);Kf(e,r,n);break;case 5:var s=a.stateNode;a.flags&32&&(Al(s,\\\"\\\"),a.flags&=-33);var l=ph(e);Kf(e,l,s);break;case 3:case 4:var i=a.stateNode.containerInfo,u=ph(e);tx(e,u,i);break;default:throw Error(z(161))}}catch(c){We(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Vv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Fv(e,t.alternate,t),t=t.sibling}function as(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:hr(4,t,t.return),as(t);break;case 1:Fo(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount==\\\"function\\\"&&Ov(t,t.return,a),as(t);break;case 27:ru(t.stateNode);case 26:case 5:Fo(t,t.return),as(t);break;case 22:t.memoizedState===null&&as(t);break;case 30:as(t);break;default:as(t)}e=e.sibling}}function hn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,n=e,r=t,s=r.flags;switch(r.tag){case 0:case 11:case 15:hn(n,r,a),Tu(4,r);break;case 1:if(hn(n,r,a),o=r,n=o.stateNode,typeof n.componentDidMount==\\\"function\\\")try{n.componentDidMount()}catch(u){We(o,o.return,u)}if(o=r,n=o.updateQueue,n!==null){var l=o.stateNode;try{var i=n.shared.hiddenCallbacks;if(i!==null)for(n.shared.hiddenCallbacks=null,n=0;n<i.length;n++)HR(i[n],l)}catch(u){We(o,o.return,u)}}a&&s&64&&Dv(r),tu(r,r.return);break;case 27:Bv(r);case 26:case 5:hn(n,r,a),a&&o===null&&s&4&&Pv(r),tu(r,r.return);break;case 12:hn(n,r,a);break;case 31:hn(n,r,a),a&&s&4&&Hv(n,r);break;case 13:hn(n,r,a),a&&s&4&&zv(n,r);break;case 22:r.memoizedState===null&&hn(n,r,a),tu(r,r.return);break;case 30:break;default:hn(n,r,a)}t=t.sibling}}function eb(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&wu(a))}function tb(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wu(e))}function yo(e,t,a,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gv(e,t,a,o),t=t.sibling}function Gv(e,t,a,o){var n=t.flags;switch(t.tag){case 0:case 11:case 15:yo(e,t,a,o),n&2048&&Tu(9,t);break;case 1:yo(e,t,a,o);break;case 3:yo(e,t,a,o),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wu(e)));break;case 12:if(n&2048){yo(e,t,a,o),e=t.stateNode;try{var r=t.memoizedProps,s=r.id,l=r.onPostCommit;typeof l==\\\"function\\\"&&l(s,t.alternate===null?\\\"mount\\\":\\\"update\\\",e.passiveEffectDuration,-0)}catch(i){We(t,t.return,i)}}else yo(e,t,a,o);break;case 31:yo(e,t,a,o);break;case 13:yo(e,t,a,o);break;case 23:break;case 22:r=t.stateNode,s=t.alternate,t.memoizedState!==null?r._visibility&2?yo(e,t,a,o):au(e,t):r._visibility&2?yo(e,t,a,o):(r._visibility|=2,il(e,t,a,o,(t.subtreeFlags&10256)!==0||!1)),n&2048&&eb(s,t);break;case 24:yo(e,t,a,o),n&2048&&tb(t.alternate,t);break;default:yo(e,t,a,o)}}function il(e,t,a,o,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,s=t,l=a,i=o,u=s.flags;switch(s.tag){case 0:case 11:case 15:il(r,s,l,i,n),Tu(8,s);break;case 23:break;case 22:var c=s.stateNode;s.memoizedState!==null?c._visibility&2?il(r,s,l,i,n):au(r,s):(c._visibility|=2,il(r,s,l,i,n)),n&&u&2048&&eb(s.alternate,s);break;case 24:il(r,s,l,i,n),n&&u&2048&&tb(s.alternate,s);break;default:il(r,s,l,i,n)}t=t.sibling}}function au(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,o=t,n=o.flags;switch(o.tag){case 22:au(a,o),n&2048&&eb(o.alternate,o);break;case 24:au(a,o),n&2048&&tb(o.alternate,o);break;default:au(a,o)}t=t.sibling}}var ji=8192;function ll(e,t,a){if(e.subtreeFlags&ji)for(e=e.child;e!==null;)Xv(e,t,a),e=e.sibling}function Xv(e,t,a){switch(e.tag){case 26:ll(e,t,a),e.flags&ji&&e.memoizedState!==null&&KP(a,So,e.memoizedState,e.memoizedProps);break;case 5:ll(e,t,a);break;case 3:case 4:var o=So;So=ad(e.stateNode.containerInfo),ll(e,t,a),So=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=ji,ji=16777216,ll(e,t,a),ji=o):ll(e,t,a));break;default:ll(e,t,a)}}function jv(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 Ui(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var o=t[a];Ut=o,Kv(o,e)}jv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yv(e),e=e.sibling}function Yv(e){switch(e.tag){case 0:case 11:case 15:Ui(e),e.flags&2048&&hr(9,e,e.return);break;case 3:Ui(e);break;case 12:Ui(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kf(e)):Ui(e);break;default:Ui(e)}}function kf(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var o=t[a];Ut=o,Kv(o,e)}jv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:hr(8,t,t.return),kf(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,kf(t));break;default:kf(t)}e=e.sibling}}function Kv(e,t){for(;Ut!==null;){var a=Ut;switch(a.tag){case 0:case 11:case 15:hr(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:wu(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,Ut=o;else e:for(a=e;Ut!==null;){o=Ut;var n=o.sibling,r=o.return;if(_v(o),o===a){Ut=null;break e}if(n!==null){n.return=r,Ut=n;break e}Ut=r}}}var fP={getCacheForType:function(e){var t=Kt(Et),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Kt(Et).controller.signal}},dP=typeof WeakMap==\\\"function\\\"?WeakMap:Map,Ye=0,st=null,He=null,qe=0,$e=0,Da=null,ar=!1,Gl=!1,ab=!1,En=0,Lt=0,xr=0,ls=0,ob=0,Na=0,Nl=0,ou=null,Sa=null,ax=!1,bd=0,$v=0,$f=1/0,Wf=null,ur=null,Ot=0,cr=null,Bl=null,vn=0,ox=0,nx=null,Wv=null,nu=0,rx=null;function Ua(){return(Ye&2)!==0&&qe!==0?qe&-qe:Se.T!==null?rb():rR()}function Zv(){if(Na===0)if((qe&536870912)===0||Ve){var e=ef;ef<<=1,(ef&3932160)===0&&(ef=262144),Na=e}else Na=536870912;return e=za.current,e!==null&&(e.flags|=32),Na}function Ca(e,t,a){(e===st&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(Fl(e,0),or(e,qe,Na,!1)),Ru(e,a),((Ye&2)===0||e!==st)&&(e===st&&((Ye&2)===0&&(ls|=a),Lt===4&&or(e,qe,Na,!1)),Ho(e))}function Qv(e,t,a){if((Ye&6)!==0)throw Error(z(327));var o=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Lu(e,t),n=o?gP(e,t):gh(e,t,!0),r=o;do{if(n===0){Gl&&!o&&or(e,t,0,!1);break}else{if(a=e.current.alternate,r&&!pP(a)){n=gh(e,t,!1),r=!1;continue}if(n===2){if(r=t,e.errorRecoveryDisabledLanes&r)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var l=e;n=ou;var i=l.current.memoizedState.isDehydrated;if(i&&(Fl(l,s).flags|=256),s=gh(l,s,!1),s!==2){if(ab&&!i){l.errorRecoveryDisabledLanes|=r,ls|=r,n=4;break e}r=Sa,Sa=n,r!==null&&(Sa===null?Sa=r:Sa.push.apply(Sa,r))}n=s}if(r=!1,n!==2)continue}}if(n===1){Fl(e,0),or(e,t,0,!0);break}e:{switch(o=e,r=n,r){case 0:case 1:throw Error(z(345));case 4:if((t&4194048)!==t)break;case 6:or(o,t,Na,!ar);break e;case 2:Sa=null;break;case 3:case 5:break;default:throw Error(z(329))}if((t&62914560)===t&&(n=bd+300-Ba(),10<n)){if(or(o,t,Na,!ar),ld(o,0,!0)!==0)break e;vn=t,o.timeoutHandle=bI(hL.bind(null,o,a,Sa,Wf,ax,t,Na,ls,Nl,ar,r,\\\"Throttled\\\",-0,0),n);break e}hL(o,a,Sa,Wf,ax,t,Na,ls,Nl,ar,r,null,-0,0)}}break}while(!0);Ho(e)}function hL(e,t,a,o,n,r,s,l,i,u,c,f,d,p){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sn},Xv(t,r,f);var x=(r&62914560)===r?bd-Ba():(r&4194048)===r?$v-Ba():0;if(x=$P(f,x),x!==null){vn=r,e.cancelPendingCommit=x(bL.bind(null,e,t,r,a,o,n,s,l,i,c,f,null,d,p)),or(e,r,s,!u);return}}bL(e,t,r,a,o,n,s,l,i)}function pP(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var n=a[o],r=n.getSnapshot;n=n.value;try{if(!Ha(r(),n))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 or(e,t,a,o){t&=~ob,t&=~ls,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var n=t;0<n;){var r=31-_a(n),s=1<<r;o[r]=-1,n&=~s}a!==0&&aR(e,a,t)}function yd(){return(Ye&6)===0?(Eu(0,!1),!1):!0}function nb(){if(He!==null){if($e===0)var e=He.return;else e=He,Cn=xs=null,Vx(e),wl=null,du=0,e=He;for(;e!==null;)Av(e.alternate,e),e=e.return;He=null}}function Fl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,AP(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),vn=0,nb(),st=e,He=a=Ln(e.current,null),qe=t,$e=0,Da=null,ar=!1,Gl=Lu(e,t),ab=!1,Nl=Na=ob=ls=xr=Lt=0,Sa=ou=null,ax=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var n=31-_a(o),r=1<<n;t|=e[n],o&=~r}return En=t,fd(),a}function Jv(e,t){Ee=null,Se.H=mu,t===Vl||t===pd?(t=KC(),$e=3):t===Bx?(t=KC(),$e=4):$e=t===Qx?8:t!==null&&typeof t==\\\"object\\\"&&typeof t.then==\\\"function\\\"?6:1,Da=t,He===null&&(Lt=1,jf(e,no(t,e.current)))}function eI(){var e=za.current;return e===null?!0:(qe&4194048)===qe?so===null:(qe&62914560)===qe||(qe&536870912)!==0?e===so:!1}function tI(){var e=Se.H;return Se.H=mu,e===null?mu:e}function aI(){var e=Se.A;return Se.A=fP,e}function Zf(){Lt=4,ar||(qe&4194048)!==qe&&za.current!==null||(Gl=!0),(xr&134217727)===0&&(ls&134217727)===0||st===null||or(st,qe,Na,!1)}function gh(e,t,a){var o=Ye;Ye|=2;var n=tI(),r=aI();(st!==e||qe!==t)&&(Wf=null,Fl(e,t)),t=!1;var s=Lt;e:do try{if($e!==0&&He!==null){var l=He,i=Da;switch($e){case 8:nb(),s=6;break e;case 3:case 2:case 9:case 6:za.current===null&&(t=!0);var u=$e;if($e=0,Da=null,Cl(e,l,i,u),a&&Gl){s=0;break e}break;default:u=$e,$e=0,Da=null,Cl(e,l,i,u)}}mP(),s=Lt;break}catch(c){Jv(e,c)}while(!0);return t&&e.shellSuspendCounter++,Cn=xs=null,Ye=o,Se.H=n,Se.A=r,He===null&&(st=null,qe=0,fd()),s}function mP(){for(;He!==null;)oI(He)}function gP(e,t){var a=Ye;Ye|=2;var o=tI(),n=aI();st!==e||qe!==t?(Wf=null,$f=Ba()+500,Fl(e,t)):Gl=Lu(e,t);e:do try{if($e!==0&&He!==null){t=He;var r=Da;t:switch($e){case 1:$e=0,Da=null,Cl(e,t,r,1);break;case 2:case 9:if(YC(r)){$e=0,Da=null,xL(t);break}t=function(){$e!==2&&$e!==9||st!==e||($e=7),Ho(e)},r.then(t,t);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:YC(r)?($e=0,Da=null,xL(t)):($e=0,Da=null,Cl(e,t,r,7));break;case 5:var s=null;switch(He.tag){case 26:s=He.memoizedState;case 5:case 27:var l=He;if(s?RI(s):l.stateNode.complete){$e=0,Da=null;var i=l.sibling;if(i!==null)He=i;else{var u=l.return;u!==null?(He=u,Sd(u)):He=null}break t}}$e=0,Da=null,Cl(e,t,r,5);break;case 6:$e=0,Da=null,Cl(e,t,r,6);break;case 8:nb(),Lt=6;break e;default:throw Error(z(462))}}hP();break}catch(c){Jv(e,c)}while(!0);return Cn=xs=null,Se.H=o,Se.A=n,Ye=a,He!==null?0:(st=null,qe=0,fd(),Lt)}function hP(){for(;He!==null&&!UD();)oI(He)}function oI(e){var t=Mv(e.alternate,e,En);e.memoizedProps=e.pendingProps,t===null?Sd(e):He=t}function xL(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=cL(a,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=cL(a,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:Vx(t);default:Av(a,t),t=He=AR(t,En),t=Mv(a,t,En)}e.memoizedProps=e.pendingProps,t===null?Sd(e):He=t}function Cl(e,t,a,o){Cn=xs=null,Vx(t),wl=null,du=0;var n=t.return;try{if(nP(e,n,t,a,qe)){Lt=1,jf(e,no(a,e.current)),He=null;return}}catch(r){if(n!==null)throw He=n,r;Lt=1,jf(e,no(a,e.current)),He=null;return}t.flags&32768?(Ve||o===1?e=!0:Gl||(qe&536870912)!==0?e=!1:(ar=e=!0,(o===2||o===9||o===3||o===6)&&(o=za.current,o!==null&&o.tag===13&&(o.flags|=16384))),nI(t,e)):Sd(t)}function Sd(e){var t=e;do{if((t.flags&32768)!==0){nI(t,ar);return}e=t.return;var a=lP(t.alternate,t,En);if(a!==null){He=a;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);Lt===0&&(Lt=5)}function nI(e,t){do{var a=iP(e.alternate,e);if(a!==null){a.flags&=32767,He=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){He=e;return}He=e=a}while(e!==null);Lt=6,He=null}function bL(e,t,a,o,n,r,s,l,i){e.cancelPendingCommit=null;do Cd();while(Ot!==0);if((Ye&6)!==0)throw Error(z(327));if(t!==null){if(t===e.current)throw Error(z(177));if(r=t.lanes|t.childLanes,r|=Ex,$D(e,a,r,s,l,i),e===st&&(He=st=null,qe=0),Bl=t,cr=e,vn=a,ox=r,nx=n,Wv=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,SP(Nf,function(){return uI(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=Se.T,Se.T=null,n=Ke.p,Ke.p=2,s=Ye,Ye|=4;try{uP(e,t,a)}finally{Ye=s,Ke.p=n,Se.T=o}}Ot=1,rI(),sI(),lI()}}function rI(){if(Ot===1){Ot=0;var e=cr,t=Bl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=Se.T,Se.T=null;var o=Ke.p;Ke.p=2;var n=Ye;Ye|=4;try{qv(t,e);var r=ux,s=RR(e.containerInfo),l=r.focusedElem,i=r.selectionRange;if(s!==l&&l&&l.ownerDocument&&LR(l.ownerDocument.documentElement,l)){if(i!==null&&Tx(l)){var u=i.start,c=i.end;if(c===void 0&&(c=u),\\\"selectionStart\\\"in l)l.selectionStart=u,l.selectionEnd=Math.min(c,l.value.length);else{var f=l.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var p=d.getSelection(),x=l.textContent.length,b=Math.min(i.start,x),C=i.end===void 0?b:Math.min(i.end,x);!p.extend&&b>C&&(s=C,C=b,b=s);var g=HC(l,b),m=HC(l,C);if(g&&m&&(p.rangeCount!==1||p.anchorNode!==g.node||p.anchorOffset!==g.offset||p.focusNode!==m.node||p.focusOffset!==m.offset)){var h=f.createRange();h.setStart(g.node,g.offset),p.removeAllRanges(),b>C?(p.addRange(h),p.extend(m.node,m.offset)):(h.setEnd(m.node,m.offset),p.addRange(h))}}}}for(f=[],p=l;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus==\\\"function\\\"&&l.focus(),l=0;l<f.length;l++){var y=f[l];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}rd=!!ix,ux=ix=null}finally{Ye=n,Ke.p=o,Se.T=a}}e.current=t,Ot=2}}function sI(){if(Ot===2){Ot=0;var e=cr,t=Bl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=Se.T,Se.T=null;var o=Ke.p;Ke.p=2;var n=Ye;Ye|=4;try{Fv(e,t.alternate,t)}finally{Ye=n,Ke.p=o,Se.T=a}}Ot=3}}function lI(){if(Ot===4||Ot===3){Ot=0,HD();var e=cr,t=Bl,a=vn,o=Wv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ot=5:(Ot=0,Bl=cr=null,iI(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(ur=null),Cx(a),t=t.stateNode,Fa&&typeof Fa.onCommitFiberRoot==\\\"function\\\")try{Fa.onCommitFiberRoot(Cu,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=Se.T,n=Ke.p,Ke.p=2,Se.T=null;try{for(var r=e.onRecoverableError,s=0;s<o.length;s++){var l=o[s];r(l.value,{componentStack:l.stack})}}finally{Se.T=t,Ke.p=n}}(vn&3)!==0&&Cd(),Ho(e),n=e.pendingLanes,(a&261930)!==0&&(n&42)!==0?e===rx?nu++:(nu=0,rx=e):nu=0,Eu(0,!1)}}function iI(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,wu(t)))}function Cd(){return rI(),sI(),lI(),uI()}function uI(){if(Ot!==5)return!1;var e=cr,t=ox;ox=0;var a=Cx(vn),o=Se.T,n=Ke.p;try{Ke.p=32>a?32:a,Se.T=null,a=nx,nx=null;var r=cr,s=vn;if(Ot=0,Bl=cr=null,vn=0,(Ye&6)!==0)throw Error(z(331));var l=Ye;if(Ye|=4,Yv(r.current),Gv(r,r.current,s,a),Ye=l,Eu(0,!1),Fa&&typeof Fa.onPostCommitFiberRoot==\\\"function\\\")try{Fa.onPostCommitFiberRoot(Cu,r)}catch{}return!0}finally{Ke.p=n,Se.T=o,iI(e,t)}}function yL(e,t,a){t=no(a,t),t=Qh(e.stateNode,t,2),e=ir(e,t,2),e!==null&&(Ru(e,2),Ho(e))}function We(e,t,a){if(e.tag===3)yL(e,e,a);else for(;t!==null;){if(t.tag===3){yL(t,e,a);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError==\\\"function\\\"||typeof o.componentDidCatch==\\\"function\\\"&&(ur===null||!ur.has(o))){e=no(a,e),a=vv(2),o=ir(t,a,2),o!==null&&(Iv(a,o,t,e),Ru(o,2),Ho(o));break}}t=t.return}}function hh(e,t,a){var o=e.pingCache;if(o===null){o=e.pingCache=new dP;var n=new Set;o.set(t,n)}else n=o.get(t),n===void 0&&(n=new Set,o.set(t,n));n.has(a)||(ab=!0,n.add(a),e=xP.bind(null,e,t,a),t.then(e,e))}function xP(e,t,a){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,st===e&&(qe&a)===a&&(Lt===4||Lt===3&&(qe&62914560)===qe&&300>Ba()-bd?(Ye&2)===0&&Fl(e,0):ob|=a,Nl===qe&&(Nl=0)),Ho(e)}function cI(e,t){t===0&&(t=tR()),e=hs(e,t),e!==null&&(Ru(e,t),Ho(e))}function bP(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),cI(e,a)}function yP(e,t){var a=0;switch(e.tag){case 31:case 13:var o=e.stateNode,n=e.memoizedState;n!==null&&(a=n.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(z(314))}o!==null&&o.delete(t),cI(e,a)}function SP(e,t){return yx(e,t)}var Qf=null,ul=null,sx=!1,Jf=!1,xh=!1,nr=0;function Ho(e){e!==ul&&e.next===null&&(ul===null?Qf=ul=e:ul=ul.next=e),Jf=!0,sx||(sx=!0,LP())}function Eu(e,t){if(!xh&&Jf){xh=!0;do for(var a=!1,o=Qf;o!==null;){if(!t)if(e!==0){var n=o.pendingLanes;if(n===0)var r=0;else{var s=o.suspendedLanes,l=o.pingedLanes;r=(1<<31-_a(42|e)+1)-1,r&=n&~(s&~l),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(a=!0,SL(o,r))}else r=qe,r=ld(o,o===st?r:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(r&3)===0||Lu(o,r)||(a=!0,SL(o,r));o=o.next}while(a);xh=!1}}function CP(){fI()}function fI(){Jf=sx=!1;var e=0;nr!==0&&MP()&&(e=nr);for(var t=Ba(),a=null,o=Qf;o!==null;){var n=o.next,r=dI(o,t);r===0?(o.next=null,a===null?Qf=n:a.next=n,n===null&&(ul=a)):(a=o,(e!==0||(r&3)!==0)&&(Jf=!0)),o=n}Ot!==0&&Ot!==5||Eu(e,!1),nr!==0&&(nr=0)}function dI(e,t){for(var a=e.suspendedLanes,o=e.pingedLanes,n=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var s=31-_a(r),l=1<<s,i=n[s];i===-1?((l&a)===0||(l&o)!==0)&&(n[s]=KD(l,t)):i<=t&&(e.expiredLanes|=l),r&=~l}if(t=st,a=qe,a=ld(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,a===0||e===t&&($e===2||$e===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&jg(o),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Lu(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(o!==null&&jg(o),Cx(a)){case 2:case 8:a=JL;break;case 32:a=Nf;break;case 268435456:a=eR;break;default:a=Nf}return o=pI.bind(null,e),a=yx(a,o),e.callbackPriority=t,e.callbackNode=a,t}return o!==null&&o!==null&&jg(o),e.callbackPriority=2,e.callbackNode=null,2}function pI(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Cd()&&e.callbackNode!==a)return null;var o=qe;return o=ld(e,e===st?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Qv(e,o,t),dI(e,Ba()),e.callbackNode!=null&&e.callbackNode===a?pI.bind(null,e):null)}function SL(e,t){if(Cd())return null;Qv(e,t,!0)}function LP(){DP(function(){(Ye&6)!==0?yx(QL,CP):fI()})}function rb(){if(nr===0){var e=Dl;e===0&&(e=Jc,Jc<<=1,(Jc&261888)===0&&(Jc=256)),nr=e}return nr}function CL(e){return e==null||typeof e==\\\"symbol\\\"||typeof e==\\\"boolean\\\"?null:typeof e==\\\"function\\\"?e:bf(\\\"\\\"+e)}function LL(e,t){var a=t.ownerDocument.createElement(\\\"input\\\");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute(\\\"form\\\",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function RP(e,t,a,o,n){if(t===\\\"submit\\\"&&a&&a.stateNode===n){var r=CL((n[La]||null).action),s=o.submitter;s&&(t=(t=s[La]||null)?CL(t.formAction):s.getAttribute(\\\"formAction\\\"),t!==null&&(r=t,s=null));var l=new id(\\\"action\\\",\\\"action\\\",null,o,n);e.push({event:l,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(nr!==0){var i=s?LL(n,s):new FormData(n);Wh(a,{pending:!0,data:i,method:n.method,action:r},null,i)}}else typeof r==\\\"function\\\"&&(l.preventDefault(),i=s?LL(n,s):new FormData(n),Wh(a,{pending:!0,data:i,method:n.method,action:r},r,i))},currentTarget:n}]})}}for(df=0;df<_h.length;df++)pf=_h[df],RL=pf.toLowerCase(),vL=pf[0].toUpperCase()+pf.slice(1),Co(RL,\\\"on\\\"+vL);var pf,RL,vL,df;Co(IR,\\\"onAnimationEnd\\\");Co(wR,\\\"onAnimationIteration\\\");Co(kR,\\\"onAnimationStart\\\");Co(\\\"dblclick\\\",\\\"onDoubleClick\\\");Co(\\\"focusin\\\",\\\"onFocus\\\");Co(\\\"focusout\\\",\\\"onBlur\\\");Co(zO,\\\"onTransitionRun\\\");Co(qO,\\\"onTransitionStart\\\");Co(VO,\\\"onTransitionCancel\\\");Co(TR,\\\"onTransitionEnd\\\");Ml(\\\"onMouseEnter\\\",[\\\"mouseout\\\",\\\"mouseover\\\"]);Ml(\\\"onMouseLeave\\\",[\\\"mouseout\\\",\\\"mouseover\\\"]);Ml(\\\"onPointerEnter\\\",[\\\"pointerout\\\",\\\"pointerover\\\"]);Ml(\\\"onPointerLeave\\\",[\\\"pointerout\\\",\\\"pointerover\\\"]);ps(\\\"onChange\\\",\\\"change click focusin focusout input keydown keyup selectionchange\\\".split(\\\" \\\"));ps(\\\"onSelect\\\",\\\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\\\".split(\\\" \\\"));ps(\\\"onBeforeInput\\\",[\\\"compositionend\\\",\\\"keypress\\\",\\\"textInput\\\",\\\"paste\\\"]);ps(\\\"onCompositionEnd\\\",\\\"compositionend focusout keydown keypress keyup mousedown\\\".split(\\\" \\\"));ps(\\\"onCompositionStart\\\",\\\"compositionstart focusout keydown keypress keyup mousedown\\\".split(\\\" \\\"));ps(\\\"onCompositionUpdate\\\",\\\"compositionupdate focusout keydown keypress keyup mousedown\\\".split(\\\" \\\"));var gu=\\\"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(\\\" \\\"),vP=new Set(\\\"beforetoggle cancel close invalid load scroll scrollend toggle\\\".split(\\\" \\\").concat(gu));function mI(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var o=e[a],n=o.event;o=o.listeners;e:{var r=void 0;if(t)for(var s=o.length-1;0<=s;s--){var l=o[s],i=l.instance,u=l.currentTarget;if(l=l.listener,i!==r&&n.isPropagationStopped())break e;r=l,n.currentTarget=u;try{r(n)}catch(c){Ff(c)}n.currentTarget=null,r=i}else for(s=0;s<o.length;s++){if(l=o[s],i=l.instance,u=l.currentTarget,l=l.listener,i!==r&&n.isPropagationStopped())break e;r=l,n.currentTarget=u;try{r(n)}catch(c){Ff(c)}n.currentTarget=null,r=i}}}}function Ue(e,t){var a=t[Mh];a===void 0&&(a=t[Mh]=new Set);var o=e+\\\"__bubble\\\";a.has(o)||(gI(t,e,2,!1),a.add(o))}function bh(e,t,a){var o=0;t&&(o|=4),gI(a,e,o,t)}var mf=\\\"_reactListening\\\"+Math.random().toString(36).slice(2);function sb(e){if(!e[mf]){e[mf]=!0,sR.forEach(function(a){a!==\\\"selectionchange\\\"&&(vP.has(a)||bh(a,!1,e),bh(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mf]||(t[mf]=!0,bh(\\\"selectionchange\\\",!1,t))}}function gI(e,t,a,o){switch(TI(t)){case 2:var n=QP;break;case 8:n=JP;break;default:n=cb}a=n.bind(null,t,a,e),n=void 0,!Nh||t!==\\\"touchstart\\\"&&t!==\\\"touchmove\\\"&&t!==\\\"wheel\\\"||(n=!0),o?n!==void 0?e.addEventListener(t,a,{capture:!0,passive:n}):e.addEventListener(t,a,!0):n!==void 0?e.addEventListener(t,a,{passive:n}):e.addEventListener(t,a,!1)}function yh(e,t,a,o,n){var r=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var s=o.tag;if(s===3||s===4){var l=o.stateNode.containerInfo;if(l===n)break;if(s===4)for(s=o.return;s!==null;){var i=s.tag;if((i===3||i===4)&&s.stateNode.containerInfo===n)return;s=s.return}for(;l!==null;){if(s=dl(l),s===null)return;if(i=s.tag,i===5||i===6||i===26||i===27){o=r=s;continue e}l=l.parentNode}}o=o.return}mR(function(){var u=r,c=vx(a),f=[];e:{var d=ER.get(e);if(d!==void 0){var p=id,x=e;switch(e){case\\\"keypress\\\":if(Sf(a)===0)break e;case\\\"keydown\\\":case\\\"keyup\\\":p=yO;break;case\\\"focusin\\\":x=\\\"focus\\\",p=Zg;break;case\\\"focusout\\\":x=\\\"blur\\\",p=Zg;break;case\\\"beforeblur\\\":case\\\"afterblur\\\":p=Zg;break;case\\\"click\\\":if(a.button===2)break e;case\\\"auxclick\\\":case\\\"dblclick\\\":case\\\"mousedown\\\":case\\\"mousemove\\\":case\\\"mouseup\\\":case\\\"mouseout\\\":case\\\"mouseover\\\":case\\\"contextmenu\\\":p=AC;break;case\\\"drag\\\":case\\\"dragend\\\":case\\\"dragenter\\\":case\\\"dragexit\\\":case\\\"dragleave\\\":case\\\"dragover\\\":case\\\"dragstart\\\":case\\\"drop\\\":p=lO;break;case\\\"touchcancel\\\":case\\\"touchend\\\":case\\\"touchmove\\\":case\\\"touchstart\\\":p=LO;break;case IR:case wR:case kR:p=cO;break;case TR:p=vO;break;case\\\"scroll\\\":case\\\"scrollend\\\":p=rO;break;case\\\"wheel\\\":p=wO;break;case\\\"copy\\\":case\\\"cut\\\":case\\\"paste\\\":p=dO;break;case\\\"gotpointercapture\\\":case\\\"lostpointercapture\\\":case\\\"pointercancel\\\":case\\\"pointerdown\\\":case\\\"pointermove\\\":case\\\"pointerout\\\":case\\\"pointerover\\\":case\\\"pointerup\\\":p=OC;break;case\\\"toggle\\\":case\\\"beforetoggle\\\":p=TO}var b=(t&4)!==0,C=!b&&(e===\\\"scroll\\\"||e===\\\"scrollend\\\"),g=b?d!==null?d+\\\"Capture\\\":null:d;b=[];for(var m=u,h;m!==null;){var y=m;if(h=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||h===null||g===null||(y=lu(m,g),y!=null&&b.push(hu(m,y,h))),C)break;m=m.return}0<b.length&&(d=new p(d,x,null,a,c),f.push({event:d,listeners:b}))}}if((t&7)===0){e:{if(d=e===\\\"mouseover\\\"||e===\\\"pointerover\\\",p=e===\\\"mouseout\\\"||e===\\\"pointerout\\\",d&&a!==Ph&&(x=a.relatedTarget||a.fromElement)&&(dl(x)||x[Hl]))break e;if((p||d)&&(d=c.window===c?c:(d=c.ownerDocument)?d.defaultView||d.parentWindow:window,p?(x=a.relatedTarget||a.toElement,p=u,x=x?dl(x):null,x!==null&&(C=Su(x),b=x.tag,x!==C||b!==5&&b!==27&&b!==6)&&(x=null)):(p=null,x=u),p!==x)){if(b=AC,y=\\\"onMouseLeave\\\",g=\\\"onMouseEnter\\\",m=\\\"mouse\\\",(e===\\\"pointerout\\\"||e===\\\"pointerover\\\")&&(b=OC,y=\\\"onPointerLeave\\\",g=\\\"onPointerEnter\\\",m=\\\"pointer\\\"),C=p==null?d:Gi(p),h=x==null?d:Gi(x),d=new b(y,m+\\\"leave\\\",p,a,c),d.target=C,d.relatedTarget=h,y=null,dl(c)===u&&(b=new b(g,m+\\\"enter\\\",x,a,c),b.target=h,b.relatedTarget=C,y=b),C=y,p&&x)t:{for(b=IP,g=p,m=x,h=0,y=g;y;y=b(y))h++;y=0;for(var v=m;v;v=b(v))y++;for(;0<h-y;)g=b(g),h--;for(;0<y-h;)m=b(m),y--;for(;h--;){if(g===m||m!==null&&g===m.alternate){b=g;break t}g=b(g),m=b(m)}b=null}else b=null;p!==null&&IL(f,d,p,b,!1),x!==null&&C!==null&&IL(f,C,x,b,!0)}}e:{if(d=u?Gi(u):window,p=d.nodeName&&d.nodeName.toLowerCase(),p===\\\"select\\\"||p===\\\"input\\\"&&d.type===\\\"file\\\")var R=FC;else if(BC(d))if(SR)R=_O;else{R=BO;var I=NO}else p=d.nodeName,!p||p.toLowerCase()!==\\\"input\\\"||d.type!==\\\"checkbox\\\"&&d.type!==\\\"radio\\\"?u&&Rx(u.elementType)&&(R=FC):R=FO;if(R&&(R=R(e,u))){yR(f,R,a,c);break e}I&&I(e,d,u),e===\\\"focusout\\\"&&u&&d.type===\\\"number\\\"&&u.memoizedProps.value!=null&&Oh(d,\\\"number\\\",d.value)}switch(I=u?Gi(u):window,e){case\\\"focusin\\\":(BC(I)||I.contentEditable===\\\"true\\\")&&(gl=I,Bh=u,$i=null);break;case\\\"focusout\\\":$i=Bh=gl=null;break;case\\\"mousedown\\\":Fh=!0;break;case\\\"contextmenu\\\":case\\\"mouseup\\\":case\\\"dragend\\\":Fh=!1,zC(f,a,c);break;case\\\"selectionchange\\\":if(HO)break;case\\\"keydown\\\":case\\\"keyup\\\":zC(f,a,c)}var L;if(kx)e:{switch(e){case\\\"compositionstart\\\":var k=\\\"onCompositionStart\\\";break e;case\\\"compositionend\\\":k=\\\"onCompositionEnd\\\";break e;case\\\"compositionupdate\\\":k=\\\"onCompositionUpdate\\\";break e}k=void 0}else ml?xR(e,a)&&(k=\\\"onCompositionEnd\\\"):e===\\\"keydown\\\"&&a.keyCode===229&&(k=\\\"onCompositionStart\\\");k&&(hR&&a.locale!==\\\"ko\\\"&&(ml||k!==\\\"onCompositionStart\\\"?k===\\\"onCompositionEnd\\\"&&ml&&(L=gR()):(tr=c,Ix=\\\"value\\\"in tr?tr.value:tr.textContent,ml=!0)),I=ed(u,k),0<I.length&&(k=new DC(k,e,null,a,c),f.push({event:k,listeners:I}),L?k.data=L:(L=bR(a),L!==null&&(k.data=L)))),(L=MO?AO(e,a):DO(e,a))&&(k=ed(u,\\\"onBeforeInput\\\"),0<k.length&&(I=new DC(\\\"onBeforeInput\\\",\\\"beforeinput\\\",null,a,c),f.push({event:I,listeners:k}),I.data=L)),RP(f,e,u,a,c)}mI(f,t)})}function hu(e,t,a){return{instance:e,listener:t,currentTarget:a}}function ed(e,t){for(var a=t+\\\"Capture\\\",o=[];e!==null;){var n=e,r=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||r===null||(n=lu(e,a),n!=null&&o.unshift(hu(e,n,r)),n=lu(e,t),n!=null&&o.push(hu(e,n,r))),e.tag===3)return o;e=e.return}return[]}function IP(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function IL(e,t,a,o,n){for(var r=t._reactName,s=[];a!==null&&a!==o;){var l=a,i=l.alternate,u=l.stateNode;if(l=l.tag,i!==null&&i===o)break;l!==5&&l!==26&&l!==27||u===null||(i=u,n?(u=lu(a,r),u!=null&&s.unshift(hu(a,u,i))):n||(u=lu(a,r),u!=null&&s.push(hu(a,u,i)))),a=a.return}s.length!==0&&e.push({event:t,listeners:s})}var wP=/\\\\r\\\\n?/g,kP=/\\\\u0000|\\\\uFFFD/g;function wL(e){return(typeof e==\\\"string\\\"?e:\\\"\\\"+e).replace(wP,`\\n`).replace(kP,\\\"\\\")}function hI(e,t){return t=wL(t),wL(e)===t}function Je(e,t,a,o,n,r){switch(a){case\\\"children\\\":typeof o==\\\"string\\\"?t===\\\"body\\\"||t===\\\"textarea\\\"&&o===\\\"\\\"||Al(e,o):(typeof o==\\\"number\\\"||typeof o==\\\"bigint\\\")&&t!==\\\"body\\\"&&Al(e,\\\"\\\"+o);break;case\\\"className\\\":af(e,\\\"class\\\",o);break;case\\\"tabIndex\\\":af(e,\\\"tabindex\\\",o);break;case\\\"dir\\\":case\\\"role\\\":case\\\"viewBox\\\":case\\\"width\\\":case\\\"height\\\":af(e,a,o);break;case\\\"style\\\":pR(e,o,r);break;case\\\"data\\\":if(t!==\\\"object\\\"){af(e,\\\"data\\\",o);break}case\\\"src\\\":case\\\"href\\\":if(o===\\\"\\\"&&(t!==\\\"a\\\"||a!==\\\"href\\\")){e.removeAttribute(a);break}if(o==null||typeof o==\\\"function\\\"||typeof o==\\\"symbol\\\"||typeof o==\\\"boolean\\\"){e.removeAttribute(a);break}o=bf(\\\"\\\"+o),e.setAttribute(a,o);break;case\\\"action\\\":case\\\"formAction\\\":if(typeof o==\\\"function\\\"){e.setAttribute(a,\\\"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 r==\\\"function\\\"&&(a===\\\"formAction\\\"?(t!==\\\"input\\\"&&Je(e,t,\\\"name\\\",n.name,n,null),Je(e,t,\\\"formEncType\\\",n.formEncType,n,null),Je(e,t,\\\"formMethod\\\",n.formMethod,n,null),Je(e,t,\\\"formTarget\\\",n.formTarget,n,null)):(Je(e,t,\\\"encType\\\",n.encType,n,null),Je(e,t,\\\"method\\\",n.method,n,null),Je(e,t,\\\"target\\\",n.target,n,null)));if(o==null||typeof o==\\\"symbol\\\"||typeof o==\\\"boolean\\\"){e.removeAttribute(a);break}o=bf(\\\"\\\"+o),e.setAttribute(a,o);break;case\\\"onClick\\\":o!=null&&(e.onclick=Sn);break;case\\\"onScroll\\\":o!=null&&Ue(\\\"scroll\\\",e);break;case\\\"onScrollEnd\\\":o!=null&&Ue(\\\"scrollend\\\",e);break;case\\\"dangerouslySetInnerHTML\\\":if(o!=null){if(typeof o!=\\\"object\\\"||!(\\\"__html\\\"in o))throw Error(z(61));if(a=o.__html,a!=null){if(n.children!=null)throw Error(z(60));e.innerHTML=a}}break;case\\\"multiple\\\":e.multiple=o&&typeof o!=\\\"function\\\"&&typeof o!=\\\"symbol\\\";break;case\\\"muted\\\":e.muted=o&&typeof o!=\\\"function\\\"&&typeof o!=\\\"symbol\\\";break;case\\\"suppressContentEditableWarning\\\":case\\\"suppressHydrationWarning\\\":case\\\"defaultValue\\\":case\\\"defaultChecked\\\":case\\\"innerHTML\\\":case\\\"ref\\\":break;case\\\"autoFocus\\\":break;case\\\"xlinkHref\\\":if(o==null||typeof o==\\\"function\\\"||typeof o==\\\"boolean\\\"||typeof o==\\\"symbol\\\"){e.removeAttribute(\\\"xlink:href\\\");break}a=bf(\\\"\\\"+o),e.setAttributeNS(\\\"http://www.w3.org/1999/xlink\\\",\\\"xlink:href\\\",a);break;case\\\"contentEditable\\\":case\\\"spellCheck\\\":case\\\"draggable\\\":case\\\"value\\\":case\\\"autoReverse\\\":case\\\"externalResourcesRequired\\\":case\\\"focusable\\\":case\\\"preserveAlpha\\\":o!=null&&typeof o!=\\\"function\\\"&&typeof o!=\\\"symbol\\\"?e.setAttribute(a,\\\"\\\"+o):e.removeAttribute(a);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\\\":o&&typeof o!=\\\"function\\\"&&typeof o!=\\\"symbol\\\"?e.setAttribute(a,\\\"\\\"):e.removeAttribute(a);break;case\\\"capture\\\":case\\\"download\\\":o===!0?e.setAttribute(a,\\\"\\\"):o!==!1&&o!=null&&typeof o!=\\\"function\\\"&&typeof o!=\\\"symbol\\\"?e.setAttribute(a,o):e.removeAttribute(a);break;case\\\"cols\\\":case\\\"rows\\\":case\\\"size\\\":case\\\"span\\\":o!=null&&typeof o!=\\\"function\\\"&&typeof o!=\\\"symbol\\\"&&!isNaN(o)&&1<=o?e.setAttribute(a,o):e.removeAttribute(a);break;case\\\"rowSpan\\\":case\\\"start\\\":o==null||typeof o==\\\"function\\\"||typeof o==\\\"symbol\\\"||isNaN(o)?e.removeAttribute(a):e.setAttribute(a,o);break;case\\\"popover\\\":Ue(\\\"beforetoggle\\\",e),Ue(\\\"toggle\\\",e),xf(e,\\\"popover\\\",o);break;case\\\"xlinkActuate\\\":dn(e,\\\"http://www.w3.org/1999/xlink\\\",\\\"xlink:actuate\\\",o);break;case\\\"xlinkArcrole\\\":dn(e,\\\"http://www.w3.org/1999/xlink\\\",\\\"xlink:arcrole\\\",o);break;case\\\"xlinkRole\\\":dn(e,\\\"http://www.w3.org/1999/xlink\\\",\\\"xlink:role\\\",o);break;case\\\"xlinkShow\\\":dn(e,\\\"http://www.w3.org/1999/xlink\\\",\\\"xlink:show\\\",o);break;case\\\"xlinkTitle\\\":dn(e,\\\"http://www.w3.org/1999/xlink\\\",\\\"xlink:title\\\",o);break;case\\\"xlinkType\\\":dn(e,\\\"http://www.w3.org/1999/xlink\\\",\\\"xlink:type\\\",o);break;case\\\"xmlBase\\\":dn(e,\\\"http://www.w3.org/XML/1998/namespace\\\",\\\"xml:base\\\",o);break;case\\\"xmlLang\\\":dn(e,\\\"http://www.w3.org/XML/1998/namespace\\\",\\\"xml:lang\\\",o);break;case\\\"xmlSpace\\\":dn(e,\\\"http://www.w3.org/XML/1998/namespace\\\",\\\"xml:space\\\",o);break;case\\\"is\\\":xf(e,\\\"is\\\",o);break;case\\\"innerText\\\":case\\\"textContent\\\":break;default:(!(2<a.length)||a[0]!==\\\"o\\\"&&a[0]!==\\\"O\\\"||a[1]!==\\\"n\\\"&&a[1]!==\\\"N\\\")&&(a=oO.get(a)||a,xf(e,a,o))}}function lx(e,t,a,o,n,r){switch(a){case\\\"style\\\":pR(e,o,r);break;case\\\"dangerouslySetInnerHTML\\\":if(o!=null){if(typeof o!=\\\"object\\\"||!(\\\"__html\\\"in o))throw Error(z(61));if(a=o.__html,a!=null){if(n.children!=null)throw Error(z(60));e.innerHTML=a}}break;case\\\"children\\\":typeof o==\\\"string\\\"?Al(e,o):(typeof o==\\\"number\\\"||typeof o==\\\"bigint\\\")&&Al(e,\\\"\\\"+o);break;case\\\"onScroll\\\":o!=null&&Ue(\\\"scroll\\\",e);break;case\\\"onScrollEnd\\\":o!=null&&Ue(\\\"scrollend\\\",e);break;case\\\"onClick\\\":o!=null&&(e.onclick=Sn);break;case\\\"suppressContentEditableWarning\\\":case\\\"suppressHydrationWarning\\\":case\\\"innerHTML\\\":case\\\"ref\\\":break;case\\\"innerText\\\":case\\\"textContent\\\":break;default:if(!lR.hasOwnProperty(a))e:{if(a[0]===\\\"o\\\"&&a[1]===\\\"n\\\"&&(n=a.endsWith(\\\"Capture\\\"),t=a.slice(2,n?a.length-7:void 0),r=e[La]||null,r=r!=null?r[a]:null,typeof r==\\\"function\\\"&&e.removeEventListener(t,r,n),typeof o==\\\"function\\\")){typeof r!=\\\"function\\\"&&r!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,o,n);break e}a in e?e[a]=o:o===!0?e.setAttribute(a,\\\"\\\"):xf(e,a,o)}}}function $t(e,t,a){switch(t){case\\\"div\\\":case\\\"span\\\":case\\\"svg\\\":case\\\"path\\\":case\\\"a\\\":case\\\"g\\\":case\\\"p\\\":case\\\"li\\\":break;case\\\"img\\\":Ue(\\\"error\\\",e),Ue(\\\"load\\\",e);var o=!1,n=!1,r;for(r in a)if(a.hasOwnProperty(r)){var s=a[r];if(s!=null)switch(r){case\\\"src\\\":o=!0;break;case\\\"srcSet\\\":n=!0;break;case\\\"children\\\":case\\\"dangerouslySetInnerHTML\\\":throw Error(z(137,t));default:Je(e,t,r,s,a,null)}}n&&Je(e,t,\\\"srcSet\\\",a.srcSet,a,null),o&&Je(e,t,\\\"src\\\",a.src,a,null);return;case\\\"input\\\":Ue(\\\"invalid\\\",e);var l=r=s=n=null,i=null,u=null;for(o in a)if(a.hasOwnProperty(o)){var c=a[o];if(c!=null)switch(o){case\\\"name\\\":n=c;break;case\\\"type\\\":s=c;break;case\\\"checked\\\":i=c;break;case\\\"defaultChecked\\\":u=c;break;case\\\"value\\\":r=c;break;case\\\"defaultValue\\\":l=c;break;case\\\"children\\\":case\\\"dangerouslySetInnerHTML\\\":if(c!=null)throw Error(z(137,t));break;default:Je(e,t,o,c,a,null)}}cR(e,r,l,i,u,s,n,!1);return;case\\\"select\\\":Ue(\\\"invalid\\\",e),o=s=r=null;for(n in a)if(a.hasOwnProperty(n)&&(l=a[n],l!=null))switch(n){case\\\"value\\\":r=l;break;case\\\"defaultValue\\\":s=l;break;case\\\"multiple\\\":o=l;default:Je(e,t,n,l,a,null)}t=r,a=s,e.multiple=!!o,t!=null?Rl(e,!!o,t,!1):a!=null&&Rl(e,!!o,a,!0);return;case\\\"textarea\\\":Ue(\\\"invalid\\\",e),r=n=o=null;for(s in a)if(a.hasOwnProperty(s)&&(l=a[s],l!=null))switch(s){case\\\"value\\\":o=l;break;case\\\"defaultValue\\\":n=l;break;case\\\"children\\\":r=l;break;case\\\"dangerouslySetInnerHTML\\\":if(l!=null)throw Error(z(91));break;default:Je(e,t,s,l,a,null)}dR(e,o,n,r);return;case\\\"option\\\":for(i in a)a.hasOwnProperty(i)&&(o=a[i],o!=null)&&(i===\\\"selected\\\"?e.selected=o&&typeof o!=\\\"function\\\"&&typeof o!=\\\"symbol\\\":Je(e,t,i,o,a,null));return;case\\\"dialog\\\":Ue(\\\"beforetoggle\\\",e),Ue(\\\"toggle\\\",e),Ue(\\\"cancel\\\",e),Ue(\\\"close\\\",e);break;case\\\"iframe\\\":case\\\"object\\\":Ue(\\\"load\\\",e);break;case\\\"video\\\":case\\\"audio\\\":for(o=0;o<gu.length;o++)Ue(gu[o],e);break;case\\\"image\\\":Ue(\\\"error\\\",e),Ue(\\\"load\\\",e);break;case\\\"details\\\":Ue(\\\"toggle\\\",e);break;case\\\"embed\\\":case\\\"source\\\":case\\\"link\\\":Ue(\\\"error\\\",e),Ue(\\\"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(u in a)if(a.hasOwnProperty(u)&&(o=a[u],o!=null))switch(u){case\\\"children\\\":case\\\"dangerouslySetInnerHTML\\\":throw Error(z(137,t));default:Je(e,t,u,o,a,null)}return;default:if(Rx(t)){for(c in a)a.hasOwnProperty(c)&&(o=a[c],o!==void 0&&lx(e,t,c,o,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(o=a[l],o!=null&&Je(e,t,l,o,a,null))}function TP(e,t,a,o){switch(t){case\\\"div\\\":case\\\"span\\\":case\\\"svg\\\":case\\\"path\\\":case\\\"a\\\":case\\\"g\\\":case\\\"p\\\":case\\\"li\\\":break;case\\\"input\\\":var n=null,r=null,s=null,l=null,i=null,u=null,c=null;for(p in a){var f=a[p];if(a.hasOwnProperty(p)&&f!=null)switch(p){case\\\"checked\\\":break;case\\\"value\\\":break;case\\\"defaultValue\\\":i=f;default:o.hasOwnProperty(p)||Je(e,t,p,null,o,f)}}for(var d in o){var p=o[d];if(f=a[d],o.hasOwnProperty(d)&&(p!=null||f!=null))switch(d){case\\\"type\\\":r=p;break;case\\\"name\\\":n=p;break;case\\\"checked\\\":u=p;break;case\\\"defaultChecked\\\":c=p;break;case\\\"value\\\":s=p;break;case\\\"defaultValue\\\":l=p;break;case\\\"children\\\":case\\\"dangerouslySetInnerHTML\\\":if(p!=null)throw Error(z(137,t));break;default:p!==f&&Je(e,t,d,p,o,f)}}Dh(e,s,l,i,u,c,r,n);return;case\\\"select\\\":p=s=l=d=null;for(r in a)if(i=a[r],a.hasOwnProperty(r)&&i!=null)switch(r){case\\\"value\\\":break;case\\\"multiple\\\":p=i;default:o.hasOwnProperty(r)||Je(e,t,r,null,o,i)}for(n in o)if(r=o[n],i=a[n],o.hasOwnProperty(n)&&(r!=null||i!=null))switch(n){case\\\"value\\\":d=r;break;case\\\"defaultValue\\\":l=r;break;case\\\"multiple\\\":s=r;default:r!==i&&Je(e,t,n,r,o,i)}t=l,a=s,o=p,d!=null?Rl(e,!!a,d,!1):!!o!=!!a&&(t!=null?Rl(e,!!a,t,!0):Rl(e,!!a,a?[]:\\\"\\\",!1));return;case\\\"textarea\\\":p=d=null;for(l in a)if(n=a[l],a.hasOwnProperty(l)&&n!=null&&!o.hasOwnProperty(l))switch(l){case\\\"value\\\":break;case\\\"children\\\":break;default:Je(e,t,l,null,o,n)}for(s in o)if(n=o[s],r=a[s],o.hasOwnProperty(s)&&(n!=null||r!=null))switch(s){case\\\"value\\\":d=n;break;case\\\"defaultValue\\\":p=n;break;case\\\"children\\\":break;case\\\"dangerouslySetInnerHTML\\\":if(n!=null)throw Error(z(91));break;default:n!==r&&Je(e,t,s,n,o,r)}fR(e,d,p);return;case\\\"option\\\":for(var x in a)d=a[x],a.hasOwnProperty(x)&&d!=null&&!o.hasOwnProperty(x)&&(x===\\\"selected\\\"?e.selected=!1:Je(e,t,x,null,o,d));for(i in o)d=o[i],p=a[i],o.hasOwnProperty(i)&&d!==p&&(d!=null||p!=null)&&(i===\\\"selected\\\"?e.selected=d&&typeof d!=\\\"function\\\"&&typeof d!=\\\"symbol\\\":Je(e,t,i,d,o,p));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 b in a)d=a[b],a.hasOwnProperty(b)&&d!=null&&!o.hasOwnProperty(b)&&Je(e,t,b,null,o,d);for(u in o)if(d=o[u],p=a[u],o.hasOwnProperty(u)&&d!==p&&(d!=null||p!=null))switch(u){case\\\"children\\\":case\\\"dangerouslySetInnerHTML\\\":if(d!=null)throw Error(z(137,t));break;default:Je(e,t,u,d,o,p)}return;default:if(Rx(t)){for(var C in a)d=a[C],a.hasOwnProperty(C)&&d!==void 0&&!o.hasOwnProperty(C)&&lx(e,t,C,void 0,o,d);for(c in o)d=o[c],p=a[c],!o.hasOwnProperty(c)||d===p||d===void 0&&p===void 0||lx(e,t,c,d,o,p);return}}for(var g in a)d=a[g],a.hasOwnProperty(g)&&d!=null&&!o.hasOwnProperty(g)&&Je(e,t,g,null,o,d);for(f in o)d=o[f],p=a[f],!o.hasOwnProperty(f)||d===p||d==null&&p==null||Je(e,t,f,d,o,p)}function kL(e){switch(e){case\\\"css\\\":case\\\"script\\\":case\\\"font\\\":case\\\"img\\\":case\\\"image\\\":case\\\"input\\\":case\\\"link\\\":return!0;default:return!1}}function EP(){if(typeof performance.getEntriesByType==\\\"function\\\"){for(var e=0,t=0,a=performance.getEntriesByType(\\\"resource\\\"),o=0;o<a.length;o++){var n=a[o],r=n.transferSize,s=n.initiatorType,l=n.duration;if(r&&l&&kL(s)){for(s=0,l=n.responseEnd,o+=1;o<a.length;o++){var i=a[o],u=i.startTime;if(u>l)break;var c=i.transferSize,f=i.initiatorType;c&&kL(f)&&(i=i.responseEnd,s+=c*(i<l?1:(l-u)/(i-u)))}if(--o,t+=8*(r+s)/(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 ix=null,ux=null;function td(e){return e.nodeType===9?e:e.ownerDocument}function TL(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 xI(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 cx(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 Sh=null;function MP(){var e=window.event;return e&&e.type===\\\"popstate\\\"?e===Sh?!1:(Sh=e,!0):(Sh=null,!1)}var bI=typeof setTimeout==\\\"function\\\"?setTimeout:void 0,AP=typeof clearTimeout==\\\"function\\\"?clearTimeout:void 0,EL=typeof Promise==\\\"function\\\"?Promise:void 0,DP=typeof queueMicrotask==\\\"function\\\"?queueMicrotask:typeof EL<\\\"u\\\"?function(e){return EL.resolve(null).then(e).catch(OP)}:bI;function OP(e){setTimeout(function(){throw e})}function yr(e){return e===\\\"head\\\"}function ML(e,t){var a=t,o=0;do{var n=a.nextSibling;if(e.removeChild(a),n&&n.nodeType===8)if(a=n.data,a===\\\"/$\\\"||a===\\\"/&\\\"){if(o===0){e.removeChild(n),Ul(t);return}o--}else if(a===\\\"$\\\"||a===\\\"$?\\\"||a===\\\"$~\\\"||a===\\\"$!\\\"||a===\\\"&\\\")o++;else if(a===\\\"html\\\")ru(e.ownerDocument.documentElement);else if(a===\\\"head\\\"){a=e.ownerDocument.head,ru(a);for(var r=a.firstChild;r;){var s=r.nextSibling,l=r.nodeName;r[vu]||l===\\\"SCRIPT\\\"||l===\\\"STYLE\\\"||l===\\\"LINK\\\"&&r.rel.toLowerCase()===\\\"stylesheet\\\"||a.removeChild(r),r=s}}else a===\\\"body\\\"&&ru(e.ownerDocument.body);a=n}while(a);Ul(t)}function AL(e,t){var a=e;e=0;do{var o=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display=\\\"none\\\"):(a.style.display=a._stashedDisplay||\\\"\\\",a.getAttribute(\\\"style\\\")===\\\"\\\"&&a.removeAttribute(\\\"style\\\")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=\\\"\\\"):a.nodeValue=a._stashedText||\\\"\\\"),o&&o.nodeType===8)if(a=o.data,a===\\\"/$\\\"){if(e===0)break;e--}else a!==\\\"$\\\"&&a!==\\\"$?\\\"&&a!==\\\"$~\\\"&&a!==\\\"$!\\\"||e++;a=o}while(a)}function fx(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case\\\"HTML\\\":case\\\"HEAD\\\":case\\\"BODY\\\":fx(a),Lx(a);continue;case\\\"SCRIPT\\\":case\\\"STYLE\\\":continue;case\\\"LINK\\\":if(a.rel.toLowerCase()===\\\"stylesheet\\\")continue}e.removeChild(a)}}function PP(e,t,a,o){for(;e.nodeType===1;){var n=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!==\\\"INPUT\\\"||e.type!==\\\"hidden\\\"))break}else if(o){if(!e[vu])switch(t){case\\\"meta\\\":if(!e.hasAttribute(\\\"itemprop\\\"))break;return e;case\\\"link\\\":if(r=e.getAttribute(\\\"rel\\\"),r===\\\"stylesheet\\\"&&e.hasAttribute(\\\"data-precedence\\\"))break;if(r!==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(r=e.getAttribute(\\\"src\\\"),(r!==(n.src==null?null:n.src)||e.getAttribute(\\\"type\\\")!==(n.type==null?null:n.type)||e.getAttribute(\\\"crossorigin\\\")!==(n.crossOrigin==null?null:n.crossOrigin))&&r&&e.hasAttribute(\\\"async\\\")&&!e.hasAttribute(\\\"itemprop\\\"))break;return e;default:return e}}else if(t===\\\"input\\\"&&e.type===\\\"hidden\\\"){var r=n.name==null?null:\\\"\\\"+n.name;if(n.type===\\\"hidden\\\"&&e.getAttribute(\\\"name\\\")===r)return e}else return e;if(e=lo(e.nextSibling),e===null)break}return null}function NP(e,t,a){if(t===\\\"\\\")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==\\\"INPUT\\\"||e.type!==\\\"hidden\\\")&&!a||(e=lo(e.nextSibling),e===null))return null;return e}function yI(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==\\\"INPUT\\\"||e.type!==\\\"hidden\\\")&&!t||(e=lo(e.nextSibling),e===null))return null;return e}function dx(e){return e.data===\\\"$?\\\"||e.data===\\\"$~\\\"}function px(e){return e.data===\\\"$!\\\"||e.data===\\\"$?\\\"&&e.ownerDocument.readyState!==\\\"loading\\\"}function BP(e,t){var a=e.ownerDocument;if(e.data===\\\"$~\\\")e._reactRetry=t;else if(e.data!==\\\"$?\\\"||a.readyState!==\\\"loading\\\")t();else{var o=function(){t(),a.removeEventListener(\\\"DOMContentLoaded\\\",o)};a.addEventListener(\\\"DOMContentLoaded\\\",o),e._reactRetry=o}}function lo(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 mx=null;function DL(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a===\\\"/$\\\"||a===\\\"/&\\\"){if(t===0)return lo(e.nextSibling);t--}else a!==\\\"$\\\"&&a!==\\\"$!\\\"&&a!==\\\"$?\\\"&&a!==\\\"$~\\\"&&a!==\\\"&\\\"||t++}e=e.nextSibling}return null}function OL(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a===\\\"$\\\"||a===\\\"$!\\\"||a===\\\"$?\\\"||a===\\\"$~\\\"||a===\\\"&\\\"){if(t===0)return e;t--}else a!==\\\"/$\\\"&&a!==\\\"/&\\\"||t++}e=e.previousSibling}return null}function SI(e,t,a){switch(t=td(a),e){case\\\"html\\\":if(e=t.documentElement,!e)throw Error(z(452));return e;case\\\"head\\\":if(e=t.head,!e)throw Error(z(453));return e;case\\\"body\\\":if(e=t.body,!e)throw Error(z(454));return e;default:throw Error(z(451))}}function ru(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Lx(e)}var io=new Map,PL=new Set;function ad(e){return typeof e.getRootNode==\\\"function\\\"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Mn=Ke.d;Ke.d={f:FP,r:_P,D:UP,C:HP,L:zP,m:qP,X:GP,S:VP,M:XP};function FP(){var e=Mn.f(),t=yd();return e||t}function _P(e){var t=zl(e);t!==null&&t.tag===5&&t.type===\\\"form\\\"?pv(t):Mn.r(e)}var Xl=typeof document>\\\"u\\\"?null:document;function CI(e,t,a){var o=Xl;if(o&&typeof t==\\\"string\\\"&&t){var n=oo(t);n='link[rel=\\\"'+e+'\\\"][href=\\\"'+n+'\\\"]',typeof a==\\\"string\\\"&&(n+='[crossorigin=\\\"'+a+'\\\"]'),PL.has(n)||(PL.add(n),e={rel:e,crossOrigin:a,href:t},o.querySelector(n)===null&&(t=o.createElement(\\\"link\\\"),$t(t,\\\"link\\\",e),Ht(t),o.head.appendChild(t)))}}function UP(e){Mn.D(e),CI(\\\"dns-prefetch\\\",e,null)}function HP(e,t){Mn.C(e,t),CI(\\\"preconnect\\\",e,t)}function zP(e,t,a){Mn.L(e,t,a);var o=Xl;if(o&&e&&t){var n='link[rel=\\\"preload\\\"][as=\\\"'+oo(t)+'\\\"]';t===\\\"image\\\"&&a&&a.imageSrcSet?(n+='[imagesrcset=\\\"'+oo(a.imageSrcSet)+'\\\"]',typeof a.imageSizes==\\\"string\\\"&&(n+='[imagesizes=\\\"'+oo(a.imageSizes)+'\\\"]')):n+='[href=\\\"'+oo(e)+'\\\"]';var r=n;switch(t){case\\\"style\\\":r=_l(e);break;case\\\"script\\\":r=jl(e)}io.has(r)||(e=pt({rel:\\\"preload\\\",href:t===\\\"image\\\"&&a&&a.imageSrcSet?void 0:e,as:t},a),io.set(r,e),o.querySelector(n)!==null||t===\\\"style\\\"&&o.querySelector(Mu(r))||t===\\\"script\\\"&&o.querySelector(Au(r))||(t=o.createElement(\\\"link\\\"),$t(t,\\\"link\\\",e),Ht(t),o.head.appendChild(t)))}}function qP(e,t){Mn.m(e,t);var a=Xl;if(a&&e){var o=t&&typeof t.as==\\\"string\\\"?t.as:\\\"script\\\",n='link[rel=\\\"modulepreload\\\"][as=\\\"'+oo(o)+'\\\"][href=\\\"'+oo(e)+'\\\"]',r=n;switch(o){case\\\"audioworklet\\\":case\\\"paintworklet\\\":case\\\"serviceworker\\\":case\\\"sharedworker\\\":case\\\"worker\\\":case\\\"script\\\":r=jl(e)}if(!io.has(r)&&(e=pt({rel:\\\"modulepreload\\\",href:e},t),io.set(r,e),a.querySelector(n)===null)){switch(o){case\\\"audioworklet\\\":case\\\"paintworklet\\\":case\\\"serviceworker\\\":case\\\"sharedworker\\\":case\\\"worker\\\":case\\\"script\\\":if(a.querySelector(Au(r)))return}o=a.createElement(\\\"link\\\"),$t(o,\\\"link\\\",e),Ht(o),a.head.appendChild(o)}}}function VP(e,t,a){Mn.S(e,t,a);var o=Xl;if(o&&e){var n=Ll(o).hoistableStyles,r=_l(e);t=t||\\\"default\\\";var s=n.get(r);if(!s){var l={loading:0,preload:null};if(s=o.querySelector(Mu(r)))l.loading=5;else{e=pt({rel:\\\"stylesheet\\\",href:e,\\\"data-precedence\\\":t},a),(a=io.get(r))&&lb(e,a);var i=s=o.createElement(\\\"link\\\");Ht(i),$t(i,\\\"link\\\",e),i._p=new Promise(function(u,c){i.onload=u,i.onerror=c}),i.addEventListener(\\\"load\\\",function(){l.loading|=1}),i.addEventListener(\\\"error\\\",function(){l.loading|=2}),l.loading|=4,Tf(s,t,o)}s={type:\\\"stylesheet\\\",instance:s,count:1,state:l},n.set(r,s)}}}function GP(e,t){Mn.X(e,t);var a=Xl;if(a&&e){var o=Ll(a).hoistableScripts,n=jl(e),r=o.get(n);r||(r=a.querySelector(Au(n)),r||(e=pt({src:e,async:!0},t),(t=io.get(n))&&ib(e,t),r=a.createElement(\\\"script\\\"),Ht(r),$t(r,\\\"link\\\",e),a.head.appendChild(r)),r={type:\\\"script\\\",instance:r,count:1,state:null},o.set(n,r))}}function XP(e,t){Mn.M(e,t);var a=Xl;if(a&&e){var o=Ll(a).hoistableScripts,n=jl(e),r=o.get(n);r||(r=a.querySelector(Au(n)),r||(e=pt({src:e,async:!0,type:\\\"module\\\"},t),(t=io.get(n))&&ib(e,t),r=a.createElement(\\\"script\\\"),Ht(r),$t(r,\\\"link\\\",e),a.head.appendChild(r)),r={type:\\\"script\\\",instance:r,count:1,state:null},o.set(n,r))}}function NL(e,t,a,o){var n=(n=rr.current)?ad(n):null;if(!n)throw Error(z(446));switch(e){case\\\"meta\\\":case\\\"title\\\":return null;case\\\"style\\\":return typeof a.precedence==\\\"string\\\"&&typeof a.href==\\\"string\\\"?(t=_l(a.href),a=Ll(n).hoistableStyles,o=a.get(t),o||(o={type:\\\"style\\\",instance:null,count:0,state:null},a.set(t,o)),o):{type:\\\"void\\\",instance:null,count:0,state:null};case\\\"link\\\":if(a.rel===\\\"stylesheet\\\"&&typeof a.href==\\\"string\\\"&&typeof a.precedence==\\\"string\\\"){e=_l(a.href);var r=Ll(n).hoistableStyles,s=r.get(e);if(s||(n=n.ownerDocument||n,s={type:\\\"stylesheet\\\",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,s),(r=n.querySelector(Mu(e)))&&!r._p&&(s.instance=r,s.state.loading=5),io.has(e)||(a={rel:\\\"preload\\\",as:\\\"style\\\",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},io.set(e,a),r||jP(n,e,a,s.state))),t&&o===null)throw Error(z(528,\\\"\\\"));return s}if(t&&o!==null)throw Error(z(529,\\\"\\\"));return null;case\\\"script\\\":return t=a.async,a=a.src,typeof a==\\\"string\\\"&&t&&typeof t!=\\\"function\\\"&&typeof t!=\\\"symbol\\\"?(t=jl(a),a=Ll(n).hoistableScripts,o=a.get(t),o||(o={type:\\\"script\\\",instance:null,count:0,state:null},a.set(t,o)),o):{type:\\\"void\\\",instance:null,count:0,state:null};default:throw Error(z(444,e))}}function _l(e){return'href=\\\"'+oo(e)+'\\\"'}function Mu(e){return'link[rel=\\\"stylesheet\\\"]['+e+\\\"]\\\"}function LI(e){return pt({},e,{\\\"data-precedence\\\":e.precedence,precedence:null})}function jP(e,t,a,o){e.querySelector('link[rel=\\\"preload\\\"][as=\\\"style\\\"]['+t+\\\"]\\\")?o.loading=1:(t=e.createElement(\\\"link\\\"),o.preload=t,t.addEventListener(\\\"load\\\",function(){return o.loading|=1}),t.addEventListener(\\\"error\\\",function(){return o.loading|=2}),$t(t,\\\"link\\\",a),Ht(t),e.head.appendChild(t))}function jl(e){return'[src=\\\"'+oo(e)+'\\\"]'}function Au(e){return\\\"script[async]\\\"+e}function BL(e,t,a){if(t.count++,t.instance===null)switch(t.type){case\\\"style\\\":var o=e.querySelector('style[data-href~=\\\"'+oo(a.href)+'\\\"]');if(o)return t.instance=o,Ht(o),o;var n=pt({},a,{\\\"data-href\\\":a.href,\\\"data-precedence\\\":a.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement(\\\"style\\\"),Ht(o),$t(o,\\\"style\\\",n),Tf(o,a.precedence,e),t.instance=o;case\\\"stylesheet\\\":n=_l(a.href);var r=e.querySelector(Mu(n));if(r)return t.state.loading|=4,t.instance=r,Ht(r),r;o=LI(a),(n=io.get(n))&&lb(o,n),r=(e.ownerDocument||e).createElement(\\\"link\\\"),Ht(r);var s=r;return s._p=new Promise(function(l,i){s.onload=l,s.onerror=i}),$t(r,\\\"link\\\",o),t.state.loading|=4,Tf(r,a.precedence,e),t.instance=r;case\\\"script\\\":return r=jl(a.src),(n=e.querySelector(Au(r)))?(t.instance=n,Ht(n),n):(o=a,(n=io.get(r))&&(o=pt({},a),ib(o,n)),e=e.ownerDocument||e,n=e.createElement(\\\"script\\\"),Ht(n),$t(n,\\\"link\\\",o),e.head.appendChild(n),t.instance=n);case\\\"void\\\":return null;default:throw Error(z(443,t.type))}else t.type===\\\"stylesheet\\\"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,Tf(o,a.precedence,e));return t.instance}function Tf(e,t,a){for(var o=a.querySelectorAll('link[rel=\\\"stylesheet\\\"][data-precedence],style[data-precedence]'),n=o.length?o[o.length-1]:null,r=n,s=0;s<o.length;s++){var l=o[s];if(l.dataset.precedence===t)r=l;else if(r!==n)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function lb(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ib(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ef=null;function FL(e,t,a){if(Ef===null){var o=new Map,n=Ef=new Map;n.set(a,o)}else n=Ef,o=n.get(a),o||(o=new Map,n.set(a,o));if(o.has(e))return o;for(o.set(e,null),a=a.getElementsByTagName(e),n=0;n<a.length;n++){var r=a[n];if(!(r[vu]||r[jt]||e===\\\"link\\\"&&r.getAttribute(\\\"rel\\\")===\\\"stylesheet\\\")&&r.namespaceURI!==\\\"http://www.w3.org/2000/svg\\\"){var s=r.getAttribute(t)||\\\"\\\";s=e+s;var l=o.get(s);l?l.push(r):o.set(s,[r])}}return o}function _L(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t===\\\"title\\\"?e.querySelector(\\\"head > title\\\"):null)}function YP(e,t,a){if(a===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;return t.rel===\\\"stylesheet\\\"?(e=t.disabled,typeof t.precedence==\\\"string\\\"&&e==null):!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 RI(e){return!(e.type===\\\"stylesheet\\\"&&(e.state.loading&3)===0)}function KP(e,t,a,o){if(a.type===\\\"stylesheet\\\"&&(typeof o.media!=\\\"string\\\"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=_l(o.href),r=t.querySelector(Mu(n));if(r){t=r._p,t!==null&&typeof t==\\\"object\\\"&&typeof t.then==\\\"function\\\"&&(e.count++,e=od.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=r,Ht(r);return}r=t.ownerDocument||t,o=LI(o),(n=io.get(n))&&lb(o,n),r=r.createElement(\\\"link\\\"),Ht(r);var s=r;s._p=new Promise(function(l,i){s.onload=l,s.onerror=i}),$t(r,\\\"link\\\",o),a.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=od.bind(e),t.addEventListener(\\\"load\\\",a),t.addEventListener(\\\"error\\\",a))}}var Ch=0;function $P(e,t){return e.stylesheets&&e.count===0&&Mf(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var o=setTimeout(function(){if(e.stylesheets&&Mf(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Ch===0&&(Ch=62500*EP());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Mf(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Ch?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(n)}}:null}function od(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var nd=null;function Mf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,nd=new Map,t.forEach(WP,e),nd=null,od.call(e))}function WP(e,t){if(!(t.state.loading&4)){var a=nd.get(e);if(a)var o=a.get(null);else{a=new Map,nd.set(e,a);for(var n=e.querySelectorAll(\\\"link[data-precedence],style[data-precedence]\\\"),r=0;r<n.length;r++){var s=n[r];(s.nodeName===\\\"LINK\\\"||s.getAttribute(\\\"media\\\")!==\\\"not all\\\")&&(a.set(s.dataset.precedence,s),o=s)}o&&a.set(null,o)}n=t.instance,s=n.getAttribute(\\\"data-precedence\\\"),r=a.get(s)||o,r===o&&a.set(null,n),a.set(s,n),this.count++,o=od.bind(this),n.addEventListener(\\\"load\\\",o),n.addEventListener(\\\"error\\\",o),r?r.parentNode.insertBefore(n,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var xu={$$typeof:yn,Provider:null,Consumer:null,_currentValue:os,_currentValue2:os,_threadCount:0};function ZP(e,t,a,o,n,r,s,l,i){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=Yg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yg(0),this.hiddenUpdates=Yg(null),this.identifierPrefix=o,this.onUncaughtError=n,this.onCaughtError=r,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=i,this.incompleteTransitions=new Map}function vI(e,t,a,o,n,r,s,l,i,u,c,f){return e=new ZP(e,t,a,s,i,u,c,f,l),t=1,r===!0&&(t|=24),r=Pa(3,null,null,t),e.current=r,r.stateNode=e,t=Px(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:o,isDehydrated:a,cache:t},Fx(r),e}function II(e){return e?(e=bl,e):bl}function wI(e,t,a,o,n,r){n=II(n),o.context===null?o.context=n:o.pendingContext=n,o=lr(t),o.payload={element:a},r=r===void 0?null:r,r!==null&&(o.callback=r),a=ir(e,o,t),a!==null&&(Ca(a,e,t),Zi(a,e,t))}function UL(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function ub(e,t){UL(e,t),(e=e.alternate)&&UL(e,t)}function kI(e){if(e.tag===13||e.tag===31){var t=hs(e,67108864);t!==null&&Ca(t,e,67108864),ub(e,67108864)}}function HL(e){if(e.tag===13||e.tag===31){var t=Ua();t=Sx(t);var a=hs(e,t);a!==null&&Ca(a,e,t),ub(e,t)}}var rd=!0;function QP(e,t,a,o){var n=Se.T;Se.T=null;var r=Ke.p;try{Ke.p=2,cb(e,t,a,o)}finally{Ke.p=r,Se.T=n}}function JP(e,t,a,o){var n=Se.T;Se.T=null;var r=Ke.p;try{Ke.p=8,cb(e,t,a,o)}finally{Ke.p=r,Se.T=n}}function cb(e,t,a,o){if(rd){var n=gx(o);if(n===null)yh(e,t,o,sd,a),zL(e,o);else if(tN(n,e,t,a,o))o.stopPropagation();else if(zL(e,o),t&4&&-1<eN.indexOf(e)){for(;n!==null;){var r=zl(n);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var s=es(r.pendingLanes);if(s!==0){var l=r;for(l.pendingLanes|=2,l.entangledLanes|=2;s;){var i=1<<31-_a(s);l.entanglements[1]|=i,s&=~i}Ho(r),(Ye&6)===0&&($f=Ba()+500,Eu(0,!1))}}break;case 31:case 13:l=hs(r,2),l!==null&&Ca(l,r,2),yd(),ub(r,2)}if(r=gx(o),r===null&&yh(e,t,o,sd,a),r===n)break;n=r}n!==null&&o.stopPropagation()}else yh(e,t,o,null,a)}}function gx(e){return e=vx(e),fb(e)}var sd=null;function fb(e){if(sd=null,e=dl(e),e!==null){var t=Su(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=YL(t),e!==null)return e;e=null}else if(a===31){if(e=KL(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return sd=e,null}function TI(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(zD()){case QL:return 2;case JL:return 8;case Nf:case qD:return 32;case eR:return 268435456;default:return 32}default:return 32}}var hx=!1,fr=null,dr=null,pr=null,bu=new Map,yu=new Map,Jn=[],eN=\\\"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 zL(e,t){switch(e){case\\\"focusin\\\":case\\\"focusout\\\":fr=null;break;case\\\"dragenter\\\":case\\\"dragleave\\\":dr=null;break;case\\\"mouseover\\\":case\\\"mouseout\\\":pr=null;break;case\\\"pointerover\\\":case\\\"pointerout\\\":bu.delete(t.pointerId);break;case\\\"gotpointercapture\\\":case\\\"lostpointercapture\\\":yu.delete(t.pointerId)}}function Hi(e,t,a,o,n,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:a,eventSystemFlags:o,nativeEvent:r,targetContainers:[n]},t!==null&&(t=zl(t),t!==null&&kI(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function tN(e,t,a,o,n){switch(t){case\\\"focusin\\\":return fr=Hi(fr,e,t,a,o,n),!0;case\\\"dragenter\\\":return dr=Hi(dr,e,t,a,o,n),!0;case\\\"mouseover\\\":return pr=Hi(pr,e,t,a,o,n),!0;case\\\"pointerover\\\":var r=n.pointerId;return bu.set(r,Hi(bu.get(r)||null,e,t,a,o,n)),!0;case\\\"gotpointercapture\\\":return r=n.pointerId,yu.set(r,Hi(yu.get(r)||null,e,t,a,o,n)),!0}return!1}function EI(e){var t=dl(e.target);if(t!==null){var a=Su(t);if(a!==null){if(t=a.tag,t===13){if(t=YL(a),t!==null){e.blockedOn=t,vC(e.priority,function(){HL(a)});return}}else if(t===31){if(t=KL(a),t!==null){e.blockedOn=t,vC(e.priority,function(){HL(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Af(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=gx(e.nativeEvent);if(a===null){a=e.nativeEvent;var o=new a.constructor(a.type,a);Ph=o,a.target.dispatchEvent(o),Ph=null}else return t=zl(a),t!==null&&kI(t),e.blockedOn=a,!1;t.shift()}return!0}function qL(e,t,a){Af(e)&&a.delete(t)}function aN(){hx=!1,fr!==null&&Af(fr)&&(fr=null),dr!==null&&Af(dr)&&(dr=null),pr!==null&&Af(pr)&&(pr=null),bu.forEach(qL),yu.forEach(qL)}function gf(e,t){e.blockedOn===t&&(e.blockedOn=null,hx||(hx=!0,Pt.unstable_scheduleCallback(Pt.unstable_NormalPriority,aN)))}var hf=null;function VL(e){hf!==e&&(hf=e,Pt.unstable_scheduleCallback(Pt.unstable_NormalPriority,function(){hf===e&&(hf=null);for(var t=0;t<e.length;t+=3){var a=e[t],o=e[t+1],n=e[t+2];if(typeof o!=\\\"function\\\"){if(fb(o||a)===null)continue;break}var r=zl(a);r!==null&&(e.splice(t,3),t-=3,Wh(r,{pending:!0,data:n,method:a.method,action:o},o,n))}}))}function Ul(e){function t(i){return gf(i,e)}fr!==null&&gf(fr,e),dr!==null&&gf(dr,e),pr!==null&&gf(pr,e),bu.forEach(t),yu.forEach(t);for(var a=0;a<Jn.length;a++){var o=Jn[a];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Jn.length&&(a=Jn[0],a.blockedOn===null);)EI(a),a.blockedOn===null&&Jn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var n=a[o],r=a[o+1],s=n[La]||null;if(typeof r==\\\"function\\\")s||VL(a);else if(s){var l=null;if(r&&r.hasAttribute(\\\"formAction\\\")){if(n=r,s=r[La]||null)l=s.formAction;else if(fb(n)!==null)continue}else l=s.action;typeof l==\\\"function\\\"?a[o+1]=l:(a.splice(o,3),o-=3),VL(a)}}}function MI(){function e(r){r.canIntercept&&r.info===\\\"react-transition\\\"&&r.intercept({handler:function(){return new Promise(function(s){return n=s})},focusReset:\\\"manual\\\",scroll:\\\"manual\\\"})}function t(){n!==null&&(n(),n=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:\\\"react-transition\\\",history:\\\"replace\\\"})}}if(typeof navigation==\\\"object\\\"){var o=!1,n=null;return navigation.addEventListener(\\\"navigate\\\",e),navigation.addEventListener(\\\"navigatesuccess\\\",t),navigation.addEventListener(\\\"navigateerror\\\",t),setTimeout(a,100),function(){o=!0,navigation.removeEventListener(\\\"navigate\\\",e),navigation.removeEventListener(\\\"navigatesuccess\\\",t),navigation.removeEventListener(\\\"navigateerror\\\",t),n!==null&&(n(),n=null)}}}function db(e){this._internalRoot=e}Ld.prototype.render=db.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));var a=t.current,o=Ua();wI(a,o,e,t,null,null)};Ld.prototype.unmount=db.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wI(e.current,2,null,e,null,null),yd(),t[Hl]=null}};function Ld(e){this._internalRoot=e}Ld.prototype.unstable_scheduleHydration=function(e){if(e){var t=rR();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Jn.length&&t!==0&&t<Jn[a].priority;a++);Jn.splice(a,0,e),a===0&&EI(e)}};var GL=XL.version;if(GL!==\\\"19.2.7\\\")throw Error(z(527,GL,\\\"19.2.7\\\"));Ke.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==\\\"function\\\"?Error(z(188)):(e=Object.keys(e).join(\\\",\\\"),Error(z(268,e)));return e=PD(t),e=e!==null?$L(e):null,e=e===null?null:e.stateNode,e};var oN={bundleType:0,version:\\\"19.2.7\\\",rendererPackageName:\\\"react-dom\\\",currentDispatcherRef:Se,reconcilerVersion:\\\"19.2.7\\\"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\\\"u\\\"&&(zi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!zi.isDisabled&&zi.supportsFiber))try{Cu=zi.inject(oN),Fa=zi}catch{}var zi;Rd.createRoot=function(e,t){if(!jL(e))throw Error(z(299));var a=!1,o=\\\"\\\",n=Cv,r=Lv,s=Rv;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=vI(e,1,!1,null,null,a,o,null,n,r,s,MI),e[Hl]=t.current,sb(e),new db(t)};Rd.hydrateRoot=function(e,t,a){if(!jL(e))throw Error(z(299));var o=!1,n=\\\"\\\",r=Cv,s=Lv,l=Rv,i=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(r=a.onUncaughtError),a.onCaughtError!==void 0&&(s=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(i=a.formState)),t=vI(e,1,!0,t,a??null,o,n,i,r,s,l,MI),t.context=II(null),a=t.current,o=Ua(),o=Sx(o),n=lr(o),n.callback=null,ir(a,n,o),a=o,t.current.lanes=a,Ru(t,a),Ho(t),e[Hl]=t.current,sb(e),new Ld(t)};Rd.version=\\\"19.2.7\\\"});var PI=ha((Nz,OI)=>{\\\"use strict\\\";function DI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\\\"u\\\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\\\"function\\\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DI)}catch(e){console.error(e)}}DI(),OI.exports=AI()});var bw=ha(Md=>{\\\"use strict\\\";var h2=Symbol.for(\\\"react.transitional.element\\\"),x2=Symbol.for(\\\"react.fragment\\\");function xw(e,t,a){var o=null;if(a!==void 0&&(o=\\\"\\\"+a),t.key!==void 0&&(o=\\\"\\\"+t.key),\\\"key\\\"in t){a={};for(var n in t)n!==\\\"key\\\"&&(a[n]=t[n])}else a=t;return t=a.ref,{$$typeof:h2,type:e,key:o,ref:t!==void 0?t:null,props:a}}Md.Fragment=x2;Md.jsx=xw;Md.jsxs=xw});var D=ha((W3,yw)=>{\\\"use strict\\\";yw.exports=bw()});var tE=ha(eE=>{\\\"use strict\\\";var hi=T();function tU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aU=typeof Object.is==\\\"function\\\"?Object.is:tU,oU=hi.useState,nU=hi.useEffect,rU=hi.useLayoutEffect,sU=hi.useDebugValue;function lU(e,t){var a=t(),o=oU({inst:{value:a,getSnapshot:t}}),n=o[0].inst,r=o[1];return rU(function(){n.value=a,n.getSnapshot=t,Hy(n)&&r({inst:n})},[e,a,t]),nU(function(){return Hy(n)&&r({inst:n}),e(function(){Hy(n)&&r({inst:n})})},[e]),sU(a),a}function Hy(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!aU(e,a)}catch{return!0}}function iU(e,t){return t()}var uU=typeof window>\\\"u\\\"||typeof window.document>\\\"u\\\"||typeof window.document.createElement>\\\"u\\\"?iU:lU;eE.useSyncExternalStore=hi.useSyncExternalStore!==void 0?hi.useSyncExternalStore:uU});var Vp=ha((Y9,aE)=>{\\\"use strict\\\";aE.exports=tE()});var nE=ha(oE=>{\\\"use strict\\\";var Gp=T(),cU=Vp();function fU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dU=typeof Object.is==\\\"function\\\"?Object.is:fU,pU=cU.useSyncExternalStore,mU=Gp.useRef,gU=Gp.useEffect,hU=Gp.useMemo,xU=Gp.useDebugValue;oE.useSyncExternalStoreWithSelector=function(e,t,a,o,n){var r=mU(null);if(r.current===null){var s={hasValue:!1,value:null};r.current=s}else s=r.current;r=hU(function(){function i(p){if(!u){if(u=!0,c=p,p=o(p),n!==void 0&&s.hasValue){var x=s.value;if(n(x,p))return f=x}return f=p}if(x=f,dU(c,p))return x;var b=o(p);return n!==void 0&&n(x,b)?(c=p,x):(c=p,f=b)}var u=!1,c,f,d=a===void 0?null:a;return[function(){return i(t())},d===null?void 0:function(){return i(d())}]},[t,a,o,n]);var l=pU(e,r[0],r[1]);return gU(function(){s.hasValue=!0,s.value=l},[l]),xU(l),l}});var sE=ha(($9,rE)=>{\\\"use strict\\\";rE.exports=nE()});var wz={};Oo(wz,{mountReportIsland:()=>qS});var J1=S(T(),1),eD=S(PI(),1);var wd=S(T(),1);var vd=(...e)=>e.filter((t,a,o)=>!!t&&t.trim()!==\\\"\\\"&&o.indexOf(t)===a).join(\\\" \\\").trim();var NI=e=>e.replace(/([a-z0-9])([A-Z])/g,\\\"$1-$2\\\").toLowerCase();var BI=e=>e.replace(/^([A-Z])|[\\\\s-_]+(\\\\w)/g,(t,a,o)=>o?o.toUpperCase():a.toLowerCase());var pb=e=>{let t=BI(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Du=S(T(),1);var Id={xmlns:\\\"http://www.w3.org/2000/svg\\\",width:24,height:24,viewBox:\\\"0 0 24 24\\\",fill:\\\"none\\\",stroke:\\\"currentColor\\\",strokeWidth:2,strokeLinecap:\\\"round\\\",strokeLinejoin:\\\"round\\\"};var FI=e=>{for(let t in e)if(t.startsWith(\\\"aria-\\\")||t===\\\"role\\\"||t===\\\"title\\\")return!0;return!1};var Yl=S(T(),1);var nN=(0,Yl.createContext)({});var _I=()=>(0,Yl.useContext)(nN);var UI=(0,Du.forwardRef)(({color:e,size:t,strokeWidth:a,absoluteStrokeWidth:o,className:n=\\\"\\\",children:r,iconNode:s,...l},i)=>{let{size:u=24,strokeWidth:c=2,absoluteStrokeWidth:f=!1,color:d=\\\"currentColor\\\",className:p=\\\"\\\"}=_I()??{},x=o??f?Number(a??c)*24/Number(t??u):a??c;return(0,Du.createElement)(\\\"svg\\\",{ref:i,...Id,width:t??u??Id.width,height:t??u??Id.height,stroke:e??d,strokeWidth:x,className:vd(\\\"lucide\\\",p,n),...!r&&!FI(l)&&{\\\"aria-hidden\\\":\\\"true\\\"},...l},[...s.map(([b,C])=>(0,Du.createElement)(b,C)),...Array.isArray(r)?r:[r]])});var xt=(e,t)=>{let a=(0,wd.forwardRef)(({className:o,...n},r)=>(0,wd.createElement)(UI,{ref:r,iconNode:t,className:vd(`lucide-${NI(pb(e))}`,`lucide-${e}`,o),...n}));return a.displayName=pb(e),a};var rN=[[\\\"path\\\",{d:\\\"M12 8V4H8\\\",key:\\\"hb8ula\\\"}],[\\\"rect\\\",{width:\\\"16\\\",height:\\\"12\\\",x:\\\"4\\\",y:\\\"8\\\",rx:\\\"2\\\",key:\\\"enze0r\\\"}],[\\\"path\\\",{d:\\\"M2 14h2\\\",key:\\\"vft8re\\\"}],[\\\"path\\\",{d:\\\"M20 14h2\\\",key:\\\"4cs60a\\\"}],[\\\"path\\\",{d:\\\"M15 13v2\\\",key:\\\"1xurst\\\"}],[\\\"path\\\",{d:\\\"M9 13v2\\\",key:\\\"rq6x2g\\\"}]],Ou=xt(\\\"bot\\\",rN);var sN=[[\\\"circle\\\",{cx:\\\"12\\\",cy:\\\"12\\\",r:\\\"1\\\",key:\\\"41hilf\\\"}],[\\\"circle\\\",{cx:\\\"19\\\",cy:\\\"12\\\",r:\\\"1\\\",key:\\\"1wjl8i\\\"}],[\\\"circle\\\",{cx:\\\"5\\\",cy:\\\"12\\\",r:\\\"1\\\",key:\\\"1pcz8c\\\"}]],Sr=xt(\\\"ellipsis\\\",sN);var lN=[[\\\"path\\\",{d:\\\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\\\",key:\\\"1oefj6\\\"}],[\\\"path\\\",{d:\\\"M14 2v5a1 1 0 0 0 1 1h5\\\",key:\\\"wfsgrz\\\"}],[\\\"path\\\",{d:\\\"M10 9H8\\\",key:\\\"b1mrlr\\\"}],[\\\"path\\\",{d:\\\"M16 13H8\\\",key:\\\"t4e002\\\"}],[\\\"path\\\",{d:\\\"M16 17H8\\\",key:\\\"z1uh3a\\\"}]],Pu=xt(\\\"file-text\\\",lN);var iN=[[\\\"path\\\",{d:\\\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\\\",key:\\\"1cjeqo\\\"}],[\\\"path\\\",{d:\\\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\\\",key:\\\"19qd67\\\"}]],Nu=xt(\\\"link\\\",iN);var uN=[[\\\"path\\\",{d:\\\"M3 5h.01\\\",key:\\\"18ugdj\\\"}],[\\\"path\\\",{d:\\\"M3 12h.01\\\",key:\\\"nlz23k\\\"}],[\\\"path\\\",{d:\\\"M3 19h.01\\\",key:\\\"noohij\\\"}],[\\\"path\\\",{d:\\\"M8 5h13\\\",key:\\\"1pao27\\\"}],[\\\"path\\\",{d:\\\"M8 12h13\\\",key:\\\"1za7za\\\"}],[\\\"path\\\",{d:\\\"M8 19h13\\\",key:\\\"m83p4d\\\"}]],Bu=xt(\\\"list\\\",uN);var cN=[[\\\"rect\\\",{width:\\\"20\\\",height:\\\"14\\\",x:\\\"2\\\",y:\\\"3\\\",rx:\\\"2\\\",key:\\\"48i651\\\"}],[\\\"line\\\",{x1:\\\"8\\\",x2:\\\"16\\\",y1:\\\"21\\\",y2:\\\"21\\\",key:\\\"1svkeh\\\"}],[\\\"line\\\",{x1:\\\"12\\\",x2:\\\"12\\\",y1:\\\"17\\\",y2:\\\"21\\\",key:\\\"vw1qmm\\\"}]],Fu=xt(\\\"monitor\\\",cN);var fN=[[\\\"path\\\",{d:\\\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\\\",key:\\\"kfwtm\\\"}]],_u=xt(\\\"moon\\\",fN);var dN=[[\\\"path\\\",{d:\\\"m21 21-4.34-4.34\\\",key:\\\"14j7rj\\\"}],[\\\"circle\\\",{cx:\\\"11\\\",cy:\\\"11\\\",r:\\\"8\\\",key:\\\"4ej97u\\\"}]],Uu=xt(\\\"search\\\",dN);var pN=[[\\\"circle\\\",{cx:\\\"18\\\",cy:\\\"5\\\",r:\\\"3\\\",key:\\\"gq8acd\\\"}],[\\\"circle\\\",{cx:\\\"6\\\",cy:\\\"12\\\",r:\\\"3\\\",key:\\\"w7nqdw\\\"}],[\\\"circle\\\",{cx:\\\"18\\\",cy:\\\"19\\\",r:\\\"3\\\",key:\\\"1xt0gg\\\"}],[\\\"line\\\",{x1:\\\"8.59\\\",x2:\\\"15.42\\\",y1:\\\"13.51\\\",y2:\\\"17.49\\\",key:\\\"47mynk\\\"}],[\\\"line\\\",{x1:\\\"15.41\\\",x2:\\\"8.59\\\",y1:\\\"6.51\\\",y2:\\\"10.49\\\",key:\\\"1n3mei\\\"}]],Hu=xt(\\\"share-2\\\",pN);var mN=[[\\\"path\\\",{d:\\\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\\\",key:\\\"1s2grr\\\"}],[\\\"path\\\",{d:\\\"M20 2v4\\\",key:\\\"1rf3ol\\\"}],[\\\"path\\\",{d:\\\"M22 4h-4\\\",key:\\\"gwowj6\\\"}],[\\\"circle\\\",{cx:\\\"4\\\",cy:\\\"20\\\",r:\\\"2\\\",key:\\\"6kqj1y\\\"}]],Cr=xt(\\\"sparkles\\\",mN);var gN=[[\\\"circle\\\",{cx:\\\"12\\\",cy:\\\"12\\\",r:\\\"4\\\",key:\\\"4exip2\\\"}],[\\\"path\\\",{d:\\\"M12 2v2\\\",key:\\\"tus03m\\\"}],[\\\"path\\\",{d:\\\"M12 20v2\\\",key:\\\"1lh1kg\\\"}],[\\\"path\\\",{d:\\\"m4.93 4.93 1.41 1.41\\\",key:\\\"149t6j\\\"}],[\\\"path\\\",{d:\\\"m17.66 17.66 1.41 1.41\\\",key:\\\"ptbguv\\\"}],[\\\"path\\\",{d:\\\"M2 12h2\\\",key:\\\"1t8f8n\\\"}],[\\\"path\\\",{d:\\\"M20 12h2\\\",key:\\\"1q8mjw\\\"}],[\\\"path\\\",{d:\\\"m6.34 17.66-1.41 1.41\\\",key:\\\"1m8zz5\\\"}],[\\\"path\\\",{d:\\\"m19.07 4.93-1.41 1.41\\\",key:\\\"1shlcs\\\"}]],zu=xt(\\\"sun\\\",gN);var hN=[[\\\"path\\\",{d:\\\"M18 6 6 18\\\",key:\\\"1bl5f8\\\"}],[\\\"path\\\",{d:\\\"m6 6 12 12\\\",key:\\\"d8bk6v\\\"}]],bs=xt(\\\"x\\\",hN);function HI(){if(typeof document>\\\"u\\\")throw new Error(\\\"WebMCP is unavailable outside a browser document.\\\");let e=document.modelContext;if(!e)throw new Error(\\\"WebMCP is unavailable: document.modelContext is undefined. Use a browser with WebMCP enabled, or installTestModelContext() from webmcpable/testing.\\\");return e}async function xN(e){let t;try{t=await e()}catch(a){return`Error: ${a instanceof Error?a.message:String(a)}`}return typeof t==\\\"string\\\"?t:t===void 0?\\\"\\\":JSON.stringify(t)??\\\"\\\"}function bN(e){let t=new WeakSet;try{return JSON.stringify(e,(a,o)=>{if(typeof o==\\\"bigint\\\")return`${o}`;if(o instanceof Map)return Object.fromEntries(o);if(o instanceof Set)return[...o];if(typeof o==\\\"object\\\"&&o!==null){if(t.has(o))return\\\"[circular]\\\";t.add(o)}return o})??\\\"\\\"}catch{return String(e)}}function yN(e){let t=`${e.name} ${bN(e.input)}`,a=e.title??e.description;return e.descriptorChanged?`${t}\\n${a}\\nThis tool has changed since page load.`:`${t}\\n${a}`}async function SN(e,t){return e===void 0||e===!1?!0:typeof e==\\\"function\\\"?e(t):typeof globalThis.confirm==\\\"function\\\"?globalThis.confirm(yN(t)):!1}var qI=e=>typeof e==\\\"object\\\"&&e!==null&&\\\"~standard\\\"in e;function VI(e){if(!e)return{properties:{},type:\\\"object\\\"};let t=e;if(typeof t.toJSONSchema==\\\"function\\\")return t.toJSONSchema();if(typeof t.toJsonSchema==\\\"function\\\")return t.toJsonSchema();if(qI(e))throw new TypeError(`Cannot derive a JSON Schema from \\\"${e[\\\"~standard\\\"].vendor}\\\". Pass a JSON Schema object as \\\\`input\\\\` instead.`);return e}async function CN(e,t){if(!e)return{value:t};if(!qI(e)){let o=e.required;if(Array.isArray(o)){let n=typeof t==\\\"object\\\"&&t!==null?t:{},r=o.filter(s=>typeof s==\\\"string\\\"&&n[s]===void 0);if(r.length>0)return{error:`Invalid input \\\\u2014 missing required: ${r.join(\\\", \\\")}`}}return{value:t}}let a=await e[\\\"~standard\\\"].validate(t);return a.issues?{error:`Invalid input \\\\u2014 ${a.issues.map(o=>`${o.path?.map(n=>typeof n==\\\"object\\\"?n.key:n).join(\\\".\\\")??\\\"\\\"}: ${o.message}`).join(\\\"; \\\")}`}:{value:a.value}}var LN=e=>e,GI=e=>e.when?.()??!0,RN=(e,t)=>t===!0?void 0:t||`${e} is not available right now.`,mb=(e,t)=>t===\\\"off\\\"?void 0:e.title,zI=(e,t,a)=>JSON.stringify([e,mb(t,a),t.description,VI(t.input),t.annotations,t.exposedTo]),vN=()=>new AbortController().signal;function IN(e,t,a={},o=()=>!1,n=vN()){let r=mb(t,a.titles);return async(s,l)=>{let i=l??{signal:n},u=await CN(t.input,s);return\\\"error\\\"in u?u.error:xN(async()=>{let c=RN(e,GI(t));return c||(t.annotations?.readOnlyHint!==!0&&a.confirm&&!await SN(a.confirm,{description:t.description,descriptorChanged:o(),input:u.value,name:e,...r!==void 0&&{title:r}})?`${e} was not confirmed.`:t.execute(LN(u.value),i))})}}function XI(e,t={}){let a=new Map,o=new Map;async function n(l,i,u){let c=new AbortController;a.set(l,{controller:c,key:u});try{let f=mb(i,t.titles);await HI().registerTool({description:i.description,name:l,...f!==void 0&&{title:f},inputSchema:VI(i.input),...i.annotations&&{annotations:i.annotations},execute:IN(l,i,t,()=>o.get(l)!==zI(l,i,t.titles),c.signal)},{signal:c.signal,...i.exposedTo&&{exposedTo:i.exposedTo}}),o.has(l)||o.set(l,u)}catch(f){throw a.get(l)?.controller===c&&a.delete(l),new Error(`webmcpable could not register \\\"${l}\\\": ${f instanceof Error?`${f.name}: ${f.message}`:String(f)}`,{cause:f})}}function r(l){a.get(l)?.controller.abort(),a.delete(l)}async function s(){if(typeof document>\\\"u\\\"||!document.modelContext)return;let l=new Set(Object.keys(e));for(let i of[...a.keys()])l.has(i)||r(i);for(let[i,u]of Object.entries(e)){let c=a.get(i);if(GI(u)===!1){c&&r(i);continue}let f=zI(i,u,t.titles);c?c.key!==f&&(r(i),await n(i,u,f)):await n(i,u,f)}}return{mount:s,revalidate:s,unmount(){for(let l of[...a.keys()])r(l);o.clear()}}}var ys=S(T(),1),jI=e=>{console.error(\\\"[webmcpable] Tool registration failed.\\\",e)};function YI(e,t={}){let a=(0,ys.useRef)(void 0),o=(0,ys.useRef)(e),n=(0,ys.useRef)(t);o.current=e,n.current=t,(0,ys.useEffect)(()=>{let r=new Proxy({},{get(l,i){if(typeof i!=\\\"string\\\")return;let u=()=>o.current[i];return{get annotations(){return u().annotations},get description(){return u().description},get exposedTo(){return u().exposedTo},get input(){return u().input},get title(){return u().title},execute:(c,f)=>u().execute(c,f),when:()=>u().when?.()??!0}},getOwnPropertyDescriptor:()=>({configurable:!0,enumerable:!0}),has:(l,i)=>typeof i==\\\"string\\\"&&i in o.current,ownKeys:()=>Object.keys(o.current)}),s=XI(r,{get confirm(){return n.current.confirm},get titles(){return n.current.titles}});return a.current=s,s.mount().catch(jI),()=>{s.unmount(),a.current=void 0}},[]),(0,ys.useEffect)(()=>{a.current?.revalidate().catch(jI)})}var _e=S(T(),1);function KI(e){var t,a,o=\\\"\\\";if(typeof e==\\\"string\\\"||typeof e==\\\"number\\\")o+=e;else if(typeof e==\\\"object\\\")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(a=KI(e[t]))&&(o&&(o+=\\\" \\\"),o+=a)}else for(a in e)e[a]&&(o&&(o+=\\\" \\\"),o+=a);return o}function kd(){for(var e,t,a=0,o=\\\"\\\",n=arguments.length;a<n;a++)(e=arguments[a])&&(t=KI(e))&&(o&&(o+=\\\" \\\"),o+=t);return o}var $I=e=>typeof e==\\\"boolean\\\"?`${e}`:e===0?\\\"0\\\":e,WI=kd,Lr=(e,t)=>a=>{var o;if(t?.variants==null)return WI(e,a?.class,a?.className);let{variants:n,defaultVariants:r}=t,s=Object.keys(n).map(u=>{let c=a?.[u],f=r?.[u];if(c===null)return null;let d=$I(c)||$I(f);return n[u][d]}),l=a&&Object.entries(a).reduce((u,c)=>{let[f,d]=c;return d===void 0||(u[f]=d),u},{}),i=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,c)=>{let{class:f,className:d,...p}=c;return Object.entries(p).every(x=>{let[b,C]=x;return Array.isArray(C)?C.includes({...r,...l}[b]):{...r,...l}[b]===C})?[...u,f,d]:u},[]);return WI(e,s,i,a?.class,a?.className)};var wN=(e,t)=>{let a=new Array(e.length+t.length);for(let o=0;o<e.length;o++)a[o]=e[o];for(let o=0;o<t.length;o++)a[e.length+o]=t[o];return a},kN=(e,t)=>({classGroupId:e,validator:t}),aw=(e=new Map,t=null,a)=>({nextPart:e,validators:t,classGroupId:a});var ZI=[],TN=\\\"arbitrary..\\\",EN=e=>{let t=AN(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{if(s.startsWith(\\\"[\\\")&&s.endsWith(\\\"]\\\"))return MN(s);let l=s.split(\\\"-\\\"),i=l[0]===\\\"\\\"&&l.length>1?1:0;return ow(l,i,t)},getConflictingClassGroupIds:(s,l)=>{if(l){let i=o[s],u=a[s];return i?u?wN(u,i):i:u||ZI}return a[s]||ZI}}},ow=(e,t,a)=>{if(e.length-t===0)return a.classGroupId;let n=e[t],r=a.nextPart.get(n);if(r){let u=ow(e,t+1,r);if(u)return u}let s=a.validators;if(s===null)return;let l=t===0?e.join(\\\"-\\\"):e.slice(t).join(\\\"-\\\"),i=s.length;for(let u=0;u<i;u++){let c=s[u];if(c.validator(l))return c.classGroupId}},MN=e=>e.slice(1,-1).indexOf(\\\":\\\")===-1?void 0:(()=>{let t=e.slice(1,-1),a=t.indexOf(\\\":\\\"),o=t.slice(0,a);return o?TN+o:void 0})(),AN=e=>{let{theme:t,classGroups:a}=e;return DN(a,t)},DN=(e,t)=>{let a=aw();for(let o in e){let n=e[o];hb(n,a,o,t)}return a},hb=(e,t,a,o)=>{let n=e.length;for(let r=0;r<n;r++){let s=e[r];ON(s,t,a,o)}},ON=(e,t,a,o)=>{if(typeof e==\\\"string\\\"){PN(e,t,a);return}if(typeof e==\\\"function\\\"){NN(e,t,a,o);return}BN(e,t,a,o)},PN=(e,t,a)=>{let o=e===\\\"\\\"?t:nw(t,e);o.classGroupId=a},NN=(e,t,a,o)=>{if(FN(e)){hb(e(o),t,a,o);return}t.validators===null&&(t.validators=[]),t.validators.push(kN(a,e))},BN=(e,t,a,o)=>{let n=Object.entries(e),r=n.length;for(let s=0;s<r;s++){let[l,i]=n[s];hb(i,nw(t,l),a,o)}},nw=(e,t)=>{let a=e,o=t.split(\\\"-\\\"),n=o.length;for(let r=0;r<n;r++){let s=o[r],l=a.nextPart.get(s);l||(l=aw(),a.nextPart.set(s,l)),a=l}return a},FN=e=>\\\"isThemeGetter\\\"in e&&e.isThemeGetter===!0,_N=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=Object.create(null),o=Object.create(null),n=(r,s)=>{a[r]=s,t++,t>e&&(t=0,o=a,a=Object.create(null))};return{get(r){let s=a[r];if(s!==void 0)return s;if((s=o[r])!==void 0)return n(r,s),s},set(r,s){r in a?a[r]=s:n(r,s)}}};var UN=[],QI=(e,t,a,o,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:o,isExternal:n}),HN=e=>{let{prefix:t,experimentalParseClassName:a}=e,o=n=>{let r=[],s=0,l=0,i=0,u,c=n.length;for(let b=0;b<c;b++){let C=n[b];if(s===0&&l===0){if(C===\\\":\\\"){r.push(n.slice(i,b)),i=b+1;continue}if(C===\\\"/\\\"){u=b;continue}}C===\\\"[\\\"?s++:C===\\\"]\\\"?s--:C===\\\"(\\\"?l++:C===\\\")\\\"&&l--}let f=r.length===0?n:n.slice(i),d=f,p=!1;f.endsWith(\\\"!\\\")?(d=f.slice(0,-1),p=!0):f.startsWith(\\\"!\\\")&&(d=f.slice(1),p=!0);let x=u&&u>i?u-i:void 0;return QI(r,p,d,x)};if(t){let n=t+\\\":\\\",r=o;o=s=>s.startsWith(n)?r(s.slice(n.length)):QI(UN,!1,s,void 0,!0)}if(a){let n=o;o=r=>a({className:r,parseClassName:n})}return o},zN=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((a,o)=>{t.set(a,1e6+o)}),a=>{let o=[],n=[];for(let r=0;r<a.length;r++){let s=a[r],l=s[0]===\\\"[\\\",i=t.has(s);l||i?(n.length>0&&(n.sort(),o.push(...n),n=[]),o.push(s)):n.push(s)}return n.length>0&&(n.sort(),o.push(...n)),o}},qN=e=>({cache:_N(e.cacheSize),parseClassName:HN(e),sortModifiers:zN(e),postfixLookupClassGroupIds:VN(e),...EN(e)}),VN=e=>{let t=Object.create(null),a=e.postfixLookupClassGroups;if(a)for(let o=0;o<a.length;o++)t[a[o]]=!0;return t},GN=/\\\\s+/,XN=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:r,postfixLookupClassGroupIds:s}=t,l=[],i=e.trim().split(GN),u=\\\"\\\";for(let c=i.length-1;c>=0;c-=1){let f=i[c],{isExternal:d,modifiers:p,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:C}=a(f);if(d){u=f+(u.length>0?\\\" \\\"+u:u);continue}let g=!!C,m;if(g){let I=b.substring(0,C);m=o(I);let L=m&&s[m]?o(b):void 0;L&&L!==m&&(m=L,g=!1)}else m=o(b);if(!m){if(!g){u=f+(u.length>0?\\\" \\\"+u:u);continue}if(m=o(b),!m){u=f+(u.length>0?\\\" \\\"+u:u);continue}g=!1}let h=p.length===0?\\\"\\\":p.length===1?p[0]:r(p).join(\\\":\\\"),y=x?h+\\\"!\\\":h,v=y+m;if(l.indexOf(v)>-1)continue;l.push(v);let R=n(m,g);for(let I=0;I<R.length;++I){let L=R[I];l.push(y+L)}u=f+(u.length>0?\\\" \\\"+u:u)}return u},jN=(...e)=>{let t=0,a,o,n=\\\"\\\";for(;t<e.length;)(a=e[t++])&&(o=rw(a))&&(n&&(n+=\\\" \\\"),n+=o);return n},rw=e=>{if(typeof e==\\\"string\\\")return e;let t,a=\\\"\\\";for(let o=0;o<e.length;o++)e[o]&&(t=rw(e[o]))&&(a&&(a+=\\\" \\\"),a+=t);return a},YN=(e,...t)=>{let a,o,n,r,s=i=>{let u=t.reduce((c,f)=>f(c),e());return a=qN(u),o=a.cache.get,n=a.cache.set,r=l,l(i)},l=i=>{let u=o(i);if(u)return u;let c=XN(i,a);return n(i,c),c};return r=s,(...i)=>r(jN(...i))},KN=[],Nt=e=>{let t=a=>a[e]||KN;return t.isThemeGetter=!0,t},sw=/^\\\\[(?:(\\\\w[\\\\w-]*):)?(.+)\\\\]$/i,lw=/^\\\\((?:(\\\\w[\\\\w-]*):)?(.+)\\\\)$/i,$N=/^\\\\d+(?:\\\\.\\\\d+)?\\\\/\\\\d+(?:\\\\.\\\\d+)?$/,WN=/^(\\\\d+(\\\\.\\\\d+)?)?(xs|sm|md|lg|xl)$/,ZN=/\\\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\\\b(calc|min|max|clamp)\\\\(.+\\\\)|^0$/,QN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\\\\(.+\\\\)$/,JN=/^(inset_)?-?((\\\\d+)?\\\\.?(\\\\d+)[a-z]+|0)_-?((\\\\d+)?\\\\.?(\\\\d+)[a-z]+|0)/,e2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\\\(.+\\\\)$/,Rr=e=>$N.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),zo=e=>!!e&&Number.isInteger(Number(e)),gb=e=>e.endsWith(\\\"%\\\")&&Be(e.slice(0,-1)),An=e=>WN.test(e),iw=()=>!0,t2=e=>ZN.test(e)&&!QN.test(e),xb=()=>!1,a2=e=>JN.test(e),o2=e=>e2.test(e),n2=e=>!ne(e)&&!se(e),r2=e=>e.startsWith(\\\"@container\\\")&&(e[10]===\\\"/\\\"&&e[11]!==void 0||e[11]===\\\"s\\\"&&e[16]!==void 0&&e.startsWith(\\\"-size/\\\",10)||e[11]===\\\"n\\\"&&e[18]!==void 0&&e.startsWith(\\\"-normal/\\\",10)),s2=e=>vr(e,fw,xb),ne=e=>sw.test(e),Ss=e=>vr(e,dw,t2),JI=e=>vr(e,m2,Be),l2=e=>vr(e,mw,iw),i2=e=>vr(e,pw,xb),ew=e=>vr(e,uw,xb),u2=e=>vr(e,cw,o2),Td=e=>vr(e,gw,a2),se=e=>lw.test(e),qu=e=>Cs(e,dw),c2=e=>Cs(e,pw),tw=e=>Cs(e,uw),f2=e=>Cs(e,fw),d2=e=>Cs(e,cw),Ed=e=>Cs(e,gw,!0),p2=e=>Cs(e,mw,!0),vr=(e,t,a)=>{let o=sw.exec(e);return o?o[1]?t(o[1]):a(o[2]):!1},Cs=(e,t,a=!1)=>{let o=lw.exec(e);return o?o[1]?t(o[1]):a:!1},uw=e=>e===\\\"position\\\"||e===\\\"percentage\\\",cw=e=>e===\\\"image\\\"||e===\\\"url\\\",fw=e=>e===\\\"length\\\"||e===\\\"size\\\"||e===\\\"bg-size\\\",dw=e=>e===\\\"length\\\",m2=e=>e===\\\"number\\\",pw=e=>e===\\\"family-name\\\",mw=e=>e===\\\"number\\\"||e===\\\"weight\\\",gw=e=>e===\\\"shadow\\\";var g2=()=>{let e=Nt(\\\"color\\\"),t=Nt(\\\"font\\\"),a=Nt(\\\"text\\\"),o=Nt(\\\"font-weight\\\"),n=Nt(\\\"tracking\\\"),r=Nt(\\\"leading\\\"),s=Nt(\\\"breakpoint\\\"),l=Nt(\\\"container\\\"),i=Nt(\\\"spacing\\\"),u=Nt(\\\"radius\\\"),c=Nt(\\\"shadow\\\"),f=Nt(\\\"inset-shadow\\\"),d=Nt(\\\"text-shadow\\\"),p=Nt(\\\"drop-shadow\\\"),x=Nt(\\\"blur\\\"),b=Nt(\\\"perspective\\\"),C=Nt(\\\"aspect\\\"),g=Nt(\\\"ease\\\"),m=Nt(\\\"animate\\\"),h=()=>[\\\"auto\\\",\\\"avoid\\\",\\\"all\\\",\\\"avoid-page\\\",\\\"page\\\",\\\"left\\\",\\\"right\\\",\\\"column\\\"],y=()=>[\\\"center\\\",\\\"top\\\",\\\"bottom\\\",\\\"left\\\",\\\"right\\\",\\\"top-left\\\",\\\"left-top\\\",\\\"top-right\\\",\\\"right-top\\\",\\\"bottom-right\\\",\\\"right-bottom\\\",\\\"bottom-left\\\",\\\"left-bottom\\\"],v=()=>[...y(),se,ne],R=()=>[\\\"auto\\\",\\\"hidden\\\",\\\"clip\\\",\\\"visible\\\",\\\"scroll\\\"],I=()=>[\\\"auto\\\",\\\"contain\\\",\\\"none\\\"],L=()=>[se,ne,i],k=()=>[Rr,\\\"full\\\",\\\"auto\\\",...L()],w=()=>[zo,\\\"none\\\",\\\"subgrid\\\",se,ne],A=()=>[\\\"auto\\\",{span:[\\\"full\\\",zo,se,ne]},zo,se,ne],P=()=>[zo,\\\"auto\\\",se,ne],U=()=>[\\\"auto\\\",\\\"min\\\",\\\"max\\\",\\\"fr\\\",se,ne],O=()=>[\\\"start\\\",\\\"end\\\",\\\"center\\\",\\\"between\\\",\\\"around\\\",\\\"evenly\\\",\\\"stretch\\\",\\\"baseline\\\",\\\"center-safe\\\",\\\"end-safe\\\"],M=()=>[\\\"start\\\",\\\"end\\\",\\\"center\\\",\\\"stretch\\\",\\\"center-safe\\\",\\\"end-safe\\\"],_=()=>[\\\"auto\\\",...L()],q=()=>[Rr,\\\"auto\\\",\\\"full\\\",\\\"dvw\\\",\\\"dvh\\\",\\\"lvw\\\",\\\"lvh\\\",\\\"svw\\\",\\\"svh\\\",\\\"min\\\",\\\"max\\\",\\\"fit\\\",...L()],E=()=>[Rr,\\\"screen\\\",\\\"full\\\",\\\"dvw\\\",\\\"lvw\\\",\\\"svw\\\",\\\"min\\\",\\\"max\\\",\\\"fit\\\",...L()],N=()=>[Rr,\\\"screen\\\",\\\"full\\\",\\\"lh\\\",\\\"dvh\\\",\\\"lvh\\\",\\\"svh\\\",\\\"min\\\",\\\"max\\\",\\\"fit\\\",...L()],B=()=>[e,se,ne],ae=()=>[...y(),tw,ew,{position:[se,ne]}],X=()=>[\\\"no-repeat\\\",{repeat:[\\\"\\\",\\\"x\\\",\\\"y\\\",\\\"space\\\",\\\"round\\\"]}],Q=()=>[\\\"auto\\\",\\\"cover\\\",\\\"contain\\\",f2,s2,{size:[se,ne]}],$=()=>[gb,qu,Ss],ee=()=>[\\\"\\\",\\\"none\\\",\\\"full\\\",u,se,ne],J=()=>[\\\"\\\",Be,qu,Ss],Ce=()=>[\\\"solid\\\",\\\"dashed\\\",\\\"dotted\\\",\\\"double\\\"],Y=()=>[\\\"normal\\\",\\\"multiply\\\",\\\"screen\\\",\\\"overlay\\\",\\\"darken\\\",\\\"lighten\\\",\\\"color-dodge\\\",\\\"color-burn\\\",\\\"hard-light\\\",\\\"soft-light\\\",\\\"difference\\\",\\\"exclusion\\\",\\\"hue\\\",\\\"saturation\\\",\\\"color\\\",\\\"luminosity\\\"],W=()=>[Be,gb,tw,ew],me=()=>[\\\"\\\",\\\"none\\\",x,se,ne],ge=()=>[\\\"none\\\",Be,se,ne],oe=()=>[\\\"none\\\",Be,se,ne],he=()=>[Be,se,ne],pe=()=>[Rr,\\\"full\\\",...L()];return{cacheSize:500,theme:{animate:[\\\"spin\\\",\\\"ping\\\",\\\"pulse\\\",\\\"bounce\\\"],aspect:[\\\"video\\\"],blur:[An],breakpoint:[An],color:[iw],container:[An],\\\"drop-shadow\\\":[An],ease:[\\\"in\\\",\\\"out\\\",\\\"in-out\\\"],font:[n2],\\\"font-weight\\\":[\\\"thin\\\",\\\"extralight\\\",\\\"light\\\",\\\"normal\\\",\\\"medium\\\",\\\"semibold\\\",\\\"bold\\\",\\\"extrabold\\\",\\\"black\\\"],\\\"inset-shadow\\\":[An],leading:[\\\"none\\\",\\\"tight\\\",\\\"snug\\\",\\\"normal\\\",\\\"relaxed\\\",\\\"loose\\\"],perspective:[\\\"dramatic\\\",\\\"near\\\",\\\"normal\\\",\\\"midrange\\\",\\\"distant\\\",\\\"none\\\"],radius:[An],shadow:[An],spacing:[\\\"px\\\",Be],text:[An],\\\"text-shadow\\\":[An],tracking:[\\\"tighter\\\",\\\"tight\\\",\\\"normal\\\",\\\"wide\\\",\\\"wider\\\",\\\"widest\\\"]},classGroups:{aspect:[{aspect:[\\\"auto\\\",\\\"square\\\",Rr,ne,se,C]}],container:[\\\"container\\\"],\\\"container-type\\\":[{\\\"@container\\\":[\\\"\\\",\\\"normal\\\",\\\"size\\\",se,ne]}],\\\"container-named\\\":[r2],columns:[{columns:[Be,ne,se,l]}],\\\"break-after\\\":[{\\\"break-after\\\":h()}],\\\"break-before\\\":[{\\\"break-before\\\":h()}],\\\"break-inside\\\":[{\\\"break-inside\\\":[\\\"auto\\\",\\\"avoid\\\",\\\"avoid-page\\\",\\\"avoid-column\\\"]}],\\\"box-decoration\\\":[{\\\"box-decoration\\\":[\\\"slice\\\",\\\"clone\\\"]}],box:[{box:[\\\"border\\\",\\\"content\\\"]}],display:[\\\"block\\\",\\\"inline-block\\\",\\\"inline\\\",\\\"flex\\\",\\\"inline-flex\\\",\\\"table\\\",\\\"inline-table\\\",\\\"table-caption\\\",\\\"table-cell\\\",\\\"table-column\\\",\\\"table-column-group\\\",\\\"table-footer-group\\\",\\\"table-header-group\\\",\\\"table-row-group\\\",\\\"table-row\\\",\\\"flow-root\\\",\\\"grid\\\",\\\"inline-grid\\\",\\\"contents\\\",\\\"list-item\\\",\\\"hidden\\\"],sr:[\\\"sr-only\\\",\\\"not-sr-only\\\"],float:[{float:[\\\"right\\\",\\\"left\\\",\\\"none\\\",\\\"start\\\",\\\"end\\\"]}],clear:[{clear:[\\\"left\\\",\\\"right\\\",\\\"both\\\",\\\"none\\\",\\\"start\\\",\\\"end\\\"]}],isolation:[\\\"isolate\\\",\\\"isolation-auto\\\"],\\\"object-fit\\\":[{object:[\\\"contain\\\",\\\"cover\\\",\\\"fill\\\",\\\"none\\\",\\\"scale-down\\\"]}],\\\"object-position\\\":[{object:v()}],overflow:[{overflow:R()}],\\\"overflow-x\\\":[{\\\"overflow-x\\\":R()}],\\\"overflow-y\\\":[{\\\"overflow-y\\\":R()}],overscroll:[{overscroll:I()}],\\\"overscroll-x\\\":[{\\\"overscroll-x\\\":I()}],\\\"overscroll-y\\\":[{\\\"overscroll-y\\\":I()}],position:[\\\"static\\\",\\\"fixed\\\",\\\"absolute\\\",\\\"relative\\\",\\\"sticky\\\"],inset:[{inset:k()}],\\\"inset-x\\\":[{\\\"inset-x\\\":k()}],\\\"inset-y\\\":[{\\\"inset-y\\\":k()}],start:[{\\\"inset-s\\\":k(),start:k()}],end:[{\\\"inset-e\\\":k(),end:k()}],\\\"inset-bs\\\":[{\\\"inset-bs\\\":k()}],\\\"inset-be\\\":[{\\\"inset-be\\\":k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:[\\\"visible\\\",\\\"invisible\\\",\\\"collapse\\\"],z:[{z:[zo,\\\"auto\\\",se,ne]}],basis:[{basis:[Rr,\\\"full\\\",\\\"auto\\\",l,...L()]}],\\\"flex-direction\\\":[{flex:[\\\"row\\\",\\\"row-reverse\\\",\\\"col\\\",\\\"col-reverse\\\"]}],\\\"flex-wrap\\\":[{flex:[\\\"nowrap\\\",\\\"wrap\\\",\\\"wrap-reverse\\\"]}],flex:[{flex:[Be,Rr,\\\"auto\\\",\\\"initial\\\",\\\"none\\\",ne]}],grow:[{grow:[\\\"\\\",Be,se,ne]}],shrink:[{shrink:[\\\"\\\",Be,se,ne]}],order:[{order:[zo,\\\"first\\\",\\\"last\\\",\\\"none\\\",se,ne]}],\\\"grid-cols\\\":[{\\\"grid-cols\\\":w()}],\\\"col-start-end\\\":[{col:A()}],\\\"col-start\\\":[{\\\"col-start\\\":P()}],\\\"col-end\\\":[{\\\"col-end\\\":P()}],\\\"grid-rows\\\":[{\\\"grid-rows\\\":w()}],\\\"row-start-end\\\":[{row:A()}],\\\"row-start\\\":[{\\\"row-start\\\":P()}],\\\"row-end\\\":[{\\\"row-end\\\":P()}],\\\"grid-flow\\\":[{\\\"grid-flow\\\":[\\\"row\\\",\\\"col\\\",\\\"dense\\\",\\\"row-dense\\\",\\\"col-dense\\\"]}],\\\"auto-cols\\\":[{\\\"auto-cols\\\":U()}],\\\"auto-rows\\\":[{\\\"auto-rows\\\":U()}],gap:[{gap:L()}],\\\"gap-x\\\":[{\\\"gap-x\\\":L()}],\\\"gap-y\\\":[{\\\"gap-y\\\":L()}],\\\"justify-content\\\":[{justify:[...O(),\\\"normal\\\"]}],\\\"justify-items\\\":[{\\\"justify-items\\\":[...M(),\\\"normal\\\"]}],\\\"justify-self\\\":[{\\\"justify-self\\\":[\\\"auto\\\",...M()]}],\\\"align-content\\\":[{content:[\\\"normal\\\",...O()]}],\\\"align-items\\\":[{items:[...M(),{baseline:[\\\"\\\",\\\"last\\\"]}]}],\\\"align-self\\\":[{self:[\\\"auto\\\",...M(),{baseline:[\\\"\\\",\\\"last\\\"]}]}],\\\"place-content\\\":[{\\\"place-content\\\":O()}],\\\"place-items\\\":[{\\\"place-items\\\":[...M(),\\\"baseline\\\"]}],\\\"place-self\\\":[{\\\"place-self\\\":[\\\"auto\\\",...M()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mbs:[{mbs:_()}],mbe:[{mbe:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],\\\"space-x\\\":[{\\\"space-x\\\":L()}],\\\"space-x-reverse\\\":[\\\"space-x-reverse\\\"],\\\"space-y\\\":[{\\\"space-y\\\":L()}],\\\"space-y-reverse\\\":[\\\"space-y-reverse\\\"],size:[{size:q()}],\\\"inline-size\\\":[{inline:[\\\"auto\\\",...E()]}],\\\"min-inline-size\\\":[{\\\"min-inline\\\":[\\\"auto\\\",...E()]}],\\\"max-inline-size\\\":[{\\\"max-inline\\\":[\\\"none\\\",...E()]}],\\\"block-size\\\":[{block:[\\\"auto\\\",...N()]}],\\\"min-block-size\\\":[{\\\"min-block\\\":[\\\"auto\\\",...N()]}],\\\"max-block-size\\\":[{\\\"max-block\\\":[\\\"none\\\",...N()]}],w:[{w:[l,\\\"screen\\\",...q()]}],\\\"min-w\\\":[{\\\"min-w\\\":[l,\\\"screen\\\",\\\"none\\\",...q()]}],\\\"max-w\\\":[{\\\"max-w\\\":[l,\\\"screen\\\",\\\"none\\\",\\\"prose\\\",{screen:[s]},...q()]}],h:[{h:[\\\"screen\\\",\\\"lh\\\",...q()]}],\\\"min-h\\\":[{\\\"min-h\\\":[\\\"screen\\\",\\\"lh\\\",\\\"none\\\",...q()]}],\\\"max-h\\\":[{\\\"max-h\\\":[\\\"screen\\\",\\\"lh\\\",...q()]}],\\\"font-size\\\":[{text:[\\\"base\\\",a,qu,Ss]}],\\\"font-smoothing\\\":[\\\"antialiased\\\",\\\"subpixel-antialiased\\\"],\\\"font-style\\\":[\\\"italic\\\",\\\"not-italic\\\"],\\\"font-weight\\\":[{font:[o,p2,l2]}],\\\"font-stretch\\\":[{\\\"font-stretch\\\":[\\\"ultra-condensed\\\",\\\"extra-condensed\\\",\\\"condensed\\\",\\\"semi-condensed\\\",\\\"normal\\\",\\\"semi-expanded\\\",\\\"expanded\\\",\\\"extra-expanded\\\",\\\"ultra-expanded\\\",gb,ne]}],\\\"font-family\\\":[{font:[c2,i2,t]}],\\\"font-features\\\":[{\\\"font-features\\\":[ne]}],\\\"fvn-normal\\\":[\\\"normal-nums\\\"],\\\"fvn-ordinal\\\":[\\\"ordinal\\\"],\\\"fvn-slashed-zero\\\":[\\\"slashed-zero\\\"],\\\"fvn-figure\\\":[\\\"lining-nums\\\",\\\"oldstyle-nums\\\"],\\\"fvn-spacing\\\":[\\\"proportional-nums\\\",\\\"tabular-nums\\\"],\\\"fvn-fraction\\\":[\\\"diagonal-fractions\\\",\\\"stacked-fractions\\\"],tracking:[{tracking:[n,se,ne]}],\\\"line-clamp\\\":[{\\\"line-clamp\\\":[Be,\\\"none\\\",se,JI]}],leading:[{leading:[r,...L()]}],\\\"list-image\\\":[{\\\"list-image\\\":[\\\"none\\\",se,ne]}],\\\"list-style-position\\\":[{list:[\\\"inside\\\",\\\"outside\\\"]}],\\\"list-style-type\\\":[{list:[\\\"disc\\\",\\\"decimal\\\",\\\"none\\\",se,ne]}],\\\"text-alignment\\\":[{text:[\\\"left\\\",\\\"center\\\",\\\"right\\\",\\\"justify\\\",\\\"start\\\",\\\"end\\\"]}],\\\"placeholder-color\\\":[{placeholder:B()}],\\\"text-color\\\":[{text:B()}],\\\"text-decoration\\\":[\\\"underline\\\",\\\"overline\\\",\\\"line-through\\\",\\\"no-underline\\\"],\\\"text-decoration-style\\\":[{decoration:[...Ce(),\\\"wavy\\\"]}],\\\"text-decoration-thickness\\\":[{decoration:[Be,\\\"from-font\\\",\\\"auto\\\",se,Ss]}],\\\"text-decoration-color\\\":[{decoration:B()}],\\\"underline-offset\\\":[{\\\"underline-offset\\\":[Be,\\\"auto\\\",se,ne]}],\\\"text-transform\\\":[\\\"uppercase\\\",\\\"lowercase\\\",\\\"capitalize\\\",\\\"normal-case\\\"],\\\"text-overflow\\\":[\\\"truncate\\\",\\\"text-ellipsis\\\",\\\"text-clip\\\"],\\\"text-wrap\\\":[{text:[\\\"wrap\\\",\\\"nowrap\\\",\\\"balance\\\",\\\"pretty\\\"]}],indent:[{indent:L()}],\\\"tab-size\\\":[{tab:[zo,se,ne]}],\\\"vertical-align\\\":[{align:[\\\"baseline\\\",\\\"top\\\",\\\"middle\\\",\\\"bottom\\\",\\\"text-top\\\",\\\"text-bottom\\\",\\\"sub\\\",\\\"super\\\",se,ne]}],whitespace:[{whitespace:[\\\"normal\\\",\\\"nowrap\\\",\\\"pre\\\",\\\"pre-line\\\",\\\"pre-wrap\\\",\\\"break-spaces\\\"]}],break:[{break:[\\\"normal\\\",\\\"words\\\",\\\"all\\\",\\\"keep\\\"]}],wrap:[{wrap:[\\\"break-word\\\",\\\"anywhere\\\",\\\"normal\\\"]}],hyphens:[{hyphens:[\\\"none\\\",\\\"manual\\\",\\\"auto\\\"]}],content:[{content:[\\\"none\\\",se,ne]}],\\\"bg-attachment\\\":[{bg:[\\\"fixed\\\",\\\"local\\\",\\\"scroll\\\"]}],\\\"bg-clip\\\":[{\\\"bg-clip\\\":[\\\"border\\\",\\\"padding\\\",\\\"content\\\",\\\"text\\\"]}],\\\"bg-origin\\\":[{\\\"bg-origin\\\":[\\\"border\\\",\\\"padding\\\",\\\"content\\\"]}],\\\"bg-position\\\":[{bg:ae()}],\\\"bg-repeat\\\":[{bg:X()}],\\\"bg-size\\\":[{bg:Q()}],\\\"bg-image\\\":[{bg:[\\\"none\\\",{linear:[{to:[\\\"t\\\",\\\"tr\\\",\\\"r\\\",\\\"br\\\",\\\"b\\\",\\\"bl\\\",\\\"l\\\",\\\"tl\\\"]},zo,se,ne],radial:[\\\"\\\",se,ne],conic:[zo,se,ne]},d2,u2]}],\\\"bg-color\\\":[{bg:B()}],\\\"gradient-from-pos\\\":[{from:$()}],\\\"gradient-via-pos\\\":[{via:$()}],\\\"gradient-to-pos\\\":[{to:$()}],\\\"gradient-from\\\":[{from:B()}],\\\"gradient-via\\\":[{via:B()}],\\\"gradient-to\\\":[{to:B()}],rounded:[{rounded:ee()}],\\\"rounded-s\\\":[{\\\"rounded-s\\\":ee()}],\\\"rounded-e\\\":[{\\\"rounded-e\\\":ee()}],\\\"rounded-t\\\":[{\\\"rounded-t\\\":ee()}],\\\"rounded-r\\\":[{\\\"rounded-r\\\":ee()}],\\\"rounded-b\\\":[{\\\"rounded-b\\\":ee()}],\\\"rounded-l\\\":[{\\\"rounded-l\\\":ee()}],\\\"rounded-ss\\\":[{\\\"rounded-ss\\\":ee()}],\\\"rounded-se\\\":[{\\\"rounded-se\\\":ee()}],\\\"rounded-ee\\\":[{\\\"rounded-ee\\\":ee()}],\\\"rounded-es\\\":[{\\\"rounded-es\\\":ee()}],\\\"rounded-tl\\\":[{\\\"rounded-tl\\\":ee()}],\\\"rounded-tr\\\":[{\\\"rounded-tr\\\":ee()}],\\\"rounded-br\\\":[{\\\"rounded-br\\\":ee()}],\\\"rounded-bl\\\":[{\\\"rounded-bl\\\":ee()}],\\\"border-w\\\":[{border:J()}],\\\"border-w-x\\\":[{\\\"border-x\\\":J()}],\\\"border-w-y\\\":[{\\\"border-y\\\":J()}],\\\"border-w-s\\\":[{\\\"border-s\\\":J()}],\\\"border-w-e\\\":[{\\\"border-e\\\":J()}],\\\"border-w-bs\\\":[{\\\"border-bs\\\":J()}],\\\"border-w-be\\\":[{\\\"border-be\\\":J()}],\\\"border-w-t\\\":[{\\\"border-t\\\":J()}],\\\"border-w-r\\\":[{\\\"border-r\\\":J()}],\\\"border-w-b\\\":[{\\\"border-b\\\":J()}],\\\"border-w-l\\\":[{\\\"border-l\\\":J()}],\\\"divide-x\\\":[{\\\"divide-x\\\":J()}],\\\"divide-x-reverse\\\":[\\\"divide-x-reverse\\\"],\\\"divide-y\\\":[{\\\"divide-y\\\":J()}],\\\"divide-y-reverse\\\":[\\\"divide-y-reverse\\\"],\\\"border-style\\\":[{border:[...Ce(),\\\"hidden\\\",\\\"none\\\"]}],\\\"divide-style\\\":[{divide:[...Ce(),\\\"hidden\\\",\\\"none\\\"]}],\\\"border-color\\\":[{border:B()}],\\\"border-color-x\\\":[{\\\"border-x\\\":B()}],\\\"border-color-y\\\":[{\\\"border-y\\\":B()}],\\\"border-color-s\\\":[{\\\"border-s\\\":B()}],\\\"border-color-e\\\":[{\\\"border-e\\\":B()}],\\\"border-color-bs\\\":[{\\\"border-bs\\\":B()}],\\\"border-color-be\\\":[{\\\"border-be\\\":B()}],\\\"border-color-t\\\":[{\\\"border-t\\\":B()}],\\\"border-color-r\\\":[{\\\"border-r\\\":B()}],\\\"border-color-b\\\":[{\\\"border-b\\\":B()}],\\\"border-color-l\\\":[{\\\"border-l\\\":B()}],\\\"divide-color\\\":[{divide:B()}],\\\"outline-style\\\":[{outline:[...Ce(),\\\"none\\\",\\\"hidden\\\"]}],\\\"outline-offset\\\":[{\\\"outline-offset\\\":[Be,se,ne]}],\\\"outline-w\\\":[{outline:[\\\"\\\",Be,qu,Ss]}],\\\"outline-color\\\":[{outline:B()}],shadow:[{shadow:[\\\"\\\",\\\"none\\\",c,Ed,Td]}],\\\"shadow-color\\\":[{shadow:B()}],\\\"inset-shadow\\\":[{\\\"inset-shadow\\\":[\\\"none\\\",f,Ed,Td]}],\\\"inset-shadow-color\\\":[{\\\"inset-shadow\\\":B()}],\\\"ring-w\\\":[{ring:J()}],\\\"ring-w-inset\\\":[\\\"ring-inset\\\"],\\\"ring-color\\\":[{ring:B()}],\\\"ring-offset-w\\\":[{\\\"ring-offset\\\":[Be,Ss]}],\\\"ring-offset-color\\\":[{\\\"ring-offset\\\":B()}],\\\"inset-ring-w\\\":[{\\\"inset-ring\\\":J()}],\\\"inset-ring-color\\\":[{\\\"inset-ring\\\":B()}],\\\"text-shadow\\\":[{\\\"text-shadow\\\":[\\\"none\\\",d,Ed,Td]}],\\\"text-shadow-color\\\":[{\\\"text-shadow\\\":B()}],opacity:[{opacity:[Be,se,ne]}],\\\"mix-blend\\\":[{\\\"mix-blend\\\":[...Y(),\\\"plus-darker\\\",\\\"plus-lighter\\\"]}],\\\"bg-blend\\\":[{\\\"bg-blend\\\":Y()}],\\\"mask-clip\\\":[{\\\"mask-clip\\\":[\\\"border\\\",\\\"padding\\\",\\\"content\\\",\\\"fill\\\",\\\"stroke\\\",\\\"view\\\"]},\\\"mask-no-clip\\\"],\\\"mask-composite\\\":[{mask:[\\\"add\\\",\\\"subtract\\\",\\\"intersect\\\",\\\"exclude\\\"]}],\\\"mask-image-linear-pos\\\":[{\\\"mask-linear\\\":[Be]}],\\\"mask-image-linear-from-pos\\\":[{\\\"mask-linear-from\\\":W()}],\\\"mask-image-linear-to-pos\\\":[{\\\"mask-linear-to\\\":W()}],\\\"mask-image-linear-from-color\\\":[{\\\"mask-linear-from\\\":B()}],\\\"mask-image-linear-to-color\\\":[{\\\"mask-linear-to\\\":B()}],\\\"mask-image-t-from-pos\\\":[{\\\"mask-t-from\\\":W()}],\\\"mask-image-t-to-pos\\\":[{\\\"mask-t-to\\\":W()}],\\\"mask-image-t-from-color\\\":[{\\\"mask-t-from\\\":B()}],\\\"mask-image-t-to-color\\\":[{\\\"mask-t-to\\\":B()}],\\\"mask-image-r-from-pos\\\":[{\\\"mask-r-from\\\":W()}],\\\"mask-image-r-to-pos\\\":[{\\\"mask-r-to\\\":W()}],\\\"mask-image-r-from-color\\\":[{\\\"mask-r-from\\\":B()}],\\\"mask-image-r-to-color\\\":[{\\\"mask-r-to\\\":B()}],\\\"mask-image-b-from-pos\\\":[{\\\"mask-b-from\\\":W()}],\\\"mask-image-b-to-pos\\\":[{\\\"mask-b-to\\\":W()}],\\\"mask-image-b-from-color\\\":[{\\\"mask-b-from\\\":B()}],\\\"mask-image-b-to-color\\\":[{\\\"mask-b-to\\\":B()}],\\\"mask-image-l-from-pos\\\":[{\\\"mask-l-from\\\":W()}],\\\"mask-image-l-to-pos\\\":[{\\\"mask-l-to\\\":W()}],\\\"mask-image-l-from-color\\\":[{\\\"mask-l-from\\\":B()}],\\\"mask-image-l-to-color\\\":[{\\\"mask-l-to\\\":B()}],\\\"mask-image-x-from-pos\\\":[{\\\"mask-x-from\\\":W()}],\\\"mask-image-x-to-pos\\\":[{\\\"mask-x-to\\\":W()}],\\\"mask-image-x-from-color\\\":[{\\\"mask-x-from\\\":B()}],\\\"mask-image-x-to-color\\\":[{\\\"mask-x-to\\\":B()}],\\\"mask-image-y-from-pos\\\":[{\\\"mask-y-from\\\":W()}],\\\"mask-image-y-to-pos\\\":[{\\\"mask-y-to\\\":W()}],\\\"mask-image-y-from-color\\\":[{\\\"mask-y-from\\\":B()}],\\\"mask-image-y-to-color\\\":[{\\\"mask-y-to\\\":B()}],\\\"mask-image-radial\\\":[{\\\"mask-radial\\\":[se,ne]}],\\\"mask-image-radial-from-pos\\\":[{\\\"mask-radial-from\\\":W()}],\\\"mask-image-radial-to-pos\\\":[{\\\"mask-radial-to\\\":W()}],\\\"mask-image-radial-from-color\\\":[{\\\"mask-radial-from\\\":B()}],\\\"mask-image-radial-to-color\\\":[{\\\"mask-radial-to\\\":B()}],\\\"mask-image-radial-shape\\\":[{\\\"mask-radial\\\":[\\\"circle\\\",\\\"ellipse\\\"]}],\\\"mask-image-radial-size\\\":[{\\\"mask-radial\\\":[{closest:[\\\"side\\\",\\\"corner\\\"],farthest:[\\\"side\\\",\\\"corner\\\"]}]}],\\\"mask-image-radial-pos\\\":[{\\\"mask-radial-at\\\":y()}],\\\"mask-image-conic-pos\\\":[{\\\"mask-conic\\\":[Be]}],\\\"mask-image-conic-from-pos\\\":[{\\\"mask-conic-from\\\":W()}],\\\"mask-image-conic-to-pos\\\":[{\\\"mask-conic-to\\\":W()}],\\\"mask-image-conic-from-color\\\":[{\\\"mask-conic-from\\\":B()}],\\\"mask-image-conic-to-color\\\":[{\\\"mask-conic-to\\\":B()}],\\\"mask-mode\\\":[{mask:[\\\"alpha\\\",\\\"luminance\\\",\\\"match\\\"]}],\\\"mask-origin\\\":[{\\\"mask-origin\\\":[\\\"border\\\",\\\"padding\\\",\\\"content\\\",\\\"fill\\\",\\\"stroke\\\",\\\"view\\\"]}],\\\"mask-position\\\":[{mask:ae()}],\\\"mask-repeat\\\":[{mask:X()}],\\\"mask-size\\\":[{mask:Q()}],\\\"mask-type\\\":[{\\\"mask-type\\\":[\\\"alpha\\\",\\\"luminance\\\"]}],\\\"mask-image\\\":[{mask:[\\\"none\\\",se,ne]}],filter:[{filter:[\\\"\\\",\\\"none\\\",se,ne]}],blur:[{blur:me()}],brightness:[{brightness:[Be,se,ne]}],contrast:[{contrast:[Be,se,ne]}],\\\"drop-shadow\\\":[{\\\"drop-shadow\\\":[\\\"\\\",\\\"none\\\",p,Ed,Td]}],\\\"drop-shadow-color\\\":[{\\\"drop-shadow\\\":B()}],grayscale:[{grayscale:[\\\"\\\",Be,se,ne]}],\\\"hue-rotate\\\":[{\\\"hue-rotate\\\":[Be,se,ne]}],invert:[{invert:[\\\"\\\",Be,se,ne]}],saturate:[{saturate:[Be,se,ne]}],sepia:[{sepia:[\\\"\\\",Be,se,ne]}],\\\"backdrop-filter\\\":[{\\\"backdrop-filter\\\":[\\\"\\\",\\\"none\\\",se,ne]}],\\\"backdrop-blur\\\":[{\\\"backdrop-blur\\\":me()}],\\\"backdrop-brightness\\\":[{\\\"backdrop-brightness\\\":[Be,se,ne]}],\\\"backdrop-contrast\\\":[{\\\"backdrop-contrast\\\":[Be,se,ne]}],\\\"backdrop-grayscale\\\":[{\\\"backdrop-grayscale\\\":[\\\"\\\",Be,se,ne]}],\\\"backdrop-hue-rotate\\\":[{\\\"backdrop-hue-rotate\\\":[Be,se,ne]}],\\\"backdrop-invert\\\":[{\\\"backdrop-invert\\\":[\\\"\\\",Be,se,ne]}],\\\"backdrop-opacity\\\":[{\\\"backdrop-opacity\\\":[Be,se,ne]}],\\\"backdrop-saturate\\\":[{\\\"backdrop-saturate\\\":[Be,se,ne]}],\\\"backdrop-sepia\\\":[{\\\"backdrop-sepia\\\":[\\\"\\\",Be,se,ne]}],\\\"border-collapse\\\":[{border:[\\\"collapse\\\",\\\"separate\\\"]}],\\\"border-spacing\\\":[{\\\"border-spacing\\\":L()}],\\\"border-spacing-x\\\":[{\\\"border-spacing-x\\\":L()}],\\\"border-spacing-y\\\":[{\\\"border-spacing-y\\\":L()}],\\\"table-layout\\\":[{table:[\\\"auto\\\",\\\"fixed\\\"]}],caption:[{caption:[\\\"top\\\",\\\"bottom\\\"]}],transition:[{transition:[\\\"\\\",\\\"all\\\",\\\"colors\\\",\\\"opacity\\\",\\\"shadow\\\",\\\"transform\\\",\\\"none\\\",se,ne]}],\\\"transition-behavior\\\":[{transition:[\\\"normal\\\",\\\"discrete\\\"]}],duration:[{duration:[Be,\\\"initial\\\",se,ne]}],ease:[{ease:[\\\"linear\\\",\\\"initial\\\",g,se,ne]}],delay:[{delay:[Be,se,ne]}],animate:[{animate:[\\\"none\\\",m,se,ne]}],backface:[{backface:[\\\"hidden\\\",\\\"visible\\\"]}],perspective:[{perspective:[b,se,ne]}],\\\"perspective-origin\\\":[{\\\"perspective-origin\\\":v()}],rotate:[{rotate:ge()}],\\\"rotate-x\\\":[{\\\"rotate-x\\\":ge()}],\\\"rotate-y\\\":[{\\\"rotate-y\\\":ge()}],\\\"rotate-z\\\":[{\\\"rotate-z\\\":ge()}],scale:[{scale:oe()}],\\\"scale-x\\\":[{\\\"scale-x\\\":oe()}],\\\"scale-y\\\":[{\\\"scale-y\\\":oe()}],\\\"scale-z\\\":[{\\\"scale-z\\\":oe()}],\\\"scale-3d\\\":[\\\"scale-3d\\\"],skew:[{skew:he()}],\\\"skew-x\\\":[{\\\"skew-x\\\":he()}],\\\"skew-y\\\":[{\\\"skew-y\\\":he()}],transform:[{transform:[se,ne,\\\"\\\",\\\"none\\\",\\\"gpu\\\",\\\"cpu\\\"]}],\\\"transform-origin\\\":[{origin:v()}],\\\"transform-style\\\":[{transform:[\\\"3d\\\",\\\"flat\\\"]}],translate:[{translate:pe()}],\\\"translate-x\\\":[{\\\"translate-x\\\":pe()}],\\\"translate-y\\\":[{\\\"translate-y\\\":pe()}],\\\"translate-z\\\":[{\\\"translate-z\\\":pe()}],\\\"translate-none\\\":[\\\"translate-none\\\"],zoom:[{zoom:[zo,se,ne]}],accent:[{accent:B()}],appearance:[{appearance:[\\\"none\\\",\\\"auto\\\"]}],\\\"caret-color\\\":[{caret:B()}],\\\"color-scheme\\\":[{scheme:[\\\"normal\\\",\\\"dark\\\",\\\"light\\\",\\\"light-dark\\\",\\\"only-dark\\\",\\\"only-light\\\"]}],cursor:[{cursor:[\\\"auto\\\",\\\"default\\\",\\\"pointer\\\",\\\"wait\\\",\\\"text\\\",\\\"move\\\",\\\"help\\\",\\\"not-allowed\\\",\\\"none\\\",\\\"context-menu\\\",\\\"progress\\\",\\\"cell\\\",\\\"crosshair\\\",\\\"vertical-text\\\",\\\"alias\\\",\\\"copy\\\",\\\"no-drop\\\",\\\"grab\\\",\\\"grabbing\\\",\\\"all-scroll\\\",\\\"col-resize\\\",\\\"row-resize\\\",\\\"n-resize\\\",\\\"e-resize\\\",\\\"s-resize\\\",\\\"w-resize\\\",\\\"ne-resize\\\",\\\"nw-resize\\\",\\\"se-resize\\\",\\\"sw-resize\\\",\\\"ew-resize\\\",\\\"ns-resize\\\",\\\"nesw-resize\\\",\\\"nwse-resize\\\",\\\"zoom-in\\\",\\\"zoom-out\\\",se,ne]}],\\\"field-sizing\\\":[{\\\"field-sizing\\\":[\\\"fixed\\\",\\\"content\\\"]}],\\\"pointer-events\\\":[{\\\"pointer-events\\\":[\\\"auto\\\",\\\"none\\\"]}],resize:[{resize:[\\\"none\\\",\\\"\\\",\\\"y\\\",\\\"x\\\"]}],\\\"scroll-behavior\\\":[{scroll:[\\\"auto\\\",\\\"smooth\\\"]}],\\\"scrollbar-thumb-color\\\":[{\\\"scrollbar-thumb\\\":B()}],\\\"scrollbar-track-color\\\":[{\\\"scrollbar-track\\\":B()}],\\\"scrollbar-gutter\\\":[{\\\"scrollbar-gutter\\\":[\\\"auto\\\",\\\"stable\\\",\\\"both\\\"]}],\\\"scrollbar-w\\\":[{scrollbar:[\\\"auto\\\",\\\"thin\\\",\\\"none\\\"]}],\\\"scroll-m\\\":[{\\\"scroll-m\\\":L()}],\\\"scroll-mx\\\":[{\\\"scroll-mx\\\":L()}],\\\"scroll-my\\\":[{\\\"scroll-my\\\":L()}],\\\"scroll-ms\\\":[{\\\"scroll-ms\\\":L()}],\\\"scroll-me\\\":[{\\\"scroll-me\\\":L()}],\\\"scroll-mbs\\\":[{\\\"scroll-mbs\\\":L()}],\\\"scroll-mbe\\\":[{\\\"scroll-mbe\\\":L()}],\\\"scroll-mt\\\":[{\\\"scroll-mt\\\":L()}],\\\"scroll-mr\\\":[{\\\"scroll-mr\\\":L()}],\\\"scroll-mb\\\":[{\\\"scroll-mb\\\":L()}],\\\"scroll-ml\\\":[{\\\"scroll-ml\\\":L()}],\\\"scroll-p\\\":[{\\\"scroll-p\\\":L()}],\\\"scroll-px\\\":[{\\\"scroll-px\\\":L()}],\\\"scroll-py\\\":[{\\\"scroll-py\\\":L()}],\\\"scroll-ps\\\":[{\\\"scroll-ps\\\":L()}],\\\"scroll-pe\\\":[{\\\"scroll-pe\\\":L()}],\\\"scroll-pbs\\\":[{\\\"scroll-pbs\\\":L()}],\\\"scroll-pbe\\\":[{\\\"scroll-pbe\\\":L()}],\\\"scroll-pt\\\":[{\\\"scroll-pt\\\":L()}],\\\"scroll-pr\\\":[{\\\"scroll-pr\\\":L()}],\\\"scroll-pb\\\":[{\\\"scroll-pb\\\":L()}],\\\"scroll-pl\\\":[{\\\"scroll-pl\\\":L()}],\\\"snap-align\\\":[{snap:[\\\"start\\\",\\\"end\\\",\\\"center\\\",\\\"align-none\\\"]}],\\\"snap-stop\\\":[{snap:[\\\"normal\\\",\\\"always\\\"]}],\\\"snap-type\\\":[{snap:[\\\"none\\\",\\\"x\\\",\\\"y\\\",\\\"both\\\"]}],\\\"snap-strictness\\\":[{snap:[\\\"mandatory\\\",\\\"proximity\\\"]}],touch:[{touch:[\\\"auto\\\",\\\"none\\\",\\\"manipulation\\\"]}],\\\"touch-x\\\":[{\\\"touch-pan\\\":[\\\"x\\\",\\\"left\\\",\\\"right\\\"]}],\\\"touch-y\\\":[{\\\"touch-pan\\\":[\\\"y\\\",\\\"up\\\",\\\"down\\\"]}],\\\"touch-pz\\\":[\\\"touch-pinch-zoom\\\"],select:[{select:[\\\"none\\\",\\\"text\\\",\\\"all\\\",\\\"auto\\\"]}],\\\"will-change\\\":[{\\\"will-change\\\":[\\\"auto\\\",\\\"scroll\\\",\\\"contents\\\",\\\"transform\\\",se,ne]}],fill:[{fill:[\\\"none\\\",...B()]}],\\\"stroke-w\\\":[{stroke:[Be,qu,Ss,JI]}],stroke:[{stroke:[\\\"none\\\",...B()]}],\\\"forced-color-adjust\\\":[{\\\"forced-color-adjust\\\":[\\\"auto\\\",\\\"none\\\"]}]},conflictingClassGroups:{\\\"container-named\\\":[\\\"container-type\\\"],overflow:[\\\"overflow-x\\\",\\\"overflow-y\\\"],overscroll:[\\\"overscroll-x\\\",\\\"overscroll-y\\\"],inset:[\\\"inset-x\\\",\\\"inset-y\\\",\\\"inset-bs\\\",\\\"inset-be\\\",\\\"start\\\",\\\"end\\\",\\\"top\\\",\\\"right\\\",\\\"bottom\\\",\\\"left\\\"],\\\"inset-x\\\":[\\\"right\\\",\\\"left\\\"],\\\"inset-y\\\":[\\\"top\\\",\\\"bottom\\\"],flex:[\\\"basis\\\",\\\"grow\\\",\\\"shrink\\\"],gap:[\\\"gap-x\\\",\\\"gap-y\\\"],p:[\\\"px\\\",\\\"py\\\",\\\"ps\\\",\\\"pe\\\",\\\"pbs\\\",\\\"pbe\\\",\\\"pt\\\",\\\"pr\\\",\\\"pb\\\",\\\"pl\\\"],px:[\\\"pr\\\",\\\"pl\\\"],py:[\\\"pt\\\",\\\"pb\\\"],m:[\\\"mx\\\",\\\"my\\\",\\\"ms\\\",\\\"me\\\",\\\"mbs\\\",\\\"mbe\\\",\\\"mt\\\",\\\"mr\\\",\\\"mb\\\",\\\"ml\\\"],mx:[\\\"mr\\\",\\\"ml\\\"],my:[\\\"mt\\\",\\\"mb\\\"],size:[\\\"w\\\",\\\"h\\\"],\\\"font-size\\\":[\\\"leading\\\"],\\\"fvn-normal\\\":[\\\"fvn-ordinal\\\",\\\"fvn-slashed-zero\\\",\\\"fvn-figure\\\",\\\"fvn-spacing\\\",\\\"fvn-fraction\\\"],\\\"fvn-ordinal\\\":[\\\"fvn-normal\\\"],\\\"fvn-slashed-zero\\\":[\\\"fvn-normal\\\"],\\\"fvn-figure\\\":[\\\"fvn-normal\\\"],\\\"fvn-spacing\\\":[\\\"fvn-normal\\\"],\\\"fvn-fraction\\\":[\\\"fvn-normal\\\"],\\\"line-clamp\\\":[\\\"display\\\",\\\"overflow\\\"],rounded:[\\\"rounded-s\\\",\\\"rounded-e\\\",\\\"rounded-t\\\",\\\"rounded-r\\\",\\\"rounded-b\\\",\\\"rounded-l\\\",\\\"rounded-ss\\\",\\\"rounded-se\\\",\\\"rounded-ee\\\",\\\"rounded-es\\\",\\\"rounded-tl\\\",\\\"rounded-tr\\\",\\\"rounded-br\\\",\\\"rounded-bl\\\"],\\\"rounded-s\\\":[\\\"rounded-ss\\\",\\\"rounded-es\\\"],\\\"rounded-e\\\":[\\\"rounded-se\\\",\\\"rounded-ee\\\"],\\\"rounded-t\\\":[\\\"rounded-tl\\\",\\\"rounded-tr\\\"],\\\"rounded-r\\\":[\\\"rounded-tr\\\",\\\"rounded-br\\\"],\\\"rounded-b\\\":[\\\"rounded-br\\\",\\\"rounded-bl\\\"],\\\"rounded-l\\\":[\\\"rounded-tl\\\",\\\"rounded-bl\\\"],\\\"border-spacing\\\":[\\\"border-spacing-x\\\",\\\"border-spacing-y\\\"],\\\"border-w\\\":[\\\"border-w-x\\\",\\\"border-w-y\\\",\\\"border-w-s\\\",\\\"border-w-e\\\",\\\"border-w-bs\\\",\\\"border-w-be\\\",\\\"border-w-t\\\",\\\"border-w-r\\\",\\\"border-w-b\\\",\\\"border-w-l\\\"],\\\"border-w-x\\\":[\\\"border-w-r\\\",\\\"border-w-l\\\"],\\\"border-w-y\\\":[\\\"border-w-t\\\",\\\"border-w-b\\\"],\\\"border-color\\\":[\\\"border-color-x\\\",\\\"border-color-y\\\",\\\"border-color-s\\\",\\\"border-color-e\\\",\\\"border-color-bs\\\",\\\"border-color-be\\\",\\\"border-color-t\\\",\\\"border-color-r\\\",\\\"border-color-b\\\",\\\"border-color-l\\\"],\\\"border-color-x\\\":[\\\"border-color-r\\\",\\\"border-color-l\\\"],\\\"border-color-y\\\":[\\\"border-color-t\\\",\\\"border-color-b\\\"],translate:[\\\"translate-x\\\",\\\"translate-y\\\",\\\"translate-none\\\"],\\\"translate-none\\\":[\\\"translate\\\",\\\"translate-x\\\",\\\"translate-y\\\",\\\"translate-z\\\"],\\\"scroll-m\\\":[\\\"scroll-mx\\\",\\\"scroll-my\\\",\\\"scroll-ms\\\",\\\"scroll-me\\\",\\\"scroll-mbs\\\",\\\"scroll-mbe\\\",\\\"scroll-mt\\\",\\\"scroll-mr\\\",\\\"scroll-mb\\\",\\\"scroll-ml\\\"],\\\"scroll-mx\\\":[\\\"scroll-mr\\\",\\\"scroll-ml\\\"],\\\"scroll-my\\\":[\\\"scroll-mt\\\",\\\"scroll-mb\\\"],\\\"scroll-p\\\":[\\\"scroll-px\\\",\\\"scroll-py\\\",\\\"scroll-ps\\\",\\\"scroll-pe\\\",\\\"scroll-pbs\\\",\\\"scroll-pbe\\\",\\\"scroll-pt\\\",\\\"scroll-pr\\\",\\\"scroll-pb\\\",\\\"scroll-pl\\\"],\\\"scroll-px\\\":[\\\"scroll-pr\\\",\\\"scroll-pl\\\"],\\\"scroll-py\\\":[\\\"scroll-pt\\\",\\\"scroll-pb\\\"],touch:[\\\"touch-x\\\",\\\"touch-y\\\",\\\"touch-pz\\\"],\\\"touch-x\\\":[\\\"touch\\\"],\\\"touch-y\\\":[\\\"touch\\\"],\\\"touch-pz\\\":[\\\"touch\\\"]},conflictingClassGroupModifiers:{\\\"font-size\\\":[\\\"leading\\\"]},postfixLookupClassGroups:[\\\"container-type\\\"],orderSensitiveModifiers:[\\\"*\\\",\\\"**\\\",\\\"after\\\",\\\"backdrop\\\",\\\"before\\\",\\\"details-content\\\",\\\"file\\\",\\\"first-letter\\\",\\\"first-line\\\",\\\"marker\\\",\\\"placeholder\\\",\\\"selection\\\"]}};var hw=YN(g2);function te(...e){return hw(kd(e))}var Ad=S(D(),1);function Sw({className:e,...t}){return(0,Ad.jsx)(\\\"div\\\",{\\\"data-slot\\\":\\\"empty\\\",className:te(\\\"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12\\\",e),...t})}function Cw({className:e,...t}){return(0,Ad.jsx)(\\\"div\\\",{\\\"data-slot\\\":\\\"empty-header\\\",className:te(\\\"flex max-w-sm flex-col items-center gap-2 text-center\\\",e),...t})}var J3=Lr(\\\"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0\\\",{variants:{variant:{default:\\\"bg-transparent\\\",icon:\\\"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6\\\"}},defaultVariants:{variant:\\\"default\\\"}});function Lw({className:e,...t}){return(0,Ad.jsx)(\\\"div\\\",{\\\"data-slot\\\":\\\"empty-title\\\",className:te(\\\"text-lg font-medium tracking-tight\\\",e),...t})}var Dd=S(D(),1);function Rw({message:e}){return(0,Dd.jsx)(Sw,{\\\"aria-live\\\":\\\"polite\\\",className:\\\"border\\\",children:(0,Dd.jsx)(Cw,{children:(0,Dd.jsx)(Lw,{children:e??\\\"No scenarios in this report.\\\"})})})}var Iw=S(T(),1);var vw=S(T(),1),Ls=(0,vw.createContext)(null);function qa(){let e=(0,Iw.useContext)(Ls);if(!e)throw new Error(\\\"useReport must be used inside <ReportRoot> or <Report>. Wrap your tree with one of those.\\\");return e.report}function qo(e){if(e<1e3)return`${Math.round(e)} ms`;if(e<6e4)return`${(e/1e3).toFixed(2)} s`;let t=Math.floor(e/6e4),a=Math.floor(e%6e4/1e3);if(t<60)return a>0?`${t}m ${a}s`:`${t}m`;let o=Math.floor(t/60),n=t%60;return`${o}h ${n}m`}var kw=S(D(),1),b2=/\\\"[^\\\"]*\\\"|(?<![\\\\w.-])\\\\d+(?:\\\\.\\\\d+)?(?![\\\\w.-])/g;function ww(e){let t=Array.from(e.matchAll(b2));if(t.length===0)return e;let a=[],o=0;return t.forEach((n,r)=>{let s=n.index,l=s+n[0].length;s>o&&a.push(e.slice(o,s)),a.push((0,kw.jsx)(\\\"span\\\",{className:\\\"font-medium text-step-param italic\\\",children:n[0]},r)),o=l}),o<e.length&&a.push(e.slice(o)),a}function bb(e){let t=\\\"Given\\\",a=[];for(let o of e)(o.keyword===\\\"Given\\\"||o.keyword===\\\"When\\\"||o.keyword===\\\"Then\\\")&&(t=o.keyword),t===\\\"Then\\\"&&a.push(o);return a}function Od(e){let t=bb(e).filter(a=>typeof a.assertions==\\\"number\\\");return t.length===0?\\\"unobserved\\\":t.some(a=>(a.assertions??0)>0)?\\\"asserted\\\":\\\"unasserted\\\"}var Ew=S(D(),1);function Tw({entry:e}){return(0,Ew.jsx)(\\\"p\\\",{className:\\\"my-2 text-sm text-muted-foreground\\\",children:e.text})}var Bq=S(T(),1);function y2(e,t){return function(o,...n){let r=new URL(e);return r.searchParams.set(\\\"code\\\",o.toString()),n.forEach(s=>r.searchParams.append(\\\"args[]\\\",s)),`${t} error #${o}; visit ${r} for the full message.`}}var S2=y2(\\\"https://base-ui.com/production-error\\\",\\\"Base UI\\\"),Pe=S2;var Rs=S(T(),1);var Aw=S(T(),1),Mw={};function tt(e,t){let a=Aw.useRef(Mw);return a.current===Mw&&(a.current=e(t)),a}function va(e,t,a,o){let n=tt(Ow).current;return C2(n,e,t,a,o)&&Pw(n,[e,t,a,o]),n.callback}function Dw(e){let t=tt(Ow).current;return L2(t,e)&&Pw(t,e),t.callback}function Ow(){return{callback:null,cleanup:null,refs:[]}}function C2(e,t,a,o,n){return e.refs[0]!==t||e.refs[1]!==a||e.refs[2]!==o||e.refs[3]!==n}function L2(e,t){return e.refs.length!==t.length||e.refs.some((a,o)=>a!==t[o])}function Pw(e,t){if(e.refs=t,t.every(a=>a==null)){e.callback=null;return}e.callback=a=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),a!=null){let o=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let r=t[n];if(r!=null)switch(typeof r){case\\\"function\\\":{let s=r(a);typeof s==\\\"function\\\"&&(o[n]=s);break}case\\\"object\\\":{r.current=a;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let r=t[n];if(r!=null)switch(typeof r){case\\\"function\\\":{let s=o[n];typeof s==\\\"function\\\"?s():r(null);break}case\\\"object\\\":{r.current=null;break}default:}}}}}}var Bw=S(T(),1);var Nw=S(T(),1),R2=parseInt(Nw.version,10);function Kl(e){return R2>=e}function yb(e){if(!Bw.isValidElement(e))return null;let t=e,a=t.props;return(Kl(19)?a?.ref:t.ref)??null}function Vu(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Fe(){}var Ia=Object.freeze([]),Me=Object.freeze({});function Fw(e,t){let a={};for(let o in e){let n=e[o];if(t?.hasOwnProperty(o)){let r=t[o](n);r!=null&&Object.assign(a,r);continue}n===!0?a[`data-${o.toLowerCase()}`]=\\\"\\\":n&&(a[`data-${o.toLowerCase()}`]=n.toString())}return a}function _w(e,t){return typeof e==\\\"function\\\"?e(t):e}function Uw(e,t){return typeof e==\\\"function\\\"?e(t):e}var Sb={};function da(e,t,a,o,n){if(!a&&!o&&!n&&!e)return Pd(t);let r=Pd(e);return t&&(r=Gu(r,t)),a&&(r=Gu(r,a)),o&&(r=Gu(r,o)),n&&(r=Gu(r,n)),r}function Hw(e){if(e.length===0)return Sb;if(e.length===1)return Pd(e[0]);let t=Pd(e[0]);for(let a=1;a<e.length;a+=1)t=Gu(t,e[a]);return t}function Pd(e){return Cb(e)?{...qw(e,Sb)}:v2(e)}function Gu(e,t){return Cb(t)?qw(t,e):I2(e,t)}function v2(e){let t={...e};for(let a in t){let o=t[a];zw(a,o)&&(t[a]=Vw(o))}return t}function I2(e,t){if(!t)return e;for(let a in t){let o=t[a];switch(a){case\\\"style\\\":{e[a]=Vu(e.style,o);break}case\\\"className\\\":{e[a]=Lb(e.className,o);break}default:zw(a,o)?e[a]=w2(e[a],o):e[a]=o}}return e}function zw(e,t){let a=e.charCodeAt(0),o=e.charCodeAt(1),n=e.charCodeAt(2);return a===111&&o===110&&n>=65&&n<=90&&(typeof t==\\\"function\\\"||typeof t>\\\"u\\\")}function Cb(e){return typeof e==\\\"function\\\"}function qw(e,t){return Cb(e)?e(t):e??Sb}function w2(e,t){return t?e?(...a)=>{let o=a[0];if(Gw(o)){let r=o;Xu(r);let s=t(...a);return r.baseUIHandlerPrevented||e?.(...a),s}let n=t(...a);return e?.(...a),n}:Vw(t):e}function Vw(e){return e&&((...t)=>{let a=t[0];return Gw(a)&&Xu(a),e(...t)})}function Xu(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Lb(e,t){return t?e?t+\\\" \\\"+e:t:e}function Gw(e){return e!=null&&typeof e==\\\"object\\\"&&\\\"nativeEvent\\\"in e}var Rb=S(T(),1);function le(e,t,a={}){let o=t.render,n=k2(t,a);if(a.enabled===!1)return null;let r=a.state??Me;return M2(e,o,n,r)}function k2(e,t={}){let{className:a,style:o,render:n}=e,{state:r=Me,ref:s,props:l,stateAttributesMapping:i,enabled:u=!0}=t,c=u?_w(a,r):void 0,f=u?Uw(o,r):void 0,d=u?Fw(r,i):Me,p=u&&l?T2(l):void 0,x=u?Vu(d,p)??{}:Me;return typeof document<\\\"u\\\"&&(u?Array.isArray(s)?x.ref=Dw([x.ref,yb(n),...s]):x.ref=va(x.ref,yb(n),s):va(null,null)),u?(c!==void 0&&(x.className=Lb(x.className,c)),f!==void 0&&(x.style=Vu(x.style,f)),x):Me}function T2(e){return Array.isArray(e)?Hw(e):da(void 0,e)}var E2=Symbol.for(\\\"react.lazy\\\");function M2(e,t,a,o){if(t){if(typeof t==\\\"function\\\")return t(a,o);let n=da(a,t.props);n.ref=a.ref;let r=t;return r?.$$typeof===E2&&(r=Rs.Children.toArray(t)[0]),Rs.cloneElement(r,n)}if(e&&typeof e==\\\"string\\\")return A2(e,a);throw new Error(Pe(8))}function A2(e,t){return e===\\\"button\\\"?(0,Rb.createElement)(\\\"button\\\",{type:\\\"button\\\",...t,key:t.key}):e===\\\"img\\\"?(0,Rb.createElement)(\\\"img\\\",{alt:\\\"\\\",...t,key:t.key}):Rs.createElement(e,t)}function Nd(e){return le(e.defaultTagName??\\\"div\\\",e,e)}var D2=Lr(\\\"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3\\\",{variants:{variant:{default:\\\"bg-primary text-primary-foreground [a&]:hover:bg-primary/90\\\",secondary:\\\"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\\\",destructive:\\\"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90\\\",outline:\\\"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\\\",ghost:\\\"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground\\\",link:\\\"text-primary underline-offset-4 [a&]:hover:underline\\\",passed:\\\"border-pass-border text-pass font-mono uppercase\\\",failed:\\\"border-fail-border bg-fail-bg text-fail font-mono uppercase\\\",skipped:\\\"border-skip-border text-skip font-mono uppercase\\\",pending:\\\"border-pend-border text-pend font-mono uppercase\\\",tag:\\\"border-border text-muted-foreground font-mono font-medium [a&]:hover:bg-muted\\\"}},defaultVariants:{variant:\\\"default\\\"}});function Jt({className:e,variant:t=\\\"default\\\",render:a,...o}){return Nd({defaultTagName:\\\"span\\\",render:a,props:{\\\"data-slot\\\":\\\"badge\\\",\\\"data-variant\\\":t,className:te(D2({variant:t}),e),...o}})}var Bd=S(D(),1);function Xw({entry:e}){return(0,Bd.jsx)(\\\"ul\\\",{className:\\\"my-2 flex flex-wrap gap-1.5\\\",\\\"aria-label\\\":\\\"Tags\\\",children:e.names.map(t=>(0,Bd.jsx)(\\\"li\\\",{children:(0,Bd.jsx)(Jt,{variant:\\\"tag\\\",children:t})},t))})}var $l=S(D(),1);function O2(e){if(e===null)return\\\"null\\\";if(typeof e==\\\"string\\\")return e;if(typeof e==\\\"number\\\"||typeof e==\\\"boolean\\\")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Fd({entries:e}){return(0,$l.jsx)(\\\"dl\\\",{className:\\\"my-2 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-1 text-sm\\\",children:e.map((t,a)=>(0,$l.jsxs)(\\\"div\\\",{className:\\\"contents\\\",children:[(0,$l.jsx)(\\\"dt\\\",{className:\\\"font-semibold text-muted-foreground\\\",children:t.label}),(0,$l.jsx)(\\\"dd\\\",{className:\\\"min-w-0 break-words font-mono text-foreground\\\",children:O2(t.value)})]},a))})}var vb=S(T(),1);var P2={},N2={};function jw(){return(0,vb.useContext)(Ls)?.customRenderers??P2}function Wl(){return(0,vb.useContext)(Ls)?.renderers??N2}var Vo=S(D(),1);function ju({label:e,children:t}){return(0,Vo.jsxs)(\\\"figure\\\",{className:\\\"my-3\\\",children:[e?(0,Vo.jsx)(\\\"figcaption\\\",{className:\\\"mb-1.5 text-xs font-medium text-muted-foreground\\\",children:e}):null,(0,Vo.jsx)(\\\"pre\\\",{tabIndex:0,className:\\\"overflow-x-auto rounded-md bg-muted p-3\\\",children:t})]})}function Yw({entry:e}){let t=Wl();return t.code?(0,Vo.jsx)(Vo.Fragment,{children:t.code(e)}):(0,Vo.jsx)(ju,{label:e.label,children:(0,Vo.jsx)(\\\"code\\\",{className:te(\\\"font-mono text-xs\\\",e.lang&&`language-${e.lang}`),children:e.content})})}var uo=S(D(),1);function Kw({entry:e}){return(0,uo.jsxs)(\\\"figure\\\",{className:\\\"my-3\\\",children:[e.label?(0,uo.jsx)(\\\"figcaption\\\",{className:\\\"mb-1.5 text-xs font-medium text-muted-foreground\\\",children:e.label}):null,(0,uo.jsx)(\\\"div\\\",{tabIndex:0,className:\\\"overflow-x-auto rounded-md border border-border\\\",children:(0,uo.jsxs)(\\\"table\\\",{className:\\\"w-full border-collapse text-sm\\\",children:[(0,uo.jsx)(\\\"thead\\\",{children:(0,uo.jsx)(\\\"tr\\\",{className:\\\"bg-muted/50\\\",children:e.columns.map(t=>(0,uo.jsx)(\\\"th\\\",{scope:\\\"col\\\",className:\\\"border-b border-border px-3 py-2 text-left font-semibold\\\",children:t},t))})}),(0,uo.jsx)(\\\"tbody\\\",{children:e.rows.map((t,a)=>(0,uo.jsx)(\\\"tr\\\",{children:t.map((o,n)=>(0,uo.jsx)(\\\"td\\\",{className:\\\"border-b border-border px-3 py-2 text-foreground\\\",children:o},n))},a))})]})})]})}var Ww=S(D(),1);function $w({entry:e}){return(0,Ww.jsx)(\\\"a\\\",{className:\\\"text-sm font-medium text-primary underline underline-offset-2 hover:no-underline\\\",href:e.url,rel:\\\"noreferrer noopener\\\",target:\\\"_blank\\\",children:e.label})}function Tb(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ws=Tb();function n0(e){ws=e}var vs={exec:()=>null};function Zl(e){let t=[];return a=>{let o=Math.max(0,Math.min(3,a-1)),n=t[o];return n||(n=e(o),t[o]=n),n}}function ze(e,t=\\\"\\\"){let a=typeof e==\\\"string\\\"?e:e.source,o={replace:(n,r)=>{let s=typeof r==\\\"string\\\"?r:r.source;return s=s.replace(ea.caret,\\\"$1\\\"),a=a.replace(n,s),o},getRegex:()=>new RegExp(a,t)};return o}var B2=((e=\\\"\\\")=>{try{return!!new RegExp(\\\"(?<=1)(?<!1)\\\"+e)}catch{return!1}})(),ea={codeRemoveIndent:/^(?: {1,4}| {0,3}\\\\t)/gm,outputLinkReplace:/\\\\\\\\([\\\\[\\\\]])/g,indentCodeCompensation:/^(\\\\s+)(?:```)/,beginningSpace:/^\\\\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\\\\n/g,tabCharGlobal:/\\\\t/g,multipleSpaceGlobal:/\\\\s+/g,blankLine:/^[ \\\\t]*$/,doubleBlankLine:/\\\\n[ \\\\t]*\\\\n[ \\\\t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\\\\n {0,3}((?:=+|-+) *)(?=\\\\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \\\\t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\\\\[[ xX]\\\\] +\\\\S/,listReplaceTask:/^\\\\[[ xX]\\\\] +/,listTaskCheckbox:/\\\\[[ xX]\\\\]/,anyLine:/\\\\n.*\\\\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\\\\||\\\\| *$/g,tableRowBlankLine:/\\\\n[ \\\\t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\\\\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\\\\s|>)/i,endPreScriptTag:/^<\\\\/(pre|code|kbd|script)(\\\\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'\\\"]*[^\\\\s])\\\\s+(['\\\"])(.*)\\\\2/,unicodeAlphaNumeric:/[\\\\p{L}\\\\p{N}]/u,escapeTest:/[&<>\\\"']/,escapeReplace:/[&<>\\\"']/g,escapeTestNoEncode:/[<>\\\"']|&(?!(#\\\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\\\w+);)/,escapeReplaceNoEncode:/[<>\\\"']|&(?!(#\\\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\\\w+);)/g,caret:/(^|[^\\\\[])\\\\^/g,percentDecode:/%25/g,findPipe:/\\\\|/g,splitPipe:/ \\\\|/,slashPipe:/\\\\\\\\\\\\|/g,carriageReturn:/\\\\r\\\\n|\\\\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\\\\S*/,endingNewline:/\\\\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\\t ][^\\\\\\\\n]*)?(?:\\\\\\\\n|$))`),nextBulletRegex:Zl(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\\\\\\\d{1,9}[.)])((?:[ \\t][^\\\\\\\\n]*)?(?:\\\\\\\\n|$))`)),hrRegex:Zl(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\\\\\* *){3,})(?:\\\\\\\\n+|$)`)),fencesBeginRegex:Zl(e=>new RegExp(`^ {0,${e}}(?:\\\\`\\\\`\\\\`|~~~)`)),headingBeginRegex:Zl(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Zl(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,\\\"i\\\")),blockquoteBeginRegex:Zl(e=>new RegExp(`^ {0,${e}}>`))},F2=/^(?:[ \\\\t]*(?:\\\\n|$))+/,_2=/^((?: {4}| {0,3}\\\\t)[^\\\\n]+(?:\\\\n(?:[ \\\\t]*(?:\\\\n|$))*)?)+/,U2=/^ {0,3}(`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~{3,})([^\\\\n]*)(?:\\\\n|$)(?:|([\\\\s\\\\S]*?)(?:\\\\n|$))(?: {0,3}\\\\1[~`]* *(?=\\\\n|$)|$)/,$u=/^ {0,3}((?:-[\\\\t ]*){3,}|(?:_[ \\\\t]*){3,}|(?:\\\\*[ \\\\t]*){3,})(?:\\\\n+|$)/,H2=/^ {0,3}(#{1,6})(?=\\\\s|$)(.*)(?:\\\\n+|$)/,Eb=/ {0,3}(?:[*+-]|\\\\d{1,9}[.)])/,r0=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\\\n(?!\\\\s*?\\\\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\\\\n {0,3}(=+|-+) *(?:\\\\n+|$)/,s0=ze(r0).replace(/bull/g,Eb).replace(/blockCode/g,/(?: {4}| {0,3}\\\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\\\s|$)/).replace(/html/g,/ {0,3}<[^\\\\n>]+>\\\\n/).replace(/\\\\|table/g,\\\"\\\").getRegex(),z2=ze(r0).replace(/bull/g,Eb).replace(/blockCode/g,/(?: {4}| {0,3}\\\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\\\s|$)/).replace(/html/g,/ {0,3}<[^\\\\n>]+>\\\\n/).replace(/table/g,/ {0,3}\\\\|?(?:[:\\\\- ]*\\\\|)+[\\\\:\\\\- ]*\\\\n/).getRegex(),Mb=/^([^\\\\n]+(?:\\\\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \\\\t]+\\\\n)[^\\\\n]+)*)/,q2=/^[^\\\\n]+/,Ab=/(?!\\\\s*\\\\])(?:\\\\\\\\[\\\\s\\\\S]|[^\\\\[\\\\]\\\\\\\\])+/,V2=ze(/^ {0,3}\\\\[(label)\\\\]: *(?:\\\\n[ \\\\t]*)?([^<\\\\s][^\\\\s]*|<.*?>)(?:(?: +(?:\\\\n[ \\\\t]*)?| *\\\\n[ \\\\t]*)(title))? *(?:\\\\n+|$)/).replace(\\\"label\\\",Ab).replace(\\\"title\\\",/(?:\\\"(?:\\\\\\\\\\\"?|[^\\\"\\\\\\\\])*\\\"|'[^'\\\\n]*(?:\\\\n[^'\\\\n]+)*\\\\n?'|\\\\([^()]*\\\\))/).getRegex(),G2=ze(/^(bull)([ \\\\t][^\\\\n]*?)?(?:\\\\n|$)/).replace(/bull/g,Eb).getRegex(),qd=\\\"address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul\\\",Db=/<!--(?:-?>|[\\\\s\\\\S]*?(?:-->|$))/,X2=ze(\\\"^ {0,3}(?:<(script|pre|style|textarea)[\\\\\\\\s>][\\\\\\\\s\\\\\\\\S]*?(?:</\\\\\\\\1>[^\\\\\\\\n]*\\\\\\\\n*|$)|comment[^\\\\\\\\n]*(\\\\\\\\n+|$)|<\\\\\\\\?[\\\\\\\\s\\\\\\\\S]*?(?:\\\\\\\\?>[^\\\\\\\\n]*\\\\\\\\n*|$)|<![A-Z][\\\\\\\\s\\\\\\\\S]*?(?:>[^\\\\\\\\n]*\\\\\\\\n*|$)|<!\\\\\\\\[CDATA\\\\\\\\[[\\\\\\\\s\\\\\\\\S]*?(?:\\\\\\\\]\\\\\\\\]>[^\\\\\\\\n]*\\\\\\\\n*|$)|</?(tag)(?: +|\\\\\\\\n|/?>)[\\\\\\\\s\\\\\\\\S]*?(?:(?:\\\\\\\\n[ \\t]*)+\\\\\\\\n|$)|<(?!script|pre|style|textarea)([a-z][\\\\\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\\\\\t]*(?:\\\\\\\\n|$))[\\\\\\\\s\\\\\\\\S]*?(?:(?:\\\\\\\\n[ \\t]*)+\\\\\\\\n|$)|</(?!script|pre|style|textarea)[a-z][\\\\\\\\w-]*\\\\\\\\s*>(?=[ \\\\\\\\t]*(?:\\\\\\\\n|$))[\\\\\\\\s\\\\\\\\S]*?(?:(?:\\\\\\\\n[ \\t]*)+\\\\\\\\n|$))\\\",\\\"i\\\").replace(\\\"comment\\\",Db).replace(\\\"tag\\\",qd).replace(\\\"attribute\\\",/ +[a-zA-Z:_][\\\\w.:-]*(?: *= *\\\"[^\\\"\\\\n]*\\\"| *= *'[^'\\\\n]*'| *= *[^\\\\s\\\"'=<>`]+)?/).getRegex(),l0=e=>ze(Mb).replace(\\\"hr\\\",$u).replace(\\\"heading\\\",\\\" {0,3}#{1,6}(?:\\\\\\\\s|$)\\\").replace(\\\"|lheading\\\",\\\"\\\").replace(\\\"|table\\\",\\\"\\\").replace(\\\"blockquote\\\",\\\" {0,3}>\\\").replace(\\\"fences\\\",\\\" {0,3}(?:`{3,}(?=[^`\\\\\\\\n]*(?:\\\\\\\\n|$))|~~~)[^\\\\\\\\n]*(?:\\\\\\\\n|$)\\\").replace(\\\"list\\\",e).replace(\\\"html\\\",\\\"</?(?:tag)(?: +|\\\\\\\\n|/?>)|<(?:script|pre|style|textarea|!--)\\\").replace(\\\"tag\\\",qd).getRegex(),j2=l0(/ {0,3}(?:[*+-]|1[.)])[ \\\\t]+[^ \\\\t\\\\n]/),Y2=l0(/ {0,3}(?:[*+-]|\\\\d{1,9}[.)])(?:[ \\\\t]|\\\\n|$)/),K2=ze(/^( {0,3}> ?(paragraph|[^\\\\n]*)(?:\\\\n|$))+/).replace(\\\"paragraph\\\",Y2).getRegex(),Ob={blockquote:K2,code:_2,def:V2,fences:U2,heading:H2,hr:$u,html:X2,lheading:s0,list:G2,newline:F2,paragraph:j2,table:vs,text:q2},Zw=ze(\\\"^ *([^\\\\\\\\n ].*)\\\\\\\\n {0,3}((?:\\\\\\\\| *)?:?-+:? *(?:\\\\\\\\| *:?-+:? *)*(?:\\\\\\\\| *)?)(?:\\\\\\\\n((?:(?! *\\\\\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\\\\\n|$))*)\\\\\\\\n*|$)\\\").replace(\\\"hr\\\",$u).replace(\\\"heading\\\",\\\" {0,3}#{1,6}(?:\\\\\\\\s|$)\\\").replace(\\\"blockquote\\\",\\\" {0,3}>\\\").replace(\\\"code\\\",\\\"(?: {4}| {0,3}\\t)[^\\\\\\\\n]\\\").replace(\\\"fences\\\",\\\" {0,3}(?:`{3,}(?=[^`\\\\\\\\n]*(?:\\\\\\\\n|$))|~~~)[^\\\\\\\\n]*(?:\\\\\\\\n|$)\\\").replace(\\\"list\\\",\\\" {0,3}(?:[*+-]|1[.)])[ \\\\\\\\t]\\\").replace(\\\"html\\\",\\\"</?(?:tag)(?: +|\\\\\\\\n|/?>)|<(?:script|pre|style|textarea|!--)\\\").replace(\\\"tag\\\",qd).getRegex(),$2={...Ob,lheading:z2,table:Zw,paragraph:ze(Mb).replace(\\\"hr\\\",$u).replace(\\\"heading\\\",\\\" {0,3}#{1,6}(?:\\\\\\\\s|$)\\\").replace(\\\"|lheading\\\",\\\"\\\").replace(\\\"table\\\",Zw).replace(\\\"blockquote\\\",\\\" {0,3}>\\\").replace(\\\"fences\\\",\\\" {0,3}(?:`{3,}(?=[^`\\\\\\\\n]*(?:\\\\\\\\n|$))|~~~)[^\\\\\\\\n]*(?:\\\\\\\\n|$)\\\").replace(\\\"list\\\",\\\" {0,3}(?:[*+-]|1[.)])[ \\\\\\\\t]+[^ \\\\\\\\t\\\\\\\\n]\\\").replace(\\\"html\\\",\\\"</?(?:tag)(?: +|\\\\\\\\n|/?>)|<(?:script|pre|style|textarea|!--)\\\").replace(\\\"tag\\\",qd).getRegex()},W2={...Ob,html:ze(`^ *(?:comment *(?:\\\\\\\\n|\\\\\\\\s*$)|<(tag)[\\\\\\\\s\\\\\\\\S]+?</\\\\\\\\1> *(?:\\\\\\\\n{2,}|\\\\\\\\s*$)|<tag(?:\\\"[^\\\"]*\\\"|'[^']*'|\\\\\\\\s[^'\\\"/>\\\\\\\\s]*)*?/?> *(?:\\\\\\\\n{2,}|\\\\\\\\s*$))`).replace(\\\"comment\\\",Db).replace(/tag/g,\\\"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\\\\\\\b)\\\\\\\\w+(?!:|[^\\\\\\\\w\\\\\\\\s@]*@)\\\\\\\\b\\\").getRegex(),def:/^ *\\\\[([^\\\\]]+)\\\\]: *<?([^\\\\s>]+)>?(?: +([\\\"(][^\\\\n]+[\\\")]))? *(?:\\\\n+|$)/,heading:/^(#{1,6})(.*)(?:\\\\n+|$)/,fences:vs,lheading:/^(.+?)\\\\n {0,3}(=+|-+) *(?:\\\\n+|$)/,paragraph:ze(Mb).replace(\\\"hr\\\",$u).replace(\\\"heading\\\",` *#{1,6} *[^\\n]`).replace(\\\"lheading\\\",s0).replace(\\\"|table\\\",\\\"\\\").replace(\\\"blockquote\\\",\\\" {0,3}>\\\").replace(\\\"|fences\\\",\\\"\\\").replace(\\\"|list\\\",\\\"\\\").replace(\\\"|html\\\",\\\"\\\").replace(\\\"|tag\\\",\\\"\\\").getRegex()},Z2=/^\\\\\\\\([!\\\"#$%&'()*+,\\\\-./:;<=>?@\\\\[\\\\]\\\\\\\\^_`{|}~])/,Q2=/^(`+)([^`]|[^`][\\\\s\\\\S]*?[^`])\\\\1(?!`)/,i0=/^( {2,}|\\\\\\\\)\\\\n(?!\\\\s*$)/,J2=/^(`+|[^`])(?:(?= {2,}\\\\n)|[\\\\s\\\\S]*?(?:(?=[\\\\\\\\<!\\\\[`*_]|\\\\b_|$)|[^ ](?= {2,}\\\\n)))/,Dn=/[\\\\p{P}\\\\p{S}]/u,Ql=/[\\\\s\\\\p{P}\\\\p{S}]/u,Wu=/[^\\\\s\\\\p{P}\\\\p{S}]/u,eB=ze(/^((?![*_])punctSpace)/,\\\"u\\\").replace(/punctSpace/g,Ql).getRegex(),tB=/[\\\\p{Pi}\\\\p{Ps}\\\"']/u,u0=/(?!~)[\\\\p{P}\\\\p{S}]/u,aB=/(?!~)[\\\\s\\\\p{P}\\\\p{S}]/u,oB=/(?:[^\\\\s\\\\p{P}\\\\p{S}]|~)/u,nB=ze(/link|precode-code|html/,\\\"g\\\").replace(\\\"link\\\",/\\\\[(?:[^\\\\[\\\\]`]|(?<a>`+)[^`]+\\\\k<a>(?!`))*?\\\\]\\\\((?:\\\\\\\\[\\\\s\\\\S]|[^\\\\\\\\\\\\(\\\\)]|\\\\((?:\\\\\\\\[\\\\s\\\\S]|[^\\\\\\\\\\\\(\\\\)])*\\\\))*\\\\)/).replace(\\\"precode-\\\",B2?\\\"(?<!`)()\\\":\\\"(^^|[^`])\\\").replace(\\\"code\\\",/(?<b>`+)[^`]+\\\\k<b>(?!`)/).replace(\\\"html\\\",/<(?! )[^<>]*?>/).getRegex(),c0=/^(?:\\\\*+(?:((?!\\\\*)punct)|([^\\\\s*]))?)|^_+(?:((?!_)punct)|([^\\\\s_]))?/,rB=ze(c0,\\\"u\\\").replace(/punct/g,Dn).getRegex(),sB=ze(c0,\\\"u\\\").replace(/punct/g,u0).getRegex(),lB=/^(?:\\\\*+(?:((?!\\\\*)(?!openQuote)punct)|([^\\\\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\\\\s_]))?/,iB=ze(lB,\\\"u\\\").replace(/openQuote/g,tB).replace(/punct/g,Dn).getRegex(),f0=\\\"^[^_*]*?__[^_*]*?\\\\\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\\\\\*)punct(\\\\\\\\*+)(?=[\\\\\\\\s]|$)|notPunctSpace(\\\\\\\\*+)(?!\\\\\\\\*)(?=punctSpace|$)|(?!\\\\\\\\*)punctSpace(\\\\\\\\*+)(?=notPunctSpace)|[\\\\\\\\s](\\\\\\\\*+)(?!\\\\\\\\*)(?=punct)|(?!\\\\\\\\*)punct(\\\\\\\\*+)(?!\\\\\\\\*)(?=punct)|notPunctSpace(\\\\\\\\*+)(?=notPunctSpace)\\\",uB=ze(f0,\\\"gu\\\").replace(/notPunctSpace/g,Wu).replace(/punctSpace/g,Ql).replace(/punct/g,Dn).getRegex(),cB=ze(f0,\\\"gu\\\").replace(/notPunctSpace/g,oB).replace(/punctSpace/g,aB).replace(/punct/g,u0).getRegex(),fB=\\\"^[^_*]*?__[^_*]*?\\\\\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\\\\\*)punct(\\\\\\\\*+)(?=[\\\\\\\\s]|$)|notPunctSpace(\\\\\\\\*+)(?!\\\\\\\\*)(?=punctSpace|$)|(?!\\\\\\\\*)[\\\\\\\\s](\\\\\\\\*+)(?=notPunctSpace)|[\\\\\\\\s](\\\\\\\\*+)(?!\\\\\\\\*)(?=punct)|(?!\\\\\\\\*)punct(\\\\\\\\*+)(?!\\\\\\\\*)(?=punct)|(?:(?!\\\\\\\\*)punct|notPunctSpace)(\\\\\\\\*+)(?!\\\\\\\\*)(?=notPunctSpace)\\\",dB=ze(fB,\\\"gu\\\").replace(/notPunctSpace/g,Wu).replace(/punctSpace/g,Ql).replace(/punct/g,Dn).getRegex(),pB=ze(\\\"^[^_*]*?\\\\\\\\*\\\\\\\\*[^_*]*?_[^_*]*?(?=\\\\\\\\*\\\\\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\\\\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)\\\",\\\"gu\\\").replace(/notPunctSpace/g,Wu).replace(/punctSpace/g,Ql).replace(/punct/g,Dn).getRegex(),mB=\\\"^[^_*]*?\\\\\\\\*\\\\\\\\*[^_*]*?_[^_*]*?(?=\\\\\\\\*\\\\\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\\\\\\\s](_+)(?=notPunctSpace)|[\\\\\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)\\\",gB=ze(mB,\\\"gu\\\").replace(/notPunctSpace/g,Wu).replace(/punctSpace/g,Ql).replace(/punct/g,Dn).getRegex(),hB=ze(/^~~?(?:((?!~)punct)|[^\\\\s~])/,\\\"u\\\").replace(/punct/g,Dn).getRegex(),xB=\\\"^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\\\\\\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\\\\\\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)\\\",bB=ze(xB,\\\"gu\\\").replace(/notPunctSpace/g,Wu).replace(/punctSpace/g,Ql).replace(/punct/g,Dn).getRegex(),yB=ze(/\\\\\\\\(punct)/,\\\"gu\\\").replace(/punct/g,Dn).getRegex(),SB=ze(/^<(scheme:[^\\\\s\\\\x00-\\\\x1f<>]*|email)>/).replace(\\\"scheme\\\",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(\\\"email\\\",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),CB=ze(Db).replace(\\\"(?:-->|$)\\\",\\\"-->\\\").getRegex(),LB=ze(\\\"^comment|^</[a-zA-Z][\\\\\\\\w:-]*\\\\\\\\s*>|^<[a-zA-Z][\\\\\\\\w-]*(?:attribute)*?\\\\\\\\s*/?>|^<\\\\\\\\?[\\\\\\\\s\\\\\\\\S]*?\\\\\\\\?>|^<![a-zA-Z]+\\\\\\\\s[\\\\\\\\s\\\\\\\\S]*?>|^<!\\\\\\\\[CDATA\\\\\\\\[[\\\\\\\\s\\\\\\\\S]*?\\\\\\\\]\\\\\\\\]>\\\").replace(\\\"comment\\\",CB).replace(\\\"attribute\\\",/\\\\s+[a-zA-Z:_][\\\\w.:-]*(?:\\\\s*=\\\\s*\\\"[^\\\"]*\\\"|\\\\s*=\\\\s*'[^']*'|\\\\s*=\\\\s*[^\\\\s\\\"'=<>`]+)?/).getRegex(),Ud=/(?:\\\\[(?:\\\\\\\\[\\\\s\\\\S]|[^\\\\[\\\\]\\\\\\\\])*\\\\]|\\\\\\\\[\\\\s\\\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\\\])|[^\\\\[\\\\]\\\\\\\\`])*?/,RB=ze(/^!?\\\\[(label)\\\\]\\\\(\\\\s*(href)(?:(?:[ \\\\t]+(?:\\\\n[ \\\\t]*)?|\\\\n[ \\\\t]*)(title))?\\\\s*\\\\)/).replace(\\\"label\\\",Ud).replace(\\\"href\\\",/<(?:\\\\\\\\.|[^\\\\n<>\\\\\\\\])+>|[^ \\\\t\\\\n\\\\x00-\\\\x1f]+|(?=\\\\))/).replace(\\\"title\\\",/\\\"(?:\\\\\\\\\\\"?|[^\\\"\\\\\\\\])*\\\"|'(?:\\\\\\\\'?|[^'\\\\\\\\])*'|\\\\((?:\\\\\\\\\\\\)?|[^)\\\\\\\\])*\\\\)/).getRegex(),d0=ze(/^!?\\\\[(label)\\\\]\\\\[(ref)\\\\]/).replace(\\\"label\\\",Ud).replace(\\\"ref\\\",Ab).getRegex(),p0=ze(/^!?\\\\[(ref)\\\\](?:\\\\[\\\\])?/).replace(\\\"ref\\\",Ab).getRegex(),vB=ze(\\\"reflink|nolink(?!\\\\\\\\()\\\",\\\"g\\\").replace(\\\"reflink\\\",d0).replace(\\\"nolink\\\",p0).getRegex(),Qw=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Pb={_backpedal:vs,anyPunctuation:yB,autolink:SB,blockSkip:nB,br:i0,code:Q2,del:vs,delLDelim:vs,delRDelim:vs,emStrongLDelim:rB,emStrongRDelimAst:uB,emStrongRDelimUnd:pB,escape:Z2,link:RB,nolink:p0,punctuation:eB,reflink:d0,reflinkSearch:vB,tag:LB,text:J2,url:vs},IB={...Pb,emStrongLDelim:iB,emStrongRDelimAst:dB,emStrongRDelimUnd:gB,link:ze(/^!?\\\\[(label)\\\\]\\\\((.*?)\\\\)/).replace(\\\"label\\\",Ud).getRegex(),reflink:ze(/^!?\\\\[(label)\\\\]\\\\s*\\\\[([^\\\\]]*)\\\\]/).replace(\\\"label\\\",Ud).getRegex()},Ib={...Pb,emStrongRDelimAst:cB,emStrongLDelim:sB,delLDelim:hB,delRDelim:bB,url:ze(/^((?:protocol):\\\\/\\\\/|www\\\\.)(?:[a-zA-Z0-9\\\\-]+\\\\.?)+[^\\\\s<]*|^email/).replace(\\\"protocol\\\",Qw).replace(\\\"email\\\",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'\\\"~()&]+|\\\\([^)]*\\\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\\\"~)]+(?!$))+/,del:/^(~~?)(?=[^\\\\s~])((?:\\\\\\\\[\\\\s\\\\S]|[^\\\\\\\\])*?(?:\\\\\\\\[\\\\s\\\\S]|[^\\\\s~\\\\\\\\]))\\\\1(?=[^~]|$)/,text:ze(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\\\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\\\/=?_`{\\\\|}~-]+@)|[\\\\s\\\\S]*?(?:(?=[\\\\\\\\<!\\\\[`*~_]|\\\\b_|protocol:\\\\/\\\\/|www\\\\.|$)|[^ ](?= {2,}\\\\n)|[^a-zA-Z0-9.!#$%&'*+\\\\/=?_`{\\\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\\\/=?_`{\\\\|}~-]+@)))/).replace(\\\"protocol\\\",Qw).getRegex()},wB={...Ib,br:ze(i0).replace(\\\"{2,}\\\",\\\"*\\\").getRegex(),text:ze(Ib.text).replace(\\\"\\\\\\\\b_\\\",\\\"\\\\\\\\b_| {2,}\\\\\\\\n\\\").replace(/\\\\{2,\\\\}/g,\\\"*\\\").getRegex()},_d={normal:Ob,gfm:$2,pedantic:W2},Yu={normal:Pb,gfm:Ib,breaks:wB,pedantic:IB},kB={\\\"&\\\":\\\"&amp;\\\",\\\"<\\\":\\\"&lt;\\\",\\\">\\\":\\\"&gt;\\\",'\\\"':\\\"&quot;\\\",\\\"'\\\":\\\"&#39;\\\"},Jw=e=>kB[e];function Go(e,t){if(t){if(ea.escapeTest.test(e))return e.replace(ea.escapeReplace,Jw)}else if(ea.escapeTestNoEncode.test(e))return e.replace(ea.escapeReplaceNoEncode,Jw);return e}function e0(e){try{e=encodeURI(e).replace(ea.percentDecode,\\\"%\\\")}catch{return null}return e}function t0(e,t){let a=e.replace(ea.findPipe,(r,s,l)=>{let i=!1,u=s;for(;--u>=0&&l[u]===\\\"\\\\\\\\\\\";)i=!i;return i?\\\"|\\\":\\\" |\\\"}),o=a.split(ea.splitPipe),n=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),t)if(o.length>t)o.splice(t);else for(;o.length<t;)o.push(\\\"\\\");for(;n<o.length;n++)o[n]=o[n].trim().replace(ea.slashPipe,\\\"|\\\");return o}function Ir(e,t,a){let o=e.length;if(o===0)return\\\"\\\";let n=0;for(;n<o;){let r=e.charAt(o-n-1);if(r===t&&!a)n++;else if(r!==t&&a)n++;else break}return e.slice(0,o-n)}function a0(e){let t=e.split(`\\n`),a=t.length-1;for(;a>=0&&ea.blankLine.test(t[a]);)a--;return t.length-a<=2?e:t.slice(0,a+1).join(`\\n`)}function TB(e,t){if(e.indexOf(t[1])===-1)return-1;let a=0;for(let o=0;o<e.length;o++)if(e[o]===\\\"\\\\\\\\\\\")o++;else if(e[o]===t[0])a++;else if(e[o]===t[1]&&(a--,a<0))return o;return a>0?-2:-1}function EB(e,t=0){let a=t,o=\\\"\\\";for(let n of e)if(n===\\\"\\t\\\"){let r=4-a%4;o+=\\\" \\\".repeat(r),a+=r}else o+=n,a++;return o}function o0(e,t,a,o,n){let r=t.href,s=t.title||null,l=e[1].replace(n.other.outputLinkReplace,\\\"$1\\\");o.state.inLink=!0;let i={type:e[0].charAt(0)===\\\"!\\\"?\\\"image\\\":\\\"link\\\",raw:a,href:r,title:s,text:l,tokens:o.inlineTokens(l)};return o.state.inLink=!1,i}function MB(e,t,a){let o=e.match(a.other.indentCodeCompensation);if(o===null)return t;let n=o[1];return t.split(`\\n`).map(r=>{let s=r.match(a.other.beginningSpace);if(s===null)return r;let[l]=s;return l.length>=n.length?r.slice(n.length):r}).join(`\\n`)}var Hd=class{options;rules;lexer;constructor(e){this.options=e||ws}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:\\\"space\\\",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let a=this.options.pedantic?t[0]:a0(t[0]),o=a.replace(this.rules.other.codeRemoveIndent,\\\"\\\");return{type:\\\"code\\\",raw:a,codeBlockStyle:\\\"indented\\\",text:o}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],o=MB(a,t[3]||\\\"\\\",this.rules);return{type:\\\"code\\\",raw:a,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,\\\"$1\\\"):t[2],text:o}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let a=t[2].trim();if(this.rules.other.endingHash.test(a)){let o=Ir(a,\\\"#\\\");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(a=o.trim())}return{type:\\\"heading\\\",raw:Ir(t[0],`\\n`),depth:t[1].length,text:a,tokens:this.lexer.inline(a)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:\\\"hr\\\",raw:Ir(t[0],`\\n`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=Ir(t[0],`\\n`).split(`\\n`),o=\\\"\\\",n=\\\"\\\",r=[];for(;a.length>0;){let s=!1,l=[],i;for(i=0;i<a.length;i++)if(this.rules.other.blockquoteStart.test(a[i]))l.push(a[i]),s=!0;else if(!s)l.push(a[i]);else break;a=a.slice(i);let u=l.join(`\\n`),c=u.replace(this.rules.other.blockquoteSetextReplace,`\\n    $1`).replace(this.rules.other.blockquoteSetextReplace2,\\\"\\\");o=o?`${o}\\n${u}`:u,n=n?`${n}\\n${c}`:c;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,r,!0),this.lexer.state.top=f,a.length===0)break;let d=r.at(-1);if(d?.type===\\\"code\\\")break;if(d?.type===\\\"blockquote\\\"){let p=d,x=a.join(`\\n`),b=p.raw+`\\n`+x.replace(this.rules.other.blockquoteSetextReplace2,\\\"\\\"),C=this.blockquote(b);r[r.length-1]=C,o=`${o}\\n${x}`,n=n.substring(0,n.length-p.text.length)+C.text;break}else if(d?.type===\\\"list\\\"){let p=d,x=p.raw+`\\n`+a.join(`\\n`),b=this.list(x);r[r.length-1]=b,o=o.substring(0,o.length-d.raw.length)+b.raw,n=n.substring(0,n.length-p.raw.length)+b.raw,a=x.substring(r.at(-1).raw.length).split(`\\n`);continue}}return{type:\\\"blockquote\\\",raw:o,tokens:r,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let a=t[1].trim(),o=a.length>1,n={type:\\\"list\\\",raw:\\\"\\\",ordered:o,start:o?+a.slice(0,-1):\\\"\\\",loose:!1,items:[]};a=o?`\\\\\\\\d{1,9}\\\\\\\\${a.slice(-1)}`:`\\\\\\\\${a}`,this.options.pedantic&&(a=o?a:\\\"[*+-]\\\");let r=this.rules.other.listItemRegex(a),s=!1;for(;e;){let i=!1,u=\\\"\\\",c=\\\"\\\";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let f=EB(t[2].split(`\\n`,1)[0],t[1].length),d=e.split(`\\n`,1)[0],p=!f.trim(),x=0;if(this.options.pedantic?(x=2,c=f.trimStart()):p?x=t[1].length+1:(x=f.search(this.rules.other.nonSpaceChar),x=x>4?1:x,c=f.slice(x),x+=t[1].length),p&&this.rules.other.blankLine.test(d)&&(u+=d+`\\n`,e=e.substring(d.length+1),i=!0),!i){let b=this.rules.other.nextBulletRegex(x),C=this.rules.other.hrRegex(x),g=this.rules.other.fencesBeginRegex(x),m=this.rules.other.headingBeginRegex(x),h=this.rules.other.htmlBeginRegex(x),y=this.rules.other.blockquoteBeginRegex(x);for(;e;){let v=e.split(`\\n`,1)[0],R;if(d=v,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,\\\"  \\\"),R=d):R=d.replace(this.rules.other.tabCharGlobal,\\\"    \\\"),g.test(d)||m.test(d)||h.test(d)||y.test(d)||b.test(d)||C.test(d))break;if(R.search(this.rules.other.nonSpaceChar)>=x||!d.trim())c+=`\\n`+R.slice(x);else{if(p||f.replace(this.rules.other.tabCharGlobal,\\\"    \\\").search(this.rules.other.nonSpaceChar)>=4||g.test(f)||m.test(f)||C.test(f))break;c+=`\\n`+d}p=!d.trim(),u+=v+`\\n`,e=e.substring(v.length+1),f=R.slice(x)}}n.loose||(s?n.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(s=!0)),n.items.push({type:\\\"list_item\\\",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),n.raw+=u}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let i of n.items)if(this.lexer.state.top=!1,i.tokens=this.lexer.blockTokens(i.text,[]),!n.loose){let u=i.tokens.filter(f=>f.type===\\\"space\\\"),c=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));n.loose=c}for(let i of n.items){let u=i.tokens[0];if(i.task&&(u?.type===\\\"text\\\"||u?.type===\\\"paragraph\\\")){i.text=i.text.replace(this.rules.other.listReplaceTask,\\\"\\\"),u.raw=u.raw.replace(this.rules.other.listReplaceTask,\\\"\\\"),u.text=u.text.replace(this.rules.other.listReplaceTask,\\\"\\\");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,\\\"\\\");break}let c=this.rules.other.listTaskCheckbox.exec(i.raw);if(c){let f={type:\\\"checkbox\\\",raw:c[0]+\\\" \\\",checked:c[0]!==\\\"[ ]\\\"};i.checked=f.checked,n.loose?i.tokens[0]&&[\\\"paragraph\\\",\\\"text\\\"].includes(i.tokens[0].type)&&\\\"tokens\\\"in i.tokens[0]&&i.tokens[0].tokens?(i.tokens[0].raw=f.raw+i.tokens[0].raw,i.tokens[0].text=f.raw+i.tokens[0].text,i.tokens[0].tokens.unshift(f)):i.tokens.unshift({type:\\\"paragraph\\\",raw:f.raw,text:f.raw,tokens:[f]}):i.tokens.unshift(f)}}else i.task&&(i.task=!1)}if(n.loose)for(let i of n.items){i.loose=!0;for(let u of i.tokens)u.type===\\\"text\\\"&&(u.type=\\\"paragraph\\\")}return n}}html(e){let t=this.rules.block.html.exec(e);if(t){let a=a0(t[0]);return{type:\\\"html\\\",block:!0,raw:a,pre:t[1]===\\\"pre\\\"||t[1]===\\\"script\\\"||t[1]===\\\"style\\\",text:a}}}def(e){let t=this.rules.block.def.exec(e);if(t){let a=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,\\\" \\\"),o=t[2]?t[2].replace(this.rules.other.hrefBrackets,\\\"$1\\\").replace(this.rules.inline.anyPunctuation,\\\"$1\\\"):\\\"\\\",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,\\\"$1\\\"):t[3];return{type:\\\"def\\\",tag:a,raw:Ir(t[0],`\\n`),href:o,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let a=t0(t[1]),o=t[2].replace(this.rules.other.tableAlignChars,\\\"\\\").split(\\\"|\\\"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,\\\"\\\").split(`\\n`):[],r={type:\\\"table\\\",raw:Ir(t[0],`\\n`),header:[],align:[],rows:[]};if(a.length===o.length){for(let s of o)this.rules.other.tableAlignRight.test(s)?r.align.push(\\\"right\\\"):this.rules.other.tableAlignCenter.test(s)?r.align.push(\\\"center\\\"):this.rules.other.tableAlignLeft.test(s)?r.align.push(\\\"left\\\"):r.align.push(null);for(let s=0;s<a.length;s++)r.header.push({text:a[s],tokens:this.lexer.inline(a[s]),header:!0,align:r.align[s]});for(let s of n)r.rows.push(t0(s,r.header.length).map((l,i)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[i]})));return r}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let a=t[1].trim();return{type:\\\"heading\\\",raw:Ir(t[0],`\\n`),depth:t[2].charAt(0)===\\\"=\\\"?1:2,text:a,tokens:this.lexer.inline(a)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let a=t[1].charAt(t[1].length-1)===`\\n`?t[1].slice(0,-1):t[1];return{type:\\\"paragraph\\\",raw:t[0],text:a,tokens:this.lexer.inline(a)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:\\\"text\\\",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:\\\"escape\\\",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:\\\"html\\\",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let a=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let r=Ir(a.slice(0,-1),\\\"\\\\\\\\\\\");if((a.length-r.length)%2===0)return}else{let r=TB(t[2],\\\"()\\\");if(r===-2)return;if(r>-1){let s=(t[0].indexOf(\\\"!\\\")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,s).trim(),t[3]=\\\"\\\"}}let o=t[2],n=\\\"\\\";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(o);r&&(o=r[1],n=r[3])}else n=t[3]?t[3].slice(1,-1):\\\"\\\";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?o=o.slice(1):o=o.slice(1,-1)),o0(t,{href:o&&o.replace(this.rules.inline.anyPunctuation,\\\"$1\\\"),title:n&&n.replace(this.rules.inline.anyPunctuation,\\\"$1\\\")},t[0],this.lexer,this.rules)}}reflink(e,t){let a;if((a=this.rules.inline.reflink.exec(e))||(a=this.rules.inline.nolink.exec(e))){let o=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal,\\\" \\\"),n=t[o.toLowerCase()];if(!n){let r=a[0].charAt(0);return{type:\\\"text\\\",raw:r,text:r}}return o0(a,n,a[0],this.lexer,this.rules)}}emStrong(e,t,a=\\\"\\\"){let o=this.rules.inline.emStrongLDelim.exec(e);if(!(!o||!o[1]&&!o[2]&&!o[3]&&!o[4]||o[4]&&a.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[3])||!a||this.rules.inline.punctuation.exec(a))){let n=[...o[0]].length-1,r,s,l=n,i=0,u=o[0][0],c=a===u,f=u===\\\"*\\\"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+n);(o=f.exec(t))!==null;){if(r=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!r)continue;if(s=[...r].length,o[3]||o[4]){l+=s;continue}else if(o[5]||o[6]){if(n%3&&!((n+s)%3)){i+=s;continue}if(c)break}if(l-=s,l>0)continue;s=Math.min(s,s+l+i);let d=[...o[0]][0].length,p=e.slice(0,n+o.index+d+s);if(Math.min(n,s)%2){let b=p.slice(1,-1);return{type:\\\"em\\\",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}let x=p.slice(2,-2);return{type:\\\"strong\\\",raw:p,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let a=t[2].replace(this.rules.other.newLineCharGlobal,\\\" \\\"),o=this.rules.other.nonSpaceChar.test(a),n=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return o&&n&&(a=a.substring(1,a.length-1)),{type:\\\"codespan\\\",raw:t[0],text:a}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:\\\"br\\\",raw:t[0]}}del(e,t,a=\\\"\\\"){let o=this.rules.inline.delLDelim.exec(e);if(o&&(!o[1]||!a||this.rules.inline.punctuation.exec(a))){let n=[...o[0]].length-1,r,s,l=n,i=this.rules.inline.delRDelim;for(i.lastIndex=0,t=t.slice(-1*e.length+n);(o=i.exec(t))!==null;){if(r=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!r||(s=[...r].length,s!==n))continue;if(o[3]||o[4]){l+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l);let u=[...o[0]][0].length,c=e.slice(0,n+o.index+u+s),f=c.slice(n,-n);return{type:\\\"del\\\",raw:c,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let a,o;return t[2]===\\\"@\\\"?(a=t[1],o=\\\"mailto:\\\"+a):(a=t[1],o=a),{type:\\\"link\\\",raw:t[0],text:a,href:o,tokens:[{type:\\\"text\\\",raw:a,text:a}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let a,o;if(t[2]===\\\"@\\\")a=t[0],o=\\\"mailto:\\\"+a;else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??\\\"\\\";while(n!==t[0]);a=t[0],t[1]===\\\"www.\\\"?o=\\\"http://\\\"+t[0]:o=t[0]}return{type:\\\"link\\\",raw:t[0],text:a,href:o,tokens:[{type:\\\"text\\\",raw:a,text:a}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let a=this.lexer.state.inRawBlock;return{type:\\\"text\\\",raw:t[0],text:t[0],escaped:a}}}},Lo=class wb{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ws,this.options.tokenizer=this.options.tokenizer||new Hd,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let a={other:ea,block:_d.normal,inline:Yu.normal};this.options.pedantic?(a.block=_d.pedantic,a.inline=Yu.pedantic):this.options.gfm&&(a.block=_d.gfm,this.options.breaks?a.inline=Yu.breaks:a.inline=Yu.gfm),this.tokenizer.rules=a}static get rules(){return{block:_d,inline:Yu}}static lex(t,a){return new wb(a).lex(t)}static lexInline(t,a){return new wb(a).inlineTokens(t)}lex(t){t=t.replace(ea.carriageReturn,`\\n`),this.blockTokens(t,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let o=this.inlineQueue[a];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,a=[],o=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(ea.tabCharGlobal,\\\"    \\\").replace(ea.spaceLine,\\\"\\\"));let n=1/0;for(;t;){if(t.length<n)n=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let r;if(this.options.extensions?.block?.some(l=>(r=l.call({lexer:this},t,a))?(t=t.substring(r.raw.length),a.push(r),!0):!1))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);let l=a.at(-1);r.raw.length===1&&l!==void 0?l.raw+=`\\n`:a.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let l=a.at(-1);l?.type===\\\"paragraph\\\"||l?.type===\\\"text\\\"?(l.raw+=(l.raw.endsWith(`\\n`)?\\\"\\\":`\\n`)+r.raw,l.text+=`\\n`+r.text,this.inlineQueue.at(-1).src=l.text):a.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);let l=a.at(-1);l?.type===\\\"paragraph\\\"||l?.type===\\\"text\\\"?(l.raw+=(l.raw.endsWith(`\\n`)?\\\"\\\":`\\n`)+r.raw,l.text+=`\\n`+r.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},a.push(r));continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),a.push(r);continue}let s=t;if(this.options.extensions?.startBlock){let l=1/0,i=t.slice(1),u;this.options.extensions.startBlock.forEach(c=>{u=c.call({lexer:this},i),typeof u==\\\"number\\\"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(s=t.substring(0,l+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let l=a.at(-1);o&&l?.type===\\\"paragraph\\\"?(l.raw+=(l.raw.endsWith(`\\n`)?\\\"\\\":`\\n`)+r.raw,l.text+=`\\n`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):a.push(r),o=s.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);let l=a.at(-1);l?.type===\\\"text\\\"?(l.raw+=(l.raw.endsWith(`\\n`)?\\\"\\\":`\\n`)+r.raw,l.text+=`\\n`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):a.push(r);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,a}inline(t,a=[]){return this.inlineQueue.push({src:t,tokens:a}),a}inlineTokens(t,a=[]){this.tokenizer.lexer=this;let o=t;if(this.tokens.links){let l=Object.keys(this.tokens.links);l.length>0&&(o=o.replace(this.tokenizer.rules.inline.reflinkSearch,i=>l.includes(i.slice(i.lastIndexOf(\\\"[\\\")+1,-1))?\\\"[\\\"+\\\"a\\\".repeat(i.length-2)+\\\"]\\\":i))}o=o.replace(this.tokenizer.rules.inline.anyPunctuation,l=>\\\"+\\\".repeat(l.length)),o=o.replace(this.tokenizer.rules.inline.blockSkip,(l,i,u)=>{let c=u?u.length:0;return l.slice(0,c)+\\\"[\\\"+\\\"a\\\".repeat(l.length-c-2)+\\\"]\\\"}),o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let n=!1,r=\\\"\\\",s=1/0;for(;t;){if(t.length<s)s=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}n||(r=\\\"\\\"),n=!1;let l;if(this.options.extensions?.inline?.some(u=>(l=u.call({lexer:this},t,a))?(t=t.substring(l.raw.length),a.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let u=a.at(-1);l.type===\\\"text\\\"&&u?.type===\\\"text\\\"?(u.raw+=l.raw,u.text+=l.text):a.push(l);continue}if(l=this.tokenizer.emStrong(t,o,r)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.del(t,o,r)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),a.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),a.push(l);continue}let i=t;if(this.options.extensions?.startInline){let u=1/0,c=t.slice(1),f;this.options.extensions.startInline.forEach(d=>{f=d.call({lexer:this},c),typeof f==\\\"number\\\"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(l=this.tokenizer.inlineText(i)){t=t.substring(l.raw.length),l.raw.slice(-1)!==\\\"_\\\"&&(r=l.raw.slice(-1)),n=!0;let u=a.at(-1);u?.type===\\\"text\\\"?(u.raw+=l.raw,u.text+=l.text):a.push(l);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return a}infiniteLoopError(t){let a=\\\"Infinite loop on byte: \\\"+t;if(this.options.silent)console.error(a);else throw new Error(a)}},zd=class{options;parser;constructor(e){this.options=e||ws}space(e){return\\\"\\\"}code({text:e,lang:t,escaped:a}){let o=(t||\\\"\\\").match(ea.notSpaceStart)?.[0],n=e.replace(ea.endingNewline,\\\"\\\")+`\\n`;return o?'<pre><code class=\\\"language-'+Go(o)+'\\\">'+(a?n:Go(n,!0))+`</code></pre>\\n`:\\\"<pre><code>\\\"+(a?n:Go(n,!0))+`</code></pre>\\n`}blockquote({tokens:e}){return`<blockquote>\\n${this.parser.parse(e)}</blockquote>\\n`}html({text:e}){return e}def(e){return\\\"\\\"}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\\n`}hr(e){return`<hr>\\n`}list(e){let t=e.ordered,a=e.start,o=\\\"\\\";for(let s=0;s<e.items.length;s++){let l=e.items[s];o+=this.listitem(l)}let n=t?\\\"ol\\\":\\\"ul\\\",r=t&&a!==1?' start=\\\"'+a+'\\\"':\\\"\\\";return\\\"<\\\"+n+r+`>\\n`+o+\\\"</\\\"+n+`>\\n`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\\n`}checkbox({checked:e}){return\\\"<input \\\"+(e?'checked=\\\"\\\" ':\\\"\\\")+'disabled=\\\"\\\" type=\\\"checkbox\\\"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\\n`}table(e){let t=\\\"\\\",a=\\\"\\\";for(let n=0;n<e.header.length;n++)a+=this.tablecell(e.header[n]);t+=this.tablerow({text:a});let o=\\\"\\\";for(let n=0;n<e.rows.length;n++){let r=e.rows[n];a=\\\"\\\";for(let s=0;s<r.length;s++)a+=this.tablecell(r[s]);o+=this.tablerow({text:a})}return o&&(o=`<tbody>${o}</tbody>`),`<table>\\n<thead>\\n`+t+`</thead>\\n`+o+`</table>\\n`}tablerow({text:e}){return`<tr>\\n${e}</tr>\\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),a=e.header?\\\"th\\\":\\\"td\\\";return(e.align?`<${a} align=\\\"${e.align}\\\">`:`<${a}>`)+t+`</${a}>\\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Go(e,!0)}</code>`}br(e){return\\\"<br>\\\"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:a}){let o=this.parser.parseInline(a),n=e0(e);if(n===null)return o;e=n;let r='<a href=\\\"'+e+'\\\"';return t&&(r+=' title=\\\"'+Go(t)+'\\\"'),r+=\\\">\\\"+o+\\\"</a>\\\",r}image({href:e,title:t,text:a,tokens:o}){o&&(a=this.parser.parseInline(o,this.parser.textRenderer));let n=e0(e);if(n===null)return Go(a);e=n;let r=`<img src=\\\"${e}\\\" alt=\\\"${Go(a)}\\\"`;return t&&(r+=` title=\\\"${Go(t)}\\\"`),r+=\\\">\\\",r}text(e){return\\\"tokens\\\"in e&&e.tokens?this.parser.parseInline(e.tokens):\\\"escaped\\\"in e&&e.escaped?e.text:Go(e.text)}},Nb=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return\\\"\\\"+e}image({text:e}){return\\\"\\\"+e}br(){return\\\"\\\"}checkbox({raw:e}){return e}},Ro=class kb{options;renderer;textRenderer;constructor(t){this.options=t||ws,this.options.renderer=this.options.renderer||new zd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Nb}static parse(t,a){return new kb(a).parse(t)}static parseInline(t,a){return new kb(a).parseInline(t)}parse(t){this.renderer.parser=this;let a=\\\"\\\";for(let o=0;o<t.length;o++){let n=t[o];if(this.options.extensions?.renderers?.[n.type]){let s=n,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||![\\\"space\\\",\\\"hr\\\",\\\"heading\\\",\\\"code\\\",\\\"table\\\",\\\"blockquote\\\",\\\"list\\\",\\\"checkbox\\\",\\\"html\\\",\\\"def\\\",\\\"paragraph\\\",\\\"text\\\"].includes(s.type)){a+=l||\\\"\\\";continue}}let r=n;switch(r.type){case\\\"space\\\":{a+=this.renderer.space(r);break}case\\\"hr\\\":{a+=this.renderer.hr(r);break}case\\\"heading\\\":{a+=this.renderer.heading(r);break}case\\\"code\\\":{a+=this.renderer.code(r);break}case\\\"table\\\":{a+=this.renderer.table(r);break}case\\\"blockquote\\\":{a+=this.renderer.blockquote(r);break}case\\\"list\\\":{a+=this.renderer.list(r);break}case\\\"checkbox\\\":{a+=this.renderer.checkbox(r);break}case\\\"html\\\":{a+=this.renderer.html(r);break}case\\\"def\\\":{a+=this.renderer.def(r);break}case\\\"paragraph\\\":{a+=this.renderer.paragraph(r);break}case\\\"text\\\":{a+=this.renderer.text(r);break}default:{let s='Token with \\\"'+r.type+'\\\" type was not found.';if(this.options.silent)return console.error(s),\\\"\\\";throw new Error(s)}}}return a}parseInline(t,a=this.renderer){this.renderer.parser=this;let o=\\\"\\\";for(let n=0;n<t.length;n++){let r=t[n];if(this.options.extensions?.renderers?.[r.type]){let l=this.options.extensions.renderers[r.type].call({parser:this},r);if(l!==!1||![\\\"escape\\\",\\\"html\\\",\\\"link\\\",\\\"image\\\",\\\"checkbox\\\",\\\"strong\\\",\\\"em\\\",\\\"codespan\\\",\\\"br\\\",\\\"del\\\",\\\"text\\\"].includes(r.type)){o+=l||\\\"\\\";continue}}let s=r;switch(s.type){case\\\"escape\\\":{o+=a.text(s);break}case\\\"html\\\":{o+=a.html(s);break}case\\\"link\\\":{o+=a.link(s);break}case\\\"image\\\":{o+=a.image(s);break}case\\\"checkbox\\\":{o+=a.checkbox(s);break}case\\\"strong\\\":{o+=a.strong(s);break}case\\\"em\\\":{o+=a.em(s);break}case\\\"codespan\\\":{o+=a.codespan(s);break}case\\\"br\\\":{o+=a.br(s);break}case\\\"del\\\":{o+=a.del(s);break}case\\\"text\\\":{o+=a.text(s);break}default:{let l='Token with \\\"'+s.type+'\\\" type was not found.';if(this.options.silent)return console.error(l),\\\"\\\";throw new Error(l)}}}return o}},Ku=class{options;block;constructor(e){this.options=e||ws}static passThroughHooks=new Set([\\\"preprocess\\\",\\\"postprocess\\\",\\\"processAllTokens\\\",\\\"emStrongMask\\\"]);static passThroughHooksRespectAsync=new Set([\\\"preprocess\\\",\\\"postprocess\\\",\\\"processAllTokens\\\"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Lo.lex:Lo.lexInline}provideParser(e=this.block){return e?Ro.parse:Ro.parseInline}},AB=class{defaults=Tb();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ro;Renderer=zd;TextRenderer=Nb;Lexer=Lo;Tokenizer=Hd;Hooks=Ku;constructor(...e){this.use(...e)}walkTokens(e,t){let a=[];for(let o of e)switch(a=a.concat(t.call(this,o)),o.type){case\\\"table\\\":{let n=o;for(let r of n.header)a=a.concat(this.walkTokens(r.tokens,t));for(let r of n.rows)for(let s of r)a=a.concat(this.walkTokens(s.tokens,t));break}case\\\"list\\\":{let n=o;a=a.concat(this.walkTokens(n.items,t));break}default:{let n=o;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(r=>{let s=n[r].flat(1/0);a=a.concat(this.walkTokens(s,t))}):n.tokens&&(a=a.concat(this.walkTokens(n.tokens,t)))}}return a}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(a=>{let o={...a};if(o.async=this.defaults.async||o.async||!1,a.extensions&&(a.extensions.forEach(n=>{if(!n.name)throw new Error(\\\"extension name required\\\");if(\\\"renderer\\\"in n){let r=t.renderers[n.name];r?t.renderers[n.name]=function(...s){let l=n.renderer.apply(this,s);return l===!1&&(l=r.apply(this,s)),l}:t.renderers[n.name]=n.renderer}if(\\\"tokenizer\\\"in n){if(!n.level||n.level!==\\\"block\\\"&&n.level!==\\\"inline\\\")throw new Error(\\\"extension level must be 'block' or 'inline'\\\");let r=t[n.level];r?r.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level===\\\"block\\\"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level===\\\"inline\\\"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}\\\"childTokens\\\"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),o.extensions=t),a.renderer){let n=this.defaults.renderer||new zd(this.defaults);for(let r in a.renderer){if(!(r in n))throw new Error(`renderer '${r}' does not exist`);if([\\\"options\\\",\\\"parser\\\"].includes(r))continue;let s=r,l=a.renderer[s],i=n[s];n[s]=(...u)=>{let c=l.apply(n,u);return c===!1&&(c=i.apply(n,u)),c||\\\"\\\"}}o.renderer=n}if(a.tokenizer){let n=this.defaults.tokenizer||new Hd(this.defaults);for(let r in a.tokenizer){if(!(r in n))throw new Error(`tokenizer '${r}' does not exist`);if([\\\"options\\\",\\\"rules\\\",\\\"lexer\\\"].includes(r))continue;let s=r,l=a.tokenizer[s],i=n[s];n[s]=(...u)=>{let c=l.apply(n,u);return c===!1&&(c=i.apply(n,u)),c}}o.tokenizer=n}if(a.hooks){let n=this.defaults.hooks||new Ku;for(let r in a.hooks){if(!(r in n))throw new Error(`hook '${r}' does not exist`);if([\\\"options\\\",\\\"block\\\"].includes(r))continue;let s=r,l=a.hooks[s],i=n[s];Ku.passThroughHooks.has(r)?n[s]=u=>{if(this.defaults.async&&Ku.passThroughHooksRespectAsync.has(r))return(async()=>{let f=await l.call(n,u);return i.call(n,f)})();let c=l.call(n,u);return i.call(n,c)}:n[s]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(n,u);return f===!1&&(f=await i.apply(n,u)),f})();let c=l.apply(n,u);return c===!1&&(c=i.apply(n,u)),c}}o.hooks=n}if(a.walkTokens){let n=this.defaults.walkTokens,r=a.walkTokens;o.walkTokens=function(s){let l=[];return l.push(r.call(this,s)),n&&(l=l.concat(n.call(this,s))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Lo.lex(e,t??this.defaults)}parser(e,t){return Ro.parse(e,t??this.defaults)}parseMarkdown(e){return(t,a)=>{let o={...a},n={...this.defaults,...o},r=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&o.async===!1)return r(new Error(\\\"marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.\\\"));if(typeof t>\\\"u\\\"||t===null)return r(new Error(\\\"marked(): input parameter is undefined or null\\\"));if(typeof t!=\\\"string\\\")return r(new Error(\\\"marked(): input parameter is of type \\\"+Object.prototype.toString.call(t)+\\\", string expected\\\"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=e),n.async)return(async()=>{let s=n.hooks?await n.hooks.preprocess(t):t,l=await(n.hooks?await n.hooks.provideLexer(e):e?Lo.lex:Lo.lexInline)(s,n),i=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(i,n.walkTokens));let u=await(n.hooks?await n.hooks.provideParser(e):e?Ro.parse:Ro.parseInline)(i,n);return n.hooks?await n.hooks.postprocess(u):u})().catch(r);try{n.hooks&&(t=n.hooks.preprocess(t));let s=(n.hooks?n.hooks.provideLexer(e):e?Lo.lex:Lo.lexInline)(t,n);n.hooks&&(s=n.hooks.processAllTokens(s)),n.walkTokens&&this.walkTokens(s,n.walkTokens);let l=(n.hooks?n.hooks.provideParser(e):e?Ro.parse:Ro.parseInline)(s,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(s){return r(s)}}}onError(e,t){return a=>{if(a.message+=`\\nPlease report this to https://github.com/markedjs/marked.`,e){let o=\\\"<p>An error occurred:</p><pre>\\\"+Go(a.message+\\\"\\\",!0)+\\\"</pre>\\\";return t?Promise.resolve(o):o}if(t)return Promise.reject(a);throw a}}},Is=new AB;function Ze(e,t){return Is.parse(e,t)}Ze.options=Ze.setOptions=function(e){return Is.setOptions(e),Ze.defaults=Is.defaults,n0(Ze.defaults),Ze};Ze.getDefaults=Tb;Ze.defaults=ws;function DB(...e){return Is.use(...e),Ze.defaults=Is.defaults,n0(Ze.defaults),Ze}Ze.use=DB;Ze.walkTokens=function(e,t){return Is.walkTokens(e,t)};Ze.parseInline=Is.parseInline;Ze.Parser=Ro;Ze.parser=Ro.parse;Ze.Renderer=zd;Ze.TextRenderer=Nb;Ze.Lexer=Lo;Ze.lexer=Lo.lex;Ze.Tokenizer=Hd;Ze.Hooks=Ku;Ze.parse=Ze;var Zq=Ze.options,Qq=Ze.setOptions,Jq=Ze.walkTokens,eV=Ze.parseInline;var tV=Ro.parse,aV=Lo.lex;function On(e){if(!e)return;let t=e.trim(),a=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!(a&&!/^https?$/i.test(a[1]??\\\"\\\")))return t}function Zu(e){if(!e)return;let t=e.trim();return/^data:image\\\\//i.test(t)?t:On(t)}function ks(e){return/^(?:[/\\\\\\\\]|[A-Za-z]:[/\\\\\\\\])/.test(e)}function Vd(e){return Ze.parse(e,{async:!1}).replace(/<script\\\\b[^>]*>[\\\\s\\\\S]*?<\\\\/script>/gi,\\\"\\\").replace(/<style\\\\b[^>]*>[\\\\s\\\\S]*?<\\\\/style>/gi,\\\"\\\").replace(/<\\\\/?(?:iframe|object|embed|form|base)\\\\b[^>]*>/gi,\\\"\\\").replace(/\\\\son[a-z]+\\\\s*=\\\\s*\\\"[^\\\"]*\\\"/gi,\\\"\\\").replace(/\\\\son[a-z]+\\\\s*=\\\\s*'[^']*'/gi,\\\"\\\").replace(/\\\\son[a-z]+\\\\s*=\\\\s*[^\\\\s>]+/gi,\\\"\\\").replace(/(href|src)\\\\s*=\\\\s*\\\"([^\\\"]*)\\\"/gi,(a,o,n)=>`${o}=\\\"${m0(n)}\\\"`).replace(/(href|src)\\\\s*=\\\\s*'([^']*)'/gi,(a,o,n)=>`${o}='${m0(n)}'`)}function Gd(e){let t=e.replace(/\\\\t/g,\\\"  \\\").split(`\\n`),a=t.filter(n=>n.trim().length>0).map(n=>n.length-n.trimStart().length),o=a.length>0?Math.min(...a):0;return t.map(n=>n.slice(o)).join(`\\n`).trim()}function m0(e){return On(e)??\\\"#\\\"}var wr=S(D(),1);function g0({entry:e}){let t=Wl();if(t.section)return(0,wr.jsx)(wr.Fragment,{children:t.section(e)});let a=Vd(Gd(e.markdown));return(0,wr.jsxs)(\\\"section\\\",{className:\\\"my-3 text-sm\\\",\\\"aria-label\\\":e.title,children:[e.title?(0,wr.jsx)(\\\"h4\\\",{className:\\\"mb-1 font-semibold text-foreground\\\",children:e.title}):null,(0,wr.jsx)(\\\"div\\\",{className:\\\"es-doc-prose prose prose-sm max-w-none\\\",dangerouslySetInnerHTML:{__html:a}})]})}var Pn=S(D(),1);function Bb({entry:e,ref:t}){return(0,Pn.jsxs)(\\\"figure\\\",{ref:t,className:\\\"my-3\\\",\\\"aria-label\\\":e.title??\\\"Diagram\\\",children:[e.title?(0,Pn.jsx)(\\\"figcaption\\\",{className:\\\"mb-1.5 text-xs font-medium text-muted-foreground\\\",children:e.title}):null,(0,Pn.jsx)(\\\"pre\\\",{\\\"data-mermaid\\\":!0,tabIndex:0,className:\\\"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground\\\",children:e.code})]})}function Xd({entry:e}){let t=Wl();return t.mermaid?(0,Pn.jsx)(Pn.Fragment,{children:t.mermaid(e)}):(0,Pn.jsx)(Bb,{entry:e})}var Nn=S(D(),1);function h0({entry:e}){let t=ks(e.path)?void 0:Zu(e.path);return t?(0,Nn.jsxs)(\\\"figure\\\",{className:\\\"my-3\\\",children:[(0,Nn.jsx)(\\\"img\\\",{src:t,alt:e.alt??\\\"\\\",loading:\\\"lazy\\\",className:\\\"max-w-full rounded-md border border-border\\\"}),e.alt?(0,Nn.jsx)(\\\"figcaption\\\",{className:\\\"mt-1.5 text-xs text-muted-foreground\\\",children:e.alt}):null]}):(0,Nn.jsxs)(\\\"figure\\\",{className:\\\"my-3 rounded-md border border-dashed border-border p-3 text-sm text-muted-foreground\\\",children:[(0,Nn.jsx)(\\\"div\\\",{className:\\\"font-medium\\\",children:\\\"Screenshot unavailable\\\"}),(0,Nn.jsx)(\\\"div\\\",{className:\\\"mt-1 break-all font-mono text-xs\\\",children:e.path}),e.alt?(0,Nn.jsx)(\\\"figcaption\\\",{className:\\\"mt-1.5 text-xs\\\",children:e.alt}):null]})}var Bn=S(D(),1);function x0({entry:e}){if(ks(e.path))return(0,Bn.jsxs)(\\\"figure\\\",{className:\\\"my-3 rounded-md border border-dashed border-border p-3 text-sm text-muted-foreground\\\",children:[(0,Bn.jsx)(\\\"div\\\",{className:\\\"font-medium\\\",children:\\\"Video unavailable\\\"}),(0,Bn.jsx)(\\\"div\\\",{className:\\\"mt-1 break-all font-mono text-xs\\\",children:e.path}),e.caption?(0,Bn.jsx)(\\\"figcaption\\\",{className:\\\"mt-1.5 text-xs\\\",children:e.caption}):null]});let t=On(e.path),a=On(e.poster);return(0,Bn.jsxs)(\\\"figure\\\",{className:\\\"my-3\\\",children:[(0,Bn.jsx)(\\\"video\\\",{controls:!0,preload:\\\"metadata\\\",...t?{src:t}:{},...a?{poster:a}:{},className:\\\"max-w-full rounded-md border border-border\\\"}),e.caption?(0,Bn.jsx)(\\\"figcaption\\\",{className:\\\"mt-1 text-xs text-muted-foreground\\\",children:e.caption}):null]})}var Jl=S(T(),1);var Ts=S(D(),1),OB=\\\"<script>(function(){if(parent===window)return;var last=0,queued=false;var measure=function(){var kids=document.body.children,h=0;for(var i=0;i<kids.length;i++)h=Math.max(h,kids[i].getBoundingClientRect().bottom);return Math.ceil(h||document.body.getBoundingClientRect().bottom)};var post=function(){queued=false;var h=measure();if(h===last)return;last=h;parent.postMessage({__esHtmlHeight:h},'*')};var schedule=function(){if(queued)return;queued=true;requestAnimationFrame(post)};var start=function(){new ResizeObserver(schedule).observe(document.body);new MutationObserver(schedule).observe(document.body,{subtree:true,childList:true,attributes:true,characterData:true});addEventListener('load',schedule);post()};if(document.body)start();else addEventListener('DOMContentLoaded',start)})();<\\\\/script>\\\",PB=5e3;function b0({entry:e}){let t=typeof e.height==\\\"number\\\"?`${e.height}px`:e.height??\\\"400px\\\",a=e.title??\\\"Embedded HTML\\\",o=On(e.url??e.path),n=(0,Jl.useRef)(null),[r,s]=(0,Jl.useState)();(0,Jl.useEffect)(()=>{if(e.content===void 0)return;let u=c=>{if(c.source!==n.current?.contentWindow)return;let f=c.data?.__esHtmlHeight;typeof f!=\\\"number\\\"||!Number.isFinite(f)||f<=0||s(Math.min(f,PB))};return window.addEventListener(\\\"message\\\",u),()=>window.removeEventListener(\\\"message\\\",u)},[e.content]);let l=r===void 0?t:`${r}px`,i=e.content!==void 0?{srcDoc:e.content+OB}:{src:o??\\\"\\\"};return(0,Ts.jsxs)(\\\"figure\\\",{className:\\\"my-3 overflow-hidden rounded-md border border-border\\\",children:[(0,Ts.jsxs)(\\\"figcaption\\\",{className:\\\"flex items-center justify-between border-b border-border bg-muted/40 px-3 py-1.5 text-xs font-medium text-muted-foreground\\\",children:[(0,Ts.jsx)(\\\"span\\\",{children:e.title??\\\"HTML\\\"}),o?(0,Ts.jsx)(\\\"a\\\",{href:o,target:\\\"_blank\\\",rel:\\\"noreferrer noopener\\\",\\\"aria-label\\\":\\\"Open in new tab\\\",title:\\\"Open in new tab\\\",className:\\\"text-primary\\\",children:\\\"\\\\u2197\\\"}):null]}),(0,Ts.jsx)(\\\"iframe\\\",{ref:n,...i,sandbox:\\\"allow-scripts\\\",loading:\\\"lazy\\\",title:a,className:\\\"block w-full border-0\\\",style:{height:l,colorScheme:\\\"light\\\",background:\\\"#fff\\\"}})]})}var Fb=S(D(),1);function y0({entry:e}){let t;try{t=JSON.stringify(e.value,null,2)??String(e.value)}catch{t=String(e.value)}return(0,Fb.jsx)(ju,{label:e.label??\\\"State\\\",children:(0,Fb.jsx)(\\\"code\\\",{className:\\\"font-mono text-xs language-json\\\",children:t})})}var kr=S(D(),1);function S0({entry:e}){let a=jw()[e.type];return a?(0,kr.jsx)(kr.Fragment,{children:a(e)}):(0,kr.jsxs)(\\\"div\\\",{className:\\\"my-2\\\",\\\"data-type\\\":e.type,children:[(0,kr.jsx)(\\\"p\\\",{className:\\\"mb-1 text-xs font-medium text-muted-foreground\\\",children:e.type}),(0,kr.jsx)(\\\"pre\\\",{tabIndex:0,className:\\\"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground\\\",children:NB(e.data)})]})}function NB(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}var wa=S(D(),1);function C0({entry:e}){switch(e.kind){case\\\"note\\\":return(0,wa.jsx)(Tw,{entry:e});case\\\"tag\\\":return(0,wa.jsx)(Xw,{entry:e});case\\\"kv\\\":return(0,wa.jsx)(Fd,{entries:[e]});case\\\"code\\\":return(0,wa.jsx)(Yw,{entry:e});case\\\"table\\\":return(0,wa.jsx)(Kw,{entry:e});case\\\"link\\\":return(0,wa.jsx)($w,{entry:e});case\\\"section\\\":return(0,wa.jsx)(g0,{entry:e});case\\\"mermaid\\\":return(0,wa.jsx)(Xd,{entry:e});case\\\"screenshot\\\":return(0,wa.jsx)(h0,{entry:e});case\\\"video\\\":return(0,wa.jsx)(x0,{entry:e});case\\\"html\\\":return(0,wa.jsx)(b0,{entry:e});case\\\"state\\\":return(0,wa.jsx)(y0,{entry:e});case\\\"custom\\\":return(0,wa.jsx)(S0,{entry:e})}}var ei=S(D(),1);function jd({entries:e}){if(e.length===0)return null;let t=[];for(let a of e){let o=t[t.length-1];a.kind===\\\"kv\\\"&&Array.isArray(o)?o.push(a):t.push(a.kind===\\\"kv\\\"?[a]:a)}return(0,ei.jsx)(ei.Fragment,{children:t.map((a,o)=>Array.isArray(a)?(0,ei.jsx)(Fd,{entries:a},o):(0,ei.jsx)(C0,{entry:a},o))})}var ka=S(D(),1),BB={passed:\\\"\\\\u2713\\\",failed:\\\"\\\\u2717\\\",skipped:\\\"\\\\u25CB\\\",pending:\\\"\\\\u25CB\\\"},FB={passed:\\\"text-pass\\\",failed:\\\"text-fail\\\",skipped:\\\"text-skip\\\",pending:\\\"text-pend\\\"};function L0({scenario:e}){if(e.steps.length===0)return null;let t=new Set(Od(e.steps)===\\\"unasserted\\\"?bb(e.steps).map(a=>a.id):[]);return(0,ka.jsx)(\\\"ol\\\",{\\\"data-slot\\\":\\\"steps\\\",className:\\\"flex flex-col\\\",children:e.steps.map(a=>(0,ka.jsx)(_B,{step:a,unasserted:t.has(a.id)},a.id))})}function _B({step:e,unasserted:t=!1}){let a=e.keyword.toLowerCase(),o=a===\\\"and\\\"||a===\\\"but\\\";return(0,ka.jsxs)(\\\"li\\\",{id:e.id,\\\"data-status\\\":e.status,className:te(\\\"py-1.5 text-[0.8125rem] leading-normal\\\",o&&\\\"pl-5\\\"),children:[(0,ka.jsxs)(\\\"div\\\",{className:\\\"flex items-baseline gap-2\\\",children:[(0,ka.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,className:te(\\\"w-4 shrink-0 text-center text-xs\\\",FB[e.status]),children:BB[e.status]??\\\"\\\\u25CB\\\"}),(0,ka.jsx)(\\\"span\\\",{className:te(\\\"min-w-[52px] shrink-0 font-mono text-xs font-semibold capitalize\\\",o?\\\"font-medium text-muted-foreground\\\":\\\"text-keyword\\\"),children:e.keyword}),(0,ka.jsx)(\\\"span\\\",{className:\\\"flex-1 text-foreground\\\",children:ww(e.text)}),t?(0,ka.jsx)(\\\"span\\\",{className:\\\"shrink-0 rounded-full border border-pend-border bg-pend-bg px-2 py-0.5 text-[0.6875rem] font-medium text-pend\\\",children:\\\"No assertion\\\"}):null,e.durationMs>0?(0,ka.jsx)(\\\"span\\\",{className:\\\"shrink-0 whitespace-nowrap font-mono text-[0.6875rem] text-muted-foreground\\\",children:qo(e.durationMs)}):null]}),e.errorMessage?(0,ka.jsx)(\\\"pre\\\",{role:\\\"alert\\\",className:\\\"mt-2.5 ml-6 overflow-x-auto rounded-md border border-fail-border bg-fail-bg px-4 py-3.5 font-mono text-xs leading-relaxed whitespace-pre-wrap text-fail\\\",children:e.errorMessage}):null,e.docEntries.length>0?(0,ka.jsx)(\\\"div\\\",{\\\"data-es-docs\\\":!0,className:\\\"mt-2 ml-6\\\",children:(0,ka.jsx)(jd,{entries:e.docEntries})}):null]})}var Yd=e=>typeof e==\\\"object\\\"&&e!==null&&!Array.isArray(e);function Ub(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((a,o)=>Ub(a,t[o]));if(Yd(e)&&Yd(t)){let a=Object.keys(e),o=Object.keys(t);return a.length===o.length&&a.every(n=>n in t&&Ub(e[n],t[n]))}return!1}var R0=(e,t)=>e===\\\"\\\"?t:`${e}.${t}`;function Hb(e,t,a,o){if(!Object.is(t,a)){if(Array.isArray(t)&&Array.isArray(a)){let n=Math.min(t.length,a.length);for(let r=0;r<n;r++)Hb(`${e}[${r}]`,t[r],a[r],o);for(let r=n;r<a.length;r++)o.push({path:`${e}[${r}]`,kind:\\\"added\\\",after:a[r]});for(let r=n;r<t.length;r++)o.push({path:`${e}[${r}]`,kind:\\\"removed\\\",before:t[r]});return}if(Yd(t)&&Yd(a)){for(let n of Object.keys(a)){let r=R0(e,n);n in t?Hb(r,t[n],a[n],o):o.push({path:r,kind:\\\"added\\\",after:a[n]})}for(let n of Object.keys(t))n in a||o.push({path:R0(e,n),kind:\\\"removed\\\",before:t[n]});return}Ub(t,a)||o.push({path:e,kind:\\\"changed\\\",before:t,after:a})}}function Kd(e,t){let a=[];return Hb(\\\"\\\",e,t,a),a}function _b(e,t=60){let a=e===void 0?\\\"undefined\\\":JSON.stringify(e);return a.length>t?`${a.slice(0,t-1)}\\\\u2026`:a}function $d(e){return e.map(t=>{let a=t.path===\\\"\\\"?\\\"(root)\\\":t.path;switch(t.kind){case\\\"added\\\":return`+ ${a}: ${_b(t.after)}`;case\\\"removed\\\":return`\\\\u2212 ${a}`;case\\\"changed\\\":return`${a}: ${_b(t.before)} \\\\u2192 ${_b(t.after)}`}})}function v0(e){for(let t of e){if(t.kind===\\\"screenshot\\\")return t;if(t.children){let a=v0(t.children);if(a)return a}}}function I0(e,t=[]){for(let a of e)a.kind===\\\"state\\\"&&t.push(a),a.children&&I0(a.children,t);return t}var UB=e=>e??\\\"\\\";function w0(e){let t=[],a=[],o=new Map;for(let n of e.steps){let r=v0(n.docEntries),s=I0(n.docEntries);if(!r&&s.length===0)continue;let l=new Map;for(let u of s){let c=UB(u.label);!l.has(c)&&!a.includes(c)&&a.push(c),l.set(c,u)}let i=[];for(let u of a){let c=l.get(u);if(!c)continue;let f={...c.label!==void 0&&{label:c.label},value:c.value};o.has(u)&&(f.changes=Kd(o.get(u),c.value)),o.set(u,c.value),i.push(f)}t.push({stepId:n.id,stepIndex:n.index,keyword:n.keyword,text:n.text,status:n.status,...r&&{screenshot:{path:r.path,...r.alt!==void 0&&{alt:r.alt}}},states:i})}return t}var Qe=S(D(),1),HB={passed:\\\"\\\\u2713\\\",failed:\\\"\\\\u2717\\\",skipped:\\\"\\\\u25CB\\\",pending:\\\"\\\\u25CB\\\"},zB={passed:\\\"text-pass\\\",failed:\\\"text-fail\\\",skipped:\\\"text-skip\\\",pending:\\\"text-pend\\\"};function k0({scenario:e}){let t=w0(e);return t.length<2?null:(0,Qe.jsxs)(\\\"section\\\",{\\\"data-slot\\\":\\\"storyboard\\\",\\\"aria-label\\\":\\\"Storyboard\\\",className:\\\"mb-3\\\",children:[(0,Qe.jsx)(\\\"h4\\\",{className:\\\"mb-1.5 text-xs font-semibold tracking-wide text-muted-foreground uppercase\\\",children:\\\"Storyboard\\\"}),(0,Qe.jsx)(\\\"ol\\\",{className:\\\"flex items-start gap-3 overflow-x-auto pb-2\\\",children:t.map(a=>(0,Qe.jsx)(qB,{frame:a},a.stepId))})]})}function qB({frame:e}){let t=`${e.keyword} ${e.text}`,a=e.states.length>0,o=(0,Qe.jsxs)(\\\"p\\\",{className:\\\"mt-1 flex items-baseline gap-1.5 text-[0.6875rem] leading-snug\\\",children:[(0,Qe.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,className:te(\\\"shrink-0\\\",zB[e.status]),children:HB[e.status]??\\\"\\\\u25CB\\\"}),(0,Qe.jsxs)(\\\"span\\\",{className:\\\"min-w-0\\\",children:[(0,Qe.jsx)(\\\"span\\\",{className:\\\"font-mono font-semibold text-keyword\\\",children:e.keyword}),\\\" \\\",(0,Qe.jsx)(\\\"span\\\",{className:\\\"text-muted-foreground\\\",children:e.screenshot?.alt??e.text})]})]});return(0,Qe.jsxs)(\\\"li\\\",{className:te(\\\"shrink-0\\\",a?\\\"w-64\\\":\\\"w-40\\\"),children:[e.screenshot?(0,Qe.jsx)(VB,{frame:e,label:t}):null,a?(0,Qe.jsx)(\\\"div\\\",{className:te(\\\"flex flex-col gap-1.5\\\",e.screenshot&&\\\"mt-1.5\\\"),children:e.states.map((n,r)=>(0,Qe.jsx)(jB,{card:n},n.label??r))}):null,e.screenshot?o:(0,Qe.jsx)(\\\"a\\\",{href:`#${e.stepId}`,\\\"aria-label\\\":`Jump to step: ${t}`,className:\\\"block hover:underline\\\",children:o})]})}function VB({frame:e,label:t}){let a=e.screenshot?.path??\\\"\\\",o=ks(a)?void 0:Zu(a);return(0,Qe.jsx)(\\\"a\\\",{href:`#${e.stepId}`,\\\"aria-label\\\":`Jump to step: ${t}`,className:\\\"block overflow-hidden rounded-md border border-border transition-colors hover:border-ring\\\",children:o?(0,Qe.jsx)(\\\"img\\\",{src:o,alt:e.screenshot?.alt??t,loading:\\\"lazy\\\",className:\\\"h-24 w-full bg-muted object-cover object-top\\\"}):(0,Qe.jsx)(\\\"span\\\",{className:\\\"flex h-24 w-full items-center justify-center border-b border-dashed border-border bg-muted px-2 text-center text-[0.6875rem] text-muted-foreground\\\",children:\\\"Screenshot unavailable\\\"})})}var GB={added:\\\"bg-pass-bg text-pass\\\",removed:\\\"bg-fail-bg text-fail\\\",changed:\\\"bg-skip-bg text-skip\\\"};function XB(e){try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function jB({card:e}){let t=XB(e.value),a=e.changes===void 0;return(0,Qe.jsxs)(\\\"div\\\",{\\\"data-slot\\\":\\\"state-card\\\",className:\\\"rounded-md border border-border bg-card p-2\\\",children:[(0,Qe.jsxs)(\\\"p\\\",{className:\\\"flex flex-wrap items-baseline gap-1.5\\\",children:[(0,Qe.jsx)(\\\"span\\\",{className:\\\"inline-flex rounded-full border border-border px-1.5 font-mono text-[0.625rem] font-medium text-muted-foreground\\\",children:e.label??\\\"State\\\"}),a?(0,Qe.jsx)(\\\"span\\\",{className:\\\"text-[0.625rem] text-muted-foreground italic\\\",children:\\\"first capture\\\"}):null]}),!a&&(e.changes&&e.changes.length>0?(0,Qe.jsx)(\\\"ul\\\",{className:\\\"mt-1.5 flex flex-col gap-0.5\\\",children:e.changes.map((o,n)=>(0,Qe.jsx)(\\\"li\\\",{className:te(\\\"rounded-sm px-1.5 py-0.5 font-mono text-[0.625rem] leading-snug break-all\\\",GB[o.kind]),children:$d([o])[0]},n))}):(0,Qe.jsx)(\\\"p\\\",{className:\\\"mt-1.5 text-[0.625rem] text-muted-foreground\\\",children:\\\"No changes\\\"})),(0,Qe.jsxs)(\\\"details\\\",{open:a&&t.length<=240,className:te(a?\\\"mt-1.5\\\":\\\"mt-1\\\"),children:[(0,Qe.jsx)(\\\"summary\\\",{className:\\\"cursor-pointer text-[0.625rem] text-muted-foreground hover:text-foreground\\\",children:\\\"Snapshot\\\"}),(0,Qe.jsx)(\\\"pre\\\",{tabIndex:0,className:\\\"mt-1 max-h-48 overflow-auto rounded-sm bg-muted p-1.5 font-mono text-[0.625rem] leading-snug\\\",children:t})]})]})}var vo=S(D(),1);function T0({attachments:e}){return e.length===0?null:(0,vo.jsx)(\\\"div\\\",{role:\\\"group\\\",\\\"aria-label\\\":\\\"Attachments\\\",className:\\\"mt-3 flex flex-col gap-2\\\",children:e.map((t,a)=>{let o=t.contentEncoding===\\\"BASE64\\\"?`data:${t.mediaType};base64,${t.body}`:`data:${t.mediaType},${encodeURIComponent(t.body)}`,n=t.mediaType.startsWith(\\\"image/\\\");return(0,vo.jsx)(\\\"figure\\\",{className:\\\"m-0\\\",children:n?(0,vo.jsxs)(vo.Fragment,{children:[(0,vo.jsx)(\\\"img\\\",{src:o,alt:t.name,loading:\\\"lazy\\\",className:\\\"max-w-full rounded-md border border-border\\\"}),(0,vo.jsx)(\\\"figcaption\\\",{className:\\\"mt-1 text-xs text-muted-foreground\\\",children:t.name})]}):(0,vo.jsxs)(\\\"a\\\",{href:o,download:t.name,className:\\\"text-xs text-link underline underline-offset-2\\\",children:[t.name,\\\" \\\",(0,vo.jsxs)(\\\"span\\\",{className:\\\"text-muted-foreground\\\",children:[\\\"(\\\",t.mediaType,\\\")\\\"]})]})},`${t.name}-${a}`)})})}var YB=new Set([\\\"ok\\\",\\\"error\\\",\\\"unset\\\"]),KB=e=>YB.has(e)?e:\\\"unset\\\";function $B(e){let t=[];for(let a of e){if(!a||typeof a.spanId!=\\\"string\\\"||typeof a.name!=\\\"string\\\")continue;let o,n;if(a.startTimeMs!=null&&a.durationMs!=null)o=a.startTimeMs,n=a.durationMs;else if(a.startTimeUnixNano!=null&&a.endTimeUnixNano!=null)o=a.startTimeUnixNano/1e6,n=(a.endTimeUnixNano-a.startTimeUnixNano)/1e6;else continue;n=Math.max(0,n),!(!isFinite(o)||!isFinite(n))&&t.push({spanId:a.spanId,parentSpanId:a.parentSpanId,name:a.name,startTimeMs:o,durationMs:n,status:KB(a.status),statusMessage:a.statusMessage})}return t}function E0(e){let t=$B(e);if(t.length===0)return[];let a=new Map;for(let l of t){let i=l.spanId,u=2;for(;a.has(i);)i=`${l.spanId}__dup${u++}`;a.set(i,{span:{...l,spanId:i},children:[],depth:0})}let o=[];for(let l of a.values()){let i=l.span.parentSpanId?a.get(l.span.parentSpanId):void 0;i&&i!==l?i.children.push(l):o.push(l)}for(let l of a.values())l.children.sort((i,u)=>i.span.startTimeMs-u.span.startTimeMs);o.sort((l,i)=>l.span.startTimeMs-i.span.startTimeMs);let n=[],r=new Set,s=(l,i)=>{if(!r.has(l.span.spanId)){r.add(l.span.spanId),n.push({...l.span,depth:i});for(let u of l.children)s(u,i+1)}};for(let l of o)s(l,0);for(let l of a.values())r.has(l.span.spanId)||s(l,0);return n}function M0(e){let t=1/0,a=-1/0;for(let n of e)t=Math.min(t,n.startTimeMs),a=Math.max(a,n.startTimeMs+n.durationMs);let o=a-t;return{minStartMs:isFinite(t)?t:0,totalMs:o>0?o:1}}var Xo=S(D(),1),WB={ok:\\\"bg-pass\\\",error:\\\"bg-fail\\\",unset:\\\"bg-skip\\\"};function A0({spans:e}){if(!e||e.length===0)return null;let t=E0(e);if(t.length===0)return null;let{minStartMs:a,totalMs:o}=M0(t);return(0,Xo.jsxs)(\\\"details\\\",{className:\\\"mt-3 rounded-md border border-border bg-muted/30\\\",children:[(0,Xo.jsxs)(\\\"summary\\\",{className:\\\"cursor-pointer px-3 py-2 text-xs font-medium text-muted-foreground\\\",children:[\\\"Trace (\\\",t.length,\\\" span\\\",t.length===1?\\\"\\\":\\\"s\\\",\\\", \\\",qo(o),\\\")\\\"]}),(0,Xo.jsx)(\\\"ul\\\",{className:\\\"flex flex-col gap-0.5 px-3 pb-3 font-mono text-[0.6875rem]\\\",children:t.map((n,r)=>{let s=(n.startTimeMs-a)/o*100,l=Math.max(n.durationMs/o*100,.5);return(0,Xo.jsxs)(\\\"li\\\",{className:\\\"flex items-center gap-2\\\",children:[(0,Xo.jsx)(\\\"span\\\",{className:\\\"min-w-0 flex-1 truncate text-foreground\\\",style:{paddingLeft:`${n.depth*12}px`},title:n.statusMessage?`${n.name}: ${n.statusMessage}`:n.name,children:n.name}),(0,Xo.jsx)(\\\"span\\\",{className:\\\"relative h-3 w-1/2 shrink-0 overflow-hidden rounded-sm bg-border/40\\\",children:(0,Xo.jsx)(\\\"span\\\",{className:te(\\\"absolute top-0 h-full rounded-sm\\\",WB[n.status]),style:{left:`${s}%`,width:`${l}%`}})}),(0,Xo.jsx)(\\\"span\\\",{className:\\\"w-16 shrink-0 text-right text-muted-foreground\\\",children:qo(n.durationMs)})]},`${n.spanId}-${r}`)})})]})}var Wd=S(T(),1),D0=(0,Wd.createContext)(null),O0=D0.Provider;function P0(){return(0,Wd.useContext)(D0)}function ZB(e){let t=e[e.length-1];if(!t)return;let a=0;for(let o=e.length-1;o>=0&&e[o].status===t.status;o--)a++;return{status:t.status,count:a}}var QB={passed:\\\"Passing\\\",failed:\\\"Failing\\\",skipped:\\\"Skipped\\\",pending:\\\"Pending\\\"};function zb(e){let a=`${e.filter(n=>n.status===\\\"passed\\\").length}/${e.length} runs passed`,o=ZB(e);return!o||e.length<2?a:`${a} \\\\xB7 ${QB[o.status]} for the last ${o.count===1?\\\"run\\\":`${o.count} runs`}`}var JB=3;function N0(e){let t=e.filter(r=>r.status===\\\"passed\\\"||r.status===\\\"failed\\\");if(t.length<JB)return\\\"stable\\\";let a=0;for(let r=1;r<t.length;r++)t[r].status!==t[r-1].status&&a++;let o=a/(t.length-1),n=t.filter(r=>r.status===\\\"failed\\\").length/t.length;return o>.5||o>.3&&n>.2?\\\"flaky\\\":o>.2||n>.3?\\\"unstable\\\":\\\"stable\\\"}function B0(e,t){let a=!1,o={newlyFailing:[],newlyPassing:[],added:[]};for(let n of t){let r=e[n.id];if(!r||r.length===0)continue;let s=r[r.length-1],l=r[r.length-2];if(!l){o.added.push(n);continue}a=!0,s.status===\\\"failed\\\"&&l.status!==\\\"failed\\\"?o.newlyFailing.push(n):s.status===\\\"passed\\\"&&l.status===\\\"failed\\\"&&o.newlyPassing.push(n)}return a?o:void 0}var Tr=S(D(),1),eF=10,tF={passed:\\\"bg-pass\\\",failed:\\\"bg-fail\\\",skipped:\\\"bg-skip\\\",pending:\\\"bg-pend\\\"};function aF(e){let t=[new Date(e.timestamp).toLocaleString(),e.status];return e.commitSha&&t.push(e.commitSha.slice(0,8)),t.join(\\\" \\\\xB7 \\\")}function F0({scenarioId:e}){let a=P0()?.[e];if(!a||a.length<2)return null;let o=a.slice(-eF),n=N0(o)===\\\"flaky\\\",r=n?`${zb(o)} \\\\xB7 Flaky`:zb(o);return(0,Tr.jsxs)(Tr.Fragment,{children:[n?(0,Tr.jsx)(Jt,{variant:\\\"pending\\\",\\\"aria-label\\\":\\\"Flaky: status flips between recent runs\\\",title:r,children:\\\"Flaky\\\"}):null,(0,Tr.jsx)(\\\"span\\\",{role:\\\"img\\\",\\\"aria-label\\\":`Run history: ${r}`,title:r,className:\\\"flex shrink-0 items-center gap-[3px]\\\",children:o.map((s,l)=>(0,Tr.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,title:aF(s),className:te(\\\"inline-block size-1.5 rounded-full\\\",tF[s.status],l===o.length-1&&\\\"ring-1 ring-border ring-offset-1 ring-offset-card\\\")},`${s.timestamp}-${l}`))})]})}var Jd=S(T(),1);function _0(e){if(e.finishedAtMs&&e.finishedAtMs>0)return e.finishedAtMs;if(e.startedAtMs&&e.startedAtMs>0)return e.startedAtMs}function ti(e,t){let a=Math.max(0,t-e),o=Math.floor(a/6e4);if(o<1)return\\\"just now\\\";if(o<60)return`${o} minute${o===1?\\\"\\\":\\\"s\\\"} ago`;let n=Math.floor(o/60);if(n<24)return`${n} hour${n===1?\\\"\\\":\\\"s\\\"} ago`;let r=Math.floor(n/24);return`${r} day${r===1?\\\"\\\":\\\"s\\\"} ago`}function Zd(e,t,a){return e===void 0||t<=0?!1:a-e>=t*864e5}var oF={github:\\\"GitHub Actions\\\",gitlab:\\\"GitLab CI\\\",circleci:\\\"CircleCI\\\",jenkins:\\\"Jenkins\\\",azure:\\\"Azure DevOps\\\",buildkite:\\\"Buildkite\\\",travis:\\\"Travis CI\\\",ci:\\\"CI\\\"};function qb(e){return oF[e]??e}function U0(e,t){let a=e?.commitSha??t;if(!e?.url||!a)return;let o=e.url.match(/^(https?:\\\\/\\\\/[^/]+\\\\/[^/]+\\\\/[^/]+)\\\\/actions\\\\/runs\\\\//);if(o)return`${o[1]}/commit/${a}`;let n=e.url.match(/^(https?:\\\\/\\\\/.+)\\\\/-\\\\/pipelines\\\\//);if(n)return`${n[1]}/-/commit/${a}`}function H0(e){if(!e?.url||!e.prNumber)return;let t=e.url.match(/^(https?:\\\\/\\\\/[^/]+\\\\/[^/]+\\\\/[^/]+)\\\\/actions\\\\/runs\\\\//);if(t)return`${t[1]}/pull/${e.prNumber}`}var Qd=S(T(),1),z0=(0,Qd.createContext)(null),q0=z0.Provider;function V0(){return(0,Qd.useContext)(z0)}var X0=S(D(),1);function G0({scenario:e}){let t=V0(),a=t?.nowMs,[o,n]=(0,Jd.useState)(a);if((0,Jd.useEffect)(()=>{a===void 0&&n(Date.now())},[a]),!t||o===void 0)return null;let r=e.lastRunAtMs;return!r||r<=0||!Zd(r,t.staleAfterDays,o)?null:(0,X0.jsxs)(Jt,{variant:\\\"outline\\\",\\\"aria-label\\\":\\\"Scenario freshness\\\",children:[\\\"Last ran \\\",ti(r,o)]})}var Io=S(T(),1),j0=(0,Io.createContext)(null),Y0=j0.Provider;function ep(){return(0,Io.useContext)(j0)}var K0=\\\"es-collapsed-ids\\\";function nF(){if(typeof localStorage>\\\"u\\\")return null;try{let e=localStorage.getItem(K0);return e?new Set(JSON.parse(e)):null}catch{return null}}function Vb(e){if(!(typeof localStorage>\\\"u\\\"))try{localStorage.setItem(K0,JSON.stringify([...e]))}catch{}}function $0(e){let[t,a]=(0,Io.useState)(()=>nF()??e?.()??new Set),o=(0,Io.useCallback)(l=>t.has(l),[t]),n=(0,Io.useCallback)(l=>{a(i=>{let u=new Set(i);return u.has(l)?u.delete(l):u.add(l),Vb(u),u})},[]),r=(0,Io.useCallback)(l=>{a(()=>{let i=new Set(l);return Vb(i),i})},[]),s=(0,Io.useCallback)(()=>{a(()=>{let l=new Set;return Vb(l),l})},[]);return{api:{isCollapsed:o,toggle:n},collapseAll:r,expandAll:s}}var tp=S(T(),1);function W0(e){return e.replaceAll(\\\"|\\\",\\\"\\\\\\\\|\\\").replaceAll(`\\n`,\\\" \\\")}function Gb(e){if(typeof e==\\\"string\\\")return e;try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function Xb(e,t){let a=[];switch(e.kind){case\\\"note\\\":a.push(e.text);break;case\\\"tag\\\":a.push(e.names.map(o=>`\\\\`@${o}\\\\``).join(\\\" \\\"));break;case\\\"kv\\\":a.push(`**${e.label}:** ${Gb(e.value)}`);break;case\\\"code\\\":a.push(`**${e.label}**`,\\\"\\\",\\\"```\\\"+(e.lang??\\\"\\\"),e.content,\\\"```\\\");break;case\\\"table\\\":{a.push(`**${e.label}**`,\\\"\\\"),a.push(`| ${e.columns.map(W0).join(\\\" | \\\")} |`),a.push(`| ${e.columns.map(()=>\\\"---\\\").join(\\\" | \\\")} |`);for(let o of e.rows)a.push(`| ${o.map(W0).join(\\\" | \\\")} |`);break}case\\\"link\\\":a.push(`[${e.label}](${e.url})`);break;case\\\"section\\\":a.push(`### ${e.title}`,\\\"\\\",e.markdown);break;case\\\"mermaid\\\":e.title&&a.push(`**${e.title}**`,\\\"\\\"),a.push(\\\"```mermaid\\\",e.code,\\\"```\\\");break;case\\\"screenshot\\\":a.push(`![${e.alt??\\\"screenshot\\\"}](${e.path})`);break;case\\\"video\\\":a.push(`Video: ${e.path}${e.caption?` \\\\u2014 ${e.caption}`:\\\"\\\"}`);break;case\\\"html\\\":{let o=e.title??\\\"Embedded HTML\\\";e.content?a.push(`**${o}**`,\\\"\\\",\\\"```html\\\",e.content,\\\"```\\\"):e.url?a.push(`[${o}](${e.url})`):a.push(`Embedded HTML: ${e.path??\\\"(inline)\\\"}`);break}case\\\"custom\\\":a.push(`**${e.type}**`,\\\"\\\",\\\"```json\\\",Gb(e.data),\\\"```\\\");break;case\\\"state\\\":{let o=e.label??\\\"\\\";if(a.push(`**${e.label??\\\"State\\\"}**`),t?.has(o)){let n=$d(Kd(t.get(o),e.value));n.length>0&&a.push(\\\"\\\",...n.map(r=>`- ${r}`))}t?.set(o,e.value),a.push(\\\"\\\",\\\"<details>\\\",\\\"<summary>snapshot</summary>\\\",\\\"\\\",\\\"```json\\\",Gb(e.value??null),\\\"```\\\",\\\"\\\",\\\"</details>\\\");break}}for(let o of e.children??[])a.push(\\\"\\\",...Xb(o,t));return a}function rF(e,t,a,o){let n=e.status===\\\"passed\\\"?\\\"\\\":` \\\\u2014 **${e.status}**`,r=[`${t}. **${e.keyword}** ${e.text}${n}`];if(!a)return r;e.errorMessage&&r.push(...e.errorMessage.split(`\\n`).map(s=>`   > ${s}`));for(let s of e.docEntries)r.push(\\\"\\\",...Xb(s,o).map(l=>l===\\\"\\\"?l:`   ${l}`));return r}function Z0(e,t={}){let{variant:a=\\\"full\\\",meta:o=[]}=t,n=a===\\\"full\\\",r=n?[`# ${e.title}`,\\\"\\\"]:[`## ${e.title} _(${e.status})_`,\\\"\\\"];n&&o.length>0&&r.push(...o);let s=new Map;if(e.steps.length>0&&(n&&r.push(\\\"\\\",\\\"## Steps\\\",\\\"\\\"),e.steps.forEach((l,i)=>r.push(...rF(l,i+1,n,s)))),e.errorMessage&&(n?r.push(\\\"\\\",\\\"## Failure\\\",\\\"\\\"):r.push(\\\"\\\"),r.push(\\\"```\\\",e.errorMessage.trim(),\\\"```\\\")),n&&e.docEntries.length>0){r.push(\\\"\\\",\\\"## Docs\\\",\\\"\\\");for(let l of e.docEntries)r.push(...Xb(l,s),\\\"\\\")}return r.join(`\\n`).replaceAll(/\\\\n{3,}/g,`\\n\\n`).trimEnd()+(n?`\\n`:\\\"\\\")}var Q0=(0,tp.createContext)(null),J0=Q0.Provider;function ek(){return(0,tp.useContext)(Q0)}function tk(e){return Z0(e,{variant:\\\"compact\\\"})}function ak(e){let t=[`A test scenario is ${e.status}. Investigate the likely cause and propose a fix.`,\\\"\\\",`Scenario: ${e.title}`,\\\"Steps:\\\"];for(let a of e.steps){let o=a.status===\\\"failed\\\"?\\\" \\\\u27F5 failed here\\\":\\\"\\\";t.push(`  ${a.keyword} ${a.text}${o}`)}return e.errorMessage&&t.push(\\\"\\\",\\\"Error:\\\",e.errorMessage.trim()),e.errorStack&&t.push(\\\"\\\",\\\"Stack:\\\",e.errorStack.trim()),t.join(`\\n`)}function ok(e){if(e.length===0)return\\\"\\\";let t=e.length===1?\\\"test scenario is\\\":\\\"test scenarios are\\\",a=[`${e.length} ${t} failing. Investigate the likely cause (they may share one) and propose a fix.`];return e.forEach((o,n)=>{a.push(\\\"\\\",`${n+1}. ${o.title}`,\\\"Steps:\\\");for(let r of o.steps){let s=r.status===\\\"failed\\\"?\\\" \\\\u27F5 failed here\\\":\\\"\\\";a.push(`  ${r.keyword} ${r.text}${s}`)}o.errorMessage&&a.push(\\\"Error:\\\",o.errorMessage.trim())}),a.join(`\\n`)}function nk(e){return typeof location>\\\"u\\\"?`#${e.id}`:`${location.href.split(\\\"#\\\")[0]}#${e.id}`}var A4=S(T(),1);var ap=S(D(),1);function rk({className:e,...t}){return(0,ap.jsx)(\\\"div\\\",{\\\"data-slot\\\":\\\"card\\\",className:te(\\\"flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-xs\\\",e),...t})}function sk({className:e,...t}){return(0,ap.jsx)(\\\"div\\\",{\\\"data-slot\\\":\\\"card-header\\\",className:te(\\\"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\\\",e),...t})}function lk({className:e,...t}){return(0,ap.jsx)(\\\"div\\\",{\\\"data-slot\\\":\\\"card-content\\\",className:te(\\\"px-6\\\",e),...t})}var XZ=S(T(),1);var Vn={};Oo(Vn,{Arrow:()=>uk,Backdrop:()=>fk,CheckboxItem:()=>Tk,CheckboxItemIndicator:()=>Dk,Group:()=>Nk,GroupLabel:()=>Fk,Handle:()=>Ec,Item:()=>Uk,LinkItem:()=>Hk,Popup:()=>ME,Portal:()=>OE,Positioner:()=>JE,RadioGroup:()=>tM,RadioItem:()=>nM,RadioItemIndicator:()=>rM,Root:()=>_m,Separator:()=>PM,SubmenuRoot:()=>mM,SubmenuTrigger:()=>BM,Trigger:()=>CM,Viewport:()=>DM,createHandle:()=>FM});var ik=S(T(),1);var op=S(T(),1),jb=op.createContext(void 0);function ta(e){let t=op.useContext(jb);if(t===void 0&&!e)throw new Error(Pe(33));return t}var np=S(T(),1),Yb=np.createContext(void 0);function at(e){let t=np.useContext(Yb);if(t===void 0&&!e)throw new Error(Pe(36));return t}var Kb=(function(e){return e.startingStyle=\\\"data-starting-style\\\",e.endingStyle=\\\"data-ending-style\\\",e})({}),sF={\\\"data-starting-style\\\":\\\"\\\"},lF={\\\"data-ending-style\\\":\\\"\\\"},ai={transitionStatus(e){return e===\\\"starting\\\"?sF:e===\\\"ending\\\"?lF:null}};var H4=(function(e){return e.open=\\\"data-open\\\",e.closed=\\\"data-closed\\\",e[e.startingStyle=Kb.startingStyle]=\\\"startingStyle\\\",e[e.endingStyle=Kb.endingStyle]=\\\"endingStyle\\\",e.anchorHidden=\\\"data-anchor-hidden\\\",e.side=\\\"data-side\\\",e.align=\\\"data-align\\\",e})({});var iF={\\\"data-popup-open\\\":\\\"\\\"},uF={\\\"data-popup-open\\\":\\\"\\\",\\\"data-pressed\\\":\\\"\\\"},cF={\\\"data-open\\\":\\\"\\\"},fF={\\\"data-closed\\\":\\\"\\\"},dF={\\\"data-anchor-hidden\\\":\\\"\\\"},rp={open(e){return e?iF:null}},$b={open(e){return e?uF:null}},Es={open(e){return e?cF:fF},anchorHidden(e){return e?dF:null}},oi={...Es,...ai};var uk=ik.forwardRef(function(t,a){let{render:o,className:n,style:r,...s}=t,{store:l}=at(),{arrowRef:i,side:u,align:c,arrowUncentered:f,arrowStyles:d}=ta(),x={open:l.useState(\\\"open\\\"),side:u,align:c,uncentered:f};return le(\\\"div\\\",t,{ref:[i,a],stateAttributesMapping:Es,state:x,props:{style:d,\\\"aria-hidden\\\":!0,...s}})});var ck=S(T(),1);var sp=S(T(),1),pF=sp.createContext(void 0);function Er(e=!0){let t=sp.useContext(pF);if(t===void 0&&!e)throw new Error(Pe(25));return t}var j={};Oo(j,{cancelOpen:()=>zF,chipRemovePress:()=>RF,clearPress:()=>LF,closePress:()=>SF,closeWatcher:()=>PF,decrementPress:()=>wF,disabled:()=>VF,drag:()=>_F,escapeKey:()=>OF,focusOut:()=>DF,imperativeAction:()=>jF,incrementPress:()=>IF,initial:()=>XF,inputBlur:()=>EF,inputChange:()=>kF,inputClear:()=>TF,inputPaste:()=>MF,inputPress:()=>AF,itemPress:()=>yF,keyboard:()=>BF,linkPress:()=>CF,listNavigation:()=>NF,missing:()=>GF,none:()=>mF,outsidePress:()=>bF,pointer:()=>FF,scrub:()=>HF,siblingOpen:()=>qF,swipe:()=>YF,trackPress:()=>vF,triggerFocus:()=>xF,triggerHover:()=>hF,triggerPress:()=>gF,wheel:()=>UF,windowResize:()=>KF});var mF=\\\"none\\\",gF=\\\"trigger-press\\\",hF=\\\"trigger-hover\\\",xF=\\\"trigger-focus\\\",bF=\\\"outside-press\\\",yF=\\\"item-press\\\",SF=\\\"close-press\\\",CF=\\\"link-press\\\",LF=\\\"clear-press\\\",RF=\\\"chip-remove-press\\\",vF=\\\"track-press\\\",IF=\\\"increment-press\\\",wF=\\\"decrement-press\\\",kF=\\\"input-change\\\",TF=\\\"input-clear\\\",EF=\\\"input-blur\\\",MF=\\\"input-paste\\\",AF=\\\"input-press\\\",DF=\\\"focus-out\\\",OF=\\\"escape-key\\\",PF=\\\"close-watcher\\\",NF=\\\"list-navigation\\\",BF=\\\"keyboard\\\",FF=\\\"pointer\\\",_F=\\\"drag\\\",UF=\\\"wheel\\\",HF=\\\"scrub\\\",zF=\\\"cancel-open\\\",qF=\\\"sibling-open\\\",VF=\\\"disabled\\\",GF=\\\"missing\\\",XF=\\\"initial\\\",jF=\\\"imperative-action\\\",YF=\\\"swipe\\\",KF=\\\"window-resize\\\";var fk=ck.forwardRef(function(t,a){let{render:o,className:n,style:r,...s}=t,{store:l}=at(),i=l.useState(\\\"open\\\"),u=l.useState(\\\"mounted\\\"),c=l.useState(\\\"transitionStatus\\\"),f=l.useState(\\\"lastOpenChangeReason\\\"),d=Er(),p={open:i,transitionStatus:c};return le(\\\"div\\\",t,{ref:d?.backdropRef?[a,d.backdropRef]:a,state:p,stateAttributesMapping:oi,props:[{role:\\\"presentation\\\",hidden:!u,style:{pointerEvents:f===j.triggerHover?\\\"none\\\":void 0,userSelect:\\\"none\\\",WebkitUserSelect:\\\"none\\\"}},s]})});var xp=S(T(),1);var Ms=S(T(),1);function jo({controlled:e,default:t,name:a,state:o=\\\"value\\\"}){let{current:n}=Ms.useRef(e!==void 0),[r,s]=Ms.useState(t),l=n?e:r,i=Ms.useCallback(u=>{n||s(u)},[]);return[l,i]}var lp=S(T(),1),Wb=lp.createContext(void 0);function dk(){let e=lp.useContext(Wb);if(e===void 0)throw new Error(Pe(30));return e}var si=S(T(),1);var ri=S(T(),1);function ip(){return typeof window<\\\"u\\\"}function wt(e){return up(e)?(e.nodeName||\\\"\\\").toLowerCase():\\\"#document\\\"}function Ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ko(e){var t;return(t=(up(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function up(e){return ip()?e instanceof Node||e instanceof Ge(e).Node:!1}function Ie(e){return ip()?e instanceof Element||e instanceof Ge(e).Element:!1}function Ne(e){return ip()?e instanceof HTMLElement||e instanceof Ge(e).HTMLElement:!1}function Yo(e){return!ip()||typeof ShadowRoot>\\\"u\\\"?!1:e instanceof ShadowRoot||e instanceof Ge(e).ShadowRoot}function Ds(e){let{overflow:t,overflowX:a,overflowY:o,display:n}=Bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+a)&&n!==\\\"inline\\\"&&n!==\\\"contents\\\"}function pk(e){return/^(table|td|th)$/.test(wt(e))}function Qu(e){try{if(e.matches(\\\":popover-open\\\"))return!0}catch{}try{return e.matches(\\\":modal\\\")}catch{return!1}}var $F=/transform|translate|scale|rotate|perspective|filter/,WF=/paint|layout|strict|content/,As=e=>!!e&&e!==\\\"none\\\",Zb;function cp(e){let t=Ie(e)?Bt(e):e;return As(t.transform)||As(t.translate)||As(t.scale)||As(t.rotate)||As(t.perspective)||!fp()&&(As(t.backdropFilter)||As(t.filter))||$F.test(t.willChange||\\\"\\\")||WF.test(t.contain||\\\"\\\")}function mk(e){let t=co(e);for(;Ne(t)&&!fo(t);){if(cp(t))return t;if(Qu(t))return null;t=co(t)}return null}function fp(){return Zb==null&&(Zb=typeof CSS<\\\"u\\\"&&CSS.supports&&CSS.supports(\\\"-webkit-backdrop-filter\\\",\\\"none\\\")),Zb}function fo(e){return/^(html|body|#document)$/.test(wt(e))}function Bt(e){return Ge(e).getComputedStyle(e)}function Ju(e){return Ie(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function co(e){if(wt(e)===\\\"html\\\")return e;let t=e.assignedSlot||e.parentNode||Yo(e)&&e.host||Ko(e);return Yo(t)?t.host:t}function gk(e){let t=co(e);return fo(t)?(e.ownerDocument||e).body:Ne(t)&&Ds(t)?t:gk(t)}function Mr(e,t,a){var o;t===void 0&&(t=[]),a===void 0&&(a=!0);let n=gk(e),r=n===((o=e.ownerDocument)==null?void 0:o.body),s=Ge(n);if(r){let l=dp(s);return t.concat(s,s.visualViewport||[],Ds(n)?n:[],l&&a?Mr(l):[])}else return t.concat(n,Mr(n,[],a))}function dp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var ZF=S(T(),1),ec={...ZF};var Qb=ec.useInsertionEffect,QF=Qb&&Qb!==ec.useLayoutEffect?Qb:e=>e();function K(e){let t=tt(JF).current;return t.next=e,QF(t.effect),t.trampoline}function JF(){let e={next:void 0,callback:e_,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function e_(){}var hk=S(T(),1),t_=()=>{},G=typeof document<\\\"u\\\"?hk.useLayoutEffect:t_;var pp=S(T(),1),Jb=pp.createContext(void 0);function ni(e=!1){let t=pp.useContext(Jb);if(t===void 0&&!e)throw new Error(Pe(16));return t}var xk=S(T(),1);function bk(e){let{focusableWhenDisabled:t,disabled:a,composite:o=!1,tabIndex:n=0,isNativeButton:r}=e,s=o&&t!==!1,l=o&&t===!1;return{props:xk.useMemo(()=>{let u={onKeyDown(c){a&&t&&c.key!==\\\"Tab\\\"&&c.preventDefault()}};return o||(u.tabIndex=n,!r&&a&&(u.tabIndex=t?n:-1)),(r&&(t||s)||!r&&a)&&(u[\\\"aria-disabled\\\"]=a),r&&(!t||l)&&(u.disabled=a),u},[o,a,t,s,l,r,n])}}function ye(e){return e?.ownerDocument||document}function Ar(e,t,{detail:a=0}={}){e.dispatchEvent(new(Ge(e)).PointerEvent(\\\"click\\\",{bubbles:!0,cancelable:!0,composed:!0,detail:a,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function pa(e={}){let{disabled:t=!1,focusableWhenDisabled:a,tabIndex:o=0,native:n=!0,composite:r}=e,s=ri.useRef(null),l=ni(!0),i=r??l!==void 0,{props:u}=bk({focusableWhenDisabled:a,disabled:t,composite:i,tabIndex:o,isNativeButton:n}),c=ri.useCallback(()=>{let p=s.current;ey(p)&&i&&t&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,u.disabled,i]);G(c,[c]);let f=ri.useCallback((p={})=>{let{onClick:x,onMouseDown:b,onKeyUp:C,onKeyDown:g,onPointerDown:m,...h}=p;return da({onClick(y){if(t){y.preventDefault();return}x?.(y)},onMouseDown(y){t||b?.(y)},onKeyDown(y){if(t||(Xu(y),g?.(y),y.baseUIHandlerPrevented))return;let v=y.target===y.currentTarget,R=y.currentTarget,I=ey(R),L=!n&&a_(R),k=v&&(n?I:!L),w=y.key===\\\"Enter\\\",A=y.key===\\\" \\\",P=R.getAttribute(\\\"role\\\"),U=P?.startsWith(\\\"menuitem\\\")||P===\\\"option\\\"||P===\\\"gridcell\\\";if(v&&i&&A){if(y.defaultPrevented&&U)return;y.preventDefault(),(!n||I)&&(y.preventBaseUIHandler(),Ar(R,y));return}if(!k||n||!A&&!w){v&&L&&A&&y.preventDefault();return}y.defaultPrevented||(y.preventDefault(),w&&(y.preventBaseUIHandler(),Ar(R,y)))},onKeyUp(y){if(!t){if(Xu(y),C?.(y),y.target===y.currentTarget&&n&&i&&ey(y.currentTarget)&&y.key===\\\" \\\"){y.preventDefault();return}y.baseUIHandlerPrevented||y.target===y.currentTarget&&!n&&!i&&!y.defaultPrevented&&y.key===\\\" \\\"&&(y.preventBaseUIHandler(),Ar(y.currentTarget,y))}},onPointerDown(y){if(t){y.preventDefault();return}m?.(y)}},n?{type:\\\"button\\\"}:{role:\\\"button\\\"},u,h)},[t,u,i,n]),d=K(p=>{s.current=p,c()});return{getButtonProps:f,buttonRef:d}}function ey(e){return Ne(e)&&e.tagName===\\\"BUTTON\\\"}function a_(e){return Ne(e)&&e.tagName===\\\"A\\\"&&!!e.href}var Rk=S(T(),1);var Xe={};Oo(Xe,{engine:()=>ry,env:()=>ly,os:()=>oy,screenReader:()=>sy});var oy={};Oo(oy,{android:()=>Ck,apple:()=>ay,ios:()=>ty,linux:()=>l_,mac:()=>Lk,windows:()=>s_});function o_(){return typeof navigator>\\\"u\\\"?{userAgent:\\\"\\\",platform:\\\"\\\",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??\\\"\\\",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:n_,platform:r_,maxTouchPoints:yk}=o_(),Os=n_.toLowerCase(),Ps=r_.toLowerCase();var ty=/^i(os$|p)/.test(Ps)||Ps===\\\"macintel\\\"&&yk>1,Sk=\\\"android\\\",Ck=Ps===Sk||Os.includes(Sk),Lk=!ty&&Ps.startsWith(\\\"mac\\\"),s_=Ps.startsWith(\\\"win\\\"),l_=!Ck&&/^(linux|chrome os)/.test(Ps),ay=Lk||ty;var ry={};Oo(ry,{blink:()=>u_,gecko:()=>i_,webkit:()=>ny});var ny=typeof CSS<\\\"u\\\"&&!!CSS.supports?.(\\\"-webkit-backdrop-filter:none\\\"),i_=!ny&&Os.includes(\\\"firefox\\\"),u_=!ny&&Os.includes(\\\"chrom\\\");var sy={};Oo(sy,{voiceOver:()=>c_});var c_=ay;var ly={};Oo(ly,{jsdom:()=>f_});var f_=/jsdom|happydom/.test(Os);function mp(e){let{closeOnClick:t,highlighted:a,id:o,nodeId:n,store:r,typingRef:s,itemRef:l,itemMetadata:i}=e,{events:u}=r.useState(\\\"floatingTreeRoot\\\"),c=r.useState(\\\"open\\\"),f=Er(!0),d=f!==void 0;return Rk.useMemo(()=>({id:o,role:\\\"menuitem\\\",tabIndex:c&&a?0:-1,onKeyDown(p){p.key===\\\" \\\"&&s?.current&&p.preventDefault()},onMouseMove(p){n&&u.emit(\\\"itemhover\\\",{nodeId:n,target:p.currentTarget})},onClick(p){t&&u.emit(\\\"close\\\",{domEvent:p,reason:j.itemPress})},onMouseUp(p){if(f){let x=f.initialCursorPointRef.current;if(f.initialCursorPointRef.current=null,d&&x&&Math.abs(p.clientX-x.x)<=1&&Math.abs(p.clientY-x.y)<=1||d&&!Xe.os.mac&&p.button===2)return}l.current&&r.context.allowMouseUpTriggerRef.current&&(!d||p.button===2)&&i.type===\\\"regular-item\\\"&&Ar(l.current,p,{detail:1})}}),[t,a,o,u,n,c,r,s,l,f,d,i])}var Dr={type:\\\"regular-item\\\"};function Or(e){let{closeOnClick:t,disabled:a,highlighted:o,id:n,store:r,typingRef:s=r.context.typingRef,nativeButton:l,itemMetadata:i,nodeId:u}=e,c=si.useRef(null),{getButtonProps:f,buttonRef:d}=pa({disabled:a,focusableWhenDisabled:!0,native:l,composite:!0}),p=mp({closeOnClick:t,highlighted:o,id:n,nodeId:u,store:r,typingRef:s,itemRef:c,itemMetadata:i}),x=si.useCallback(C=>da(p,{onMouseEnter(){i.type===\\\"submenu-trigger\\\"&&i.setActive()}},C,f),[p,f,i]),b=va(c,d);return si.useMemo(()=>({getItemProps:x,itemRef:b}),[x,b])}var Ns=S(T(),1);var gp=S(T(),1),iy=gp.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function vk(){return gp.useContext(iy)}function po(e={}){let{guess:t,label:a,metadata:o,textRef:n,index:r}=e,{register:s,unregister:l,subscribeMapChange:i,nextIndexRef:u}=vk(),c=Ns.useRef(-1),[f,d]=Ns.useState(r==null&&t?()=>{if(c.current===-1){let C=u.current;u.current+=1,c.current=C}return c.current}:-1),p=r??f,x=Ns.useRef(null),b=Ns.useCallback(C=>{let g=x.current;g&&l(g),x.current=C,C&&s(C,{metadata:o??null,index:r??null,label:a,textRef:n})},[r,s,l,o,a,n]);return G(()=>{if(r==null)return i(C=>{let g=x.current?C.get(x.current)?.index:null;g!=null&&d(g)})},[r,i]),{ref:b,index:p}}var hp=S(T(),1);var Ik=0;function d_(e,t=\\\"mui\\\"){let[a,o]=hp.useState(e),n=e||a;return hp.useEffect(()=>{a==null&&(Ik+=1,o(`${t}-${Ik}`))},[a,t]),n}var wk=ec.useId;function wo(e,t){if(wk!==void 0){let a=wk();return e??(t?`${t}-${a}`:a)}return d_(e,t)}function ot(e){return wo(e,\\\"base-ui\\\")}var uy=(function(e){return e.checked=\\\"data-checked\\\",e.unchecked=\\\"data-unchecked\\\",e.disabled=\\\"data-disabled\\\",e.highlighted=\\\"data-highlighted\\\",e})({});var Pr={checked(e){return e?{[uy.checked]:\\\"\\\"}:{[uy.unchecked]:\\\"\\\"}},...ai};function ce(e,t,a,o){let n=!1,r=!1,s=o??Me;return{reason:e,event:t??new Event(\\\"base-ui\\\"),cancel(){n=!0},allowPropagation(){r=!0},get isCanceled(){return n},get isPropagationAllowed(){return r},trigger:a,...s}}var kk=S(D(),1),Tk=xp.forwardRef(function(t,a){let{render:o,className:n,id:r,label:s,nativeButton:l=!1,disabled:i=!1,closeOnClick:u=!1,checked:c,defaultChecked:f,onCheckedChange:d,style:p,...x}=t,b=po({guess:!0,label:s}),C=ta(!0),g=ot(r),{store:m}=at(),h=m.useState(\\\"disabled\\\"),y=i||h,v=m.useState(\\\"isActive\\\",b.index),R=m.useState(\\\"itemProps\\\"),[I,L]=jo({controlled:c,default:f??!1,name:\\\"MenuCheckboxItem\\\",state:\\\"checked\\\"}),{getItemProps:k,itemRef:w}=Or({closeOnClick:u,disabled:y,highlighted:v,id:g,store:m,nativeButton:l,nodeId:C?.context.nodeId,itemMetadata:Dr}),A=xp.useMemo(()=>({disabled:y,highlighted:v,checked:I}),[y,v,I]);function P(O){let M=ce(j.itemPress,O.nativeEvent,void 0,{preventUnmountOnClose:Fe});d?.(!I,M),!M.isCanceled&&L(_=>!_)}let U=le(\\\"div\\\",t,{state:A,stateAttributesMapping:Pr,props:[R,{role:\\\"menuitemcheckbox\\\",\\\"aria-checked\\\":I,onClick:P},x,k],ref:[w,a,b.ref]});return(0,kk.jsx)(Wb.Provider,{value:A,children:U})});var Sp=S(T(),1);var fy=S(T(),1);var Ek=S(T(),1);function li(e){Ek.useEffect(e,Ia)}var bp=null,C5=globalThis.requestAnimationFrame,cy=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;let a=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let n=0;n<a.length;n+=1)a[n]?.(t)};request(t){let a=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),a}cancel(t){let a=t-this.startId;a<0||a>=this.callbacks.length||(this.callbacks[a]=null,this.callbacksCount-=1)}},yp=new cy;var mo=class e{static create(){return new e}static request(t){return yp.request(t)}static cancel(t){return yp.cancel(t)}currentId=bp;request(t){this.cancel(),this.currentId=yp.request(()=>{this.currentId=bp,t()})}cancel=()=>{this.currentId!==bp&&(yp.cancel(this.currentId),this.currentId=bp)};disposeEffect=()=>this.cancel};function Va(){let e=tt(mo.create).current;return li(e.disposeEffect),e}function ii(e,t=!1,a=!1){let[o,n]=fy.useState(e&&t?\\\"idle\\\":void 0),[r,s]=fy.useState(e);return e&&!r&&(s(!0),n(\\\"starting\\\")),!e&&r&&o!==\\\"ending\\\"&&!a&&n(\\\"ending\\\"),!e&&!r&&o===\\\"ending\\\"&&n(void 0),G(()=>{if(!e&&r&&o!==\\\"ending\\\"&&a){let l=mo.request(()=>{n(\\\"ending\\\")});return()=>{mo.cancel(l)}}},[e,r,o,a]),G(()=>{if(!e||t)return;let l=mo.request(()=>{n(void 0)});return()=>{mo.cancel(l)}},[t,e]),G(()=>{if(!e||!t)return;e&&r&&o!==\\\"idle\\\"&&n(\\\"starting\\\");let l=mo.request(()=>{n(\\\"idle\\\")});return()=>{mo.cancel(l)}},[t,e,r,o]),{mounted:r,setMounted:s,transitionStatus:o}}var Ak=S(T(),1);var Mk=S(fn(),1);function ko(e){return e==null?e:\\\"current\\\"in e?e.current:e}function Nr(e,t=!1){let a=Va();return K((o,n=null)=>{a.cancel();let r=ko(e);if(r==null)return;let s=r,l=()=>{Mk.flushSync(o)};if(typeof s.getAnimations!=\\\"function\\\"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function i(){Promise.all(s.getAnimations().map(u=>u.finished)).then(()=>{n?.aborted||l()},()=>{if(n?.aborted)return;if(s.getAnimations().some(c=>c.pending||c.playState!==\\\"finished\\\")){i();return}l()})}if(t){let u=\\\"data-starting-style\\\";if(!s.hasAttribute(u)){a.request(i);return}let c=new MutationObserver(()=>{s.hasAttribute(u)||(c.disconnect(),i())});c.observe(s,{attributes:!0,attributeFilter:[u]}),n?.addEventListener(\\\"abort\\\",()=>c.disconnect(),{once:!0});return}a.request(i)})}function $o(e){let{enabled:t=!0,open:a,ref:o,onComplete:n}=e,r=K(n),s=Nr(o,a);Ak.useEffect(()=>{if(!t)return;let l=new AbortController;return s(r,l.signal),()=>{l.abort()}},[t,a,r,s])}var Dk=Sp.forwardRef(function(t,a){let{render:o,className:n,style:r,keepMounted:s=!1,...l}=t,i=dk(),u=Sp.useRef(null),{transitionStatus:c,mounted:f,setMounted:d}=ii(i.checked);$o({open:i.checked,ref:u,onComplete(){i.checked||d(!1)}});let p={checked:i.checked,disabled:i.disabled,highlighted:i.highlighted,transitionStatus:c};return le(\\\"span\\\",t,{state:p,ref:[a,u],stateAttributesMapping:Pr,props:{\\\"aria-hidden\\\":!0,...l},enabled:s||f})});var Lp=S(T(),1);var Cp=S(T(),1),tc=Cp.createContext(void 0);function Ok(){let e=Cp.useContext(tc);if(e===void 0)throw new Error(Pe(31));return e}var Pk=S(D(),1),Nk=Lp.forwardRef(function(t,a){let{render:o,className:n,style:r,...s}=t,[l,i]=Lp.useState(void 0),u=le(\\\"div\\\",t,{ref:a,props:{role:\\\"group\\\",\\\"aria-labelledby\\\":l,...s}});return(0,Pk.jsx)(tc.Provider,{value:i,children:u})});var Bk=S(T(),1);var Fk=Bk.forwardRef(function(t,a){let{render:o,className:n,style:r,id:s,...l}=t,i=ot(s),u=Ok();return G(()=>(u(i),()=>{u(c=>c===i?void 0:c)}),[u,i]),le(\\\"div\\\",t,{ref:a,props:{id:i,role:\\\"presentation\\\",...l}})});var _k=S(T(),1);var Uk=_k.forwardRef(function(t,a){let{render:o,className:n,id:r,label:s,nativeButton:l=!1,disabled:i=!1,closeOnClick:u=!0,style:c,...f}=t,d=po({guess:!0,label:s}),p=ta(!0),x=ot(r),{store:b}=at(),C=b.useState(\\\"disabled\\\"),g=i||C,m=b.useState(\\\"isActive\\\",d.index),h=b.useState(\\\"itemProps\\\"),{getItemProps:y,itemRef:v}=Or({closeOnClick:u,disabled:g,highlighted:m,id:x,store:b,nativeButton:l,nodeId:p?.context.nodeId,itemMetadata:Dr});return le(\\\"div\\\",t,{state:{disabled:g,highlighted:m},props:[h,f,y],ref:[v,a,d.ref]})});var Rp=S(T(),1);var Hk=Rp.forwardRef(function(t,a){let{render:o,className:n,id:r,label:s,closeOnClick:l=!1,style:i,...u}=t,c=Rp.useRef(null),f=po({guess:!0,label:s}),p=ta(!0)?.context.nodeId,x=ot(r),{store:b}=at(),C=b.useState(\\\"isActive\\\",f.index),g=b.useState(\\\"itemProps\\\"),m=b.context.typingRef,{getButtonProps:h,buttonRef:y}=pa({native:!1,composite:!0}),v=mp({closeOnClick:l,highlighted:C,id:x,nodeId:p,store:b,typingRef:m,itemRef:c,itemMetadata:Dr});function R(L){return da(v,L,h)}return le(\\\"a\\\",t,{state:{highlighted:C},props:[g,u,R],ref:[c,y,a,f.ref]})});var Cm=S(T(),1);var ac=0,Ta=class e{static create(){return new e}currentId=ac;start(t,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ac,a()},t)}isStarted(){return this.currentId!==ac}clear=()=>{this.currentId!==ac&&(clearTimeout(this.currentId),this.currentId=ac)};disposeEffect=()=>this.clear};function Rt(){let e=tt(Ta.create).current;return li(e.disposeEffect),e}function Ea(e){e.preventDefault(),e.stopPropagation()}function zk(e){return\\\"nativeEvent\\\"in e}function vp(e){return e.pointerType===\\\"\\\"&&e.isTrusted?!0:Xe.os.android&&e.pointerType?e.type===\\\"click\\\"&&e.buttons===1:e.detail===0&&!e.pointerType}function ui(e){return Xe.env.jsdom?!1:!Xe.os.android&&e.width===0&&e.height===0||Xe.os.android&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===\\\"mouse\\\"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===\\\"touch\\\"}function Fn(e,t){let a=[\\\"mouse\\\",\\\"pen\\\"];return t||a.push(\\\"\\\",void 0),a.includes(e)}function qk(e){let t=e.type;return t===\\\"click\\\"||t===\\\"mousedown\\\"||t===\\\"keydown\\\"||t===\\\"keyup\\\"}var oc=\\\"data-base-ui-focusable\\\";var dy=\\\"input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\\\",nc=\\\"ArrowLeft\\\",rc=\\\"ArrowRight\\\",py=\\\"ArrowUp\\\",Ip=\\\"ArrowDown\\\";function Ft(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ie(e,t){if(!e||!t)return!1;let a=t.getRootNode?.();if(e.contains(t))return!0;if(a&&Yo(a)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function lt(e){return\\\"composedPath\\\"in e?e.composedPath()[0]:e.target}function Br(e,t){if(!Ie(e))return!1;let a=e;if(t.hasElement(a))return!a.hasAttribute(\\\"data-trigger-disabled\\\");for(let[,o]of t.entries())if(ie(o,a))return!o.hasAttribute(\\\"data-trigger-disabled\\\");return!1}function wp(e,t){if(t==null)return!1;if(\\\"composedPath\\\"in e)return e.composedPath().includes(t);let a=e;return a.target!=null&&t.contains(a.target)}function Vk(e){return e.matches(\\\"html,body\\\")}function Bs(e){return Ne(e)&&e.matches(dy)}function my(e){return e?.closest(`button,a[href],[role=\\\"button\\\"],select,[tabindex]:not([tabindex=\\\"-1\\\"]),${dy}`)!=null}function sc(e){return e?e.getAttribute(\\\"role\\\")===\\\"combobox\\\"&&Bs(e):!1}function Gk(e){if(!e||Xe.env.jsdom)return!0;try{return e.matches(\\\":focus-visible\\\")}catch{return!0}}function lc(e){return e?e.hasAttribute(oc)?e:e.querySelector(`[${oc}]`)||e:null}function p_(e,t){return t!=null&&!Fn(t)?0:typeof e==\\\"function\\\"?e():e}function ic(e,t,a){let o=p_(e,a);return typeof o==\\\"number\\\"?o:o?.[t]}function gy(e){return typeof e==\\\"function\\\"?e():e}function kp(e,t){return t||e===\\\"click\\\"||e===\\\"mousedown\\\"}function Xk(e){return e?.includes(\\\"mouse\\\")&&e!==\\\"mousedown\\\"}var ra=S(T(),1);function we(e,t,a,o){return e.addEventListener(t,a,o),()=>{e.removeEventListener(t,a,o)}}function aa(...e){return()=>{for(let t=0;t<e.length;t+=1){let a=e[t];a&&a()}}}function bt(e){let t=tt(m_,e).current;return t.next=e,G(t.effect),t}function m_(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ep=S(T(),1);var jk={clipPath:\\\"inset(50%)\\\",overflow:\\\"hidden\\\",whiteSpace:\\\"nowrap\\\",border:0,padding:0,width:1,height:1,margin:-1},Tp={...jk,position:\\\"fixed\\\",top:0,left:0},Yk={...jk,position:\\\"absolute\\\"};var Kk=S(D(),1),_n=Ep.forwardRef(function(t,a){let[o,n]=Ep.useState();return G(()=>{Xe.screenReader.voiceOver&&Xe.engine.webkit&&n(\\\"button\\\")},[]),(0,Kk.jsx)(\\\"span\\\",{...t,ref:a,style:Tp,\\\"aria-hidden\\\":o?void 0:!0,...{tabIndex:0,role:o},\\\"data-base-ui-focus-guard\\\":\\\"\\\"})});var Fr=Math.min,To=Math.max,_r=Math.round,cc=Math.floor,Wo=e=>({x:e,y:e}),g_={left:\\\"right\\\",right:\\\"left\\\",bottom:\\\"top\\\",top:\\\"bottom\\\"};function Ap(e,t,a){return To(e,Fr(t,a))}function Zo(e,t){return typeof e==\\\"function\\\"?e(t):e}function oa(e){return e.split(\\\"-\\\")[0]}function Eo(e){return e.split(\\\"-\\\")[1]}function Dp(e){return e===\\\"x\\\"?\\\"y\\\":\\\"x\\\"}function fc(e){return e===\\\"y\\\"?\\\"height\\\":\\\"width\\\"}function Ma(e){let t=e[0];return t===\\\"t\\\"||t===\\\"b\\\"?\\\"y\\\":\\\"x\\\"}function dc(e){return Dp(Ma(e))}function Zk(e,t,a){a===void 0&&(a=!1);let o=Eo(e),n=dc(e),r=fc(n),s=n===\\\"x\\\"?o===(a?\\\"end\\\":\\\"start\\\")?\\\"right\\\":\\\"left\\\":o===\\\"start\\\"?\\\"bottom\\\":\\\"top\\\";return t.reference[r]>t.floating[r]&&(s=uc(s)),[s,uc(s)]}function Qk(e){let t=uc(e);return[Mp(e),t,Mp(t)]}function Mp(e){return e.includes(\\\"start\\\")?e.replace(\\\"start\\\",\\\"end\\\"):e.replace(\\\"end\\\",\\\"start\\\")}var $k=[\\\"left\\\",\\\"right\\\"],Wk=[\\\"right\\\",\\\"left\\\"],h_=[\\\"top\\\",\\\"bottom\\\"],x_=[\\\"bottom\\\",\\\"top\\\"];function b_(e,t,a){switch(e){case\\\"top\\\":case\\\"bottom\\\":return a?t?Wk:$k:t?$k:Wk;case\\\"left\\\":case\\\"right\\\":return t?h_:x_;default:return[]}}function Jk(e,t,a,o){let n=Eo(e),r=b_(oa(e),a===\\\"start\\\",o);return n&&(r=r.map(s=>s+\\\"-\\\"+n),t&&(r=r.concat(r.map(Mp)))),r}function uc(e){let t=oa(e);return g_[t]+e.slice(t.length)}function y_(e){var t,a,o,n;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(o=e.bottom)!=null?o:0,left:(n=e.left)!=null?n:0}}function Op(e){return typeof e!=\\\"number\\\"?y_(e):{top:e,right:e,bottom:e,left:e}}function Fs(e){let{x:t,y:a,width:o,height:n}=e;return{width:o,height:n,top:a,left:t,right:t+o,bottom:a+n,x:t,y:a}}function Ur(e,t){return t<0||t>=e.length}function _s(e,t){return go(e.current,{disabledIndices:t})}function ci(e,t){return go(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function go(e,{startingIndex:t=-1,decrement:a=!1,disabledIndices:o,amount:n=1}={}){let r=t;do r+=a?-n:n;while(r>=0&&r<=e.length-1&&Us(e,r,o));return r}function Us(e,t,a){if(typeof a==\\\"function\\\"?a(t):a?.includes(t)??!1)return!0;let n=e[t];return n?!Hs(n)||n.matches(\\\":disabled\\\")?!0:!a&&(n.hasAttribute(\\\"disabled\\\")||n.getAttribute(\\\"aria-disabled\\\")===\\\"true\\\"):!1}function S_(e){return e.visibility===\\\"hidden\\\"||e.visibility===\\\"collapse\\\"}function Hs(e,t=e?Bt(e):null){return!e||!e.isConnected||!t||S_(t)?!1:typeof e.checkVisibility==\\\"function\\\"?e.checkVisibility():t.display!==\\\"none\\\"&&t.display!==\\\"contents\\\"}var C_='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable=\\\"false\\\"]),audio[controls],video[controls]';function L_(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let a=e.getRootNode();return Yo(a)?a.host:null}function xy(e){for(let t of Array.from(e.children))if(wt(t)===\\\"summary\\\")return t;return null}function R_(e,t){let a=xy(t);return!!a&&(e===a||ie(a,e))}function eT(e){let t=e?wt(e):\\\"\\\";return e!=null&&e.matches(C_)&&(t!==\\\"summary\\\"||e.parentElement!=null&&wt(e.parentElement)===\\\"details\\\"&&xy(e.parentElement)===e)&&(t!==\\\"details\\\"||xy(e)==null)&&(t!==\\\"input\\\"||e.type!==\\\"hidden\\\")}function tT(e){if(!eT(e)||!e.isConnected||e.matches(\\\":disabled\\\"))return!1;for(let t=e;t;t=L_(t)){let a=t!==e,o=wt(t)===\\\"slot\\\";if(t.hasAttribute(\\\"inert\\\")||a&&wt(t)===\\\"details\\\"&&!t.open&&!R_(e,t)||t.hasAttribute(\\\"hidden\\\")||!o&&!v_(t,a))return!1}return!0}function v_(e,t){let a=Bt(e);return t?a.display!==\\\"none\\\":Hs(e,a)}function aT(e){let t=e.tabIndex;if(t<0){let a=wt(e);if(a===\\\"details\\\"||a===\\\"audio\\\"||a===\\\"video\\\"||Ne(e)&&e.isContentEditable)return 0}return t}function hy(e){if(wt(e)!==\\\"input\\\")return null;let t=e;return t.type===\\\"radio\\\"&&t.name!==\\\"\\\"?t:null}function I_(e,t){let a=hy(e);if(!a)return!0;let o=t.find(n=>{let r=hy(n);return r?.name===a.name&&r.form===a.form&&r.checked});return o?o===a:t.find(n=>{let r=hy(n);return r?.name===a.name&&r.form===a.form})===a}function oT(e){if(Ne(e)&&wt(e)===\\\"slot\\\"){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ne(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function nT(e,t){oT(e).forEach(a=>{eT(a)&&t.push(a),nT(a,t)})}function rT(e,t,a){oT(e).forEach(o=>{Ne(o)&&o.matches(t)&&a.push(o),rT(o,t,a)})}function Pp(e){return tT(e)&&aT(e)>=0}function by(e){let t=[];return nT(e,t),t.filter(tT)}function fi(e){let t=by(e);return t.filter(a=>aT(a)>=0&&I_(a,t))}function sT(e,t){let a=fi(e),o=a.length;if(o===0)return;let n=Ft(ye(e)),r=a.indexOf(n),s=r===-1?t===1?0:o-1:r+t;return a[s]}function di(e){return sT(ye(e).body,1)||e}function Np(e){return sT(ye(e).body,-1)||e}function lT(e,t){if(!e)return null;let a=fi(ye(e).body),o=a.length;if(o===0)return null;let n=a.indexOf(e);if(n===-1)return null;let r=(n+t+o)%o;return a[r]}function iT(e){return lT(e,1)}function uT(e){return lT(e,-1)}function Un(e,t){let a=t||e.currentTarget,o=e.relatedTarget;return!o||!ie(a,o)}function cT(e){fi(e).forEach(a=>{a.dataset.tabindex=a.getAttribute(\\\"tabindex\\\")||\\\"\\\",a.setAttribute(\\\"tabindex\\\",\\\"-1\\\")})}function yy(e){let t=[];rT(e,\\\"[data-tabindex]\\\",t),t.forEach(a=>{let o=a.dataset.tabindex;delete a.dataset.tabindex,o?a.setAttribute(\\\"tabindex\\\",o):a.removeAttribute(\\\"tabindex\\\")})}function ho(e,t,a=!0){return e.filter(n=>n.parentId===t).flatMap(n=>[...!a||n.context?.open?[n]:[],...ho(e,n.id,a)])}function Sy(e,t){let a=[],o=e.find(n=>n.id===t)?.parentId;for(;o;){let n=e.find(r=>r.id===o);o=n?.parentId,n&&(a=a.concat(n))}return a}function Hn(e){return`data-base-ui-${e}`}var Bp=0;function pi(e,t={}){let{preventScroll:a=!1,sync:o=!1,shouldFocus:n}=t;cancelAnimationFrame(Bp);function r(){n&&!n()||e?.focus({preventScroll:a})}if(o)return r(),Fe;let s=requestAnimationFrame(r);return Bp=s,()=>{Bp===s&&(cancelAnimationFrame(s),Bp=0)}}var Cy={inert:new WeakMap,\\\"aria-hidden\\\":new WeakMap},fT=\\\"data-base-ui-inert\\\",Ry={inert:new WeakSet,\\\"aria-hidden\\\":new WeakSet},pc=new WeakMap,Ly=0;function w_(e){return Ry[e]}function gT(e){return e?Yo(e)?e.host:gT(e.parentNode):null}var dT=(e,t)=>t.map(a=>{if(e.contains(a))return a;let o=gT(a);return e.contains(o)?o:null}).filter(a=>a!=null),pT=e=>{let t=new Set;return e.forEach(a=>{let o=a;for(;o&&!t.has(o);)t.add(o),o=o.parentNode}),t},mT=(e,t,a)=>{let o=[],n=r=>{!r||a.has(r)||Array.from(r.children).forEach(s=>{wt(s)!==\\\"script\\\"&&(t.has(s)?n(s):o.push(s))})};return n(e),o};function k_(e,t,a,o,{mark:n=!0}){let r=null;o?r=\\\"inert\\\":a&&(r=\\\"aria-hidden\\\");let s=null,l=null,i=dT(t,e),u=n?mT(t,pT(i),new Set(i)):[],c=[],f=[];if(r){let d=Cy[r],p=w_(r);l=p,s=d;let x=dT(t,Array.from(t.querySelectorAll(\\\"[aria-live]\\\"))),b=i.concat(x);mT(t,pT(b),new Set(b)).forEach(g=>{let m=g.getAttribute(r),h=m!==null&&m!==\\\"false\\\",y=(d.get(g)||0)+1;d.set(g,y),c.push(g),y===1&&h&&p.add(g),h||g.setAttribute(r,r===\\\"inert\\\"?\\\"\\\":\\\"true\\\")})}return n&&u.forEach(d=>{let p=(pc.get(d)||0)+1;pc.set(d,p),f.push(d),p===1&&d.setAttribute(fT,\\\"\\\")}),Ly+=1,()=>{s&&c.forEach(d=>{let x=(s.get(d)||0)-1;s.set(d,x),x||(!l?.has(d)&&r&&d.removeAttribute(r),l?.delete(d))}),n&&f.forEach(d=>{let p=(pc.get(d)||0)-1;pc.set(d,p),p||d.removeAttribute(fT)}),Ly-=1,Ly||(Cy.inert=new WeakMap,Cy[\\\"aria-hidden\\\"]=new WeakMap,Ry.inert=new WeakSet,Ry[\\\"aria-hidden\\\"]=new WeakSet,pc=new WeakMap)}}function vy(e,t={}){let{ariaHidden:a=!1,inert:o=!1,mark:n=!0}=t,r=ye(e[0]).body;return k_(e,r,a,o,{mark:n})}var mt=S(T(),1),Iy=S(fn(),1);var hT={style:{transition:\\\"none\\\"}},Fp=\\\"data-base-ui-click-trigger\\\",T_=\\\"data-base-ui-swipe-ignore\\\",E_=\\\"data-swipe-ignore\\\",e8=`[${T_}]`,t8=`[${E_}]`,xT={fallbackAxisSide:\\\"none\\\"},bT={fallbackAxisSide:\\\"end\\\"},yT={clipPath:\\\"inset(50%)\\\",position:\\\"fixed\\\",top:0,left:0};var zs=S(D(),1),ST=mt.createContext(null),wy=()=>mt.useContext(ST),M_=Hn(\\\"portal\\\");function CT(e={}){let{ref:t,container:a,componentProps:o=Me,elementProps:n}=e,r=wo(),l=wy()?.portalNode,[i,u]=mt.useState(null),[c,f]=mt.useState(null),d=K(C=>{C!==null&&f(C)}),p=mt.useRef(null);G(()=>{if(a===null){p.current&&(p.current=null,f(null),u(null));return}let C=(a&&(up(a)?a:a.current))??l??document.body;if(C==null){p.current&&(p.current=null,f(null),u(null));return}p.current!==C&&(p.current=C,f(null),u(C))},[a,l]);let x=le(\\\"div\\\",o,{ref:[t,d],props:[{id:r,[M_]:\\\"\\\"},n]}),b=i&&x?Iy.createPortal(x,i):null;return{node:c,nodeId:mt.isValidElement(x)?x.props.id:void 0,subtree:b}}var mc=mt.forwardRef(function(t,a){let{render:o,className:n,style:r,children:s,container:l,...i}=t,{node:u,nodeId:c,subtree:f}=CT({container:l,ref:a,componentProps:t,elementProps:i}),d=mt.useRef(null),p=mt.useRef(null),x=mt.useRef(null),b=mt.useRef(null),[C,g]=mt.useState(null),m=mt.useRef(!1),h=C?.modal,y=C?.open,v=!!C&&!C.modal&&C.open&&!!u;mt.useEffect(()=>{if(!u||h)return;function I(L){u&&L.relatedTarget&&Un(L)&&(L.type===\\\"focusin\\\"?m.current&&(yy(u),m.current=!1):(cT(u),m.current=!0))}return aa(we(u,\\\"focusin\\\",I,!0),we(u,\\\"focusout\\\",I,!0))},[u,h]),G(()=>{!u||y!==!0||!m.current||(yy(u),m.current=!1)},[y,u]);let R=mt.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:x,afterInsideRef:b,portalNode:u,setFocusManagerState:g}),[u]);return(0,zs.jsxs)(mt.Fragment,{children:[f,(0,zs.jsxs)(ST.Provider,{value:R,children:[v&&u&&(0,zs.jsx)(_n,{\\\"data-type\\\":\\\"outside\\\",ref:d,onFocus:I=>{if(Un(I,u))x.current?.focus();else{let L=C?C.domReference:null;Np(L)?.focus()}}}),v&&u&&(0,zs.jsx)(\\\"span\\\",{\\\"aria-owns\\\":c,style:yT}),u&&Iy.createPortal(s,u),v&&u&&(0,zs.jsx)(_n,{\\\"data-type\\\":\\\"outside\\\",ref:p,onFocus:I=>{if(Un(I,u))b.current?.focus();else{let L=C?C.domReference:null;di(L)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,ce(j.focusOut,I.nativeEvent))}}})]})]})});var zr=S(T(),1);function _p(){let e=new Map;return{emit(t,a){e.get(t)?.forEach(o=>o(a))},on(t,a){e.has(t)||e.set(t,new Set),e.get(t).add(a)},off(t,a){e.get(t)?.delete(a)}}}var Hr=class{nodesRef={current:[]};events=_p();addNode(t){this.nodesRef.current.push(t)}removeNode(t){let a=this.nodesRef.current.findIndex(o=>o===t);a!==-1&&this.nodesRef.current.splice(a,1)}};var ky=S(D(),1),LT=zr.createContext(null),RT=zr.createContext(null),Ga=()=>zr.useContext(LT)?.id||null,na=e=>{let t=zr.useContext(RT);return e??t};function gc(e){let t=wo(),a=na(e),o=Ga();return G(()=>{if(!t)return;let n={id:t,parentId:o};return a?.addNode(n),()=>{a?.removeNode(n)}},[a,t,o]),t}function Ty(e){let{children:t,id:a}=e,o=Ga();return(0,ky.jsx)(LT.Provider,{value:zr.useMemo(()=>({id:a,parentId:o}),[a,o]),children:t})}function Ey(e){let{children:t,externalTree:a}=e,o=tt(()=>a??new Hr).current;return(0,ky.jsx)(RT.Provider,{value:o,children:t})}var hc=S(D(),1);function A_(e,t){let a=Ge(lt(e));return e instanceof a.KeyboardEvent?\\\"keyboard\\\":e instanceof a.FocusEvent?t||\\\"keyboard\\\":\\\"pointerType\\\"in e?e.pointerType||\\\"keyboard\\\":\\\"touches\\\"in e?\\\"touch\\\":e instanceof a.MouseEvent?t||(e.detail===0?\\\"keyboard\\\":\\\"mouse\\\"):\\\"\\\"}var vT=20,qr=[];function My(){qr=qr.filter(e=>e.deref()?.isConnected)}function IT(e){My(),e&&wt(e)!==\\\"body\\\"&&(qr.push(new WeakRef(e)),qr.length>vT&&(qr=qr.slice(-vT)))}function wT(){return My(),qr[qr.length-1]?.deref()}function D_(e){return e?Pp(e)?e:fi(e)[0]||e:null}function kT(e){if(e.hasAttribute(\\\"tabindex\\\")&&!e.hasAttribute(\\\"data-tabindex\\\")||!e.getAttribute(\\\"role\\\")?.includes(\\\"dialog\\\"))return;let a=by(e).filter(n=>{let r=n.getAttribute(\\\"data-tabindex\\\")||\\\"\\\";return Pp(n)||n.hasAttribute(\\\"data-tabindex\\\")&&!r.startsWith(\\\"-\\\")}),o=e.getAttribute(\\\"tabindex\\\");a.length===0?o!==\\\"0\\\"&&(e.setAttribute(\\\"tabindex\\\",\\\"0\\\"),e.setAttribute(\\\"data-tabindex\\\",\\\"0\\\")):(o!==\\\"-1\\\"||e.hasAttribute(\\\"data-tabindex\\\")&&e.getAttribute(\\\"data-tabindex\\\")!==\\\"-1\\\")&&(e.setAttribute(\\\"tabindex\\\",\\\"-1\\\"),e.setAttribute(\\\"data-tabindex\\\",\\\"-1\\\"))}function xc(e){let{context:t,children:a,disabled:o=!1,initialFocus:n=!0,returnFocus:r=!0,restoreFocus:s=!1,modal:l=!0,closeOnFocusOut:i=!0,openInteractionType:u=\\\"\\\",nextFocusableElement:c,previousFocusableElement:f,beforeContentFocusGuardRef:d,externalTree:p,getInsideElements:x}=e,b=\\\"rootStore\\\"in t?t.rootStore:t,C=b.useState(\\\"open\\\"),g=b.useState(\\\"domReferenceElement\\\"),m=b.useState(\\\"floatingElement\\\"),{events:h,dataRef:y}=b.context,v=K(()=>y.current.floatingContext?.nodeId),R=n===!1,I=sc(g)&&R,L=bt(n),k=bt(r),w=bt(u),A=bt(C),P=na(p),U=wy(),O=ra.useRef(!1),M=ra.useRef(!1),_=ra.useRef(!1),q=ra.useRef(null),E=ra.useRef(\\\"\\\"),N=ra.useRef(\\\"\\\"),B=ra.useRef(null),ae=ra.useRef(null),X=va(B,d,U?.beforeInsideRef),Q=va(ae,U?.afterInsideRef),$=Rt(),ee=Rt(),J=Va(),Ce=U!=null,Y=lc(m),W=K((oe=Y)=>oe?fi(oe):[]),me=K(()=>x?.().filter(oe=>oe!=null)??[]);ra.useEffect(()=>{if(o||!l)return;function oe(pe){pe.key===\\\"Tab\\\"&&ie(Y,Ft(ye(Y)))&&W().length===0&&!I&&Ea(pe)}let he=ye(Y);return we(he,\\\"keydown\\\",oe)},[o,Y,l,I,W]),ra.useEffect(()=>{if(o||!C)return;let oe=ye(Y);function he(){_.current=!1}function pe(ve){let ue=lt(ve),Te=me(),re=ie(m,ue)||ie(g,ue)||ie(U?.portalNode,ue)||Te.some(fe=>fe===ue||ie(fe,ue));_.current=!re,N.current=ve.pointerType||\\\"keyboard\\\",ue?.closest(`[${Fp}]`)&&(M.current=!0,ee.start(0,()=>{M.current=!1}))}function Le(){N.current=\\\"keyboard\\\"}return aa(we(oe,\\\"pointerdown\\\",pe,!0),we(oe,\\\"pointerup\\\",he,!0),we(oe,\\\"pointercancel\\\",he,!0),we(oe,\\\"keydown\\\",Le,!0),he)},[o,m,g,Y,C,U,ee,me]),ra.useEffect(()=>{if(o||!i)return;let oe=ye(Y);function he(){M.current=!0,ee.start(0,()=>{M.current=!1})}function pe(Te){let re=lt(Te);Pp(re)&&(q.current=re)}function Le(Te){let re=Te.relatedTarget,fe=Te.currentTarget,de=lt(Te);l&&re==null&&de!=null&&ie(m,de)&&IT(de),queueMicrotask(()=>{let Re=v(),St=b.context.triggerElements,F=me(),V=re?.hasAttribute(Hn(\\\"focus-guard\\\"))&&[B.current,ae.current,U?.beforeInsideRef.current,U?.afterInsideRef.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,ko(f),ko(c)].includes(re),Ae=!(ie(g,re)||ie(m,re)||ie(re,m)||ie(U?.portalNode,re)||F.some(Z=>Z===re||ie(Z,re))||St.hasMatchingElement(Z=>ie(Z,re))||V||P&&(ho(P.nodesRef.current,Re).find(Z=>ie(Z.context?.elements.floating,re)||ie(Z.context?.elements.domReference,re))||Sy(P.nodesRef.current,Re).find(Z=>[Z.context?.elements.floating,lc(Z.context?.elements.floating)].includes(re)||Z.context?.elements.domReference===re)));if(fe===g&&Y&&kT(Y),s&&fe!==g&&!Hs(de)&&Ft(oe)===oe.body){if(Ne(Y)&&(Y.focus(),s===\\\"popup\\\")){J.request(()=>{Y.focus()});return}let Z=W(),H=q.current,be=(H&&Z.includes(H)?H:null)||Z[Z.length-1]||Y;Ne(be)&&be.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(I||!l)&&re&&Ae&&!M.current&&(I||re!==wT())&&(O.current=!0,b.setOpen(!1,ce(j.focusOut,Te)))})}function ve(){_.current||(y.current.insideReactTree=!0,$.start(0,()=>{y.current.insideReactTree=!1}))}let ue=Ne(g)?g:null;if(!(!m&&!ue))return aa(ue&&we(ue,\\\"focusout\\\",Le),ue&&we(ue,\\\"pointerdown\\\",he),m&&we(m,\\\"focusin\\\",pe),m&&we(m,\\\"focusout\\\",Le),m&&U&&we(m,\\\"focusout\\\",ve,!0))},[o,g,m,Y,l,P,U,b,i,s,W,I,v,y,$,ee,J,c,f,me]),ra.useEffect(()=>{if(o||!m||!C)return;let oe=Array.from(U?.portalNode?.querySelectorAll(`[${Hn(\\\"portal\\\")}]`)||[]),pe=(P?Sy(P.nodesRef.current,v()):[]).find(fe=>sc(fe.context?.elements.domReference||null))?.context?.elements.domReference,ve=[...[m,...oe,B.current,ae.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,...me()],pe,ko(f),ko(c),I?g:null].filter(fe=>fe!=null),ue=vy(ve,{ariaHidden:l||I,mark:!1}),Te=[m,...oe].filter(fe=>fe!=null),re=vy(Te);return()=>{re(),ue()}},[C,o,g,m,l,U,I,P,v,c,f,me]),G(()=>{if(!C||o||!Ne(Y))return;E.current=\\\"\\\",N.current=\\\"\\\";let oe=ye(Y),he=Ft(oe);queueMicrotask(()=>{let pe=L.current,Le=typeof pe==\\\"function\\\"?pe(w.current||\\\"\\\"):pe;if(Le===void 0||Le===!1||ie(Y,he))return;let ue=null,Te=()=>(ue==null&&(ue=W(Y)),ue[0]||Y),re;Le===!0||Le===null?re=Te():re=ko(Le),re=re||Te();let fe=ie(Y,Ft(oe));pi(re,{preventScroll:re===Y,shouldFocus(){if(!A.current)return!1;if(fe)return!0;let de=Ft(oe);return!(de!==re&&ie(Y,de))}})})},[o,C,Y,W,L,w,A]),G(()=>{if(o||!Y)return;let oe=ye(Y),he=Ft(oe),pe=w.current==null;IT(he);function Le(ue){if(ue.open||(E.current=A_(ue.nativeEvent,N.current)),ue.reason===j.triggerHover&&ue.nativeEvent.type===\\\"mouseleave\\\"&&(O.current=!0),ue.reason===j.outsidePress)if(ue.nested)O.current=!1;else if(vp(ue.nativeEvent)||ui(ue.nativeEvent))O.current=!1;else{let Te=!1;ye(Y).createElement(\\\"div\\\").focus({get preventScroll(){return Te=!0,!1}}),Te?O.current=!1:O.current=!0}}h.on(\\\"openchange\\\",Le);function ve(ue){let Te=k.current,re=typeof Te==\\\"function\\\"?Te(ue):Te;if(re===void 0||re===!1)return null;re===null&&(re=!0);let fe=g?.isConnected?g:null,de=he?.isConnected&&wt(he)!==\\\"body\\\"?he:null,Re=pe?de||fe:fe||de;return Re||(Re=wT()||null),typeof re==\\\"boolean\\\"?Re:ko(re)||Re||null}return()=>{h.off(\\\"openchange\\\",Le);let ue=Ft(oe),Te=me(),re=ie(m,ue)||Te.some(St=>St===ue||ie(St,ue))||P&&ho(P.nodesRef.current,v(),!1).some(St=>ie(St.context?.elements.floating,ue)),fe=k.current,de=E.current,Re=ve(de);queueMicrotask(()=>{let St=D_(Re),F=typeof fe!=\\\"boolean\\\";if(fe&&!O.current&&Ne(St)&&(!(!F&&St!==ue&&ue!==oe.body)||re)){let V={preventScroll:!0};de===\\\"keyboard\\\"&&(V.focusVisible=!0),St.focus(V)}O.current=!1})}},[o,m,Y,k,w,h,P,g,v,me]),G(()=>{if(!Xe.engine.webkit||C||!m)return;let oe=Ft(ye(m));!Ne(oe)||!Bs(oe)||ie(m,oe)&&oe.blur()},[C,m]),G(()=>{if(!(o||!U))return U.setFocusManagerState({modal:l,closeOnFocusOut:i,open:C,onOpenChange:b.setOpen,domReference:g}),()=>{U.setFocusManagerState(null)}},[o,U,l,C,b,i,g]),G(()=>{if(!(o||!Y))return kT(Y),()=>{queueMicrotask(My)}},[o,Y]);let ge=!o&&(l?!I:!0)&&(Ce||l);return(0,hc.jsxs)(ra.Fragment,{children:[ge&&(0,hc.jsx)(_n,{\\\"data-type\\\":\\\"inside\\\",ref:X,onFocus:oe=>{if(l){let he=W();pi(he[he.length-1])}else U?.portalNode&&(O.current=!1,Un(oe,U.portalNode)?di(g)?.focus():ko(f??U.beforeOutsideRef)?.focus())}}),a,ge&&(0,hc.jsx)(_n,{\\\"data-type\\\":\\\"inside\\\",ref:Q,onFocus:oe=>{l?pi(W()[0]):U?.portalNode&&(i&&(O.current=!0),Un(oe,U.portalNode)?Np(g)?.focus():ko(c??U.afterOutsideRef)?.focus())}})]})}var bc=S(T(),1);function qs(e,t={}){let{enabled:a=!0,event:o=\\\"click\\\",toggle:n=!0,ignoreMouse:r=!1,stickIfOpen:s=!0,touchOpenDelay:l=0,reason:i=j.triggerPress}=t,u=\\\"rootStore\\\"in e?e.rootStore:e,c=u.context.dataRef,f=bc.useRef(void 0),d=Va(),p=Rt(),x=bc.useMemo(()=>{function b(g,m,h,y){let v=ce(i,m,h);g&&y===\\\"touch\\\"&&l>0?p.start(l,()=>{u.setOpen(!0,v)}):u.setOpen(g,v)}function C(g,m,h){let y=c.current.openEvent,v=u.select(\\\"domReferenceElement\\\")!==m;return g&&v||!g||!n?!0:y&&s?!h(y.type):!1}return{onPointerDown(g){f.current=Fn(g.pointerType,!0)&&ui(g.nativeEvent)?\\\"virtual\\\":g.pointerType},onMouseDown(g){let m=f.current,h=g.nativeEvent,y=u.select(\\\"open\\\");if(g.button!==0||o===\\\"click\\\"||Fn(m,!0)&&r)return;let v=C(y,g.currentTarget,L=>L===\\\"click\\\"||L===\\\"mousedown\\\"),R=lt(h);if(Bs(R)){b(v,h,R,m);return}let I=g.currentTarget;d.request(()=>{b(v,h,I,m)})},onClick(g){if(o===\\\"mousedown-only\\\")return;let m=f.current;if(o===\\\"mousedown\\\"&&m){f.current=void 0;return}if(Fn(m,!0)&&r)return;let h=u.select(\\\"open\\\"),y=C(h,g.currentTarget,v=>v===\\\"click\\\"||v===\\\"mousedown\\\"||v===\\\"keydown\\\"||v===\\\"keyup\\\");b(y,g.nativeEvent,g.currentTarget,m)},onKeyDown(){f.current=void 0}}},[c,o,r,i,u,s,n,d,p,l]);return bc.useMemo(()=>a?{reference:x}:Me,[a,x])}var Xa=S(T(),1);function O_(){return!1}function P_(e){return{escapeKey:typeof e==\\\"boolean\\\"?e:e?.escapeKey??!1,outsidePress:typeof e==\\\"boolean\\\"?e:e?.outsidePress??!0}}function yc(e,t={}){let{enabled:a=!0,escapeKey:o=!0,outsidePress:n=!0,outsidePressEvent:r=\\\"sloppy\\\",referencePress:s=O_,bubbles:l,externalTree:i}=t,u=\\\"rootStore\\\"in e?e.rootStore:e,c=u.useState(\\\"open\\\"),f=u.useState(\\\"floatingElement\\\"),{dataRef:d}=u.context,p=na(i),x=K(typeof n==\\\"function\\\"?n:()=>!1),b=typeof n==\\\"function\\\"?x:n,C=b!==!1,g=K(()=>r),{escapeKey:m,outsidePress:h}=P_(l),y=Xa.useRef(!1),v=Xa.useRef(!1),R=Xa.useRef(!1),I=Xa.useRef(!1),L=Xa.useRef(\\\"\\\"),k=Xa.useRef(null),w=Rt(),A=Rt(),P=K(()=>{A.clear(),d.current.insideReactTree=!1}),U=K(X=>{let Q=d.current.floatingContext?.nodeId;return(p?ho(p.nodesRef.current,Q):[]).some(ee=>ee.context?.open&&!ee.context.dataRef.current[X])}),O=K(X=>wp(X,u.select(\\\"floatingElement\\\"))||wp(X,u.select(\\\"domReferenceElement\\\"))),M=K(X=>{s()&&u.setOpen(!1,ce(j.triggerPress,X.nativeEvent))}),_=K(X=>{if(!c||!a||!o||X.key!==\\\"Escape\\\"||I.current||!m&&U(\\\"__escapeKeyBubbles\\\"))return;let Q=zk(X)?X.nativeEvent:X,$=ce(j.escapeKey,Q);u.setOpen(!1,$),$.isCanceled||X.preventDefault(),!m&&!$.isPropagationAllowed&&X.stopPropagation()}),q=K(()=>{d.current.insideReactTree=!0,A.start(0,P)}),E=K(X=>{if(!c||!a||X.button!==0)return;let Q=lt(X.nativeEvent);ie(u.select(\\\"floatingElement\\\"),Q)&&(y.current||(y.current=!0,v.current=!1))}),N=K(X=>{!c||!a||(X.defaultPrevented||X.nativeEvent.defaultPrevented)&&y.current&&(v.current=!0)});Xa.useEffect(()=>{if(!c||!a)return P;d.current.__escapeKeyBubbles=m,d.current.__outsidePressBubbles=h;let X=new Ta,Q=new Ta;function $(){X.clear(),I.current=!0}function ee(){X.start(Xe.engine.webkit?5:0,()=>{I.current=!1})}function J(){R.current=!0,Q.start(0,()=>{R.current=!1})}function Ce(){y.current=!1,v.current=!1}function Y(){let F=L.current,V=F===\\\"pen\\\"||!F?\\\"mouse\\\":F,Ae=g(),Z=typeof Ae==\\\"function\\\"?Ae():Ae;return typeof Z==\\\"string\\\"?Z:Z[V]}function W(F){let V=Y();return V===\\\"intentional\\\"&&F.type!==\\\"click\\\"||V===\\\"sloppy\\\"&&F.type===\\\"click\\\"}function me(F){let V=d.current.floatingContext?.nodeId,Ae=p&&ho(p.nodesRef.current,V).some(Z=>wp(F,Z.context?.elements.floating));return O(F)||Ae}function ge(F){if(W(F)){F.type!==\\\"click\\\"&&!O(F)&&(Q.clear(),R.current=!1),P();return}if(d.current.insideReactTree){P();return}let V=lt(F),Ae=`[${Hn(\\\"inert\\\")}]`,Z=Ie(V)?V.getRootNode():null,H=Array.from((Yo(Z)?Z:ye(u.select(\\\"floatingElement\\\"))).querySelectorAll(Ae)),be=u.context.triggerElements;if(V&&(be.hasElement(V)||be.hasMatchingElement(_t=>ie(_t,V))))return;let it=Ie(V)?V:null;for(;it&&!fo(it);){let _t=co(it);if(fo(_t)||!Ie(_t))break;it=_t}if(!(H.length&&Ie(V)&&!Vk(V)&&!ie(V,u.select(\\\"floatingElement\\\"))&&H.every(_t=>!ie(it,_t)))){if(Ne(V)&&!(\\\"touches\\\"in F)){let _t=fo(V),$a=Bt(V),Wa=/auto|scroll/,el=_t||Wa.test($a.overflowX),ln=_t||Wa.test($a.overflowY),Xn=el&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,Hc=ln&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,zc=$a.direction===\\\"rtl\\\",qc=Hc&&(zc?F.offsetX<=V.offsetWidth-V.clientWidth:F.offsetX>V.clientWidth),Vc=Xn&&F.offsetY>V.clientHeight;if(qc||Vc)return}if(!me(F)){if(Y()===\\\"intentional\\\"&&R.current){Q.clear(),R.current=!1;return}typeof b==\\\"function\\\"&&!b(F)||U(\\\"__outsidePressBubbles\\\")||(u.setOpen(!1,ce(j.outsidePress,F)),P())}}}function oe(F){Y()!==\\\"sloppy\\\"||F.pointerType===\\\"touch\\\"||!u.select(\\\"open\\\")||!a||O(F)||ge(F)}function he(F){if(Y()!==\\\"sloppy\\\"||!u.select(\\\"open\\\")||!a||O(F))return;let V=F.touches[0];V&&(k.current={startTime:Date.now(),startX:V.clientX,startY:V.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},w.start(1e3,()=>{k.current&&(k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1)}))}function pe(F,V){let Ae=lt(F);if(!Ae)return;let Z=we(Ae,F.type,()=>{V(F),Z()})}function Le(F){L.current=\\\"touch\\\",pe(F,he)}function ve(F){w.clear(),F.type===\\\"pointerdown\\\"&&(L.current=F.pointerType),!(F.type===\\\"mousedown\\\"&&k.current&&!k.current.dismissOnMouseDown)&&pe(F,V=>{V.type===\\\"pointerdown\\\"?oe(V):ge(V)})}function ue(F){if(!y.current)return;let V=v.current;if(Ce(),Y()===\\\"intentional\\\"){if(F.type===\\\"pointercancel\\\"){V&&J();return}if(!me(F)){if(V){J();return}typeof b==\\\"function\\\"&&!b(F)||(Q.clear(),R.current=!0,P())}}}function Te(F){if(Y()!==\\\"sloppy\\\"||!k.current||O(F))return;let V=F.touches[0];if(!V)return;let Ae=Math.abs(V.clientX-k.current.startX),Z=Math.abs(V.clientY-k.current.startY),H=Math.sqrt(Ae*Ae+Z*Z);H>5&&(k.current.dismissOnTouchEnd=!0),H>10&&(ge(F),w.clear(),k.current=null)}function re(F){pe(F,Te)}function fe(F){Y()!==\\\"sloppy\\\"||!k.current||O(F)||(k.current.dismissOnTouchEnd&&ge(F),w.clear(),k.current=null)}function de(F){pe(F,fe)}let Re=ye(f),St=aa(o&&aa(we(Re,\\\"keydown\\\",_),we(Re,\\\"compositionstart\\\",$),we(Re,\\\"compositionend\\\",ee)),C&&aa(we(Re,\\\"click\\\",ve,!0),we(Re,\\\"pointerdown\\\",ve,!0),we(Re,\\\"pointerup\\\",ue,!0),we(Re,\\\"pointercancel\\\",ue,!0),we(Re,\\\"mousedown\\\",ve,!0),we(Re,\\\"mouseup\\\",ue,!0),we(Re,\\\"touchstart\\\",Le,!0),we(Re,\\\"touchmove\\\",re,!0),we(Re,\\\"touchend\\\",de,!0)));return()=>{St(),X.clear(),Q.clear(),Ce(),R.current=!1,P()}},[d,f,o,C,b,c,a,m,h,_,P,g,U,O,p,u,w]);let B=Xa.useMemo(()=>({onKeyDown:_,onPointerDown:M,onClick:M}),[_,M]),ae=Xa.useMemo(()=>({onKeyDown:_,onPointerDown:N,onMouseDown:N,onClickCapture:q,onMouseDownCapture(X){q(),E(X)},onPointerDownCapture(X){q(),E(X)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[_,q,E,N]);return Xa.useMemo(()=>a?{reference:B,floating:ae,trigger:B}:{},[a,B,ae])}var sa=S(T(),1);function TT(e,t,a){let{reference:o,floating:n}=e,r=Ma(t),s=dc(t),l=fc(s),i=oa(t),u=r===\\\"y\\\",c=o.x+o.width/2-n.width/2,f=o.y+o.height/2-n.height/2,d=o[l]/2-n[l]/2,p;switch(i){case\\\"top\\\":p={x:c,y:o.y-n.height};break;case\\\"bottom\\\":p={x:c,y:o.y+o.height};break;case\\\"right\\\":p={x:o.x+o.width,y:f};break;case\\\"left\\\":p={x:o.x-n.width,y:f};break;default:p={x:o.x,y:o.y}}let x=Eo(t);return x&&(p[s]+=d*(x===\\\"end\\\"?1:-1)*(a&&u?-1:1)),p}async function ET(e,t){var a;t===void 0&&(t={});let{x:o,y:n,platform:r,rects:s,elements:l,strategy:i}=e,{boundary:u=\\\"clippingAncestors\\\",rootBoundary:c=\\\"viewport\\\",elementContext:f=\\\"floating\\\",altBoundary:d=!1,padding:p=0}=Zo(t,e),x=Op(p),C=l[d?f===\\\"floating\\\"?\\\"reference\\\":\\\"floating\\\":f],g=Fs(await r.getClippingRect({element:(a=await(r.isElement==null?void 0:r.isElement(C)))==null||a?C:C.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:i})),m=f===\\\"floating\\\"?{x:o,y:n,width:s.floating.width,height:s.floating.height}:s.reference,h=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),y=await(r.isElement==null?void 0:r.isElement(h))&&await(r.getScale==null?void 0:r.getScale(h))||{x:1,y:1},v=Fs(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:m,offsetParent:h,strategy:i}):m);return{top:(g.top-v.top+x.top)/y.y,bottom:(v.bottom-g.bottom+x.bottom)/y.y,left:(g.left-v.left+x.left)/y.x,right:(v.right-g.right+x.right)/y.x}}var N_=50,MT=async(e,t,a)=>{let{placement:o=\\\"bottom\\\",strategy:n=\\\"absolute\\\",middleware:r=[],platform:s}=a,l=s.detectOverflow?s:{...s,detectOverflow:ET},i=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:c,y:f}=TT(u,o,i),d=o,p=0,x={};for(let b=0;b<r.length;b++){let C=r[b];if(!C)continue;let{name:g,fn:m}=C,{x:h,y,data:v,reset:R}=await m({x:c,y:f,initialPlacement:o,placement:d,strategy:n,middlewareData:x,rects:u,platform:l,elements:{reference:e,floating:t}});c=h??c,f=y??f,x[g]={...x[g],...v},R&&p<N_&&(p++,typeof R==\\\"object\\\"&&(R.placement&&(d=R.placement),R.rects&&(u=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):R.rects),{x:c,y:f}=TT(u,d,i)),b=-1)}return{x:c,y:f,placement:d,strategy:n,middlewareData:x}};var AT=function(e){return e===void 0&&(e={}),{name:\\\"flip\\\",options:e,async fn(t){var a,o;let{placement:n,middlewareData:r,rects:s,initialPlacement:l,platform:i,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p=\\\"bestFit\\\",fallbackAxisSideDirection:x=\\\"none\\\",flipAlignment:b=!0,...C}=Zo(e,t);if((a=r.arrow)!=null&&a.alignmentOffset)return{};let g=oa(n),m=Ma(l),h=oa(l)===l,y=await(i.isRTL==null?void 0:i.isRTL(u.floating)),v=d||(h||!b?[uc(l)]:Qk(l)),R=x!==\\\"none\\\";!d&&R&&v.push(...Jk(l,b,x,y));let I=[l,...v],L=await i.detectOverflow(t,C),k=[],w=((o=r.flip)==null?void 0:o.overflows)||[];if(c&&k.push(L[g]),f){let O=Zk(n,s,y);k.push(L[O[0]],L[O[1]])}if(w=[...w,{placement:n,overflows:k}],!k.every(O=>O<=0)){var A,P;let O=(((A=r.flip)==null?void 0:A.index)||0)+1,M=I[O];if(M&&(!(f===\\\"alignment\\\"?m!==Ma(M):!1)||w.every(E=>Ma(E.placement)===m?E.overflows[0]>0:!0)))return{data:{index:O,overflows:w},reset:{placement:M}};let _=(P=w.filter(q=>q.overflows[0]<=0).sort((q,E)=>q.overflows[1]-E.overflows[1])[0])==null?void 0:P.placement;if(!_)switch(p){case\\\"bestFit\\\":{var U;let q=(U=w.filter(E=>{if(R){let N=Ma(E.placement);return N===m||N===\\\"y\\\"}return!0}).map(E=>[E.placement,E.overflows.filter(N=>N>0).reduce((N,B)=>N+B,0)]).sort((E,N)=>E[1]-N[1])[0])==null?void 0:U[0];q&&(_=q);break}case\\\"initialPlacement\\\":_=l;break}if(n!==_)return{reset:{placement:_}}}return{}}}};var DT=new Set([\\\"left\\\",\\\"top\\\"]);async function B_(e,t){let{placement:a,platform:o,elements:n}=e,r=await(o.isRTL==null?void 0:o.isRTL(n.floating)),s=oa(a),l=Eo(a),i=Ma(a)===\\\"y\\\",u=DT.has(s)?-1:1,c=r&&i?-1:1,f=Zo(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:x}=typeof f==\\\"number\\\"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof x==\\\"number\\\"&&(p=l===\\\"end\\\"?x*-1:x),i?{x:p*c,y:d*u}:{x:d*u,y:p*c}}var OT=function(e){return e===void 0&&(e=0),{name:\\\"offset\\\",options:e,async fn(t){var a,o;let{x:n,y:r,placement:s,middlewareData:l}=t,i=await B_(t,e);return s===((a=l.offset)==null?void 0:a.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:n+i.x,y:r+i.y,data:{...i,placement:s}}}}},PT=function(e){return e===void 0&&(e={}),{name:\\\"shift\\\",options:e,async fn(t){let{x:a,y:o,placement:n,platform:r}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:i={fn:m=>{let{x:h,y}=m;return{x:h,y}}},...u}=Zo(e,t),c={x:a,y:o},f=await r.detectOverflow(t,u),d=Ma(n),p=Dp(d),x=c[p],b=c[d],C=(m,h)=>Ap(h+f[m===\\\"y\\\"?\\\"top\\\":\\\"left\\\"],h,h-f[m===\\\"y\\\"?\\\"bottom\\\":\\\"right\\\"]);s&&(x=C(p,x)),l&&(b=C(d,b));let g=i.fn({...t,[p]:x,[d]:b});return{...g,data:{x:g.x-a,y:g.y-o,enabled:{[p]:s,[d]:l}}}}}},NT=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,o;let{x:n,y:r,placement:s,rects:l,middlewareData:i}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=Zo(e,t),d={x:n,y:r},p=Ma(s),x=Dp(p),b=d[x],C=d[p],g=Zo(u,t),m=typeof g==\\\"number\\\"?{mainAxis:g,crossAxis:0}:{mainAxis:(a=g.mainAxis)!=null?a:0,crossAxis:(o=g.crossAxis)!=null?o:0};if(c){let v=x===\\\"y\\\"?\\\"height\\\":\\\"width\\\",R=l.reference[x]-l.floating[v]+m.mainAxis,I=l.reference[x]+l.reference[v]-m.mainAxis;b<R?b=R:b>I&&(b=I)}if(f){var h,y;let v=x===\\\"y\\\"?\\\"width\\\":\\\"height\\\",R=DT.has(oa(s)),I=l.reference[p]-l.floating[v]+(R&&((h=i.offset)==null?void 0:h[p])||0)+(R?0:m.crossAxis),L=l.reference[p]+l.reference[v]+(R?0:((y=i.offset)==null?void 0:y[p])||0)-(R?m.crossAxis:0);C<I?C=I:C>L&&(C=L)}return{[x]:b,[p]:C}}}},BT=function(e){return e===void 0&&(e={}),{name:\\\"size\\\",options:e,async fn(t){let{placement:a,rects:o,platform:n,elements:r}=t,{apply:s=()=>{},...l}=Zo(e,t),i=await n.detectOverflow(t,l),u=oa(a),c=Eo(a),f=Ma(a)===\\\"y\\\",{width:d,height:p}=o.floating,x,b;u===\\\"top\\\"||u===\\\"bottom\\\"?(x=u,b=c===(await(n.isRTL==null?void 0:n.isRTL(r.floating))?\\\"start\\\":\\\"end\\\")?\\\"left\\\":\\\"right\\\"):(b=u,x=c===\\\"end\\\"?\\\"top\\\":\\\"bottom\\\");let C=p-i.top-i.bottom,g=d-i.left-i.right,m=Fr(p-i[x],C),h=Fr(d-i[b],g),y=t.middlewareData.shift,v=!y,R=m,I=h;y!=null&&y.enabled.x&&(I=g),y!=null&&y.enabled.y&&(R=C),v&&!c&&(f?I=d-2*To(i.left,i.right):R=p-2*To(i.top,i.bottom)),await s({...t,availableWidth:I,availableHeight:R});let L=await n.getDimensions(r.floating);return d!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function UT(e){let t=Bt(e),a=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=Ne(e),r=n?e.offsetWidth:a,s=n?e.offsetHeight:o,l=_r(a)!==r||_r(o)!==s;return l&&(a=r,o=s),{width:a,height:o,$:l}}function Dy(e){return Ie(e)?e:e.contextElement}function mi(e){let t=Dy(e);if(!Ne(t))return Wo(1);let a=t.getBoundingClientRect(),{width:o,height:n,$:r}=UT(t),s=(r?_r(a.width):a.width)/o,l=(r?_r(a.height):a.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var F_=Wo(0);function HT(e){let t=Ge(e);return!fp()||!t.visualViewport?F_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function __(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===Ge(e)}function Vs(e,t,a,o){t===void 0&&(t=!1),a===void 0&&(a=!1);let n=e.getBoundingClientRect(),r=Dy(e),s=Wo(1);t&&(o?Ie(o)&&(s=mi(o)):s=mi(e));let l=__(r,a,o)?HT(r):Wo(0),i=(n.left+l.x)/s.x,u=(n.top+l.y)/s.y,c=n.width/s.x,f=n.height/s.y;if(r&&o){let d=Ge(r),p=Ie(o)?Ge(o):o,x=d,b=dp(x);for(;b&&p!==x;){let C=mi(b),g=b.getBoundingClientRect(),m=Bt(b),h=g.left+(b.clientLeft+parseFloat(m.paddingLeft))*C.x,y=g.top+(b.clientTop+parseFloat(m.paddingTop))*C.y;i*=C.x,u*=C.y,c*=C.x,f*=C.y,i+=h,u+=y,x=Ge(b),b=dp(x)}}return Fs({width:c,height:f,x:i,y:u})}function Up(e,t){let a=Ju(e).scrollLeft;return t?t.left+a:Vs(Ko(e)).left+a}function zT(e,t){let a=e.getBoundingClientRect(),o=a.left+t.scrollLeft-Up(e,a),n=a.top+t.scrollTop;return{x:o,y:n}}function U_(e){let{elements:t,rect:a,offsetParent:o,strategy:n}=e,r=n===\\\"fixed\\\",s=Ko(o),l=t?Qu(t.floating):!1;if(o===s||l&&r)return a;let i={scrollLeft:0,scrollTop:0},u=Wo(1),c=Wo(0),f=Ne(o);if((f||!r)&&((wt(o)!==\\\"body\\\"||Ds(s))&&(i=Ju(o)),f)){let p=Vs(o);u=mi(o),c.x=p.x+o.clientLeft,c.y=p.y+o.clientTop}let d=s&&!f&&!r?zT(s,i):Wo(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-i.scrollLeft*u.x+c.x+d.x,y:a.y*u.y-i.scrollTop*u.y+c.y+d.y}}function H_(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function z_(e){let t=Ju(e),a=e.ownerDocument.body,o=To(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),n=To(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight),r=-t.scrollLeft+Up(e),s=-t.scrollTop;return Bt(a).direction===\\\"rtl\\\"&&(r+=To(e.clientWidth,a.clientWidth)-o),{width:o,height:n,x:r,y:s}}var q_=25;function V_(e,t,a){a===void 0&&(a=\\\"viewport\\\");let o=a===\\\"layoutViewport\\\",n=Ge(e),r=Ko(e),s=n.visualViewport,l=r.clientWidth,i=r.clientHeight,u=0,c=0;if(s){let d=!fp()||t===\\\"fixed\\\";o?d||(u=-s.offsetLeft,c=-s.offsetTop):(l=s.width,i=s.height,d&&(u=s.offsetLeft,c=s.offsetTop))}if(Up(r)<=0){let d=r.ownerDocument,p=d.body,x=getComputedStyle(p),b=d.compatMode===\\\"CSS1Compat\\\"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,C=Math.abs(r.clientWidth-p.clientWidth-b),g=getComputedStyle(r).scrollbarGutter===\\\"stable both-edges\\\"?C/2:C;g<=q_&&(l-=g)}return{width:l,height:i,x:u,y:c}}function G_(e,t){let a=Vs(e,!0,t===\\\"fixed\\\"),o=a.top+e.clientTop,n=a.left+e.clientLeft,r=mi(e),s=e.clientWidth*r.x,l=e.clientHeight*r.y,i=n*r.x,u=o*r.y;return{width:s,height:l,x:i,y:u}}function FT(e,t,a){let o;if(t===\\\"viewport\\\"||t===\\\"layoutViewport\\\")o=V_(e,a,t);else if(t===\\\"document\\\")o=z_(Ko(e));else if(Ie(t))o=G_(t,a);else{let n=HT(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Fs(o)}function X_(e,t){let a=t.get(e);if(a)return a;let o=Mr(e,[],!1).filter(l=>Ie(l)&&wt(l)!==\\\"body\\\"),n=null,r=Bt(e).position===\\\"fixed\\\",s=r?co(e):e;for(;Ie(s)&&!fo(s);){let l=Bt(s),i=cp(s),u=n?n.position:r?\\\"fixed\\\":\\\"\\\";!i&&(u===\\\"fixed\\\"||u===\\\"absolute\\\"&&l.position===\\\"static\\\")?o=o.filter(f=>f!==s):n=l,s=co(s)}return t.set(e,o),o}function j_(e){let{element:t,boundary:a,rootBoundary:o,strategy:n}=e,s=[...a===\\\"clippingAncestors\\\"?Qu(t)?[]:X_(t,this._c):[].concat(a),o],l=FT(t,s[0],n),i=l.top,u=l.right,c=l.bottom,f=l.left;for(let d=1;d<s.length;d++){let p=FT(t,s[d],n);i=To(p.top,i),u=Fr(p.right,u),c=Fr(p.bottom,c),f=To(p.left,f)}return{width:u-f,height:c-i,x:f,y:i}}function Y_(e){let{width:t,height:a}=UT(e);return{width:t,height:a}}function K_(e,t,a){let o=Ne(t),n=Ko(t),r=a===\\\"fixed\\\",s=Vs(e,!0,r,t),l={scrollLeft:0,scrollTop:0},i=Wo(0);if((o||!r)&&((wt(t)!==\\\"body\\\"||Ds(n))&&(l=Ju(t)),o)){let d=Vs(t,!0,r,t);i.x=d.x+t.clientLeft,i.y=d.y+t.clientTop}!o&&n&&(i.x=Up(n));let u=n&&!o&&!r?zT(n,l):Wo(0),c=s.left+l.scrollLeft-i.x-u.x,f=s.top+l.scrollTop-i.y-u.y;return{x:c,y:f,width:s.width,height:s.height}}function Ay(e){return Bt(e).position===\\\"static\\\"}function _T(e,t){if(!Ne(e)||Bt(e).position===\\\"fixed\\\")return null;if(t)return t(e);let a=e.offsetParent;return Ko(e)===a&&(a=a.ownerDocument.body),a}function qT(e,t){let a=Ge(e);if(Qu(e))return a;if(!Ne(e)){let n=co(e);for(;n&&!fo(n);){if(Ie(n)&&!Ay(n))return n;n=co(n)}return a}let o=_T(e,t);for(;o&&pk(o)&&Ay(o);)o=_T(o,t);return o&&fo(o)&&Ay(o)&&!cp(o)?a:o||mk(e)||a}var $_=async function(e){let t=this.getOffsetParent||qT,a=this.getDimensions,o=await a(e.floating);return{reference:K_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function W_(e){return Bt(e).direction===\\\"rtl\\\"}var Oy={convertOffsetParentRelativeRectToViewportRelativeRect:U_,getDocumentElement:Ko,getClippingRect:j_,getOffsetParent:qT,getElementRects:$_,getClientRects:H_,getDimensions:Y_,getScale:mi,isElement:Ie,isRTL:W_};function VT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Z_(e,t,a){let o=null,n,r=Ko(e);function s(){var c;clearTimeout(n),(c=o)==null||c.disconnect(),o=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();let d=e.getBoundingClientRect(),{left:p,top:x,width:b,height:C}=d;if(c||t(),!b||!C)return;let g=cc(x),m=cc(r.clientWidth-(p+b)),h=cc(r.clientHeight-(x+C)),y=cc(p),R={rootMargin:-g+\\\"px \\\"+-m+\\\"px \\\"+-h+\\\"px \\\"+-y+\\\"px\\\",threshold:To(0,Fr(1,f))||1},I=!0;function L(k){let w=k[0].intersectionRatio;if(!VT(d,e.getBoundingClientRect()))return l();if(w!==f){if(!I)return l();w?l(!1,w):n=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{o=new IntersectionObserver(L,{...R,root:r.ownerDocument})}catch{o=new IntersectionObserver(L,R)}o.observe(e)}let i=Ge(e),u=()=>l(a);return i.addEventListener(\\\"resize\\\",u),l(!0),()=>{i.removeEventListener(\\\"resize\\\",u),s()}}function Sc(e,t,a,o){o===void 0&&(o={});let{ancestorScroll:n=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver==\\\"function\\\",layoutShift:l=typeof IntersectionObserver==\\\"function\\\",animationFrame:i=!1}=o,u=Dy(e),c=n||r?[...u?Mr(u):[],...t?Mr(t):[]]:[];c.forEach(g=>{n&&g.addEventListener(\\\"scroll\\\",a),r&&g.addEventListener(\\\"resize\\\",a)});let f=u&&l?Z_(u,a,r):null,d=-1,p=null;s&&(p=new ResizeObserver(g=>{let[m]=g;m&&m.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var h;(h=p)==null||h.observe(t)})),a()}),u&&!i&&p.observe(u),t&&p.observe(t));let x,b=i?Vs(e):null;i&&C();function C(){let g=Vs(e);b&&!VT(b,g)&&a(),b=g,x=requestAnimationFrame(C)}return a(),()=>{var g;c.forEach(m=>{n&&m.removeEventListener(\\\"scroll\\\",a),r&&m.removeEventListener(\\\"resize\\\",a)}),f?.(),(g=p)==null||g.disconnect(),p=null,i&&cancelAnimationFrame(x)}}var GT=OT;var XT=PT,jT=AT,YT=BT;var KT=NT,Hp=(e,t,a)=>{let o=new Map,n=a??{},r={...Oy,...n.platform,_c:o};return MT(e,t,{...n,platform:r})};var At=S(T(),1),WT=S(T(),1),ZT=S(fn(),1),J_=typeof document<\\\"u\\\",eU=function(){},zp=J_?WT.useLayoutEffect:eU;function qp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==\\\"function\\\"&&e.toString()===t.toString())return!0;let a,o,n;if(e&&t&&typeof e==\\\"object\\\"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(o=a;o--!==0;)if(!qp(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),a=n.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=a;o--!==0;){let r=n[o];if(!(r===\\\"_owner\\\"&&e.$$typeof)&&!qp(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function QT(e){return typeof window>\\\"u\\\"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $T(e,t){let a=QT(e);return Math.round(t*a)/a}function Py(e){let t=At.useRef(e);return zp(()=>{t.current=e}),t}function JT(e){e===void 0&&(e={});let{placement:t=\\\"bottom\\\",strategy:a=\\\"absolute\\\",middleware:o=[],platform:n,elements:{reference:r,floating:s}={},transform:l=!0,whileElementsMounted:i,open:u}=e,[c,f]=At.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=At.useState(o);qp(d,o)||p(o);let[x,b]=At.useState(null),[C,g]=At.useState(null),m=At.useCallback(E=>{E!==R.current&&(R.current=E,b(E))},[]),h=At.useCallback(E=>{E!==I.current&&(I.current=E,g(E))},[]),y=r||x,v=s||C,R=At.useRef(null),I=At.useRef(null),L=At.useRef(c),k=i!=null,w=Py(i),A=Py(n),P=Py(u),U=At.useCallback(()=>{if(!R.current||!I.current)return;let E={placement:t,strategy:a,middleware:d};A.current&&(E.platform=A.current),Hp(R.current,I.current,E).then(N=>{let B={...N,isPositioned:P.current!==!1};O.current&&!qp(L.current,B)&&(L.current=B,ZT.flushSync(()=>{f(B)}))})},[d,t,a,A,P]);zp(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(E=>({...E,isPositioned:!1})))},[u]);let O=At.useRef(!1);zp(()=>(O.current=!0,()=>{O.current=!1}),[]),zp(()=>{if(y&&(R.current=y),v&&(I.current=v),y&&v){if(w.current)return w.current(y,v,U);U()}},[y,v,U,w,k]);let M=At.useMemo(()=>({reference:R,floating:I,setReference:m,setFloating:h}),[m,h]),_=At.useMemo(()=>({reference:y,floating:v}),[y,v]),q=At.useMemo(()=>{let E={position:a,left:0,top:0};if(!_.floating)return E;let N=$T(_.floating,c.x),B=$T(_.floating,c.y);return l?{...E,transform:\\\"translate(\\\"+N+\\\"px, \\\"+B+\\\"px)\\\",...QT(_.floating)>=1.5&&{willChange:\\\"transform\\\"}}:{position:a,left:N,top:B}},[a,l,_.floating,c.x,c.y]);return At.useMemo(()=>({...c,update:U,refs:M,elements:_,floatingStyles:q}),[c,U,M,_,q])}var Ny=(e,t)=>{let a=GT(e);return{name:a.name,fn:a.fn,options:[e,t]}},By=(e,t)=>{let a=XT(e);return{name:a.name,fn:a.fn,options:[e,t]}},Fy=(e,t)=>({fn:KT(e).fn,options:[e,t]}),_y=(e,t)=>{let a=jT(e);return{name:a.name,fn:a.fn,options:[e,t]}},Uy=(e,t)=>{let a=YT(e);return{name:a.name,fn:a.fn,options:[e,t]}};var gi=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(t,a,o=!0){this.fallbackStore=t,this.componentName=a,this.throwOnMissingTrigger=o}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(t){return this.storeListeners.add(t),()=>{this.storeListeners.delete(t)}}attachStore(t){return this.attachedStores.push(t),this.setActiveStore(t),()=>{let a=this.attachedStores.lastIndexOf(t);a!==-1&&this.attachedStores.splice(a,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(t){this.attachedStoreValue!==t&&(this.attachedStoreValue=t,this.storeListeners.forEach(a=>{a()}))}openByTrigger(t){let a=this.attachedStore;if(a===null)return;let o;if(t){for(let n=this.attachedStores.length-1;n>=0&&!o;n-=1)o=this.attachedStores[n].context.triggerElements.getById(t);o??=this.fallbackStore.context.triggerElements.getById(t)}if(t&&!o&&this.throwOnMissingTrigger)throw new Error(Pe(99,this.componentName,t,this.componentName));a.setOpen(!0,ce(j.imperativeAction,void 0,o))}closePopup(){let t=this.attachedStore;t!==null&&t.setOpen(!1,ce(j.imperativeAction))}};var Xs=S(T(),1),IU=S(fn(),1);var pE=S(T(),1);var fE=S(T(),1),Gy=S(Vp(),1),dE=S(sE(),1);var lE=S(T(),1);var zy=[],qy;function iE(){return qy}function uE(e){zy.push(e)}function Vy(e){let t=(a,o)=>{let n=tt(bU).current,r;try{qy=n;for(let s of zy)s.before(n);r=e(a,o);for(let s of zy)s.after(n);n.didInitialize=!0}finally{qy=void 0}return r};return t.displayName=e.displayName||e.name,t}function cE(e){return lE.forwardRef(Vy(e))}function bU(){return{didInitialize:!1}}var yU=Kl(19),SU=yU?LU:RU;function Xp(e,t,a,o,n){return SU(e,t,a,o,n)}function CU(e,t,a,o,n){let r=fE.useCallback(()=>t(e.getSnapshot(),a,o,n),[e,t,a,o,n]);return(0,Gy.useSyncExternalStore)(e.subscribe,r,r)}uE({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let a=0;a<e.syncHooks.length;a+=1){let o=e.syncHooks[a],n=o.selector(o.store.state,o.a1,o.a2,o.a3);Object.is(o.value,n)||(t=!0,o.value=n)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let a=new Set;for(let n of e.syncHooks)a.add(n.store);let o=[];for(let n of a)o.push(n.subscribe(t));return()=>{for(let n of o)n()}}),(0,Gy.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function LU(e,t,a,o,n){let r=iE();if(!r)return CU(e,t,a,o,n);let s=r.syncIndex;r.syncIndex+=1;let l;return r.didInitialize?(l=r.syncHooks[s],(l.store!==e||l.selector!==t||!Object.is(l.a1,a)||!Object.is(l.a2,o)||!Object.is(l.a3,n))&&(l.store!==e&&(r.didChangeStore=!0),l.store=e,l.selector=t,l.a1=a,l.a2=o,l.a3=n,l.value=t(e.getSnapshot(),a,o,n))):(l={store:e,selector:t,a1:a,a2:o,a3:n,value:t(e.getSnapshot(),a,o,n)},r.syncHooks.push(l)),l.value}function RU(e,t,a,o,n){return(0,dE.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,r=>t(r,a,o,n))}var jp=class{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;let a=this.updateTick;for(let o of this.listeners){if(a!==this.updateTick)return;o(t)}}update(t){for(let a in t)if(!Object.is(this.state[a],t[a])){this.setState({...this.state,...t});return}}set(t,a){Object.is(this.state[t],a)||this.setState({...this.state,[t]:a})}notifyAll(){let t={...this.state};this.setState(t)}use(t,a,o,n){return Xp(this,t,a,o,n)}};var Gs=S(T(),1);var Qo=class extends jp{constructor(t,a={},o){super(t),this.context=a,this.selectors=o}useSyncedValue(t,a){Gs.useDebugValue(t);let o=this;G(()=>{o.state[t]!==a&&o.set(t,a)},[o,t,a])}useSyncedValueWithCleanup(t,a){let o=this;G(()=>(o.state[t]!==a&&o.set(t,a),()=>{o.set(t,void 0)}),[o,t,a])}useSyncedValues(t){let a=this,o=Object.values(t);G(()=>{a.update(t)},[a,...o])}useControlledProp(t,a){Gs.useDebugValue(t);let o=this,n=a!==void 0;G(()=>{n&&!Object.is(o.state[t],a)&&o.setState({...o.state,[t]:a})},[o,t,a,n])}select(t,a,o,n){let r=this.selectors[t];return r(this.state,a,o,n)}useState(t,a,o,n){return Gs.useDebugValue(t),Xp(this,this.selectors[t],a,o,n)}useContextCallback(t,a){Gs.useDebugValue(t);let o=K(a??Fe);this.context[t]=o}useStateSetter(t){let a=Gs.useRef(void 0);return a.current===void 0&&(a.current=o=>{this.set(t,o)}),a.current}observe(t,a){let o;typeof t==\\\"function\\\"?o=t:o=this.selectors[t];let n=o(this.state);return a(n,n,this),this.subscribe(r=>{let s=o(r);if(!Object.is(n,s)){let l=n;n=s,a(s,l,this)}})}};var vU={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Vr=class extends Qo{constructor(t){let{syncOnly:a,nested:o,onOpenChange:n,triggerElements:r,...s}=t;super({...s,positionReference:s.referenceElement,domReferenceElement:s.referenceElement},{onOpenChange:n,dataRef:{current:{}},events:_p(),nested:o,triggerElements:r},vU),this.syncOnly=a}syncOpenEvent=(t,a)=>{(!t||!this.state.open||a!=null&&qk(a))&&(this.context.dataRef.current.openEvent=t?a:void 0)};dispatchOpenChange=(t,a)=>{this.syncOpenEvent(t,a.event);let o={open:t,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit(\\\"openchange\\\",o)};setOpen=(t,a)=>{if(this.syncOnly){this.context.onOpenChange?.(t,a);return}this.dispatchOpenChange(t,a),this.context.onOpenChange?.(t,a)}};function Cc(e){let{popupStore:t,treatPopupAsFloatingElement:a=!1,floatingRootContext:o,floatingId:n,nested:r,onOpenChange:s}=e,l=t.useState(\\\"open\\\"),i=t.useState(\\\"activeTriggerElement\\\"),u=t.useState(a?\\\"popupElement\\\":\\\"positionerElement\\\"),c=t.context.triggerElements,f=s,d=pE.useRef(null);o===void 0&&d.current===null&&(d.current=new Vr({open:l,transitionStatus:void 0,referenceElement:i,floatingElement:u,triggerElements:c,onOpenChange:f,floatingId:n,syncOnly:!0,nested:r}));let p=o??d.current;return t.useSyncedValue(\\\"floatingId\\\",n),G(()=>{let x={open:l,floatingId:n,referenceElement:i,floatingElement:u};Ie(i)&&(x.domReferenceElement=i),p.state.positionReference===p.state.referenceElement&&(x.positionReference=i),p.update(x)},[l,n,i,u,p]),p.context.onOpenChange=f,p.context.nested=r,p}var Yp={tabIndex:-1,[oc]:\\\"\\\"};function mE(e){return t=>t===\\\"touch\\\"?e.current:!0}function gE(e,t=!1){let a=wo(),o=Ga()!=null,n=tt(()=>e(a,o)).current;return Cc({popupStore:n,treatPopupAsFloatingElement:t,floatingRootContext:n.state.floatingRootContext,floatingId:a,nested:o,onOpenChange:n.setOpen}),n}function Kp({handle:e,store:t}){return G(()=>e.attachStore(t),[e,t]),null}function Xy(e,t){let a=Xs.useRef(null),o=Xs.useRef(null);return Xs.useCallback(n=>{if(e===void 0)return;let r=!1;if(a.current!==null){let s=a.current,l=o.current,i=t.context.triggerElements.getById(s);l&&i===l&&(t.context.triggerElements.delete(s),r=!0),a.current=null,o.current=null}if(n!==null&&(a.current=e,o.current=n,t.context.triggerElements.add(e,n),r=!0),r){let s=t.context.triggerElements.size;t.select(\\\"open\\\")&&t.state.triggerCount!==s&&t.set(\\\"triggerCount\\\",s)}},[t,e])}function $p(e,t,a,o=!1){t?e.preventUnmountingOnClose=!1:o&&(e.preventUnmountingOnClose=!0);let n=a?.id??null;(n||t)&&(e.activeTriggerId=n,e.activeTriggerElement=a??null)}function hE(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Wp(e,t,a,o){let n=a.useState(\\\"isMountedByTrigger\\\",e),r=Xy(e,a),s=K(i=>{let u=a.select(\\\"open\\\"),c=a.select(\\\"activeTriggerId\\\");if(c===e){a.update({activeTriggerElement:i,...u?o:null});return}c==null&&u&&a.update({activeTriggerId:e,activeTriggerElement:i,...o})}),l=Xs.useCallback(i=>{r(i),i&&s(i)},[r,s]);return G(()=>{n&&a.update({activeTriggerElement:t.current,...o})},[n,a,t,...Object.values(o)]),{registerTrigger:l,isMountedByThisTrigger:n}}function Zp(e,t={}){let{closeOnActiveTriggerUnmount:a=!1}=t,o=Xs.useRef(null),n=e.useState(\\\"open\\\"),r=e.useState(\\\"triggerCount\\\"),s=e.useState(\\\"activeTriggerId\\\"),l=e.useState(\\\"activeTriggerElement\\\");G(()=>{if(!n){o.current=null,e.state.triggerCount!==0&&e.set(\\\"triggerCount\\\",0);return}let i=e.context.triggerElements.size,u={};e.state.triggerCount!==i&&(u.triggerCount=i);let c=e.select(\\\"activeTriggerId\\\"),f=null;if(c){let d=e.context.triggerElements.getById(c);if(d)o.current=c,d!==e.state.activeTriggerElement&&(u.activeTriggerElement=d);else{for(let[p,x]of e.context.triggerElements.entries())if(x===e.state.activeTriggerElement){u.activeTriggerId=p,u.activeTriggerElement=x,o.current=p;break}u.activeTriggerId===void 0&&(o.current===c?f=c:o.current=null)}}else o.current=null;if(!f&&!c&&i===1){let d=e.context.triggerElements.entries().next();if(!d.done){let[p,x]=d.value;u.activeTriggerId=p,u.activeTriggerElement=x,o.current=p}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&a&&queueMicrotask(()=>{if(e.select(\\\"open\\\")&&e.select(\\\"activeTriggerId\\\")===f&&!e.context.triggerElements.getById(f)){let d=ce(j.none);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[n,e,r,s,l,a])}function Qp(e,t,a){let{mounted:o,setMounted:n,transitionStatus:r}=ii(e),s=t.useState(\\\"preventUnmountingOnClose\\\"),l=e?!1:s;t.useSyncedValues({mounted:o,transitionStatus:r,preventUnmountingOnClose:l});let i=K(()=>{n(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),a?.(),t.context.onOpenChangeComplete?.(!1)});return $o({enabled:o&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:r}}function Jp(e,t){e.useSyncedValues(t),G(()=>()=>{e.update({activeTriggerProps:Me,inactiveTriggerProps:Me,popupProps:Me})},[e])}function xE(e,t){G(()=>{!t&&e.state.openMethod!==null&&e.set(\\\"openMethod\\\",null)},[t,e]),G(()=>()=>{e.state.openMethod!==null&&e.set(\\\"openMethod\\\",null)},[e])}var zn=class{constructor(){this.idMap=new Map}add(t,a){this.idMap.set(t,a)}delete(t){this.idMap.delete(t)}hasElement(t){for(let a of this.idMap.values())if(a===t)return!0;return!1}hasMatchingElement(t){for(let a of this.idMap.values())if(t(a))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function bE(){return new Vr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new zn,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function em(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:bE(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Me,inactiveTriggerProps:Me,popupProps:Me}}function SE(e,t,a=!1){return new Vr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:a,onOpenChange:void 0})}var Lc=e=>e.triggerIdProp??e.activeTriggerId,jy=e=>e.openProp??e.open,yE=e=>(e.popupElement?.id??e.floatingId)||void 0;function CE(e,t){return t!==void 0&&jy(e)&&Lc(e)===t}function wU(e,t){return CE(e,t)?!0:t!==void 0&&jy(e)&&Lc(e)==null&&e.triggerCount===1}var tm={open:jy,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Lc,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:yE,isTriggerActive:(e,t)=>t!==void 0&&Lc(e)===t,isOpenedByTrigger:(e,t)=>CE(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Lc(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>wU(e,t)?yE(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};var Yy=S(T(),1),LE=S(Vp(),1);function am(e){let t=Yy.useCallback(o=>e===void 0?Fe:e.subscribeStore(o),[e]),a=Yy.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,LE.useSyncExternalStore)(t,a,()=>e?.serverStore)}function RE(e){return kU(e,e.rootContext)}function kU(e,t){let{nodeId:a,externalTree:o}=e,n=t.useState(\\\"referenceElement\\\"),r=t.useState(\\\"floatingElement\\\"),s=t.useState(\\\"domReferenceElement\\\"),l=t.useState(\\\"open\\\"),i=t.useState(\\\"floatingId\\\"),[u,c]=sa.useState(null),[f,d]=sa.useState(void 0),[p,x]=sa.useState(void 0),b=sa.useRef(null),C=na(o),g=sa.useMemo(()=>({reference:n,floating:r,domReference:s}),[n,r,s]),m=JT({...e,elements:{...g,...u&&{reference:u}}}),h=Ie(f)?f:null,y=p===void 0?t.state.floatingElement:p;t.useSyncedValue(\\\"referenceElement\\\",f??null),t.useSyncedValue(\\\"domReferenceElement\\\",f===void 0?s:h),t.useSyncedValue(\\\"floatingElement\\\",y);let v=sa.useCallback(A=>{let P=Ie(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),getClientRects:()=>A.getClientRects(),contextElement:A}:A;c(P),m.refs.setReference(P)},[m.refs]),R=sa.useCallback(A=>{(Ie(A)||A===null)&&(b.current=A,d(A)),(Ie(m.refs.reference.current)||m.refs.reference.current===null||A!==null&&!Ie(A))&&m.refs.setReference(A)},[m.refs,d]),I=sa.useCallback(A=>{x(A),m.refs.setFloating(A)},[m.refs]),L=sa.useMemo(()=>({...m.refs,setReference:R,setFloating:I,setPositionReference:v,domReference:b}),[m.refs,R,I,v]),k=sa.useMemo(()=>({...m.elements,domReference:s}),[m.elements,s]),w=sa.useMemo(()=>({...m,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:i,refs:L,elements:k,nodeId:a,rootStore:t}),[m,L,k,a,t,l,i]);return G(()=>{s&&(b.current=s)},[s]),G(()=>{t.context.dataRef.current.floatingContext=w;let A=C?.nodesRef.current.find(P=>P.id===a);A&&(A.context=w)}),sa.useMemo(()=>({...m,context:w,refs:L,elements:k,rootStore:t}),[m,L,k,w,t])}var Jo=S(T(),1);var Ky=Xe.os.mac&&Xe.engine.webkit;function $y(e,t={}){let{enabled:a=!0,delay:o}=t,n=\\\"rootStore\\\"in e?e.rootStore:e,{events:r,dataRef:s}=n.context,l=Jo.useRef(!1),i=Jo.useRef(null),u=Jo.useRef(!0),c=Rt();Jo.useEffect(()=>{let d=n.select(\\\"domReferenceElement\\\");if(!a)return;let p=Ge(d);function x(){let g=n.select(\\\"domReferenceElement\\\");!n.select(\\\"open\\\")&&Ne(g)&&g===Ft(ye(g))&&(l.current=!0)}function b(){u.current=!0}function C(){u.current=!1}return aa(we(p,\\\"blur\\\",x),Ky&&we(p,\\\"keydown\\\",b,!0),Ky&&we(p,\\\"pointerdown\\\",C,!0))},[n,a]),Jo.useEffect(()=>{if(!a)return;function d(p){if(p.reason===j.triggerPress||p.reason===j.escapeKey){let x=n.select(\\\"domReferenceElement\\\");Ie(x)&&(i.current=x,l.current=!0)}}return r.on(\\\"openchange\\\",d),()=>{r.off(\\\"openchange\\\",d)}},[r,a,n]);let f=Jo.useMemo(()=>{function d(){l.current=!1,i.current=null}return{onMouseLeave(){d()},onFocus(p){let x=p.currentTarget;if(l.current){if(i.current===x)return;d()}let b=lt(p.nativeEvent);if(Ie(b)){if(Ky&&!p.relatedTarget){if(!u.current&&!Bs(b))return}else if(!Gk(b))return}let C=Br(p.relatedTarget,n.context.triggerElements),{nativeEvent:g,currentTarget:m}=p,h=typeof o==\\\"function\\\"?o():o;if(n.select(\\\"open\\\")&&C||h===0||h===void 0){n.setOpen(!0,ce(j.triggerFocus,g,m));return}c.start(h,()=>{l.current||n.setOpen(!0,ce(j.triggerFocus,g,m))})},onBlur(p){d();let x=p.relatedTarget,b=p.nativeEvent,C=Ie(x)&&x.hasAttribute(Hn(\\\"focus-guard\\\"))&&x.getAttribute(\\\"data-type\\\")===\\\"outside\\\";c.start(0,()=>{let g=n.select(\\\"domReferenceElement\\\"),m=Ft(ye(g));!x&&m===g||ie(s.current.floatingContext?.refs.floating.current,m)||ie(g,m)||C||Br(x??m,n.context.triggerElements)||n.setOpen(!1,ce(j.triggerFocus,b))})}}},[s,o,n,c]);return Jo.useMemo(()=>a?{reference:f,trigger:f}:{},[a,f])}var Zy=S(T(),1);var Wy=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Ta,this.restTimeout=new Ta,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},om=new WeakMap;function xi(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&om.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(\\\"pointer-events\\\"),e.pointerEventsReferenceElement?.style.removeProperty(\\\"pointer-events\\\"),e.pointerEventsFloatingElement?.style.removeProperty(\\\"pointer-events\\\"),om.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function nm(e,t){let{scopeElement:a,referenceElement:o,floatingElement:n}=t,r=om.get(a);r&&r!==e&&xi(r),xi(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=a,e.pointerEventsReferenceElement=o,e.pointerEventsFloatingElement=n,om.set(a,e),a.style.pointerEvents=\\\"none\\\",o.style.pointerEvents=\\\"auto\\\",n.style.pointerEvents=\\\"auto\\\"}function rm(e){let t=e.context.dataRef.current,a=tt(()=>t.hoverInteractionState??Wy.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=a),li(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Qy(e,t={}){let{enabled:a=!0,closeDelay:o=0,nodeId:n}=t,r=\\\"rootStore\\\"in e?e.rootStore:e,s=r.useState(\\\"open\\\"),l=r.useState(\\\"floatingElement\\\"),i=r.useState(\\\"domReferenceElement\\\"),{dataRef:u}=r.context,c=na(),f=Ga(),d=rm(r),p=Rt(),x=K(()=>kp(u.current.openEvent?.type,d.interactedInside)),b=K(()=>Xk(u.current.openEvent?.type)),C=K(()=>{xi(d)});G(()=>{s||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,C())},[s,d,C]),Zy.useEffect(()=>C,[C]),G(()=>{if(a&&s&&d.handleCloseOptions?.blockPointerEvents&&b()&&Ie(i)&&l){let g=i,m=l,h=ye(l),y=c?.nodesRef.current.find(L=>L.id===f)?.context?.elements.floating;y&&(y.style.pointerEvents=\\\"\\\");let v=d.pointerEventsScopeElement!==m?d.pointerEventsScopeElement:null,R=y!==m?y:null,I=d.handleCloseOptions?.getScope?.()??v??R??g.closest(\\\"[data-rootownerid]\\\")??h.body;return nm(d,{scopeElement:I,referenceElement:g,floatingElement:m}),()=>{C()}}},[a,s,i,l,d,b,c,f,C]),Zy.useEffect(()=>{if(!a)return;function g(){return!!(c&&f&&ho(c.nodesRef.current,f).length>0)}function m(L){let k=ic(o,\\\"close\\\",d.pointerType),w=()=>{r.setOpen(!1,ce(j.triggerHover,L)),c?.events.emit(\\\"floating.closed\\\",L)};k?d.openChangeTimeout.start(k,w):(d.openChangeTimeout.clear(),w())}function h(L){let k=lt(L);if(!my(k)){d.interactedInside=!1;return}d.interactedInside=k?.closest(\\\"[aria-haspopup]\\\")!=null}function y(){d.openChangeTimeout.clear(),p.clear(),c?.events.off(\\\"floating.closed\\\",R),C()}function v(L){if(g()&&c){c.events.on(\\\"floating.closed\\\",R);return}if(Br(L.relatedTarget,r.context.triggerElements))return;let k=u.current.floatingContext?.nodeId??n,w=L.relatedTarget;if(!(c&&k&&Ie(w)&&ho(c.nodesRef.current,k,!1).some(P=>ie(P.context?.elements.floating,w)))){if(d.handler){d.handler(L);return}C(),b()&&!x()&&m(L)}}function R(L){!c||!f||g()||p.start(0,()=>{c.events.off(\\\"floating.closed\\\",R),r.setOpen(!1,ce(j.triggerHover,L)),c.events.emit(\\\"floating.closed\\\",L)})}let I=l;return aa(I&&we(I,\\\"mouseenter\\\",y),I&&we(I,\\\"mouseleave\\\",v),I&&we(I,\\\"pointerdown\\\",h,!0),()=>{c?.events.off(\\\"floating.closed\\\",R)})},[a,l,r,u,o,n,b,x,C,d,c,f,p])}var Gr=S(T(),1),vE=S(fn(),1);var TU={current:null};function Rc(e,t={}){let{enabled:a=!0,delay:o=0,handleClose:n=null,mouseOnly:r=!1,restMs:s=0,move:l=!0,triggerElementRef:i=TU,externalTree:u,isActiveTrigger:c=!0,getHandleCloseContext:f,isClosing:d,shouldOpen:p,guardStaleOpen:x=!1}=t,b=\\\"rootStore\\\"in e?e.rootStore:e,{dataRef:C,events:g}=b.context,m=na(u),h=rm(b),y=Gr.useRef(!1),v=bt(n),R=bt(o),I=bt(s),L=bt(a),k=bt(p),w=bt(d),A=K(()=>kp(C.current.openEvent?.type,h.interactedInside)),P=K(()=>k.current?.()!==!1),U=K((_,q,E)=>{let N=b.context.triggerElements;if(N.hasElement(q))return!_||!ie(_,q);if(!Ie(E))return!1;let B=E;return N.hasMatchingElement(ae=>ie(ae,B))&&(!_||!ie(_,B))}),O=K(()=>{if(!h.handler)return;ye(b.select(\\\"domReferenceElement\\\")).removeEventListener(\\\"mousemove\\\",h.handler),h.handler=void 0}),M=K(()=>{xi(h)});return c&&(h.handleCloseOptions=v.current?.__options),Gr.useEffect(()=>O,[O]),Gr.useEffect(()=>{if(!a)return;function _(q){q.open?y.current=!1:(y.current=q.reason===j.triggerHover,O(),h.openChangeTimeout.clear(),h.restTimeout.clear(),h.blockMouseMove=!0,h.restTimeoutPending=!1)}return g.on(\\\"openchange\\\",_),()=>{g.off(\\\"openchange\\\",_)}},[a,g,h,O]),Gr.useEffect(()=>{if(!a)return;function _(X,Q=!0){let $=ic(R.current,\\\"close\\\",h.pointerType);$?h.openChangeTimeout.start($,()=>{b.setOpen(!1,ce(j.triggerHover,X)),m?.events.emit(\\\"floating.closed\\\",X)}):Q&&(h.openChangeTimeout.clear(),b.setOpen(!1,ce(j.triggerHover,X)),m?.events.emit(\\\"floating.closed\\\",X))}let q=i.current??(c?b.select(\\\"domReferenceElement\\\"):null);if(!Ie(q))return;function E(X){if(h.openChangeTimeout.clear(),h.blockMouseMove=!1,r&&!Fn(h.pointerType))return;let Q=gy(I.current),$=ic(R.current,\\\"open\\\",h.pointerType),ee=lt(X),J=X.currentTarget??null,Ce=b.select(\\\"domReferenceElement\\\"),Y=J;if(Ie(ee)&&!b.context.triggerElements.hasElement(ee)){for(let ue of b.context.triggerElements.elements())if(ie(ue,ee)){Y=ue;break}}Ie(J)&&Ie(Ce)&&!b.context.triggerElements.hasElement(J)&&ie(J,Ce)&&(Y=Ce);let W=Y==null?!1:U(Ce,Y,ee),me=b.select(\\\"open\\\"),ge=w.current?.()??b.select(\\\"transitionStatus\\\")===\\\"ending\\\",oe=!me&&ge&&y.current,he=!W&&Ie(Y)&&Ie(Ce)&&ie(Ce,Y)&&oe,pe=Q>0&&!$,Le=W&&(me||oe)||he,ve=!me||W;if(Le){P()&&b.setOpen(!0,ce(j.triggerHover,X,Y));return}pe||($?h.openChangeTimeout.start($,()=>{ve&&P()&&b.setOpen(!0,ce(j.triggerHover,X,Y))}):ve&&P()&&b.setOpen(!0,ce(j.triggerHover,X,Y)))}function N(X){if(A()){M();return}O();let Q=b.select(\\\"domReferenceElement\\\"),$=ye(Q);h.restTimeout.clear(),h.restTimeoutPending=!1;let ee=C.current.floatingContext??f?.();if(Br(X.relatedTarget,b.context.triggerElements))return;if(v.current&&ee){b.select(\\\"open\\\")||h.openChangeTimeout.clear();let Ce=i.current;h.handler=v.current({...ee,tree:m,x:X.clientX,y:X.clientY,onClose(){M(),O(),L.current&&!A()&&Ce===b.select(\\\"domReferenceElement\\\")&&_(X,!0)}}),$.addEventListener(\\\"mousemove\\\",h.handler),h.handler(X);return}(h.pointerType!==\\\"touch\\\"||!ie(b.select(\\\"floatingElement\\\"),X.relatedTarget))&&_(X)}function B(X){ie(q,X.relatedTarget)||(h.openChangeTimeout.clear(),h.restTimeout.clear(),h.restTimeoutPending=!1)}let ae=x?we(q,\\\"mouseout\\\",B):void 0;return l?aa(we(q,\\\"mousemove\\\",E,{once:!0}),we(q,\\\"mouseenter\\\",E),we(q,\\\"mouseleave\\\",N),ae):aa(we(q,\\\"mouseenter\\\",E),we(q,\\\"mouseleave\\\",N),ae)},[O,M,C,R,b,a,v,h,c,U,A,r,l,I,i,m,L,f,w,P,x]),Gr.useMemo(()=>{if(!a)return;function _(q){h.pointerType=q.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(q){let{nativeEvent:E}=q,N=q.currentTarget,B=b.select(\\\"domReferenceElement\\\"),ae=b.select(\\\"open\\\"),X=U(B,N,q.target);if(r&&!Fn(h.pointerType))return;if(ae&&X&&h.handleCloseOptions?.blockPointerEvents){let ee=b.select(\\\"floatingElement\\\");if(ee){let J=h.handleCloseOptions?.getScope?.()??N.ownerDocument.body;nm(h,{scopeElement:J,referenceElement:N,floatingElement:ee})}}let Q=gy(I.current);if(ae&&!X||Q===0||!X&&h.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;h.restTimeout.clear();function $(){if(h.restTimeoutPending=!1,A())return;let ee=b.select(\\\"open\\\");!h.blockMouseMove&&(!ee||X)&&P()&&b.setOpen(!0,ce(j.triggerHover,E,N))}h.pointerType===\\\"touch\\\"?vE.flushSync(()=>{$()}):X&&ae?$():(h.restTimeoutPending=!0,h.restTimeout.start(Q,$))}}},[a,h,A,U,r,b,I,P])}var Wt=S(T(),1);var EU=\\\"Escape\\\";function IE(e){return Xe.engine.webkit&&e.movementX===0&&e.movementY===0}function lm(e,t,a){switch(e){case\\\"vertical\\\":return t;case\\\"horizontal\\\":return a;default:return t||a}}function sm(e,t){return lm(t,e===py||e===Ip,e===nc||e===rc)}function Jy(e,t,a){return lm(t,e===Ip,a?e===nc:e===rc)||e===\\\"Enter\\\"||e===\\\" \\\"||e===\\\"\\\"}function MU(e,t,a){return lm(t,a?e===nc:e===rc,e===Ip)}function AU(e,t,a,o){let n=a?e===rc:e===nc,r=e===py;return t===\\\"both\\\"||t===\\\"horizontal\\\"&&o?e===EU:lm(t,n,r)}function eS(e,t){let{listRef:a,activeIndex:o,onNavigate:n=()=>{},enabled:r=!0,selectedIndex:s=null,allowEscape:l=!1,loopFocus:i=!1,nested:u=!1,rtl:c=!1,virtual:f=!1,focusItemOnOpen:d=\\\"auto\\\",focusItemOnHover:p=!0,openOnArrowKeyDown:x=!0,disabledIndices:b=void 0,orientation:C=\\\"vertical\\\",parentOrientation:g,id:m,resetOnPointerLeave:h=!0,externalTree:y,grid:v}=t,R=v!=null,I=\\\"rootStore\\\"in e?e.rootStore:e,L=I.useState(\\\"open\\\"),k=I.useState(\\\"floatingElement\\\"),w=I.useState(\\\"domReferenceElement\\\"),A=I.context.dataRef,P=lc(k),U=sc(w),O=bt(P),M=Ga(),_=na(y),q=Wt.useRef(d),E=Wt.useRef(s??-1),N=Wt.useRef(null),B=Wt.useRef(!0),ae=K(F=>{n(E.current===-1?null:E.current,F)}),X=Wt.useRef(!!k),Q=Wt.useRef(L),$=Wt.useRef(!1),ee=Wt.useRef(!1),J=Wt.useRef(null),Ce=bt(b),Y=bt(L),W=bt(s),me=bt(h),ge=Va(),oe=Va(),he=K(()=>{function F(H){f?_?.events.emit(\\\"virtualfocus\\\",H):J.current=pi(H,{sync:$.current,preventScroll:!0})}let V=a.current[E.current],Ae=ee.current;V&&F(V),($.current?H=>H():H=>ge.request(H))(()=>{let H=a.current[E.current]||V;if(!H)return;V||F(H),re&&(Ae||!B.current)&&H.scrollIntoView?.({block:\\\"nearest\\\",inline:\\\"nearest\\\"})})});G(()=>{A.current.orientation=C},[A,C]),G(()=>{r&&(L&&k?(E.current=s??-1,q.current&&s!=null&&(ee.current=!0,ae())):X.current&&(E.current=-1,ae()))},[r,L,k,s,ae]),G(()=>{if(r){if(!L){$.current=!1;return}if(k)if(o==null){if($.current=!1,W.current!=null)return;if(X.current&&(E.current=-1,he()),(!Q.current||!X.current)&&q.current&&(N.current!=null||q.current===!0&&N.current==null)){let F=0,V=()=>{a.current[0]==null?(F<2&&(F?Z=>oe.request(Z):queueMicrotask)(V),F+=1):(E.current=N.current==null||Jy(N.current,C,c)||u?_s(a):ci(a),N.current=null,ae())};V()}}else Ur(a.current,o)||(E.current=o,he(),ee.current=!1)}},[r,L,k,o,W,u,a,C,c,ae,he,oe]),G(()=>{if(!r||k||!_||f||!X.current)return;let F=_.nodesRef.current,V=F.find(H=>H.id===M)?.context?.elements.floating,Ae=Ft(ye(w??V??null)),Z=F.some(H=>H.context&&ie(H.context.elements.floating,Ae));V&&!Z&&B.current&&V.focus({preventScroll:!0})},[r,k,w,_,M,f]),G(()=>{Q.current=L,X.current=!!k}),G(()=>{L||(N.current=null,q.current=d)},[L,d]);let pe=o!=null,Le=K(F=>{if(!Y.current)return;let V=a.current.indexOf(F.currentTarget);V!==-1&&(E.current!==V||o!==V)&&(E.current=V,ae(F))}),ve=K(()=>g??_?.nodesRef.current.find(F=>F.id===M)?.context?.dataRef?.current.orientation),ue=K(()=>_s(a,Ce.current)),Te=K(F=>{if(B.current=!1,$.current=!0,F.which===229||!Y.current&&F.currentTarget===O.current)return;if(u&&AU(F.key,C,c,R)){sm(F.key,ve())||Ea(F),I.setOpen(!1,ce(j.listNavigation,F.nativeEvent)),Ne(w)&&(f?_?.events.emit(\\\"virtualfocus\\\",w):w.focus());return}let V=E.current,Ae=_s(a,b),Z=ci(a,b);if(U||(F.key===\\\"Home\\\"&&(Ea(F),E.current=Ae,ae(F)),F.key===\\\"End\\\"&&(Ea(F),E.current=Z,ae(F))),v!=null){let H=v(F,E.current,a,C,i,c,b,Ae,Z);if(H!=null&&(E.current=H,ae(F)),C===\\\"both\\\")return}if(sm(F.key,C)){if(Ea(F),L&&!f&&Ft(F.currentTarget.ownerDocument)===F.currentTarget){E.current=Jy(F.key,C,c)?Ae:Z,ae(F);return}Jy(F.key,C,c)?i?V>=Z?l&&V!==a.current.length?E.current=-1:($.current=!1,E.current=Ae):E.current=go(a.current,{startingIndex:V,disabledIndices:b}):E.current=Math.min(Z,go(a.current,{startingIndex:V,disabledIndices:b})):i?V<=Ae?l&&V!==-1?E.current=a.current.length:($.current=!1,E.current=Z):E.current=go(a.current,{startingIndex:V,decrement:!0,disabledIndices:b}):E.current=Math.max(Ae,go(a.current,{startingIndex:V,decrement:!0,disabledIndices:b})),Ur(a.current,E.current)&&(E.current=-1),ae(F)}}),re=Wt.useMemo(()=>({onFocus(V){$.current=!0,Le(V)},onClick:({currentTarget:V})=>V.focus({preventScroll:!0}),onMouseMove(V){IE(V)||($.current=!0,ee.current=!1,p&&Le(V))},onPointerLeave(V){if(!Y.current||!B.current||V.pointerType===\\\"touch\\\")return;$.current=!0;let Ae=V.relatedTarget;if(!(!p||a.current.includes(Ae))&&me.current&&(J.current?.(),J.current=null,E.current=-1,ae(V),!f)){let Z=O.current,H=Ft(ye(Z));Z&&ie(Z,H)&&Z.focus({preventScroll:!0})}}}),[Le,Y,O,p,a,ae,me,f]),fe=Wt.useMemo(()=>f&&L&&pe&&{\\\"aria-activedescendant\\\":`${m}-${o}`},[f,L,pe,m,o]),de=Wt.useMemo(()=>({\\\"aria-orientation\\\":C===\\\"both\\\"?void 0:C,...U?{}:fe,onKeyDown(F){if(F.key===\\\"Tab\\\"&&F.shiftKey&&L&&!f){let V=lt(F.nativeEvent);if(V&&!ie(O.current,V))return;Ea(F),I.setOpen(!1,ce(j.focusOut,F.nativeEvent)),Ne(w)&&w.focus();return}Te(F)},onPointerMove(F){IE(F)||(B.current=!0)}}),[fe,Te,O,C,U,I,L,f,w]),Re=Wt.useMemo(()=>{function F(Z){I.setOpen(!0,ce(j.listNavigation,Z.nativeEvent,Z.currentTarget))}function V(Z){d===\\\"auto\\\"&&vp(Z.nativeEvent)&&(q.current=!f)}function Ae(Z){q.current=d,d===\\\"auto\\\"&&ui(Z.nativeEvent)&&(q.current=!0)}return{onKeyDown(Z){let H=I.select(\\\"open\\\");B.current=!1;let be=Z.key.startsWith(\\\"Arrow\\\"),it=MU(Z.key,ve(),c),_t=sm(Z.key,C),$a=(u?it:_t)||Z.key===\\\"Enter\\\"||Z.key.trim()===\\\"\\\";if(f&&H)return Te(Z);if(!(!H&&!x&&be)){if($a){let Wa=sm(Z.key,ve());N.current=u&&Wa?null:Z.key}if(u){it&&(Ea(Z),H?(E.current=ue(),ae(Z)):F(Z));return}_t&&(W.current!=null&&(E.current=W.current),Ea(Z),!H&&x?F(Z):Te(Z),H&&ae(Z))}},onFocus(Z){I.select(\\\"open\\\")&&!f&&(E.current=-1,ae(Z))},onPointerDown:Ae,onPointerEnter:Ae,onMouseDown:V,onClick:V}},[Te,d,ue,u,ae,I,x,C,ve,c,W,f]),St=Wt.useMemo(()=>({...fe,...Re}),[fe,Re]);return Wt.useMemo(()=>r?{reference:St,floating:de,item:re,trigger:Re}:{},[r,St,de,Re,re])}var js=S(T(),1);function tS(e,t){let{listRef:a,elementsRef:o,activeIndex:n,onMatch:r,disabledIndices:s,onTyping:l,enabled:i=!0,resetMs:u=750,selectedIndex:c=null}=t,f=\\\"rootStore\\\"in e?e.rootStore:e,d=f.useState(\\\"open\\\"),p=Rt(),x=js.useRef(\\\"\\\"),b=js.useRef(c??n??-1),C=js.useRef(null),g=K(y=>{function v(O){return o?.current[O]}function R(O){let M=v(O);return M&&!Hs(M)||M?.matches(\\\":disabled\\\")?!1:s==null||!Us(Ia,O,s)}function I(O,M,_=0){if(O.length===0)return-1;let q=(_%O.length+O.length)%O.length,E=M.toLowerCase();for(let N=0;N<O.length;N+=1){let B=(q+N)%O.length;if(!(!O[B]?.toLowerCase().startsWith(E)||!R(B)))return B}return-1}let L=a.current;if(x.current.length>0&&y.key===\\\" \\\"&&(Ea(y),l?.(!0)),x.current.length>0&&x.current[0]!==\\\" \\\"&&I(L,x.current)===-1&&y.key!==\\\" \\\"&&l?.(!1),L==null||y.key.length!==1||y.ctrlKey||y.metaKey||y.altKey)return;d&&y.key!==\\\" \\\"&&(Ea(y),l?.(!0));let k=x.current===\\\"\\\";k&&(b.current=c??n??-1),L.every((O,M)=>O&&R(M)?O[0]?.toLowerCase()!==O[1]?.toLowerCase():!0)&&x.current===y.key&&(x.current=\\\"\\\",b.current=C.current),x.current+=y.key,p.start(u,()=>{x.current=\\\"\\\",b.current=C.current,l?.(!1)});let P=((k?c??n??-1:b.current)??0)+1,U=I(L,x.current,P);U!==-1?(r?.(U),C.current=U):y.key!==\\\" \\\"&&(x.current=\\\"\\\",l?.(!1))}),m=K(y=>{let v=y.relatedTarget,R=f.select(\\\"domReferenceElement\\\"),I=f.select(\\\"floatingElement\\\");ie(R,v)||ie(I,v)||(p.clear(),x.current=\\\"\\\",b.current=C.current,l?.(!1))});G(()=>{!d&&c!==null||(p.clear(),C.current=null,x.current!==\\\"\\\"&&(x.current=\\\"\\\"))},[d,c,p]);let h=js.useMemo(()=>({onKeyDown:g,onBlur:m}),[g,m]);return js.useMemo(()=>i?{reference:h,floating:h}:{},[i,h])}var wE=.1,DU=wE*wE,nt=.5;function im(e,t,a,o,n,r){return o>=t!=r>=t&&e<=(n-a)*(t-o)/(r-o)+a}function um(e,t,a,o,n,r,s,l,i,u){let c=!1;return im(e,t,a,o,n,r)&&(c=!c),im(e,t,n,r,s,l)&&(c=!c),im(e,t,s,l,i,u)&&(c=!c),im(e,t,i,u,a,o)&&(c=!c),c}function OU(e,t,a){return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height}function cm(e,t,a,o,n,r){let s=Math.min(a,n),l=Math.max(a,n),i=Math.min(o,r),u=Math.max(o,r);return e>=s&&e<=l&&t>=i&&t<=u}function vc(e={}){let{blockPointerEvents:t=!1}=e,a=new Ta,o=({x:n,y:r,placement:s,elements:l,onClose:i,nodeId:u,tree:c})=>{let f=s?.split(\\\"-\\\")[0],d=!1,p=null,x=null,b=typeof performance<\\\"u\\\"?performance.now():0;function C(m,h){let y=performance.now(),v=y-b;if(p===null||x===null||v===0)return p=m,x=h,b=y,!1;let R=m-p,I=h-x,L=R*R+I*I,k=v*v*DU;return p=m,x=h,b=y,L<k}function g(){a.clear(),i()}return function(h){a.clear();let y=l.domReference,v=l.floating;if(!y||!v||f==null||n==null||r==null)return;let{clientX:R,clientY:I}=h,L=lt(h),k=h.type===\\\"mouseleave\\\",w=ie(v,L),A=ie(y,L);if(w&&(d=!0,!k))return;if(A&&(d=!1,!k)){d=!0;return}if(k&&Ie(h.relatedTarget)&&ie(v,h.relatedTarget))return;function P(){return!!(c&&ho(c.nodesRef.current,u).length>0)}function U(){P()||g()}if(P())return;let O=y.getBoundingClientRect(),M=v.getBoundingClientRect(),_=n>M.right-M.width/2,q=r>M.bottom-M.height/2,E=M.width>O.width,N=M.height>O.height,B=(E?O:M).left,ae=(E?O:M).right,X=(N?O:M).top,Q=(N?O:M).bottom;if(f===\\\"top\\\"&&r>=O.bottom-1||f===\\\"bottom\\\"&&r<=O.top+1||f===\\\"left\\\"&&n>=O.right-1||f===\\\"right\\\"&&n<=O.left+1){U();return}let $=!1;switch(f){case\\\"top\\\":$=cm(R,I,B,O.top+1,ae,M.bottom-1);break;case\\\"bottom\\\":$=cm(R,I,B,M.top+1,ae,O.bottom-1);break;case\\\"left\\\":$=cm(R,I,M.right-1,Q,O.left+1,X);break;case\\\"right\\\":$=cm(R,I,O.right-1,Q,M.left+1,X);break;default:}if($)return;if(d&&!OU(R,I,O)){U();return}if(!k&&C(R,I)){U();return}let ee=!1;switch(f){case\\\"top\\\":{let J=E?nt/2:nt*4,Ce=E||_?n+J:n-J,Y=E?n-J:_?n+J:n-J,W=r+nt+1,me=_||E?M.bottom-nt:M.top,ge=_?E?M.bottom-nt:M.top:M.bottom-nt;ee=um(R,I,Ce,W,Y,W,M.left,me,M.right,ge);break}case\\\"bottom\\\":{let J=E?nt/2:nt*4,Ce=E||_?n+J:n-J,Y=E?n-J:_?n+J:n-J,W=r-nt,me=_||E?M.top+nt:M.bottom,ge=_?E?M.top+nt:M.bottom:M.top+nt;ee=um(R,I,Ce,W,Y,W,M.left,me,M.right,ge);break}case\\\"left\\\":{let J=N?nt/2:nt*4,Ce=N||q?r+J:r-J,Y=N?r-J:q?r+J:r-J,W=n+nt+1,me=q||N?M.right-nt:M.left,ge=q?N?M.right-nt:M.left:M.right-nt;ee=um(R,I,me,M.top,ge,M.bottom,W,Ce,W,Y);break}case\\\"right\\\":{let J=N?nt/2:nt*4,Ce=N||q?r+J:r-J,Y=N?r-J:q?r+J:r-J,W=n-nt,me=q||N?M.left+nt:M.right,ge=q?N?M.left+nt:M.right:M.left+nt;ee=um(R,I,W,Ce,W,Y,me,M.top,ge,M.bottom);break}default:}ee?d||a.start(40,U):U()}};return o.__options={...e,blockPointerEvents:t},o}var fm=S(T(),1),PU=fm.createContext(void 0);function dm(e){let t=fm.useContext(PU);if(t===void 0&&!e)throw new Error(Pe(69));return t}var mm=\\\"ArrowUp\\\",gm=\\\"ArrowDown\\\",hm=\\\"ArrowLeft\\\",xm=\\\"ArrowRight\\\",bm=\\\"Home\\\",ym=\\\"End\\\";var bi=new Set([mm,gm,hm,xm,bm,ym]),NU=\\\"Shift\\\",TE=[NU,\\\"Control\\\",\\\"Alt\\\",\\\"Meta\\\"];function BU(e){return Ne(e)&&e.tagName===\\\"INPUT\\\"}function aS(e){return!!(BU(e)&&e.selectionStart!=null||Ne(e)&&e.tagName===\\\"TEXTAREA\\\")}function oS(e,t,a,o){if(!e||!t||!t.scrollTo)return;let n=e.scrollLeft,r=e.scrollTop,s=e.clientWidth<e.scrollWidth,l=e.clientHeight<e.scrollHeight;if(s&&o!==\\\"vertical\\\"){let i=kE(e,t,\\\"left\\\"),u=pm(e),c=pm(t);a===\\\"ltr\\\"&&(i+t.offsetWidth+c.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight?n=i+t.offsetWidth+c.scrollMarginRight-e.clientWidth+u.scrollPaddingRight:i-c.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft&&(n=i-c.scrollMarginLeft-u.scrollPaddingLeft)),a===\\\"rtl\\\"&&(i-c.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft?n=i-c.scrollMarginLeft-u.scrollPaddingLeft:i+t.offsetWidth+c.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight&&(n=i+t.offsetWidth+c.scrollMarginRight-e.clientWidth+u.scrollPaddingRight))}if(l&&o!==\\\"horizontal\\\"){let i=kE(e,t,\\\"top\\\"),u=pm(e),c=pm(t);i-c.scrollMarginTop<e.scrollTop+u.scrollPaddingTop?r=i-c.scrollMarginTop-u.scrollPaddingTop:i+t.offsetHeight+c.scrollMarginBottom>e.scrollTop+e.clientHeight-u.scrollPaddingBottom&&(r=i+t.offsetHeight+c.scrollMarginBottom-e.clientHeight+u.scrollPaddingBottom)}e.scrollTo({left:n,top:r,behavior:\\\"auto\\\"})}function kE(e,t,a){let o=a===\\\"left\\\"?\\\"offsetLeft\\\":\\\"offsetTop\\\",n=0;for(;t.offsetParent&&(n+=t[o],t.offsetParent!==e);)t=t.offsetParent;return n}function pm(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function Sm(e){return e===\\\"starting\\\"?hT:Me}var EE=S(D(),1),ME=Cm.forwardRef(function(t,a){let{render:o,className:n,style:r,finalFocus:s,...l}=t,{store:i}=at(),{side:u,align:c}=ta(),f=dm(!0)!=null,d=i.useState(\\\"open\\\"),p=i.useState(\\\"transitionStatus\\\"),x=i.useState(\\\"popupProps\\\"),b=i.useState(\\\"mounted\\\"),C=i.useState(\\\"instantType\\\"),g=i.useState(\\\"activeTriggerElement\\\"),m=i.useState(\\\"parent\\\"),h=i.useState(\\\"lastOpenChangeReason\\\"),y=i.useState(\\\"rootId\\\"),v=i.useState(\\\"floatingRootContext\\\"),R=i.useState(\\\"floatingTreeRoot\\\"),I=i.useState(\\\"closeDelay\\\"),L=i.useState(\\\"hoverEnabled\\\"),k=i.useState(\\\"disabled\\\"),w=i.useState(\\\"openMethod\\\"),A=m.type===\\\"context-menu\\\";$o({open:d,ref:i.context.popupRef,onComplete(){d&&i.context.onOpenChangeComplete?.(!0)}}),Cm.useEffect(()=>{function _(q){i.setOpen(!1,ce(q.reason,q.domEvent))}return R.events.on(\\\"close\\\",_),()=>{R.events.off(\\\"close\\\",_)}},[R.events,i]),Qy(v,{enabled:L&&!k&&!A&&m.type!==\\\"menubar\\\",closeDelay:I});let P=i.useStateSetter(\\\"popupElement\\\"),U={transitionStatus:p,side:u,align:c,open:d,nested:m.type===\\\"menu\\\",instant:C},O=le(\\\"div\\\",t,{state:U,ref:[a,i.context.popupRef,P],stateAttributesMapping:oi,props:[x,{onKeyDown(_){f&&bi.has(_.key)&&_.stopPropagation()}},Sm(p),l,{\\\"data-rootownerid\\\":y}]}),M=m.type===void 0||A;return(g||m.type===\\\"menubar\\\"&&h!==j.outsidePress)&&(M=!0),(0,EE.jsx)(xc,{context:v,openInteractionType:w,modal:A,disabled:!b,returnFocus:s===void 0?M:s,initialFocus:m.type!==\\\"menu\\\",restoreFocus:!0,externalTree:m.type!==\\\"menubar\\\"?R:void 0,previousFocusableElement:g,nextFocusableElement:m.type===void 0?i.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:m.type===void 0?i.context.beforeContentFocusGuardRef:void 0,children:O})});var DE=S(T(),1);var Lm=S(T(),1),nS=Lm.createContext(void 0);function AE(){let e=Lm.useContext(nS);if(e===void 0)throw new Error(Pe(32));return e}var rS=S(D(),1),OE=DE.forwardRef(function(t,a){let{keepMounted:o=!1,...n}=t,{store:r}=at();return r.useState(\\\"mounted\\\")||o?(0,rS.jsx)(nS.Provider,{value:o,children:(0,rS.jsx)(mc,{ref:a,...n})}):null});var tn=S(T(),1);function yi(e){return Kl(19)?e:e?\\\"true\\\":void 0}var ja=S(T(),1);var Rm=S(T(),1),FU=Rm.createContext(void 0);function en(){return Rm.useContext(FU)?.direction??\\\"ltr\\\"}var _U=e=>({name:\\\"arrow\\\",options:e,async fn(t){let{x:a,y:o,placement:n,rects:r,platform:s,elements:l,middlewareData:i}=t,{element:u,padding:c=0,offsetParent:f=\\\"real\\\"}=Zo(e,t)||{};if(u==null)return{};let d=Op(c),p={x:a,y:o},x=dc(n),b=fc(x),C=await s.getDimensions(u),g=x===\\\"y\\\",m=g?\\\"top\\\":\\\"left\\\",h=g?\\\"bottom\\\":\\\"right\\\",y=g?\\\"clientHeight\\\":\\\"clientWidth\\\",v=r.reference[b]+r.reference[x]-p[x]-r.floating[b],R=p[x]-r.reference[x],I=f===\\\"real\\\"?await s.getOffsetParent?.(u):l.floating,L=l.floating[y]||r.floating[b];(!L||!await s.isElement?.(I))&&(L=l.floating[y]||r.floating[b]);let k=v/2-R/2,w=L/2-C[b]/2-1,A=Math.min(d[m],w),P=Math.min(d[h],w),U=A,O=L-C[b]-P,M=L/2-C[b]/2+k,_=Ap(U,M,O),q=!i.arrow&&Eo(n)!=null&&M!==_&&r.reference[b]/2-(M<U?A:P)-C[b]/2<0,E=q?M<U?M-U:M-O:0;return{[x]:p[x]+E,data:{[x]:_,centerOffset:M-_-E,...q&&{alignmentOffset:E}},reset:q}}}),PE=(e,t)=>({..._U(e),options:[e,t]});var NE={name:\\\"hide\\\",async fn(e){let{width:t,height:a,x:o,y:n}=e.rects.reference,r=t===0&&a===0&&o===0&&n===0,s=await e.platform.detectOverflow(e,{elementContext:\\\"reference\\\"});return{data:{referenceHidden:s.top-a>=0||s.right-t>=0||s.bottom-a>=0||s.left-t>=0||r}}}};var Si={sideX:\\\"left\\\",sideY:\\\"top\\\"};var BE=\\\"--available-width\\\",FE=\\\"--available-height\\\";function HE(e,t,a){let o=e===\\\"inline-start\\\"||e===\\\"inline-end\\\";return{top:\\\"top\\\",right:o?a?\\\"inline-start\\\":\\\"inline-end\\\":\\\"right\\\",bottom:\\\"bottom\\\",left:o?a?\\\"inline-end\\\":\\\"inline-start\\\":\\\"left\\\"}[t]}function _E(e,t,a){let{rects:o,placement:n}=e;return{side:HE(t,oa(n),a),align:Eo(n)||\\\"center\\\",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function zE(e){return UU(e,RE)}function UU(e,t){let{anchor:a,positionMethod:o=\\\"absolute\\\",side:n=\\\"bottom\\\",sideOffset:r=0,align:s=\\\"center\\\",alignOffset:l=0,collisionBoundary:i,collisionPadding:u=5,sticky:c=!1,arrowPadding:f=5,disableAnchorTracking:d=!1,inline:p,keepMounted:x=!1,floatingRootContext:b,mounted:C,collisionAvoidance:g,shift:m,nodeId:h,adaptiveOrigin:y,lazyFlip:v=!1,externalTree:R}=e,[I,L]=ja.useState(null);!C&&I!==null&&L(null);let k=g.side||\\\"flip\\\",w=g.align||\\\"flip\\\",A=g.fallbackAxisSide||\\\"end\\\",P=m?.crossAxis??!1,U=m?.rootBoundary,O=typeof a==\\\"function\\\"?a:void 0,M=K(O),_=O?M:a,q=bt(a),E=bt(C),B=en()===\\\"rtl\\\",ae=I||{top:\\\"top\\\",right:\\\"right\\\",bottom:\\\"bottom\\\",left:\\\"left\\\",\\\"inline-end\\\":B?\\\"left\\\":\\\"right\\\",\\\"inline-start\\\":B?\\\"right\\\":\\\"left\\\"}[n],X=s===\\\"center\\\"?ae:`${ae}-${s}`,Q=u;typeof Q==\\\"number\\\"?Q={top:Q,right:Q,bottom:Q,left:Q}:Q&&(Q={top:Q.top||0,right:Q.right||0,bottom:Q.bottom||0,left:Q.left||0});let $=1,ee=n===\\\"bottom\\\"?$:0,J=n===\\\"top\\\"?$:0,Ce=n===\\\"right\\\"?$:0,Y=n===\\\"left\\\"?$:0,W={boundary:i===\\\"clipping-ancestors\\\"?\\\"clippingAncestors\\\":i,padding:Q},me=ja.useRef(null),ge=bt(r),oe=bt(l),he=typeof r!=\\\"function\\\"?r:0,pe=typeof l!=\\\"function\\\"?l:0,Le=[];p&&Le.push(p),Le.push(Ny(je=>{let Za=_E(je,n,B),Ao=typeof ge.current==\\\"function\\\"?ge.current(Za):ge.current,Aa=typeof oe.current==\\\"function\\\"?oe.current(Za):oe.current;return{mainAxis:Ao,crossAxis:Aa,alignmentAxis:Aa}},[he,pe,B,n]));let ve=w===\\\"none\\\"&&k!==\\\"shift\\\",ue=!ve&&(c||P||k===\\\"shift\\\"),Te=k===\\\"none\\\"?null:_y({...W,padding:{top:Q.top+$+ee,right:Q.right+$+Y,bottom:Q.bottom+$+J,left:Q.left+$+Ce},mainAxis:!P&&k===\\\"flip\\\",crossAxis:w===\\\"flip\\\"?\\\"alignment\\\":!1,fallbackAxisSideDirection:A}),re=ve?null:By({...W,rootBoundary:U,mainAxis:w!==\\\"none\\\",crossAxis:ue,limiter:c||P?void 0:Fy(je=>{if(!me.current)return{};let{width:Za,height:Ao}=me.current.getBoundingClientRect(),Aa=Ma(oa(je.placement)),un=Aa===\\\"y\\\"?Za:Ao,Do=Aa===\\\"y\\\"?Q.left+Q.right:Q.top+Q.bottom;return{offset:un/2+Do/2}})},[W,c,P,U,Q,w]);k===\\\"shift\\\"||w===\\\"shift\\\"||s===\\\"center\\\"?Le.push(re,Te):Le.push(Te,re),Le.push(Uy({...W,apply({elements:{floating:je},availableWidth:Za,availableHeight:Ao,rects:Aa}){if(!E.current)return;let un=je.style;un.setProperty(BE,`${Za}px`),un.setProperty(FE,`${Ao}px`);let Do=Ge(je).devicePixelRatio||1,{x:Ei,y:Gc,width:Xc,height:vg}=Aa.reference,Ig=(Math.round((Ei+Xc)*Do)-Math.round(Ei*Do))/Do,wg=(Math.round((Gc+vg)*Do)-Math.round(Gc*Do))/Do;un.setProperty(\\\"--anchor-width\\\",`${Ig}px`),un.setProperty(\\\"--anchor-height\\\",`${wg}px`)}}),PE(je=>({element:me.current||ye(je.elements.floating).createElement(\\\"div\\\"),padding:f,offsetParent:\\\"floating\\\"}),[f]),{name:\\\"transformOrigin\\\",fn(je){let{elements:Za,middlewareData:Ao,placement:Aa,rects:un,y:Do}=je,Ei=oa(Aa),Gc=Ma(Ei),Xc=me.current,vg=Ao.arrow?.x||0,Ig=Ao.arrow?.y||0,wg=Xc?.clientWidth||0,tD=Xc?.clientHeight||0,kg=vg+wg/2,GS=Ig+tD/2,aD=Math.abs(Ao.shift?.y||0),oD=un.reference.height/2,Mi=typeof r==\\\"function\\\"?r(_E(je,n,B)):r,nD=aD>Mi,rD={top:`${kg}px calc(100% + ${Mi}px)`,bottom:`${kg}px ${-Mi}px`,left:`calc(100% + ${Mi}px) ${GS}px`,right:`${-Mi}px ${GS}px`}[Ei],sD=`${kg}px ${un.reference.y+oD-Do}px`;return Za.floating.style.setProperty(\\\"--transform-origin\\\",ue&&Gc===\\\"y\\\"&&nD?sD:rD),{}}},NE,y),G(()=>{!C&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[C,b]);let fe=ja.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<\\\"u\\\",layoutShift:!d&&typeof IntersectionObserver<\\\"u\\\"}),[d]),{refs:de,elements:Re,x:St,y:F,middlewareData:V,update:Ae,placement:Z,context:H,isPositioned:be,floatingStyles:it}=t({rootContext:b,open:x?C:void 0,placement:X,middleware:Le,strategy:o,whileElementsMounted:x?void 0:(...je)=>Sc(...je,fe),nodeId:h,externalTree:R}),{sideX:_t,sideY:$a}=V.adaptiveOrigin||Si,Wa=be?o:\\\"fixed\\\",el=ja.useMemo(()=>{let je;return be?y?je={position:Wa,[_t]:St,[$a]:F}:je={...it,position:Wa}:je={position:Wa,top:0,left:0},je[BE]=\\\"100vw\\\",je[FE]=\\\"100vh\\\",be||(je.opacity=0),je},[y,Wa,_t,St,$a,F,it,be]),ln=ja.useRef(null);G(()=>{if(!C)return;let je=q.current,Za=typeof je==\\\"function\\\"?je():je,Aa=(UE(Za)?Za.current:Za)||null||null;Aa!==ln.current&&(de.setPositionReference(Aa),ln.current=Aa)},[C,de,_,q]),ja.useEffect(()=>{if(!C)return;let je=q.current;typeof je!=\\\"function\\\"&&UE(je)&&je.current!==ln.current&&(de.setPositionReference(je.current),ln.current=je.current)},[C,de,_,q]),ja.useEffect(()=>{if(x&&C&&Re.reference&&Re.floating)return Sc(Re.reference,Re.floating,Ae,fe)},[x,C,Re,Ae,fe]);let Xn=oa(Z),Hc=HE(n,Xn,B),zc=Eo(Z)||\\\"center\\\",qc=!!V.hide?.referenceHidden;G(()=>{v&&C&&be&&Xn!==ae&&L(Xn)},[v,C,be,Xn,ae]);let Vc=ja.useMemo(()=>({position:\\\"absolute\\\",top:V.arrow?.y,left:V.arrow?.x}),[V.arrow]),VS=V.arrow?.centerOffset!==0;return ja.useMemo(()=>({positionerStyles:el,arrowStyles:Vc,arrowRef:me,arrowUncentered:VS,side:Hc,align:zc,physicalSide:Xn,anchorHidden:qc,refs:de,context:H,isPositioned:be,update:Ae}),[el,Vc,me,VS,Hc,zc,Xn,qc,de,H,be,Ae])}function UE(e){return e!=null&&\\\"current\\\"in e}var qn=S(T(),1);var qE=S(D(),1);function vm(e){let{children:t,elementsRef:a,labelsRef:o,onMapChange:n}=e,r=K(n),[,s]=qn.useState(!1),l=tt(zU).current,i=tt(HU).current,u=qn.useRef(0),c=qn.useRef(!0),f=qn.useRef([]),d=qn.useRef(null),p=K(()=>{c.current||(c.current=!0,s(v=>!v))}),x=K((v,R)=>{i.set(v,R),p()}),b=K(v=>{i.delete(v),p()}),C=K(v=>{let R=new Map;return a.current.length=0,o&&(o.current.length=0),v.forEach(I=>{R.set(I.element,{...I.registration.metadata??{},index:I.index}),a.current[I.index]=I.element,o&&(o.current[I.index]=I.registration.label!==void 0?I.registration.label:I.registration.textRef?.current?.textContent??I.element.textContent)}),u.current=a.current.length,R});function g(v){if(d.current?.disconnect(),d.current=null,typeof MutationObserver!=\\\"function\\\"||v.length<2)return;let R=new MutationObserver(L=>{if(!GU(L))return;let k=null;for(let w of v)if(w.isConnected){if(k&&VE(k,w)>0){R.disconnect(),p();return}k=w}});d.current=R;let I=new Set;for(let L=1;L<v.length;L+=1){let k=VU(v[L-1],v[L]);k&&I.add(k)}I.forEach(L=>R.observe(L,{childList:!0}))}let m=K(()=>{let[v,R]=qU(i),I=C(v);g(R),f.current=v,c.current=!1,l.forEach(L=>L(I)),r(I)});G(()=>(c.current||C(f.current),()=>{a.current=[],o&&(o.current=[])}),[a,o,C]),G(()=>{c.current&&m()}),G(()=>()=>{d.current?.disconnect(),c.current=!0},[]);let h=K(v=>(l.add(v),()=>{l.delete(v)})),y=qn.useMemo(()=>({register:x,unregister:b,subscribeMapChange:h,nextIndexRef:u}),[x,b,h,u]);return(0,qE.jsx)(iy.Provider,{value:y,children:t})}function HU(){return new Map}function zU(){return new Set}function qU(e){let t=new Set,a=[],o=[];e.forEach((r,s)=>{if(!s.isConnected)return;let l=r.index,i={index:l??-1,element:s,registration:r};l===null?o.push(i):l>=0&&(t.add(l),a.push(i))});let n=0;return o.sort((r,s)=>VE(r.element,s.element)),o.forEach(r=>{for(;t.has(n);)n+=1;r.index=n,a.push(r),n+=1}),t.size>0&&a.sort((r,s)=>r.index-s.index),[a,o.map(r=>r.element)]}function VU(e,t){let a=e.parentElement;for(;a&&!a.contains(t);)a=a.parentElement;return a}function GU(e){for(let t of e)for(let a=0;a<t.removedNodes.length;a+=1)if(t.removedNodes[a].isConnected)return!0;return!1}function VE(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var GE=S(T(),1),XE=S(D(),1),Im=GE.forwardRef(function(t,a){let{cutout:o,...n}=t,r;if(o){let s=o.getBoundingClientRect();r=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${s.left}px ${s.top}px,${s.left}px ${s.bottom}px,${s.right}px ${s.bottom}px,${s.right}px ${s.top}px,${s.left}px ${s.top}px)`}return(0,XE.jsx)(\\\"div\\\",{ref:a,role:\\\"presentation\\\",\\\"data-base-ui-inert\\\":\\\"\\\",...n,style:{position:\\\"fixed\\\",inset:0,userSelect:\\\"none\\\",WebkitUserSelect:\\\"none\\\",clipPath:r}})});function jE(e,t,{styles:a,transitionStatus:o,props:n,refs:r,hidden:s,inert:l=!1}){let i={...a};return l&&(i.pointerEvents=\\\"none\\\"),le(\\\"div\\\",e,{state:t,ref:r,props:[{role:\\\"presentation\\\",hidden:s,style:i},Sm(o),n],stateAttributesMapping:Es})}var ZE=S(T(),1);var YE={},KE={},$E=\\\"\\\";function wm(e,t){return Ds(e)?e:t}function WE(e,t,a){return/hidden|clip/.test(e.getComputedStyle(wm(t,a)).overflowY)}function XU(e){if(typeof document>\\\"u\\\")return!1;let t=ye(e);return Ge(t).innerWidth-t.documentElement.clientWidth>0}function jU(e){if(!(typeof CSS<\\\"u\\\"&&CSS.supports&&CSS.supports(\\\"scrollbar-gutter\\\",\\\"stable\\\"))||typeof document>\\\"u\\\")return!1;let a=ye(e),o=a.documentElement,n=a.body,r=wm(o,n),s=r.style.overflowY,l=o.style.scrollbarGutter;o.style.scrollbarGutter=\\\"stable\\\",r.style.overflowY=\\\"scroll\\\";let i=r.offsetWidth;r.style.overflowY=\\\"hidden\\\";let u=r.offsetWidth;return r.style.overflowY=s,o.style.scrollbarGutter=l,i===u}function YU(e){let t=ye(e),a=t.documentElement,o=t.body,n=wm(a,o),r={overflowY:n.style.overflowY,overflowX:n.style.overflowX};return Object.assign(n.style,{overflowY:\\\"hidden\\\",overflowX:\\\"hidden\\\"}),()=>{Object.assign(n.style,r)}}function KU(e){let t=ye(e),a=t.documentElement,o=t.body,n=Ge(a),r=0,s=0,l=!1,i=mo.create();if(Xe.engine.webkit&&(n.visualViewport?.scale??1)!==1)return()=>{};function u(){let p=n.getComputedStyle(a),x=n.getComputedStyle(o),g=(p.scrollbarGutter||\\\"\\\").includes(\\\"both-edges\\\")?\\\"stable both-edges\\\":\\\"stable\\\";r=a.scrollTop,s=a.scrollLeft,YE={scrollbarGutter:a.style.scrollbarGutter,overflowY:a.style.overflowY,overflowX:a.style.overflowX},$E=a.style.scrollBehavior,KE={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};let m=a.scrollHeight>a.clientHeight,h=a.scrollWidth>a.clientWidth,y=p.overflowY===\\\"scroll\\\"||x.overflowY===\\\"scroll\\\",v=p.overflowX===\\\"scroll\\\"||x.overflowX===\\\"scroll\\\",R=Math.max(0,n.innerWidth-o.clientWidth),I=Math.max(0,n.innerHeight-o.clientHeight),L=parseFloat(x.marginTop)+parseFloat(x.marginBottom),k=parseFloat(x.marginLeft)+parseFloat(x.marginRight),w=wm(a,o);if(l=jU(e),l){a.style.scrollbarGutter=g,w.style.overflowY=\\\"hidden\\\",w.style.overflowX=\\\"hidden\\\";return}Object.assign(a.style,{scrollbarGutter:g,overflowY:\\\"hidden\\\",overflowX:\\\"hidden\\\"}),(m||y)&&(a.style.overflowY=\\\"scroll\\\"),(h||v)&&(a.style.overflowX=\\\"scroll\\\"),Object.assign(o.style,{position:\\\"relative\\\",height:L||I?`calc(100dvh - ${L+I}px)`:\\\"100dvh\\\",width:k||R?`calc(100vw - ${k+R}px)`:\\\"100vw\\\",boxSizing:\\\"border-box\\\",overflowY:\\\"hidden\\\",overflowX:\\\"hidden\\\",scrollBehavior:\\\"unset\\\"}),o.scrollTop=r,o.scrollLeft=s,a.setAttribute(\\\"data-base-ui-scroll-locked\\\",\\\"\\\"),a.style.scrollBehavior=\\\"unset\\\"}function c(){Object.assign(a.style,YE),Object.assign(o.style,KE),l||(a.scrollTop=r,a.scrollLeft=s,a.removeAttribute(\\\"data-base-ui-scroll-locked\\\"),a.style.scrollBehavior=$E)}function f(){c(),i.request(u)}u();let d=we(n,\\\"resize\\\",f);return()=>{i.cancel(),c(),typeof n.removeEventListener==\\\"function\\\"&&d()}}var sS=class{lockCount=0;restore=null;timeoutLock=Ta.create();timeoutUnlock=Ta.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;let a=ye(t),o=a.documentElement,n=a.body,r=Ge(o);if(WE(r,o,n)){let l=new r.MutationObserver(()=>{WE(r,o,n)||(l.disconnect(),this.restore=null,this.lock(t))}),i={attributes:!0};l.observe(o,i),l.observe(n,i),this.restore=()=>l.disconnect();return}let s=Xe.os.ios||!XU(t);this.restore=s?YU(t):KU(t)}},$U=new sS;function km(e=!0,t=null){G(()=>{if(e)return $U.acquire(t)},[e,t])}var WU=20;function QE(e,t,a,o){let[n,r]=ZE.useState(!1);G(()=>{if(!e||!t||a==null){r(!1);return}let s=ye(a).documentElement.clientWidth,l=a.offsetWidth;r(s>0&&l>0&&l>=s-WU)},[e,t,a]),km(e&&(!t||n),o)}var Ci=S(D(),1),JE=tn.forwardRef(function(t,a){let{anchor:o,positionMethod:n=\\\"absolute\\\",className:r,render:s,side:l,align:i,sideOffset:u=0,alignOffset:c=0,collisionBoundary:f=\\\"clipping-ancestors\\\",collisionPadding:d=5,arrowPadding:p=5,sticky:x=!1,disableAnchorTracking:b=!1,collisionAvoidance:C=xT,style:g,...m}=t,{store:h}=at(),y=AE(),v=Er(!0),R=h.useState(\\\"parent\\\"),I=h.useState(\\\"floatingRootContext\\\"),L=h.useState(\\\"floatingTreeRoot\\\"),k=h.useState(\\\"mounted\\\"),w=h.useState(\\\"open\\\"),A=h.useState(\\\"modal\\\"),P=h.useState(\\\"openMethod\\\"),U=h.useState(\\\"activeTriggerElement\\\"),O=h.useState(\\\"transitionStatus\\\"),M=h.useState(\\\"positionerElement\\\"),_=h.useState(\\\"instantType\\\"),q=h.useState(\\\"adaptiveOrigin\\\"),E=h.useState(\\\"lastOpenChangeReason\\\"),N=h.useState(\\\"floatingNodeId\\\"),B=h.useState(\\\"floatingParentNodeId\\\"),ae=I.useState(\\\"domReferenceElement\\\"),X=tn.useRef(null),Q=Nr(M),$=o,ee=u,J=c,Ce=i,Y=C;R.type===\\\"context-menu\\\"&&($=o??R.context?.anchor,Ce=Ce??\\\"start\\\",!l&&Ce!==\\\"center\\\"&&(J=t.alignOffset??2,ee=t.sideOffset??-5));let W=l,me=Ce;R.type===\\\"menu\\\"?(W=W??\\\"inline-end\\\",me=me??\\\"start\\\",Y=t.collisionAvoidance??bT):R.type===\\\"menubar\\\"&&(W=W??(R.context.orientation===\\\"vertical\\\"?\\\"inline-end\\\":\\\"bottom\\\"),me=me??\\\"start\\\");let ge=R.type===\\\"context-menu\\\",oe=zE({anchor:$,floatingRootContext:I,positionMethod:v?\\\"fixed\\\":n,mounted:k,side:W,sideOffset:ee,align:me,alignOffset:J,arrowPadding:ge?0:p,collisionBoundary:f,collisionPadding:d,sticky:x,nodeId:N,keepMounted:y,disableAnchorTracking:b,collisionAvoidance:Y,shift:ge?{crossAxis:!(\\\"side\\\"in Y&&Y.side===\\\"flip\\\"),rootBoundary:\\\"layoutViewport\\\"}:void 0,externalTree:L,adaptiveOrigin:q});tn.useEffect(()=>{function fe(de){de.open&&(de.parentNodeId===N&&h.set(\\\"hoverEnabled\\\",!1),de.nodeId!==N&&de.parentNodeId===h.select(\\\"floatingParentNodeId\\\")&&h.setOpen(!1,ce(j.siblingOpen)))}return L.events.on(\\\"menuopenchange\\\",fe),()=>{L.events.off(\\\"menuopenchange\\\",fe)}},[h,L.events,N]),tn.useEffect(()=>{if(h.select(\\\"floatingParentNodeId\\\")==null)return;function fe(de){if(de.open||de.nodeId!==h.select(\\\"floatingParentNodeId\\\"))return;let Re=de.reason??j.siblingOpen;h.setOpen(!1,ce(Re))}return L.events.on(\\\"menuopenchange\\\",fe),()=>{L.events.off(\\\"menuopenchange\\\",fe)}},[L.events,h]);let he=Rt();tn.useEffect(()=>{w||he.clear()},[w,he]),tn.useEffect(()=>{function fe(de){if(!(!w||de.nodeId!==h.select(\\\"floatingParentNodeId\\\")))if(de.target&&U&&U!==de.target){let Re=h.select(\\\"closeDelay\\\");Re>0?he.isStarted()||he.start(Re,()=>{h.setOpen(!1,ce(j.siblingOpen))}):h.setOpen(!1,ce(j.siblingOpen))}else he.clear()}return L.events.on(\\\"itemhover\\\",fe),()=>{L.events.off(\\\"itemhover\\\",fe)}},[L.events,w,U,h,he]),tn.useEffect(()=>{let fe={open:w,nodeId:N,parentNodeId:B,reason:h.select(\\\"lastOpenChangeReason\\\")};L.events.emit(\\\"menuopenchange\\\",fe)},[L.events,w,h,N,B]),G(()=>{let fe=ae,de=X.current;if(fe&&(X.current=fe),de&&fe&&fe!==de){h.set(\\\"instantType\\\",void 0);let Re=new AbortController;return Q(()=>{h.set(\\\"instantType\\\",\\\"trigger-change\\\")},Re.signal),()=>{Re.abort()}}},[ae,Q,h]);let pe={open:w,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,nested:R.type===\\\"menu\\\",instant:_},Le=R.type===\\\"menubar\\\"&&R.context.modal,ve=A&&E!==j.triggerHover;QE(w&&(Le||ve),P===\\\"touch\\\",M,U);let ue=jE(t,pe,{styles:oe.positionerStyles,transitionStatus:O,props:m,refs:[a,h.useStateSetter(\\\"positionerElement\\\")],hidden:!k,inert:!w}),Te=k&&R.type!==\\\"menu\\\"&&(R.type!==\\\"menubar\\\"&&A&&E!==j.triggerHover||R.type===\\\"menubar\\\"&&R.context.modal),re=null;return R.type===\\\"menubar\\\"?re=R.context.contentElement:R.type===void 0&&(re=U),(0,Ci.jsxs)(jb.Provider,{value:oe,children:[Te&&(0,Ci.jsx)(Im,{ref:R.type===\\\"context-menu\\\"||R.type===\\\"nested-context-menu\\\"?R.context.internalBackdropRef:null,inert:yi(!w),cutout:re}),(0,Ci.jsx)(Ty,{id:N,children:(0,Ci.jsx)(vm,{elementsRef:h.context.itemDomElements,labelsRef:h.context.itemLabels,children:ue})})]})});var Xr=S(T(),1);var Tm=S(T(),1),lS=Tm.createContext(void 0);function eM(){let e=Tm.useContext(lS);if(e===void 0)throw new Error(Pe(34));return e}var iS=S(D(),1),tM=Xr.memo(Xr.forwardRef(function(t,a){let{render:o,className:n,value:r,defaultValue:s,onValueChange:l,disabled:i=!1,style:u,\\\"aria-labelledby\\\":c,...f}=t,[d,p]=Xr.useState(void 0),[x,b]=jo({controlled:r,default:s,name:\\\"MenuRadioGroup\\\"}),C=K((y,v)=>{l?.(y,v),!v.isCanceled&&b(y)}),m=le(\\\"div\\\",t,{state:{disabled:i},ref:a,props:{role:\\\"group\\\",\\\"aria-labelledby\\\":c??d,\\\"aria-disabled\\\":i||void 0,...f}}),h=Xr.useMemo(()=>({value:x,setValue:C,disabled:i}),[x,C,i]);return(0,iS.jsx)(tc.Provider,{value:p,children:(0,iS.jsx)(lS.Provider,{value:h,children:m})})}));var Mm=S(T(),1);var Em=S(T(),1),uS=Em.createContext(void 0);function aM(){let e=Em.useContext(uS);if(e===void 0)throw new Error(Pe(35));return e}var oM=S(D(),1),nM=Mm.forwardRef(function(t,a){let{render:o,className:n,id:r,label:s,nativeButton:l=!1,disabled:i=!1,closeOnClick:u=!1,value:c,style:f,...d}=t,p=po({guess:!0,label:s}),x=ta(!0),b=ot(r),{store:C}=at(),g=C.useState(\\\"isActive\\\",p.index),m=C.useState(\\\"itemProps\\\"),{value:h,setValue:y,disabled:v}=eM(),R=C.useState(\\\"disabled\\\"),I=i||v||R,L=h===c,{getItemProps:k,itemRef:w}=Or({closeOnClick:u,disabled:I,highlighted:g,id:b,store:C,nativeButton:l,nodeId:x?.context.nodeId,itemMetadata:Dr}),A=Mm.useMemo(()=>({disabled:I,highlighted:g,checked:L}),[I,g,L]);function P(O){let M=ce(j.itemPress,O.nativeEvent,void 0,{preventUnmountOnClose:Fe});y(c,M)}let U=le(\\\"div\\\",t,{state:A,stateAttributesMapping:Pr,props:[m,{role:\\\"menuitemradio\\\",\\\"aria-checked\\\":L,onClick:P},d,k],ref:[w,a,p.ref]});return(0,oM.jsx)(uS.Provider,{value:A,children:U})});var Am=S(T(),1);var rM=Am.forwardRef(function(t,a){let{render:o,className:n,style:r,keepMounted:s=!1,...l}=t,i=aM(),u=Am.useRef(null),{transitionStatus:c,mounted:f,setMounted:d}=ii(i.checked);$o({open:i.checked,ref:u,onComplete(){i.checked||d(!1)}});let p={checked:i.checked,disabled:i.disabled,highlighted:i.highlighted,transitionStatus:c};return le(\\\"span\\\",t,{state:p,stateAttributesMapping:Pr,ref:[a,u],props:{\\\"aria-hidden\\\":!0,...l},enabled:s||f})});var Dt=S(T(),1);var Dm=S(T(),1),ZU=Dm.createContext(null);function Om(e){let t=Dm.useContext(ZU);if(t===null&&!e)throw new Error(Pe(5));return t}var wc=S(T(),1);var Ic=S(T(),1);function sM(e){let t=Ic.useRef(\\\"\\\"),a=Ic.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Ic.useCallback(n=>{if(n.detail===0){e(n,\\\"keyboard\\\");return}\\\"pointerType\\\"in n?e(n,n.pointerType):e(n,t.current),t.current=\\\"\\\"},[e]),onPointerDown:a}}var lM=S(T(),1);function Pm(e,t){let a=lM.useRef(e),o=K(t);G(()=>{a.current!==e&&o(a.current),a.current=e},[e,o])}function cS(e,t){let a=K((r,s)=>{(typeof e==\\\"function\\\"?e():e)||t(s||(Xe.os.ios?\\\"touch\\\":\\\"\\\"))}),{onClick:o,onPointerDown:n}=sM(a);return wc.useMemo(()=>({onClick:o,onPointerDown:n}),[o,n])}function iM(e){let[t,a]=wc.useState(null),o=cS(e,a);return Pm(e,n=>{n&&!e&&a(null)}),wc.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}var kc=S(T(),1);var Li=class extends Qo{setState(t){}update(t){}set(t,a){}notifyAll(){}};var uM={...tm,disabled:e=>e.parent.type===\\\"menubar\\\"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===\\\"context-menu\\\")&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===\\\"menu\\\"?e.parent.store.select(\\\"rootId\\\"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===\\\"menu\\\"?e.parent.store.select(\\\"floatingTreeRoot\\\"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===\\\"menu\\\")return e.parent.store.select(\\\"keyboardEventRelay\\\")}},Nm=class extends Qo{constructor(t){super({...dM(),...t},fM(),uM),this.unsubscribeParentListener=this.observe(\\\"parent\\\",a=>{if(this.unsubscribeParentListener?.(),a.type===\\\"menu\\\"){let o=a.store.select(\\\"rootId\\\"),n=a.store.select(\\\"floatingTreeRoot\\\"),r=a.store.select(\\\"keyboardEventRelay\\\");this.unsubscribeParentListener=a.store.subscribe(()=>{let s=a.store.select(\\\"rootId\\\"),l=a.store.select(\\\"floatingTreeRoot\\\"),i=a.store.select(\\\"keyboardEventRelay\\\");o===s&&n===l&&r===i||(o=s,n=l,r=i,this.notifyAll())}),this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;return}a.type!==void 0&&(this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,a){this.state.floatingRootContext.context.events.emit(\\\"setOpen\\\",{open:t,eventDetails:a})}unsubscribeParentListener=null};function cM(){let e=new Li(Object.freeze(dM()),Object.freeze(fM()),uM);return Object.assign(e,{setOpen:Fe})}function fM(){return{positionerRef:kc.createRef(),popupRef:kc.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:kc.createRef(),beforeContentFocusGuardRef:kc.createRef(),onOpenChangeComplete:void 0,triggerElements:new zn}}function dM(){return{...em(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Hr,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Me,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}var Bm=S(T(),1),fS=Bm.createContext(void 0);function Fm(){return Bm.useContext(fS)}var Tc=S(D(),1),_m=Vy(function(t){let{children:a,open:o,onOpenChange:n,onOpenChangeComplete:r,defaultOpen:s=!1,disabled:l=!1,modal:i,loopFocus:u=!0,orientation:c=\\\"vertical\\\",actionsRef:f,closeParentOnEsc:d=!1,handle:p,triggerId:x,defaultTriggerId:b=null,highlightItemOnHover:C=!0}=t,g=Er(!0),m=at(!0),h=Om(!0),y=Fm(),v=Dt.useMemo(()=>y&&m?{type:\\\"menu\\\",store:m.store}:h?{type:\\\"menubar\\\",context:h}:g&&!m?{type:\\\"context-menu\\\",context:g}:{type:void 0},[g,m,h,y]),R=QU({open:s,openProp:o,activeTriggerId:b,triggerIdProp:x,parent:v});R.useControlledProp(\\\"openProp\\\",o),R.useControlledProp(\\\"triggerIdProp\\\",x),R.useContextCallback(\\\"onOpenChangeComplete\\\",r);let I=wo(),L=wo(),k=R.useState(\\\"floatingTreeRoot\\\"),w=gc(k),A=Ga(),P=R.useState(\\\"open\\\"),U=R.useState(\\\"activeTriggerElement\\\"),O=R.useState(\\\"positionerElement\\\"),M=R.useState(\\\"hoverEnabled\\\"),_=R.useState(\\\"disabled\\\"),q=R.useState(\\\"lastOpenChangeReason\\\"),E=R.useState(\\\"parent\\\"),N=R.useState(\\\"activeIndex\\\"),B=R.useState(\\\"payload\\\"),ae=R.useState(\\\"floatingParentNodeId\\\"),X=Dt.useRef(null),Q=Dt.useRef(E.type!==\\\"context-menu\\\"),$=Rt(),ee=Dt.useRef(!0),J=Rt(),Ce=ae!=null,{openMethod:Y,triggerProps:W}=iM(P);R.useSyncedValues({disabled:l,highlightItemOnHover:C,modal:E.type===void 0?i:void 0,openMethod:Y,rootId:I}),Zp(R);let{forceUnmount:me}=Qp(P,R,()=>{R.set(\\\"allowMouseEnter\\\",!1)});G(()=>{g&&!m?R.update({parent:{type:\\\"context-menu\\\",context:g},floatingNodeId:w,floatingParentNodeId:A}):m&&R.update({floatingNodeId:w,floatingParentNodeId:A})},[g,m,w,A,R]),Dt.useEffect(()=>{if(P||(X.current=null),E.type===\\\"context-menu\\\"){if(!P){$.clear(),Q.current=!1;return}$.start(500,()=>{Q.current=!0})}},[$,P,E.type]),G(()=>{!P&&!M&&R.set(\\\"hoverEnabled\\\",!0)},[P,M,R]);let ge=K((H,be)=>{let it=be.reason;if(!H&&!R.select(\\\"open\\\")||P===H&&be.trigger===U&&q===it)return;let _t=hE(be);if(!H&&be.trigger==null&&(be.trigger=U??void 0),n?.(H,be),be.isCanceled)return;R.state.floatingRootContext.dispatchOpenChange(H,be);let $a=be.event;if(H===!1&&$a?.type===\\\"click\\\"&&$a.pointerType===\\\"touch\\\"&&!ee.current)return;H&&it===j.triggerFocus?(ee.current=!1,J.start(300,()=>{ee.current=!0})):(ee.current=!0,J.clear());let Wa=(it===j.triggerPress||it===j.itemPress)&&$a.detail===0,el=!H&&(it===j.escapeKey||it==null),ln={open:H,openChangeReason:it};X.current=be.event,$p(ln,H,be.trigger,_t()),R.update(ln),E.type===\\\"menubar\\\"&&(it===j.triggerFocus||it===j.focusOut||it===j.triggerHover||it===j.listNavigation||it===j.siblingOpen)?R.set(\\\"instantType\\\",\\\"group\\\"):Wa||el?R.set(\\\"instantType\\\",Wa?\\\"click\\\":\\\"dismiss\\\"):R.set(\\\"instantType\\\",void 0)}),oe=Cc({popupStore:R,floatingId:L,nested:A!=null,onOpenChange:ge}),he=oe.context.events;G(()=>{let H=({open:be,eventDetails:it})=>ge(be,it);return he.on(\\\"setOpen\\\",H),()=>{he?.off(\\\"setOpen\\\",H)}},[he,ge]);let pe=Dt.useCallback(()=>{R.setOpen(!1,ce(j.imperativeAction))},[R]);Dt.useImperativeHandle(f,()=>({unmount:me,close:pe}),[me,pe]);let Le;E.type===\\\"context-menu\\\"&&(Le=E.context),Dt.useImperativeHandle(Le?.positionerRef,()=>O,[O]),Dt.useImperativeHandle(Le?.actionsRef,()=>({setOpen:ge}),[ge]);let ve=yc(oe,{enabled:!_,bubbles:{escapeKey:d&&E.type===\\\"menu\\\"},outsidePress(){return E.type!==\\\"context-menu\\\"||X.current?.type===\\\"contextmenu\\\"?!0:Q.current},externalTree:Ce?k:void 0}),ue=en(),Te=Dt.useCallback(H=>{R.select(\\\"activeIndex\\\")!==H&&R.set(\\\"activeIndex\\\",H)},[R]),re=eS(oe,{enabled:!_,listRef:R.context.itemDomElements,activeIndex:N,nested:E.type!==void 0,loopFocus:u,orientation:c,parentOrientation:E.type===\\\"menubar\\\"?E.context.orientation:void 0,rtl:ue===\\\"rtl\\\",disabledIndices:Ia,onNavigate:Te,openOnArrowKeyDown:E.type!==\\\"context-menu\\\",externalTree:Ce?k:void 0,focusItemOnHover:C}),fe=Dt.useCallback(H=>{R.context.typingRef.current=H},[R]),de=tS(oe,{enabled:!_,listRef:R.context.itemLabels,elementsRef:R.context.itemDomElements,activeIndex:N,resetMs:500,onMatch:H=>{P&&H!==N&&R.set(\\\"activeIndex\\\",H)},onTyping:fe}),Re=Dt.useMemo(()=>{let H=da(de.reference,re.reference,ve.reference,{onMouseMove(){R.set(\\\"allowMouseEnter\\\",!0)}},W);return H[\\\"aria-haspopup\\\"]=\\\"menu\\\",H[\\\"aria-expanded\\\"]=P,H},[R,de.reference,re.reference,ve.reference,W,P]),St=Dt.useMemo(()=>{let H=da(re.trigger,ve.trigger,W);return H[\\\"aria-haspopup\\\"]=\\\"menu\\\",H[\\\"aria-expanded\\\"]=!1,H},[re.trigger,ve.trigger,W]),F=Dt.useMemo(()=>da(Yp,{id:L,role:\\\"menu\\\",\\\"aria-labelledby\\\":U?.id,onMouseMove(){R.set(\\\"allowMouseEnter\\\",!0),E.type===\\\"menu\\\"&&R.set(\\\"hoverEnabled\\\",!1)},onClick(){R.select(\\\"hoverEnabled\\\")&&R.set(\\\"hoverEnabled\\\",!1)},onKeyDown(H){let be=R.select(\\\"keyboardEventRelay\\\");be&&!H.isPropagationStopped()&&be(H)}},de.floating,re.floating,ve.floating),[U,L,E.type,R,de.floating,re.floating,ve.floating]),V=re.item??Me;Jp(R,{floatingRootContext:oe,activeTriggerProps:Re,inactiveTriggerProps:St,popupProps:F,itemProps:V});let Ae=Dt.useMemo(()=>({store:R,parent:v}),[R,v]),Z=(0,Tc.jsxs)(Yb.Provider,{value:Ae,children:[p&&(0,Tc.jsx)(Kp,{handle:p,store:R}),typeof a==\\\"function\\\"?a({payload:B}):a]});return E.type===void 0||E.type===\\\"context-menu\\\"?(0,Tc.jsx)(Ey,{externalTree:k,children:Z}):Z});function QU(e){return tt(()=>new Nm(e)).current}var pM=S(T(),1);var dS=S(D(),1);function mM(e){let t=at().store,a=pM.useMemo(()=>({parentMenu:t}),[t]);return(0,dS.jsx)(fS.Provider,{value:a,children:(0,dS.jsx)(_m,{...e})})}var la=S(T(),1);var Um=5;function gM(e,t){let a=JU(t);return e.clientX>=a.left-Um&&e.clientX<=a.right+Um&&e.clientY>=a.top-Um&&e.clientY<=a.bottom+Um}function JU(e){let t=e.getBoundingClientRect(),a=Ge(e);if(Xe.env.jsdom)return t;let o=a.getComputedStyle(e,\\\"::before\\\"),n=a.getComputedStyle(e,\\\"::after\\\");if(!(o.content!==\\\"none\\\"||n.content!==\\\"none\\\"))return t;let s=parseFloat(o.width)||0,l=parseFloat(o.height)||0,i=parseFloat(n.width)||0,u=parseFloat(n.height)||0,c=Math.max(t.width,s,i),f=Math.max(t.height,l,u),d=c-t.width,p=f-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-p/2,bottom:t.bottom+p/2}}var hM=S(T(),1);function xM(e={}){let{highlightItemOnHover:t,highlightedIndex:a,onHighlightedIndexChange:o}=ni(),{ref:n,index:r}=po(e),s=a===r,l=hM.useRef(null),i=va(n,l);return{compositeProps:{tabIndex:s?0:-1,onFocus(){o(r)},onMouseMove(){let c=l.current;if(!t||!c)return;let f=c.hasAttribute(\\\"disabled\\\")||c.ariaDisabled===\\\"true\\\";!s&&!f&&c.focus()}},compositeRef:i,index:r}}function Hm(e){let{render:t,className:a,style:o,state:n=Me,props:r=Ia,refs:s=Ia,metadata:l,stateAttributesMapping:i,tag:u=\\\"div\\\",...c}=e,{compositeProps:f,compositeRef:d}=xM({metadata:l});return le(u,e,{state:n,ref:[d,...s],props:[f,...r,c],stateAttributesMapping:i})}function pS(e){if(Ne(e)&&e.hasAttribute(\\\"data-rootownerid\\\"))return e.getAttribute(\\\"data-rootownerid\\\");if(!fo(e))return pS(co(e))}var bM=S(T(),1),mS=S(fn(),1);function yM(e,t){let a=bM.useRef(null);function o(r){mS.flushSync(()=>{e.setOpen(!1,ce(j.focusOut,r.nativeEvent,r.currentTarget))}),uT(a.current)?.focus()}function n(r){let s=e.select(\\\"positionerElement\\\");if(s&&Un(r,s))e.context.beforeContentFocusGuardRef.current?.focus();else{mS.flushSync(()=>{e.setOpen(!1,ce(j.focusOut,r.nativeEvent,r.currentTarget))});let l=iT(e.context.triggerFocusTargetRef.current||t.current);for(;l!==null&&ie(s,l);){let i=l;if(l=di(l),l===i)break}l?.focus()}}return{preFocusGuardRef:a,handlePreFocusGuardFocus:o,handleFocusTargetFocus:n}}var zm=S(T(),1);function SM(e){let{enabled:t=!0,mouseDownAction:a,open:o}=e,n=zm.useRef(!1);return zm.useMemo(()=>t?{onMouseDown:r=>{(a===\\\"open\\\"&&!o||a===\\\"close\\\"&&o)&&(n.current=!0,ye(r.currentTarget).addEventListener(\\\"click\\\",()=>{n.current=!1},{once:!0}))},onClick:r=>{n.current&&(n.current=!1,r.preventBaseUIHandler())}}:Me,[t,a,o])}var jr=S(D(),1),CM=cE(function(t,a){let{render:o,className:n,style:r,disabled:s=!1,nativeButton:l=!0,id:i,openOnHover:u,delay:c=100,closeDelay:f=0,handle:d,payload:p,...x}=t,b=at(!0),g=am(d)??b?.store;if(!g)throw new Error(Pe(85));let m=ot(i),h=g.useState(\\\"isTriggerActive\\\",m),y=g.useState(\\\"floatingRootContext\\\"),v=g.useState(\\\"isOpenedByTrigger\\\",m),R=g.useState(\\\"triggerPopupId\\\",m),I=la.useRef(null),L=tH(),k=ni(!0),w=na(),A=la.useMemo(()=>w??new Hr,[w]),P=gc(A),U=Ga(),{registerTrigger:O,isMountedByThisTrigger:M}=Wp(m,I,g,{payload:p,closeDelay:f,parent:L,floatingTreeRoot:A,floatingNodeId:P,floatingParentNodeId:U,keyboardEventRelay:k?.relayKeyboardEvent}),_=L.type===\\\"menubar\\\",q=g.useState(\\\"disabled\\\"),E=s||q||_&&L.context.disabled,{getButtonProps:N,buttonRef:B}=pa({disabled:E,native:l});la.useEffect(()=>{!v&&L.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,v,L.type]);let ae=la.useRef(null),X=Rt(),Q=K(fe=>{if(!ae.current)return;X.clear(),g.context.allowMouseUpTriggerRef.current=!1;let de=fe.target;ie(ae.current,de)||ie(g.select(\\\"positionerElement\\\"),de)||de===ae.current||de!=null&&pS(de)===g.select(\\\"rootId\\\")||gM(fe,ae.current)||A.events.emit(\\\"close\\\",{domEvent:fe,reason:j.cancelOpen})});la.useEffect(()=>{v&&g.select(\\\"lastOpenChangeReason\\\")===j.triggerHover&&ye(ae.current).addEventListener(\\\"mouseup\\\",Q,{once:!0})},[v,Q,g]);let $=_&&L.context.hasSubmenuOpen,J=Rc(y,{enabled:(u??$)&&!E&&(!_||$&&!M),handleClose:vc({blockPointerEvents:!_}),mouseOnly:!0,move:!1,restMs:L.type===void 0?c:void 0,delay:{close:f},triggerElementRef:I,externalTree:A,isActiveTrigger:h,isClosing:()=>g.select(\\\"transitionStatus\\\")===\\\"ending\\\"}),Ce=eH(v,g.select(\\\"lastOpenChangeReason\\\")),Y=qs(y,{enabled:!E,event:v&&_?\\\"click\\\":\\\"mousedown\\\",toggle:!0,ignoreMouse:!1,stickIfOpen:L.type===void 0?Ce:!1}),W=$y(y,{enabled:!E&&$}),me=SM({open:v,enabled:_,mouseDownAction:\\\"open\\\"}),ge=la.useMemo(()=>da(W.reference,Y.reference),[W.reference,Y.reference]),oe=g.useState(\\\"triggerProps\\\",M),{preFocusGuardRef:he,handlePreFocusGuardFocus:pe,handleFocusTargetFocus:Le}=yM(g,I),ve={disabled:E,open:v},ue=[ae,a,B,O,I],Te=[ge,J??Me,oe,{\\\"aria-haspopup\\\":\\\"menu\\\",\\\"aria-controls\\\":R,id:m,onMouseDown:fe=>{if(g.select(\\\"open\\\"))return;X.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),ye(fe.currentTarget).addEventListener(\\\"mouseup\\\",Q,{once:!0})}},_?{role:\\\"menuitem\\\"}:{},me,x,N],re=le(\\\"button\\\",t,{enabled:!_,stateAttributesMapping:$b,state:ve,ref:ue,props:Te});return _?(0,jr.jsx)(Hm,{tag:\\\"button\\\",render:o,className:n,style:r,state:ve,refs:ue,props:Te,stateAttributesMapping:$b}):v?(0,jr.jsxs)(la.Fragment,{children:[(0,jr.jsx)(_n,{ref:he,onFocus:pe},`${m}-pre-focus-guard`),(0,jr.jsx)(la.Fragment,{children:re},m),(0,jr.jsx)(_n,{ref:g.context.triggerFocusTargetRef,onFocus:Le},`${m}-post-focus-guard`)]}):(0,jr.jsx)(la.Fragment,{children:re},m)});function eH(e,t){let a=Rt(),[o,n]=la.useState(!1);return G(()=>{e&&t===j.triggerHover?(n(!0),a.start(500,()=>{n(!1)})):e||(a.clear(),n(!1))},[e,t,a]),o}function tH(){let e=Om(!0);return la.useMemo(()=>e?{type:\\\"menubar\\\",context:e}:{type:void 0},[e])}var AM=S(T(),1);var Zt=S(T(),1),TM=S(fn(),1);var LM=S(T(),1);function RM(e){let[t,a]=LM.useState({current:e,previous:null});return Object.is(e,t.current)||a({current:e,previous:t.current}),t.previous}var Ri=S(T(),1);function gS(e){let t=Bt(e),a=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=Ne(e),r=n?e.offsetWidth:a,s=n?e.offsetHeight:o;return(_r(a)!==r||_r(o)!==s)&&(a=r,o=s),{width:a,height:o}}function IM(e){let{popupElement:t,positionerElement:a,content:o,mounted:n,onMeasureLayout:r,onMeasureLayoutComplete:s,side:l,direction:i}=e,u=Nr(t,!0),c=Va(),f=Ri.useRef(null),d=Ri.useRef(!0),p=Ri.useRef(Fe),x=K(r),b=K(s),C=Ri.useMemo(()=>aH(l,i),[l,i]);G(()=>{if(!n){p.current=Fe,d.current=!0,f.current=null;return}if(!t||!a)return;p.current=vM(t,C),hS(t,\\\"auto\\\");let g=Vm(t,\\\"position\\\",\\\"static\\\"),m=Vm(t,\\\"transform\\\",\\\"none\\\"),h=Vm(t,\\\"scale\\\",\\\"1\\\"),y=vM(a,{\\\"--available-width\\\":\\\"max-content\\\",\\\"--available-height\\\":\\\"max-content\\\"});function v(){g(),m(),y()}function R(){v(),h()}if(x?.(),d.current||f.current===null){qm(a,\\\"max-content\\\");let w=gS(t);return f.current=w,qm(a,w),R(),b?.(null,w),d.current=!1,()=>{p.current(),p.current=Fe}}qm(a,\\\"max-content\\\");let I=f.current,L=gS(t);f.current=L,hS(t,I),R(),b?.(I,L),qm(a,L);let k=new AbortController;return c.request(()=>{hS(t,L),u(()=>{t.style.setProperty(\\\"--popup-width\\\",\\\"auto\\\"),t.style.setProperty(\\\"--popup-height\\\",\\\"auto\\\")},k.signal)}),()=>{k.abort(),c.cancel(),p.current(),p.current=Fe}},[o,t,a,u,c,n,x,b,C])}function aH(e,t){let a=e===\\\"top\\\",o=e===\\\"left\\\"||e===(t===\\\"rtl\\\"?\\\"inline-end\\\":\\\"inline-start\\\");return!a&&!o?Me:{position:\\\"absolute\\\",[a?\\\"bottom\\\":\\\"top\\\"]:\\\"0\\\",[o?\\\"right\\\":\\\"left\\\"]:\\\"0\\\"}}function Vm(e,t,a){let o=e.style.getPropertyValue(t);return e.style.setProperty(t,a),()=>{e.style.setProperty(t,o)}}function vM(e,t){let a=[];for(let[o,n]of Object.entries(t))a.push(Vm(e,o,n));return a.length?()=>{a.forEach(o=>o())}:Fe}function hS(e,t){let a=t===\\\"auto\\\"?\\\"auto\\\":`${t.width}px`,o=t===\\\"auto\\\"?\\\"auto\\\":`${t.height}px`;e.style.setProperty(\\\"--popup-width\\\",a),e.style.setProperty(\\\"--popup-height\\\",o)}function qm(e,t){let a=t===\\\"max-content\\\"?\\\"max-content\\\":`${t.width}px`,o=t===\\\"max-content\\\"?\\\"max-content\\\":`${t.height}px`;e.style.setProperty(\\\"--positioner-width\\\",a),e.style.setProperty(\\\"--positioner-height\\\",o)}var wM={name:\\\"adaptiveOrigin\\\",async fn(e){let{x:t,y:a,rects:{floating:o},elements:{floating:n},platform:r,strategy:s,placement:l}=e,i=Ge(n),u=i.getComputedStyle(n);if(!(u.transitionDuration!==\\\"0s\\\"&&u.transitionDuration!==\\\"\\\"))return{x:t,y:a,data:Si};let f=await r.getOffsetParent?.(n),d={width:0,height:0};if(s===\\\"fixed\\\"&&i?.visualViewport)d={width:i.visualViewport.width,height:i.visualViewport.height};else if(f===i){let m=ye(n);d={width:m.documentElement.clientWidth,height:m.documentElement.clientHeight}}else await r.isElement?.(f)&&(d=await r.getDimensions(f));let p=oa(l),x=t,b=a;p===\\\"left\\\"&&(x=d.width-(t+o.width)),p===\\\"top\\\"&&(b=d.height-(a+o.height));let C=p===\\\"left\\\"?\\\"right\\\":Si.sideX,g=p===\\\"top\\\"?\\\"bottom\\\":Si.sideY;return{x,y:b,data:{sideX:C,sideY:g}}}};var vi=S(D(),1),EM={activationDirection:e=>e?{\\\"data-activation-direction\\\":e}:null};function MM(e){let{store:t,side:a,children:o}=e,n=en(),r=t.useState(\\\"activeTriggerElement\\\"),s=t.useState(\\\"activeTriggerId\\\"),l=t.useState(\\\"open\\\"),i=t.useState(\\\"payload\\\"),u=t.useState(\\\"mounted\\\"),c=t.useState(\\\"popupElement\\\"),f=t.useState(\\\"positionerElement\\\"),d=RM(l?r:null),p=rH(s,i),x=Zt.useRef(null),[b,C]=Zt.useState(null),[g,m]=Zt.useState(null),h=Zt.useRef(null),y=Zt.useRef(null),v=Nr(h,!0),R=Va(),I=Zt.useRef(null),[L,k]=Zt.useState(null),[w,A]=Zt.useState(!1);G(()=>(t.set(\\\"adaptiveOrigin\\\",wM),()=>{t.set(\\\"adaptiveOrigin\\\",void 0)}),[t]);let P=K(()=>{h.current?.style.setProperty(\\\"animation\\\",\\\"none\\\"),h.current?.style.setProperty(\\\"transition\\\",\\\"none\\\"),y.current?.style.setProperty(\\\"display\\\",\\\"none\\\")}),U=K(N=>{h.current?.style.removeProperty(\\\"animation\\\"),h.current?.style.removeProperty(\\\"transition\\\"),y.current?.style.removeProperty(\\\"display\\\"),N&&k(N)}),O=K(()=>{I.current?.abort();let N=new AbortController;I.current=N,v(()=>{C(null),k(null),x.current=null},N.signal)}),M=Zt.useRef(null);G(()=>{(!l||!u)&&(M.current=null)},[l,u]),G(()=>{if(r&&d&&r!==d&&M.current!==r&&x.current){C(x.current),A(!0);let N=nH(d,r);m(N),M.current=r}},[r,d]),G(()=>{b!=null&&(I.current?.abort(),A(!0),R.request(()=>{TM.flushSync(()=>{A(!1)}),O()}))},[p,b,O,R]),G(()=>{let N=h.current;if(!N)return;let B=ye(N).createElement(\\\"div\\\");for(let ae of Array.from(N.childNodes))B.appendChild(ae.cloneNode(!0));x.current=B});let _=b!=null,q;_?q=(0,vi.jsxs)(Zt.Fragment,{children:[(0,vi.jsx)(\\\"div\\\",{\\\"data-previous\\\":!0,inert:yi(!0),ref:y,style:{...L?{\\\"--popup-width\\\":`${L.width}px`,\\\"--popup-height\\\":`${L.height}px`}:null,position:\\\"absolute\\\"},\\\"data-ending-style\\\":w?void 0:\\\"\\\"},\\\"previous\\\"),(0,vi.jsx)(\\\"div\\\",{\\\"data-current\\\":!0,ref:h,\\\"data-starting-style\\\":w?\\\"\\\":void 0,children:o},p)]}):q=(0,vi.jsx)(\\\"div\\\",{\\\"data-current\\\":!0,ref:h,children:o},p),G(()=>{let N=y.current;!N||!b||N.replaceChildren(...Array.from(b.childNodes))},[b]),IM({popupElement:c,positionerElement:f,mounted:u,content:i,onMeasureLayout:P,onMeasureLayoutComplete:U,side:a,direction:n});let E={activationDirection:oH(g),transitioning:_};return{children:q,state:E}}function oH(e){if(e)return`${kM(e.horizontal,5,\\\"right\\\",\\\"left\\\")} ${kM(e.vertical,5,\\\"down\\\",\\\"up\\\")}`}function kM(e,t,a,o){return e>t?a:e<-t?o:\\\"\\\"}function nH(e,t){let a=e.getBoundingClientRect(),o=t.getBoundingClientRect(),n={x:a.left+a.width/2,y:a.top+a.height/2},r={x:o.left+o.width/2,y:o.top+o.height/2};return{horizontal:r.x-n.x,vertical:r.y-n.y}}function rH(e,t){let[a,o]=Zt.useState(0),n=Zt.useRef(e),r=Zt.useRef(t),s=Zt.useRef(!1);return G(()=>{let l=n.current,i=r.current,u=e!==l,c=t!==i;u?(o(f=>f+1),s.current=!c):s.current&&c&&(o(f=>f+1),s.current=!1),n.current=e,r.current=t},[e,t]),`${e??\\\"current\\\"}-${a}`}var DM=AM.forwardRef(function(t,a){let{render:o,className:n,style:r,children:s,...l}=t,{store:i}=at(),{side:u}=ta(),c=i.useState(\\\"instantType\\\"),{children:f,state:d}=MM({store:i,side:u,children:s}),p={activationDirection:d.activationDirection,transitioning:d.transitioning,instant:c};return le(\\\"div\\\",t,{state:p,ref:a,props:[l,{children:f}],stateAttributesMapping:EM})});var OM=S(T(),1);var PM=OM.forwardRef(function(t,a){let{className:o,render:n,orientation:r=\\\"horizontal\\\",style:s,...l}=t;return le(\\\"div\\\",t,{state:{orientation:r},ref:a,props:[{role:\\\"separator\\\",\\\"aria-orientation\\\":r},l]})});var an=S(T(),1);function NM(e){return e==null||e.hasAttribute(\\\"disabled\\\")||e.getAttribute(\\\"aria-disabled\\\")===\\\"true\\\"}var sH={\\\"aria-expanded\\\":void 0},BM=an.forwardRef(function(t,a){let{render:o,className:n,style:r,label:s,id:l,nativeButton:i=!1,openOnHover:u=!0,delay:c=100,closeDelay:f=0,disabled:d=!1,...p}=t,x=Fm();if(!x?.parentMenu)throw new Error(Pe(37));let b=po({guess:!0,label:s}),C=ta(),{store:g}=at(),m=ot(l),h=g.useState(\\\"open\\\"),y=g.useState(\\\"floatingRootContext\\\"),v=g.useState(\\\"floatingTreeRoot\\\"),R=g.useState(\\\"triggerPopupId\\\",m),I=Xy(m,g),L=an.useCallback(ge=>{let oe=I(ge);return ge!==null&&g.select(\\\"open\\\")&&g.select(\\\"activeTriggerId\\\")==null&&g.update({activeTriggerId:m,activeTriggerElement:ge,closeDelay:f}),oe},[I,f,g,m]),k=an.useRef(null),w=an.useCallback(ge=>{k.current=ge,g.set(\\\"activeTriggerElement\\\",ge)},[g]);g.useSyncedValue(\\\"closeDelay\\\",f);let A=x.parentMenu,P=g.useState(\\\"disabled\\\"),U=A.useState(\\\"disabled\\\"),O=d||P||U,M=A.useState(\\\"itemProps\\\"),_=A.useState(\\\"isActive\\\",b.index),q=an.useMemo(()=>({type:\\\"submenu-trigger\\\",setActive(){A.select(\\\"highlightItemOnHover\\\")&&A.set(\\\"activeIndex\\\",b.index)}}),[A,b.index]),{getItemProps:E,itemRef:N}=Or({closeOnClick:!1,disabled:O,highlighted:_,id:m,store:g,typingRef:A.context.typingRef,nativeButton:i,itemMetadata:q,nodeId:C?.context.nodeId}),B=g.useState(\\\"hoverEnabled\\\"),ae=Rc(y,{enabled:B&&u&&!O,handleClose:vc({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:c,delay:{open:c,close:f},shouldOpen:c>0?()=>A.select(\\\"allowMouseEnter\\\"):void 0,triggerElementRef:k,externalTree:v,isClosing:()=>g.select(\\\"transitionStatus\\\")===\\\"ending\\\",guardStaleOpen:!0}),Q=qs(y,{enabled:!O,event:\\\"mousedown\\\",toggle:!u,ignoreMouse:u,stickIfOpen:!1}).reference??Me,$=g.useState(\\\"triggerProps\\\",!0);delete $.id;let ee={disabled:O,highlighted:_,open:h},J=g.useState(\\\"openMethod\\\"),Y=g.useState(\\\"lastOpenChangeReason\\\")===j.listNavigation||J===\\\"keyboard\\\",W=h&&Y&&Xe.screenReader.voiceOver;return le(\\\"div\\\",t,{state:ee,stateAttributesMapping:rp,props:[Q,ae,$,M,W?sH:void 0,{\\\"aria-controls\\\":R,tabIndex:h||_?0:-1,onBlur(){_&&A.set(\\\"activeIndex\\\",null)}},p,E],ref:[a,b.ref,N,L,w]})});var Ec=class extends gi{constructor(){super(cM(),\\\"Menu\\\")}open(t){this.openByTrigger(t)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(\\\"open\\\")??!1}};function FM(){return new Ec}var Yr=S(D(),1),lH=\\\"relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground\\\";function _M(e){return(0,Yr.jsx)(Vn.Root,{\\\"data-slot\\\":\\\"dropdown-menu\\\",...e})}function UM(e){return(0,Yr.jsx)(Vn.Trigger,{\\\"data-slot\\\":\\\"dropdown-menu-trigger\\\",...e})}function HM({className:e,align:t=\\\"end\\\",sideOffset:a=4,...o}){return(0,Yr.jsx)(Vn.Portal,{children:(0,Yr.jsx)(Vn.Positioner,{\\\"data-slot\\\":\\\"dropdown-menu-positioner\\\",className:\\\"z-50\\\",align:t,sideOffset:a,children:(0,Yr.jsx)(Vn.Popup,{\\\"data-slot\\\":\\\"dropdown-menu-content\\\",className:te(\\\"z-50 min-w-[11rem] origin-[var(--transform-origin)] overflow-hidden rounded-md border border-border bg-popover p-1 font-sans text-sm text-popover-foreground shadow-md transition-[opacity,transform] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0\\\",e),...o})})})}function Gm({className:e,...t}){return(0,Yr.jsx)(Vn.Item,{\\\"data-slot\\\":\\\"dropdown-menu-item\\\",className:te(lH,e),...t})}var De=S(D(),1),iH={passed:{label:\\\"Passed\\\",glyph:\\\"\\\\u2713\\\",glyphColor:\\\"text-pass\\\",badgeVariant:\\\"passed\\\",showPill:!1},failed:{label:\\\"Failed\\\",glyph:\\\"\\\\u2717\\\",glyphColor:\\\"text-fail\\\",badgeVariant:\\\"failed\\\",showPill:!0},skipped:{label:\\\"Skipped\\\",glyph:\\\"\\\\u25CB\\\",glyphColor:\\\"text-skip\\\",badgeVariant:\\\"skipped\\\",showPill:!0},pending:{label:\\\"Pending\\\",glyph:\\\"\\\\u25CB\\\",glyphColor:\\\"text-pend\\\",badgeVariant:\\\"pending\\\",showPill:!0}};function zM({scenario:e,hideTitle:t=!1}){let a=`${e.id}-title`,o=`${e.id}-body`,n=iH[e.status],r=e.planned?\\\"Planned\\\":n.label,s=ep(),l=s!==null&&!t,i=l?s.isCollapsed(e.id):!1,u=ek();return(0,De.jsxs)(rk,{id:e.id,\\\"data-status\\\":e.status,...t?{\\\"aria-label\\\":`${e.title}, ${r}`}:{\\\"aria-labelledby\\\":a},className:\\\"gap-0 py-0\\\",children:[(0,De.jsxs)(sk,{className:\\\"px-4 py-3\\\",children:[(0,De.jsxs)(\\\"div\\\",{className:te(\\\"flex flex-wrap items-start gap-x-4 gap-y-1\\\",t?\\\"justify-end\\\":\\\"justify-between\\\"),children:[t?null:(0,De.jsxs)(\\\"h3\\\",{id:a,className:\\\"flex min-w-0 flex-1 basis-48 items-center gap-2 text-sm font-medium text-foreground\\\",children:[l?(0,De.jsx)(\\\"button\\\",{type:\\\"button\\\",onClick:()=>s.toggle(e.id),\\\"aria-expanded\\\":!i,\\\"aria-controls\\\":o,\\\"aria-label\\\":`Toggle ${e.title}`,className:\\\"shrink-0 cursor-pointer text-muted-foreground hover:text-foreground\\\",children:(0,De.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,className:te(\\\"inline-block text-xs transition-transform\\\",!i&&\\\"rotate-90\\\"),children:\\\"\\\\u25B8\\\"})}):null,(0,De.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,className:te(\\\"text-sm leading-none\\\",n.glyphColor),children:n.glyph}),(0,De.jsx)(\\\"span\\\",{children:e.title})]}),(0,De.jsxs)(\\\"div\\\",{className:\\\"flex shrink-0 items-center gap-2\\\",children:[(0,De.jsx)(F0,{scenarioId:e.id}),(0,De.jsx)(G0,{scenario:e}),e.durationMs>0?(0,De.jsx)(\\\"span\\\",{className:\\\"whitespace-nowrap font-mono text-[0.6875rem] text-muted-foreground\\\",children:qo(e.durationMs)}):null,n.showPill?(0,De.jsx)(Jt,{variant:n.badgeVariant,\\\"aria-label\\\":`Status: ${r}`,children:r}):(0,De.jsx)(\\\"span\\\",{className:\\\"sr-only\\\",children:`Status: ${r}`}),u?(0,De.jsxs)(_M,{children:[(0,De.jsx)(UM,{\\\"aria-label\\\":`Actions for ${e.title}`,className:\\\"cursor-pointer rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground [&_svg]:size-4\\\",children:(0,De.jsx)(Sr,{\\\"aria-hidden\\\":!0})}),(0,De.jsxs)(HM,{align:\\\"end\\\",children:[(0,De.jsxs)(Gm,{onClick:()=>u.copyLink(e),children:[(0,De.jsx)(Nu,{}),\\\" Copy link\\\"]}),(0,De.jsxs)(Gm,{onClick:()=>u.copyMarkdown(e),children:[(0,De.jsx)(Pu,{}),\\\" Copy as Markdown\\\"]}),(0,De.jsxs)(Gm,{onClick:()=>u.copyPrompt(e),children:[(0,De.jsx)(Cr,{}),\\\" Explain with AI\\\"]})]})]}):null]})]}),e.tags.length>0||(e.tickets?.length??0)>0?(0,De.jsxs)(\\\"ul\\\",{\\\"aria-label\\\":\\\"Tags and tickets\\\",className:\\\"flex flex-wrap gap-1.5\\\",children:[e.tags.map(c=>(0,De.jsx)(\\\"li\\\",{children:(0,De.jsx)(Jt,{variant:\\\"tag\\\",children:c})},`tag-${c}`)),(e.tickets??[]).map(c=>(0,De.jsx)(\\\"li\\\",{children:c.url?(0,De.jsx)(\\\"a\\\",{href:c.url,target:\\\"_blank\\\",rel:\\\"noreferrer noopener\\\",className:\\\"inline-flex min-h-6 items-center\\\",children:(0,De.jsx)(Jt,{variant:\\\"outline\\\",children:c.id})}):(0,De.jsx)(Jt,{variant:\\\"outline\\\",children:c.id})},`ticket-${c.id}`))]}):null]}),(0,De.jsxs)(lk,{id:o,hidden:i,className:\\\"px-4 pt-0 pb-4\\\",children:[e.errorMessage?(0,De.jsx)(\\\"pre\\\",{role:\\\"alert\\\",className:\\\"mb-1 overflow-x-auto rounded-md border border-fail-border bg-fail-bg px-4 py-3.5 font-mono text-xs leading-relaxed whitespace-pre-wrap text-fail\\\",children:e.errorMessage}):null,(0,De.jsx)(k0,{scenario:e}),(0,De.jsx)(L0,{scenario:e}),e.docEntries.length>0?(0,De.jsx)(\\\"div\\\",{\\\"data-es-docs\\\":!0,className:\\\"mt-3\\\",children:(0,De.jsx)(jd,{entries:e.docEntries})}):null,(0,De.jsx)(T0,{attachments:e.attachments}),(0,De.jsx)(A0,{spans:e.otelSpans})]})]})}var Mc=S(D(),1);function qM({feature:e}){return(0,Mc.jsx)(Mc.Fragment,{children:e.scenarios.map(t=>(0,Mc.jsx)(zM,{scenario:t},t.id))})}var Kr=S(D(),1);function VM({feature:e}){let t=!!e.narrative?.trim(),a=!!e.glossary?.length;return!t&&!a?null:(0,Kr.jsxs)(\\\"div\\\",{className:\\\"flex flex-col gap-3 border-l-2 border-border pl-4 text-sm\\\",children:[t?(0,Kr.jsx)(\\\"div\\\",{className:\\\"es-doc-prose prose prose-sm max-w-none text-muted-foreground\\\",dangerouslySetInnerHTML:{__html:Vd(Gd(e.narrative))}}):null,a?(0,Kr.jsx)(\\\"dl\\\",{className:\\\"grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5 text-xs\\\",\\\"aria-label\\\":\\\"Glossary\\\",children:e.glossary.map(o=>(0,Kr.jsxs)(\\\"div\\\",{className:\\\"contents\\\",children:[(0,Kr.jsx)(\\\"dt\\\",{className:\\\"font-medium text-foreground\\\",children:o.term}),(0,Kr.jsx)(\\\"dd\\\",{className:\\\"text-muted-foreground\\\",children:o.definition})]},o.term))}):null]})}function GM(e){return e===\\\"ability\\\"?\\\"Ability\\\":e===\\\"business-need\\\"?\\\"Business need\\\":e===\\\"feature\\\"?\\\"Feature\\\":null}var rt=S(D(),1);function XM({feature:e}){let t=`${e.id}-title`,a=`${e.id}-body`,o=e.summary,n=ep(),r=n?.isCollapsed(e.id)??!1,s=GM(e.kind);return(0,rt.jsxs)(\\\"section\\\",{id:e.id,\\\"data-slot\\\":\\\"feature\\\",\\\"aria-labelledby\\\":t,className:\\\"flex flex-col gap-3\\\",children:[(0,rt.jsxs)(\\\"div\\\",{className:\\\"flex items-end justify-between gap-4 border-b border-border pb-2\\\",children:[(0,rt.jsxs)(\\\"div\\\",{className:\\\"min-w-0\\\",children:[(0,rt.jsx)(\\\"h2\\\",{id:t,className:\\\"text-base font-semibold tracking-tight text-foreground\\\",children:n?(0,rt.jsxs)(\\\"button\\\",{type:\\\"button\\\",onClick:()=>n.toggle(e.id),\\\"aria-expanded\\\":!r,\\\"aria-controls\\\":a,className:\\\"flex w-full cursor-pointer items-center gap-2 text-left hover:text-foreground/80\\\",children:[(0,rt.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,className:te(\\\"shrink-0 text-xs text-muted-foreground transition-transform\\\",!r&&\\\"rotate-90\\\"),children:\\\"\\\\u25B8\\\"}),(0,rt.jsx)(\\\"span\\\",{className:\\\"truncate\\\",children:e.title})]}):e.title}),(0,rt.jsxs)(\\\"p\\\",{className:te(\\\"mt-0.5 flex items-center gap-2 text-xs text-muted-foreground\\\",n&&\\\"pl-5\\\"),children:[s?(0,rt.jsx)(\\\"span\\\",{className:\\\"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-medium text-foreground\\\",children:s}):null,(0,rt.jsx)(\\\"span\\\",{className:\\\"truncate font-mono\\\",children:e.sourceFile})]})]}),(0,rt.jsxs)(\\\"p\\\",{className:\\\"flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground\\\",\\\"aria-label\\\":[`${o.passed} passed`,`${o.failed} failed`,o.skipped>0&&`${o.skipped} skipped`,o.pending>0&&`${o.pending} pending`].filter(Boolean).join(\\\", \\\"),children:[(0,rt.jsxs)(\\\"span\\\",{children:[o.passed,\\\" passed\\\"]}),(0,rt.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,children:\\\"\\\\xB7\\\"}),(0,rt.jsxs)(\\\"span\\\",{className:te(o.failed>0&&\\\"font-medium text-fail\\\"),children:[o.failed,\\\" failed\\\"]}),o.skipped>0?(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,children:\\\"\\\\xB7\\\"}),(0,rt.jsxs)(\\\"span\\\",{children:[o.skipped,\\\" skipped\\\"]})]}):null,o.pending>0?(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,children:\\\"\\\\xB7\\\"}),(0,rt.jsxs)(\\\"span\\\",{children:[o.pending,\\\" pending\\\"]})]}):null]})]}),(0,rt.jsxs)(\\\"div\\\",{id:a,hidden:r,className:\\\"flex flex-col gap-3\\\",children:[(0,rt.jsx)(VM,{feature:e}),(0,rt.jsx)(qM,{feature:e})]})]})}var xS=S(D(),1);function bS(){let e=qa();return(0,xS.jsx)(\\\"div\\\",{className:\\\"flex flex-col gap-8\\\",children:e.features.map(t=>(0,xS.jsx)(XM,{feature:t},t.id))})}function YM(e,t){let a=[];for(let o of e.features)for(let n of o.scenarios)n.durationMs>0&&a.push({id:n.id,title:n.title,sourceFile:o.sourceFile,durationMs:n.durationMs});return a.sort((o,n)=>n.durationMs-o.durationMs).slice(0,t)}function yS(e,t){return{id:t.id,title:t.title,status:t.status,feature:e.title,sourceFile:e.sourceFile,sourceLine:t.sourceLine,tags:t.tags,tickets:t.tickets??[],covers:t.covers??[],durationMs:t.durationMs,steps:t.steps.map(a=>({id:a.id,index:a.index,keyword:a.keyword,text:a.text,status:a.status,durationMs:a.durationMs,errorMessage:a.errorMessage,docKinds:a.docEntries.map(o=>o.kind),assertions:a.assertions})),docKinds:t.docEntries.map(a=>a.kind),assertionState:Od(t.steps),error:t.errorMessage?{message:t.errorMessage,stack:t.errorStack}:void 0}}function uH(e,t){return!(t.statuses?.length&&!t.statuses.includes(e.status)||t.tags?.length&&!t.tags.some(a=>e.tags.includes(a))||t.sourceFiles?.length&&!t.sourceFiles.some(a=>e.sourceFile.includes(a)))}function KM(e,t={}){return e.features.flatMap(a=>a.scenarios.map(o=>yS(a,o))).filter(a=>uH(a,t))}function $M(e,t){return jM(e,a=>a.id===t)??jM(e,a=>a.title===t)}function jM(e,t){for(let a of e.features){let o=a.scenarios.find(t);if(o)return{feature:a,scenario:o}}}function WM(e){return e.features.map(t=>({id:t.id,title:t.title,sourceFile:t.sourceFile,total:t.summary.total,passed:t.summary.passed,failed:t.summary.failed,skipped:t.summary.skipped,pending:t.summary.pending,durationMs:t.summary.durationMs}))}function ZM(e,t){let a=e.ci?.commitSha??e.gitSha;return{runId:e.runId,startedAtMs:e.startedAtMs,finishedAtMs:e.finishedAtMs,...a!==void 0&&{gitSha:a},...e.ci?.branch!==void 0&&{branch:e.ci.branch},...e.packageVersion!==void 0&&{packageVersion:e.packageVersion},ageDays:Math.max(0,Math.floor((t-e.finishedAtMs)/864e5))}}var qt=S(D(),1);function QM(){let e=qa(),t=[],a=\\\"text-primary underline underline-offset-2\\\";e.startedAtMs&&t.push({label:\\\"Started\\\",value:new Date(e.startedAtMs).toLocaleString()}),e.durationMs&&t.push({label:\\\"Duration\\\",value:qo(e.durationMs)}),e.packageVersion&&t.push({label:\\\"Version\\\",value:e.packageVersion}),e.ci?.branch&&t.push({label:\\\"Branch\\\",value:e.ci.branch});let o=e.ci?.commitSha??e.gitSha;if(o){let s=U0(e.ci,e.gitSha),l=o.slice(0,8);t.push({label:\\\"Commit\\\",value:s?(0,qt.jsx)(\\\"a\\\",{href:s,target:\\\"_blank\\\",rel:\\\"noreferrer noopener\\\",className:a,children:l}):l})}if(e.ci&&t.push({label:\\\"CI\\\",value:e.ci.url?(0,qt.jsxs)(\\\"a\\\",{href:e.ci.url,target:\\\"_blank\\\",rel:\\\"noreferrer noopener\\\",className:a,children:[qb(e.ci.name),e.ci.buildNumber?` #${e.ci.buildNumber}`:\\\"\\\"]}):`${qb(e.ci.name)}${e.ci.buildNumber?` #${e.ci.buildNumber}`:\\\"\\\"}`}),e.ci?.prNumber){let s=H0(e.ci),l=`#${e.ci.prNumber}`;t.push({label:\\\"PR\\\",value:s?(0,qt.jsx)(\\\"a\\\",{href:s,target:\\\"_blank\\\",rel:\\\"noreferrer noopener\\\",className:a,children:l}):l})}let n=YM(e,5),r=n.length>=3;return t.length===0&&!r?null:(0,qt.jsxs)(\\\"details\\\",{\\\"data-es-meta-card\\\":!0,className:\\\"es-run-details group rounded-lg border border-border bg-card text-xs\\\",children:[(0,qt.jsxs)(\\\"summary\\\",{className:\\\"flex cursor-pointer list-none select-none items-center gap-1.5 px-4 py-2 font-medium text-muted-foreground [&::-webkit-details-marker]:hidden\\\",children:[(0,qt.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,className:\\\"text-xs transition-transform group-open:rotate-90\\\",children:\\\"\\\\u25B8\\\"}),\\\"Run details\\\"]}),(0,qt.jsx)(\\\"dl\\\",{className:\\\"flex flex-wrap gap-x-5 gap-y-2 border-t border-border px-4 py-3 text-muted-foreground\\\",\\\"aria-label\\\":\\\"Run metadata\\\",children:t.map(s=>(0,qt.jsxs)(\\\"div\\\",{className:\\\"flex items-baseline gap-1.5\\\",children:[(0,qt.jsx)(\\\"dt\\\",{className:\\\"font-medium\\\",children:s.label}),(0,qt.jsx)(\\\"dd\\\",{className:\\\"font-mono text-foreground\\\",children:s.value})]},s.label))}),r?(0,qt.jsxs)(\\\"div\\\",{className:\\\"border-t border-border px-4 py-3\\\",children:[(0,qt.jsx)(\\\"div\\\",{className:\\\"mb-1.5 font-medium text-muted-foreground\\\",children:\\\"Slowest scenarios\\\"}),(0,qt.jsx)(\\\"ol\\\",{className:\\\"flex flex-col gap-1\\\",\\\"aria-label\\\":\\\"Slowest scenarios\\\",children:n.map(s=>(0,qt.jsxs)(\\\"li\\\",{className:\\\"flex items-baseline justify-between gap-4\\\",children:[(0,qt.jsx)(\\\"a\\\",{href:`#${s.id}`,className:\\\"min-w-0 text-primary underline underline-offset-2\\\",children:s.title}),(0,qt.jsx)(\\\"span\\\",{className:\\\"shrink-0 font-mono tabular-nums text-muted-foreground\\\",children:qo(s.durationMs)})]},s.id))})]}):null]})}var $r=S(D(),1);function JM({className:e}){let t=qa();return(0,$r.jsx)(fH,{summary:t.summary,...e!==void 0&&{className:e},ariaLabel:\\\"Run summary\\\"})}var cH={total:{num:\\\"text-foreground\\\",dot:\\\"bg-muted-foreground/50\\\"},passed:{num:\\\"text-pass\\\",dot:\\\"bg-pass\\\"},failed:{num:\\\"text-fail\\\",dot:\\\"bg-fail\\\"},skipped:{num:\\\"text-skip\\\",dot:\\\"bg-skip\\\"},pending:{num:\\\"text-pend\\\",dot:\\\"bg-pend\\\"}};function fH({summary:e,className:t,ariaLabel:a}){let o=[{status:\\\"total\\\",label:\\\"Total\\\",value:e.total},{status:\\\"passed\\\",label:\\\"Passed\\\",value:e.passed},{status:\\\"failed\\\",label:\\\"Failed\\\",value:e.failed},{status:\\\"skipped\\\",label:\\\"Skipped\\\",value:e.skipped}];return e.pending>0&&o.push({status:\\\"pending\\\",label:\\\"Pending\\\",value:e.pending}),(0,$r.jsx)(\\\"dl\\\",{className:te(\\\"grid grid-cols-2 gap-3\\\",o.length===5?\\\"sm:grid-cols-5\\\":\\\"sm:grid-cols-4\\\",t),\\\"aria-label\\\":a,children:o.map(n=>{let r=cH[n.status];return(0,$r.jsxs)(\\\"div\\\",{\\\"data-status\\\":n.status,className:\\\"rounded-lg border bg-card px-4 py-3\\\",children:[(0,$r.jsxs)(\\\"dt\\\",{className:\\\"flex items-center gap-1.5 font-mono text-[11px] font-medium uppercase tracking-wider text-muted-foreground\\\",children:[(0,$r.jsx)(\\\"span\\\",{className:te(\\\"size-1.5 shrink-0 rounded-full\\\",r.dot),\\\"aria-hidden\\\":\\\"true\\\"}),n.label]}),(0,$r.jsx)(\\\"dd\\\",{className:te(\\\"mt-2 text-3xl font-semibold leading-none tracking-tight tabular-nums\\\",r.num),children:n.value})]},n.status)})})}var Mo=S(D(),1);function eA({error:e}){return(0,Mo.jsxs)(\\\"section\\\",{className:\\\"es-schema-error\\\",role:\\\"alert\\\",\\\"aria-live\\\":\\\"assertive\\\",children:[(0,Mo.jsx)(\\\"p\\\",{children:(0,Mo.jsx)(\\\"strong\\\",{children:\\\"Report could not be displayed.\\\"})}),(0,Mo.jsx)(\\\"p\\\",{children:e.message}),e.code===\\\"SCHEMA_VERSION_MISMATCH\\\"?(0,Mo.jsxs)(\\\"p\\\",{children:[\\\"The report bundle is newer than this version of \\\",(0,Mo.jsx)(\\\"code\\\",{children:\\\"executable-stories-react\\\"}),\\\". Upgrade the package, or regenerate the report with an older formatters CLI.\\\"]}):null,e.issues&&e.issues.length>0?(0,Mo.jsxs)(\\\"details\\\",{children:[(0,Mo.jsxs)(\\\"summary\\\",{children:[e.issues.length,\\\" validation issue\\\",e.issues.length===1?\\\"\\\":\\\"s\\\"]}),(0,Mo.jsx)(\\\"pre\\\",{children:e.issues.slice(0,20).map(t=>`${t.path}: ${t.message}`).join(`\\n`)})]}):null]})}var Ac=S(D(),1);function tA({error:e,className:t,title:a,dataTheme:o}){return(0,Ac.jsx)(\\\"main\\\",{className:te(\\\"es-report\\\",t),\\\"aria-label\\\":a??\\\"Test report\\\",\\\"data-theme\\\":o,children:(0,Ac.jsx)(eA,{error:e})})}var dH=2,pH=\\\"\\\\0\\\";function aA(e){let t=e.attributes??{},a=i=>{let u=t[i];return typeof u==\\\"string\\\"&&u.length>0?u:void 0},o=a(\\\"db.system\\\");if(o){let i=a(\\\"db.namespace\\\")??a(\\\"db.name\\\");return{id:i?`${o}:${i}`:o,kind:\\\"datastore\\\"}}let n=a(\\\"messaging.destination.name\\\");if(n)return{id:n,kind:\\\"queue\\\"};let r=a(\\\"peer.service\\\");if(r)return{id:r,kind:\\\"service\\\"};let s=e.name.split(\\\".\\\")[0]?.trim();return{id:a(\\\"service.name\\\")??(s||e.name.trim()||\\\"(unnamed span)\\\"),kind:a(\\\"http.route\\\")?\\\"edge\\\":\\\"service\\\"}}function oA(e,t){return e===\\\"error\\\"||t===\\\"error\\\"?\\\"error\\\":\\\"ok\\\"}function mH(e,t){let a=new Set(t.added),o=new Set(t.changed),n=[];for(let r of e){let s=r.scenarioIds.filter(l=>a.has(l)||o.has(l));if(s.length!==0){if(r.scenarioIds.every(l=>a.has(l))){r.delta=\\\"added\\\";continue}n.push({node:r,share:s.length/r.scenarioIds.length})}}n.sort((r,s)=>s.share-r.share||r.node.scenarioIds.length-s.node.scenarioIds.length||r.node.id.localeCompare(s.node.id)).slice(0,dH).forEach(({node:r})=>{r.delta=\\\"changed\\\"})}function rA(e,t){let a=new Map,o=new Map;for(let s of e){let l=s.otelSpans;if(!l||l.length===0)continue;let i=new Map(l.map(u=>[u.spanId,u]));for(let u of l){let c=aA(u),f=u.status===\\\"error\\\"?\\\"error\\\":\\\"ok\\\",d=a.get(c.id);d?(d.status=oA(d.status,f),d.scenarioIds.includes(s.id)||d.scenarioIds.push(s.id)):a.set(c.id,{...c,status:f,scenarioIds:[s.id]});let p=u.parentSpanId?i.get(u.parentSpanId):void 0;if(!p)continue;let x=aA(p);if(x.id===c.id)continue;let b=`${x.id}${pH}${c.id}`,C=o.get(b)??{from:x.id,to:c.id,status:\\\"ok\\\",calls:0,scenarioIds:[]};C.status=oA(C.status,f),C.calls+=1,C.scenarioIds.includes(s.id)||C.scenarioIds.push(s.id),o.set(b,C)}}let r={nodes:[...a.values()].sort((s,l)=>l.scenarioIds.length-s.scenarioIds.length||s.id.localeCompare(l.id)),edges:[...o.values()]};return t&&mH(r.nodes,t),r}function SS(e){return e.status===\\\"error\\\"?\\\"failing\\\":e.delta}var sA=[{kind:\\\"edge\\\",label:\\\"Edge\\\"},{kind:\\\"service\\\",label:\\\"Services\\\"},{kind:\\\"queue\\\",label:\\\"Queues\\\"},{kind:\\\"datastore\\\",label:\\\"Data\\\"}];function gH(e){let t=new Map,a=new Set(sA.map(o=>`es_${o.kind}`));for(let o of e){let n=o.id.replace(/[^A-Za-z0-9_]/g,\\\"_\\\")||\\\"node\\\",r=n;for(let s=2;a.has(r);s++)r=`${n}_${s}`;a.add(r),t.set(o.id,r)}return t}function hH(e,t){return`${e.replace(/&/g,\\\"&amp;\\\").replace(/</g,\\\"&lt;\\\").replace(/>/g,\\\"&gt;\\\").replace(/\\\"/g,\\\"&quot;\\\")}<br/>${t} scenario${t===1?\\\"\\\":\\\"s\\\"}`}var nA={esFailing:\\\"classDef esFailing stroke:#d1242f,stroke-width:2px;\\\",esAdded:\\\"classDef esAdded stroke:#1a7f37,stroke-width:2px;\\\",esChanged:\\\"classDef esChanged stroke:#9a6700,stroke-width:2px;\\\"},xH={failing:\\\"esFailing\\\",added:\\\"esAdded\\\",changed:\\\"esChanged\\\"};function lA(e){if(e.nodes.length===0)return\\\"\\\";let t=[\\\"flowchart LR\\\"],a=gH(e.nodes),o=r=>a.get(r)??r.replace(/[^A-Za-z0-9_]/g,\\\"_\\\");for(let r of sA){let s=e.nodes.filter(l=>l.kind===r.kind);if(s.length!==0){t.push(`  subgraph es_${r.kind}[\\\"${r.label}\\\"]`);for(let l of s){let i=hH(l.id,l.scenarioIds.length);t.push(l.kind===\\\"datastore\\\"?`    ${o(l.id)}[(\\\"${i}\\\")]`:`    ${o(l.id)}[\\\"${i}\\\"]`)}t.push(\\\"  end\\\")}}for(let r of e.edges){let s=r.status===\\\"error\\\"?\\\"-.->\\\":\\\"-->\\\";t.push(`  ${o(r.from)} ${s}|${r.calls}| ${o(r.to)}`)}let n=new Set;for(let r of e.nodes){let s=SS(r);if(!s)continue;let l=xH[s];n.add(l),t.push(`  class ${o(r.id)} ${l}`)}for(let r of Object.keys(nA))n.has(r)&&t.push(`  ${nA[r]}`);return t.join(`\\n`)}var iA=S(T(),1);var yt=S(D(),1),bH={edge:\\\"Edge\\\",service:\\\"Service\\\",queue:\\\"Queue\\\",datastore:\\\"Data\\\"},yH={failing:\\\"Failing\\\",added:\\\"New\\\",changed:\\\"Changed\\\"},SH={failing:\\\"text-fail\\\",added:\\\"text-pass\\\",changed:\\\"text-pend\\\"};function CH({node:e}){let t=SS(e);return t?(0,yt.jsx)(\\\"span\\\",{className:te(\\\"ml-2 text-xs font-medium\\\",SH[t]),children:yH[t]}):null}function uA(){let e=qa(),{code:t,graph:a,titleById:o}=(0,iA.useMemo)(()=>{let n=e.features.flatMap(s=>s.scenarios),r=rA(n);return{graph:r,code:lA(r),titleById:new Map(n.map(s=>[s.id,s.title]))}},[e]);return t===\\\"\\\"?null:(0,yt.jsxs)(\\\"section\\\",{className:\\\"es-span-graph mt-6\\\",\\\"aria-labelledby\\\":\\\"es-span-graph-heading\\\",children:[(0,yt.jsx)(\\\"h2\\\",{id:\\\"es-span-graph-heading\\\",className:\\\"text-base font-semibold text-foreground\\\",children:\\\"Architecture, as it ran\\\"}),(0,yt.jsx)(\\\"p\\\",{className:\\\"mt-1 text-sm text-muted-foreground\\\",children:\\\"Derived from this run\\\\u2019s traces. Every component was named by a span while a scenario ran, so nothing here is inferred from the code. Instrumented, exercised paths only: a component no scenario reaches does not appear.\\\"}),(0,yt.jsx)(Xd,{entry:{kind:\\\"mermaid\\\",phase:\\\"static\\\",code:t}}),(0,yt.jsxs)(\\\"table\\\",{className:\\\"mt-2 w-full border-collapse text-left text-sm\\\",children:[(0,yt.jsx)(\\\"caption\\\",{className:\\\"sr-only\\\",children:\\\"Each component and the scenarios that exercised it\\\"}),(0,yt.jsx)(\\\"thead\\\",{children:(0,yt.jsxs)(\\\"tr\\\",{className:\\\"text-xs text-muted-foreground\\\",children:[(0,yt.jsx)(\\\"th\\\",{scope:\\\"col\\\",className:\\\"py-1 pr-4 font-medium\\\",children:\\\"Component\\\"}),(0,yt.jsx)(\\\"th\\\",{scope:\\\"col\\\",className:\\\"py-1 pr-4 font-medium\\\",children:\\\"Lane\\\"}),(0,yt.jsx)(\\\"th\\\",{scope:\\\"col\\\",className:\\\"py-1 font-medium\\\",children:\\\"Covered by\\\"})]})}),(0,yt.jsx)(\\\"tbody\\\",{children:a.nodes.map(n=>(0,yt.jsxs)(\\\"tr\\\",{className:\\\"border-t border-border align-top\\\",children:[(0,yt.jsxs)(\\\"th\\\",{scope:\\\"row\\\",className:\\\"py-1.5 pr-4 font-mono text-xs font-normal\\\",children:[n.id,(0,yt.jsx)(CH,{node:n})]}),(0,yt.jsx)(\\\"td\\\",{className:\\\"py-1.5 pr-4 text-xs text-muted-foreground\\\",children:bH[n.kind]}),(0,yt.jsx)(\\\"td\\\",{className:\\\"py-1.5\\\",children:(0,yt.jsx)(\\\"ul\\\",{className:\\\"flex flex-col gap-0.5\\\",children:n.scenarioIds.map(r=>(0,yt.jsx)(\\\"li\\\",{children:(0,yt.jsx)(\\\"a\\\",{href:`#${r}`,className:\\\"text-xs text-link underline underline-offset-2 hover:text-foreground\\\",children:o.get(r)??r})},r))})})]},n.id))})]})]})}var ZJ=S(T(),1);var Pc={};Oo(Pc,{Root:()=>yA,Thumb:()=>CA});var Ys=S(T(),1);var Xm=S(T(),1),CS=Xm.createContext(void 0);function cA(){let e=Xm.useContext(CS);if(e===void 0)throw new Error(Pe(63));return e}var fA={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},LH={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},dA={disabled:!1,...LH},pA={valid(e){return e===null?null:e?{\\\"data-valid\\\":\\\"\\\"}:{\\\"data-invalid\\\":\\\"\\\"}}};var jm={...pA,checked(e){return e?{\\\"data-checked\\\":\\\"\\\"}:{\\\"data-unchecked\\\":\\\"\\\"}}};var Ym=S(T(),1);var RH={invalid:void 0,name:void 0,validityData:{state:fA,errors:[],error:\\\"\\\",value:\\\"\\\",initialValue:null},setValidityData:Fe,disabled:void 0,setTouched:Fe,setDirty:Fe,setFilled:Fe,setFocused:Fe,validationMode:\\\"onSubmit\\\",shouldValidateOnChange:()=>!1,state:dA,registerFieldControl:Fe,validation:{getValidationProps:(e,t=Me)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Fe,getInputControl:()=>null,commit:async()=>{},change:Fe}},vH=Ym.createContext(RH);function Km(e=!0){let t=Ym.useContext(vH);if(t.setValidityData===Fe&&!e)throw new Error(Pe(28));return t}function mA(e,t,a,o,n=!0,r){let{registerFieldControl:s}=Km(),l=tt(()=>Symbol());G(()=>{let i=l.current;if(!n){s(i,void 0);return}s(i,{controlRef:e,getValue:o,id:t,name:r,value:a})},[e,n,o,t,r,s,l,a]),G(()=>{let i=l.current;return()=>{s(i,void 0)}},[s,l])}var $m=S(T(),1);var IH=$m.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Fe,validationMode:\\\"onSubmit\\\",submitAttemptedRef:{current:!1}});function gA(){return $m.useContext(IH)}var Wm=S(T(),1);var wH=Wm.createContext({controlId:void 0,registerControlId:Fe,labelId:void 0,setLabelId:Fe,messageIds:[],setMessageIds:Fe,getDescriptionProps:e=>e});function Zm(){return Wm.useContext(wH)}var hA=S(T(),1);function xA(e,t,a,o=!0,n){let[r,s]=hA.useState(),l=ot(n?`${n}-label`:void 0),i=e??t??r;return G(()=>{let u=e||t||!o?void 0:kH(a.current,l);r!==u&&s(u)}),i}function kH(e,t){let a=TH(e);if(a)return!a.id&&t&&(a.id=t),a.id||void 0}function TH(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===\\\"LABEL\\\")return t;let a=e.id;if(a){let n=e.nextElementSibling;if(n&&n.htmlFor===a)return n}let o=e.labels;return o&&o[0]}var Dc=S(T(),1);function bA(e={}){let{id:t,implicit:a=!1,controlRef:o}=e,{controlId:n,registerControlId:r}=Zm(),s=ot(t),l=a?n:void 0,i=tt(()=>Symbol()),u=Dc.useRef(!1),c=Dc.useRef(t!=null),f=K(()=>{!u.current||r===Fe||(u.current=!1,r(i.current,void 0))});return G(()=>{if(r===Fe)return;let d;if(a){let p=o?.current;Ie(p)&&p.closest(\\\"label\\\")!=null?d=t??null:d=l??s}else if(t!=null)c.current=!0,d=t;else if(c.current)d=s;else{f();return}if(d===void 0){f();return}u.current=!0,r(i.current,d)},[t,o,l,r,a,s,i,f]),Dc.useEffect(()=>f,[f]),n??s}var Oc=S(D(),1),yA=Ys.forwardRef(function(t,a){let{checked:o,className:n,defaultChecked:r,\\\"aria-labelledby\\\":s,form:l,id:i,inputRef:u,name:c,nativeButton:f=!1,onCheckedChange:d,readOnly:p=!1,required:x=!1,disabled:b=!1,render:C,uncheckedValue:g,value:m,style:h,...y}=t,{clearErrors:v}=gA(),{state:R,setTouched:I,setDirty:L,validityData:k,setFilled:w,setFocused:A,validationMode:P,disabled:U,name:O,validation:M}=Km(),{labelId:_}=Zm(),q=U||b,E=O??c,N=Ys.useRef(null),B=va(N,u,M.inputRef),ae=Ys.useRef(null),X=ot(),Q=bA({id:i,implicit:!1,controlRef:ae}),$=f?void 0:Q,[ee,J]=jo({controlled:o,default:!!r,name:\\\"Switch\\\",state:\\\"checked\\\"});mA(ae,X,ee,void 0,!q,c),G(()=>{N.current&&w(N.current.checked)},[w]),Pm(ee,()=>{v(E),L(ee!==k.initialValue),w(ee),M.change(ee)});let{getButtonProps:Ce,buttonRef:Y}=pa({disabled:q,native:f}),W=xA(s,_,N,!f,$),me={id:f?Q:X,role:\\\"switch\\\",\\\"aria-checked\\\":ee,\\\"aria-readonly\\\":p||void 0,\\\"aria-required\\\":x||void 0,\\\"aria-labelledby\\\":W,onFocus(){q||A(!0)},onBlur(){let pe=N.current;!pe||q||(I(!0),A(!1),P===\\\"onBlur\\\"&&M.commit(pe.checked))},onClick(pe){if(p||q)return;pe.preventDefault();let Le=N.current;Le&&Ar(Le,pe)}},ge={...M.getValidationProps(q),checked:ee,disabled:q,form:l,id:$,name:E,required:x,style:E?Yk:Tp,tabIndex:-1,type:\\\"checkbox\\\",\\\"aria-hidden\\\":!0,ref:B,onChange(pe){if(pe.nativeEvent.defaultPrevented)return;if(p){pe.preventDefault();return}let Le=pe.currentTarget.checked,ve=ce(j.none,pe.nativeEvent);d?.(Le,ve),!ve.isCanceled&&J(Le)},onClick(pe){pe.stopPropagation()},onFocus(){ae.current?.focus()},...m!==void 0?{value:m}:Me},oe=Ys.useMemo(()=>({...R,checked:ee,disabled:q,readOnly:p,required:x}),[R,ee,q,p,x]),he=le(\\\"span\\\",t,{state:oe,ref:[a,ae,Y],props:[me,y,Ce,pe=>M.getValidationProps(q,pe)],stateAttributesMapping:jm});return(0,Oc.jsxs)(CS.Provider,{value:oe,children:[he,!ee&&E&&g!==void 0&&(0,Oc.jsx)(\\\"input\\\",{type:\\\"hidden\\\",form:l,name:E,value:g,disabled:q}),(0,Oc.jsx)(\\\"input\\\",{...ge,suppressHydrationWarning:!0})]})});var SA=S(T(),1);var CA=SA.forwardRef(function(t,a){let{render:o,className:n,style:r,...s}=t,l=cA();return le(\\\"span\\\",t,{state:l,ref:a,stateAttributesMapping:jm,props:s})});var LS=S(D(),1);function RS({className:e,...t}){return(0,LS.jsx)(Pc.Root,{\\\"data-slot\\\":\\\"switch\\\",className:te(\\\"peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[checked]:bg-primary data-[unchecked]:bg-input\\\",e),...t,children:(0,LS.jsx)(Pc.Thumb,{\\\"data-slot\\\":\\\"switch-thumb\\\",className:\\\"pointer-events-none block size-4 rounded-full bg-background ring-0 transition-transform data-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0\\\"})})}var ag=S(T(),1);var eg=S(T(),1);var vA=S(T(),1);var Ii=S(T(),1);var LA=\\\"data-composite-item-active\\\";var EH=[];function RA(e){let{loopFocus:t=!0,orientation:a=\\\"both\\\",grid:o,onLoop:n,direction:r,highlightedIndex:s,onHighlightedIndexChange:l,rootRef:i,enableHomeAndEndKeys:u=!1,stopEventPropagation:c,disabledIndices:f,modifierKeys:d=EH}=e,[p,x]=Ii.useState(0),b=o!=null,C=Ii.useRef(null),g=va(C,i),m=Ii.useRef([]),h=Ii.useRef(!1),y=s??p,v=K((w,A=!1)=>{if((l??x)(w),A){let P=m.current[w];oS(C.current,P,r,a)}}),R=K(w=>{if(w.size===0||h.current)return;h.current=!0;let A=Array.from(w.keys()),P=A.find(O=>O?.hasAttribute(LA))??null,U=P?w.get(P)?.index??-1:-1;if(U!==-1)v(U);else if(Us(A,y,f)){let O=go(A,{disabledIndices:f});Ur(A,O)||v(O)}oS(C.current,P,r,a)});G(()=>{if(f==null||s!=null||!h.current)return;let w=m.current;if(Us(w,y,f)){let A=go(w,{disabledIndices:f});Ur(w,A)||v(A)}},[f,s,y,m,v]);let I=K((w,A,P)=>n?n(w,A,P,m):P),L=K(w=>{let A=w.key===bm||w.key===ym;if(!bi.has(w.key)||!u&&A||MH(w,d)||!C.current)return;let U=r===\\\"rtl\\\",O=U?hm:xm,M=U?xm:hm,_=a===\\\"vertical\\\"?gm:O,q=a===\\\"vertical\\\"?mm:M,E=lt(w.nativeEvent);if(E!=null&&aS(E)&&!NM(E)){let $=E.selectionStart,ee=E.selectionEnd,J=E.value;if($==null||w.shiftKey||$!==ee||w.key!==q&&$<J.length||w.key!==_&&$>0)return}let N=y,B=_s(m,f),ae=ci(m,f);o!=null&&(N=o({disabledIndices:f,elementsRef:m,event:w,highlightedIndex:y,loopFocus:t,maxIndex:ae,minIndex:B,onLoop:I,orientation:a,rtl:U}));let X=a!==\\\"vertical\\\"&&w.key===O||a!==\\\"horizontal\\\"&&w.key===gm,Q=a!==\\\"vertical\\\"&&w.key===M||a!==\\\"horizontal\\\"&&w.key===mm;u&&(w.key===bm?N=B:w.key===ym&&(N=ae)),N===y&&(X||Q)&&(t&&N===ae&&X?(N=B,n&&(N=n(w,y,N,m))):t&&N===B&&Q?(N=ae,n&&(N=n(w,y,N,m))):N=go(m.current,{startingIndex:N,decrement:Q,disabledIndices:f})),N!==y&&!Ur(m.current,N)&&(c&&w.stopPropagation(),(b||A||X||Q)&&w.preventDefault(),v(N,!0),queueMicrotask(()=>{m.current[N]?.focus()}))});return{props:{ref:g,onFocus(w){let A=C.current,P=lt(w.nativeEvent);!A||P==null||!aS(P)||P.setSelectionRange(0,P.value.length)},onKeyDown:L},highlightedIndex:y,onHighlightedIndexChange:v,elementsRef:m,onMapChange:R,relayKeyboardEvent:L}}function MH(e,t){for(let a of TE)if(!t.includes(a)&&e.getModifierState(a))return!0;return!1}var vS=S(D(),1);function IA(e){let{render:t,className:a,style:o,refs:n=Ia,props:r=Ia,state:s=Me,stateAttributesMapping:l,highlightedIndex:i,onHighlightedIndexChange:u,orientation:c,grid:f,loopFocus:d,onLoop:p,enableHomeAndEndKeys:x,onMapChange:b,stopEventPropagation:C=!0,rootRef:g,disabledIndices:m,modifierKeys:h,highlightItemOnHover:y=!1,tag:v=\\\"div\\\",...R}=e,I=en(),{props:L,highlightedIndex:k,onHighlightedIndexChange:w,elementsRef:A,onMapChange:P,relayKeyboardEvent:U}=RA({grid:f,loopFocus:d,onLoop:p,orientation:c,highlightedIndex:i,onHighlightedIndexChange:u,rootRef:g,stopEventPropagation:C,enableHomeAndEndKeys:x,direction:I,disabledIndices:m,modifierKeys:h}),O=le(v,e,{state:s,ref:n,props:[L,...r,R],stateAttributesMapping:l}),M=vA.useMemo(()=>({highlightedIndex:k,onHighlightedIndexChange:w,highlightItemOnHover:y,relayKeyboardEvent:U}),[k,w,y,U]);return(0,vS.jsx)(Jb.Provider,{value:M,children:(0,vS.jsx)(vm,{elementsRef:A,onMapChange:_=>{b?.(_),P(_)},children:O})})}var Qm=S(T(),1),AH=Qm.createContext(void 0);function wA(){return Qm.useContext(AH)}var Jm=S(T(),1),IS=Jm.createContext(void 0);function kA(){return Jm.useContext(IS)}var wS=S(D(),1),kS=eg.forwardRef(function(t,a){let{defaultValue:o,disabled:n=!1,loopFocus:r=!0,onValueChange:s,orientation:l=\\\"horizontal\\\",multiple:i=!1,value:u,className:c,render:f,style:d,...p}=t,x=dm(!0),b=wA(),C=u!==void 0||o!==void 0,g=(x?.disabled??!1)||(b?.disabled??!1)||n,[m,h]=jo({controlled:u,default:u===void 0?o??Ia:void 0,name:\\\"ToggleGroup\\\",state:\\\"value\\\"}),y=K((k,w,A)=>{let P;i?(P=m.slice(),w?P.push(k):P.splice(m.indexOf(k),1)):P=w?[k]:[],s?.(P,A),!A.isCanceled&&h(P)}),v={disabled:g,multiple:i,orientation:l},R=eg.useMemo(()=>({disabled:g,setGroupValue:y,value:m,isValueInitialized:C}),[g,y,m,C]),I={role:\\\"group\\\"},L=le(\\\"div\\\",t,{enabled:!!x,state:v,ref:a,props:[I,p]});return(0,wS.jsx)(IS.Provider,{value:R,children:x?L:(0,wS.jsx)(IA,{render:f,className:c,style:d,state:v,refs:[a],props:[I,p],loopFocus:r,enableHomeAndEndKeys:!0,orientation:l})})});var Nc=S(T(),1);var TA=S(D(),1),TS=Nc.forwardRef(function(t,a){let{className:o,defaultPressed:n=!1,disabled:r=!1,form:s,onPressedChange:l,pressed:i,render:u,type:c,value:f,nativeButton:d=!0,style:p,...x}=t,b=ot(f||void 0),C=kA(),g=C?.value??[],m=C?void 0:n,h=(r||C?.disabled)??!1,[y,v]=jo({controlled:C?b!==void 0&&g.indexOf(b)>-1:i,default:m,name:\\\"Toggle\\\",state:\\\"pressed\\\"}),{getButtonProps:R,buttonRef:I}=pa({disabled:h,native:d}),L={disabled:h,pressed:y},k=[I,a],w=[{\\\"aria-pressed\\\":y,onClick(U){let O=!y,M=ce(j.none,U.nativeEvent);l?.(O,M),!M.isCanceled&&(b&&C?.setGroupValue?.(b,O,M),!M.isCanceled&&v(O))}},x,R],A=le(\\\"button\\\",t,{enabled:!C,state:L,ref:k,props:w}),P=Nc.useMemo(()=>({disabled:h,focusableWhenDisabled:!1}),[h]);return C?(0,TA.jsx)(Hm,{tag:\\\"button\\\",render:u,className:o,style:p,metadata:P,state:L,refs:k,props:w}):A});var tg=S(D(),1),DH=Lr(\\\"inline-flex items-center justify-center gap-1.5 rounded-md font-medium whitespace-nowrap text-muted-foreground transition-[color,background-color,box-shadow] outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[pressed]:bg-background data-[pressed]:text-foreground data-[pressed]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\\\",{variants:{size:{default:\\\"h-9 px-3 text-sm\\\",sm:\\\"h-8 px-2.5 text-[0.82rem]\\\"}},defaultVariants:{size:\\\"default\\\"}}),EA=ag.createContext({size:\\\"default\\\"});function MA({className:e,size:t,children:a,...o}){return(0,tg.jsx)(kS,{\\\"data-slot\\\":\\\"toggle-group\\\",className:te(\\\"flex w-fit items-center gap-0.5 rounded-lg bg-muted p-0.5\\\",e),...o,children:(0,tg.jsx)(EA.Provider,{value:{size:t},children:a})})}function AA({className:e,children:t,size:a,...o}){let n=ag.useContext(EA);return(0,tg.jsx)(TS,{\\\"data-slot\\\":\\\"toggle-group-item\\\",className:te(DH({size:n.size??a}),\\\"flex-1 shrink-0\\\",e),...o,children:t})}var _A=S(T(),1);var Oe=S(D(),1),OH=\\\"file-tree\\\",PH=\\\"data-model\\\";function DA(e){return e===\\\"added\\\"||e===\\\"modified\\\"||e===\\\"removed\\\"||e===\\\"renamed\\\"}function og(e){return typeof e==\\\"object\\\"&&e!==null&&!Array.isArray(e)}function on(e){return typeof e==\\\"string\\\"&&e!==\\\"\\\"?e:void 0}function NH({authored:e}){return e!==\\\"agent\\\"?null:(0,Oe.jsx)(Jt,{variant:\\\"outline\\\",className:\\\"border-border text-[10px] text-muted-foreground\\\",children:\\\"AI-authored, not verified by a run\\\"})}function OA({title:e,authored:t,children:a}){return(0,Oe.jsxs)(\\\"figure\\\",{className:\\\"my-3\\\",children:[e||t===\\\"agent\\\"?(0,Oe.jsxs)(\\\"figcaption\\\",{className:\\\"mb-1.5 flex flex-wrap items-center gap-2\\\",children:[e?(0,Oe.jsx)(\\\"span\\\",{className:\\\"text-xs font-medium text-muted-foreground\\\",children:e}):null,(0,Oe.jsx)(NH,{authored:t})]}):null,a]})}function PA({change:e}){return(0,Oe.jsx)(Jt,{variant:\\\"tag\\\",className:\\\"text-[10px]\\\",children:e})}function BH(e){if(!og(e)||!Array.isArray(e.files))return;let t=[];for(let a of e.files){if(typeof a==\\\"string\\\"){a&&t.push({path:a});continue}if(!og(a))continue;let o=on(a.path);o&&t.push({path:o,change:DA(a.change)?a.change:void 0,note:on(a.note)})}if(t.length!==0)return{title:on(e.title),authored:on(e.authored),files:t}}function FH(e){let t={name:\\\"\\\",children:new Map};for(let a of e){let o=a.path.split(\\\"/\\\").filter(Boolean),n=t;o.forEach((r,s)=>{let l=n.children.get(r);l||(l={name:r,children:new Map},n.children.set(r,l)),s===o.length-1&&(l.file=a),n=l})}return t}function _H(e){return[...e.children.values()].sort((t,a)=>{let o=t.children.size>0,n=a.children.size>0;return o!==n?o?-1:1:t.name.localeCompare(a.name)})}function NA({node:e,depth:t}){let a=_H(e);return(0,Oe.jsx)(\\\"ul\\\",{className:te(\\\"space-y-0.5\\\",t>0&&\\\"ml-3 border-l border-border/60 pl-3\\\"),children:a.map(o=>{let n=o.children.size>0;return(0,Oe.jsxs)(\\\"li\\\",{children:[(0,Oe.jsxs)(\\\"div\\\",{className:\\\"flex flex-wrap items-baseline gap-2\\\",children:[(0,Oe.jsx)(\\\"span\\\",{className:te(\\\"font-mono text-xs\\\",n?\\\"text-muted-foreground\\\":\\\"text-foreground\\\"),children:n?`${o.name}/`:o.name}),o.file?.change?(0,Oe.jsx)(PA,{change:o.file.change}):null,o.file?.note?(0,Oe.jsx)(\\\"span\\\",{className:\\\"text-xs text-muted-foreground\\\",children:o.file.note}):null]}),n?(0,Oe.jsx)(NA,{node:o,depth:t+1}):null]},o.name)})})}function UH({entry:e}){let t=BH(e.data);return t?(0,Oe.jsx)(OA,{title:t.title??\\\"Files changed\\\",authored:t.authored,children:(0,Oe.jsx)(\\\"div\\\",{tabIndex:0,className:\\\"overflow-x-auto rounded-md border border-border bg-card p-3\\\",children:(0,Oe.jsx)(NA,{node:FH(t.files),depth:0})})}):(0,Oe.jsx)(BA,{entry:e})}function HH(e){if(!og(e)||!Array.isArray(e.fields))return;let t=[];for(let a of e.fields){if(!og(a))continue;let o=on(a.name);o&&t.push({name:o,type:on(a.type),note:on(a.note),change:DA(a.change)?a.change:void 0})}if(t.length!==0)return{title:on(e.title),authored:on(e.authored),name:on(e.name),fields:t}}function zH({entry:e}){let t=HH(e.data);if(!t)return(0,Oe.jsx)(BA,{entry:e});let a=t.fields.some(o=>o.note);return(0,Oe.jsx)(OA,{title:t.title??t.name??\\\"Data model\\\",authored:t.authored,children:(0,Oe.jsx)(\\\"div\\\",{tabIndex:0,className:\\\"overflow-x-auto rounded-md border border-border\\\",children:(0,Oe.jsxs)(\\\"table\\\",{className:\\\"w-full border-collapse text-sm\\\",children:[(0,Oe.jsx)(\\\"thead\\\",{children:(0,Oe.jsxs)(\\\"tr\\\",{className:\\\"bg-muted/50\\\",children:[(0,Oe.jsx)(\\\"th\\\",{scope:\\\"col\\\",className:\\\"border-b border-border px-3 py-2 text-left font-semibold\\\",children:\\\"Field\\\"}),(0,Oe.jsx)(\\\"th\\\",{scope:\\\"col\\\",className:\\\"border-b border-border px-3 py-2 text-left font-semibold\\\",children:\\\"Type\\\"}),a?(0,Oe.jsx)(\\\"th\\\",{scope:\\\"col\\\",className:\\\"border-b border-border px-3 py-2 text-left font-semibold\\\",children:\\\"Note\\\"}):null]})}),(0,Oe.jsx)(\\\"tbody\\\",{children:t.fields.map(o=>(0,Oe.jsxs)(\\\"tr\\\",{children:[(0,Oe.jsx)(\\\"td\\\",{className:\\\"border-b border-border px-3 py-2\\\",children:(0,Oe.jsxs)(\\\"span\\\",{className:\\\"flex flex-wrap items-center gap-2\\\",children:[(0,Oe.jsx)(\\\"span\\\",{className:\\\"font-mono text-xs text-foreground\\\",children:o.name}),o.change?(0,Oe.jsx)(PA,{change:o.change}):null]})}),(0,Oe.jsx)(\\\"td\\\",{className:\\\"border-b border-border px-3 py-2 font-mono text-xs text-muted-foreground\\\",children:o.type??\\\"\\\"}),a?(0,Oe.jsx)(\\\"td\\\",{className:\\\"border-b border-border px-3 py-2 text-foreground\\\",children:o.note??\\\"\\\"}):null]},o.name))})]})})})}function BA({entry:e}){return(0,Oe.jsxs)(\\\"div\\\",{className:\\\"my-2\\\",\\\"data-type\\\":e.type,children:[(0,Oe.jsxs)(\\\"p\\\",{className:\\\"mb-1 text-xs font-medium text-muted-foreground\\\",children:[e.type,\\\" (unrecognised shape)\\\"]}),(0,Oe.jsx)(\\\"pre\\\",{tabIndex:0,className:\\\"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground\\\",children:qH(e.data)})]})}function qH(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}var FA={[OH]:e=>(0,Oe.jsx)(UH,{entry:e}),[PH]:e=>(0,Oe.jsx)(zH,{entry:e})};var HA=S(D(),1),VH={};function UA({report:e,customRenderers:t,renderers:a,children:o}){let n=(0,_A.useMemo)(()=>({report:e,customRenderers:{...FA,...t},renderers:a??VH}),[e,t,a]);return(0,HA.jsx)(Ls.Provider,{value:n,children:o})}var ng={query:\\\"\\\",status:\\\"all\\\",tags:[],detail:\\\"full\\\"},GH=[\\\"all\\\",\\\"passed\\\",\\\"failed\\\",\\\"skipped\\\",\\\"pending\\\"];function Ks(e){let t=e.replace(/^#/,\\\"\\\"),a=t.indexOf(\\\"?\\\");return a===-1?{anchor:t,params:new URLSearchParams}:{anchor:t.slice(0,a),params:new URLSearchParams(t.slice(a+1))}}function zA(e){let t=e.get(\\\"status\\\"),a=e.get(\\\"tags\\\");return{query:e.get(\\\"q\\\")??ng.query,status:GH.includes(t)?t:ng.status,tags:a?a.split(\\\",\\\").filter(Boolean):[],detail:e.get(\\\"docs\\\")===\\\"0\\\"?\\\"minimal\\\":\\\"full\\\"}}function qA(e){let t=new URLSearchParams;return e.query&&t.set(\\\"q\\\",e.query),e.status!==\\\"all\\\"&&t.set(\\\"status\\\",e.status),e.tags.length>0&&t.set(\\\"tags\\\",e.tags.join(\\\",\\\")),e.detail===\\\"minimal\\\"&&t.set(\\\"docs\\\",\\\"0\\\"),t.toString()}function XH(e,t){return t?`#${e}?${t}`:e?`#${e}`:\\\"\\\"}function rg(e,t){if(typeof window>\\\"u\\\")return;let a=XH(e,t);if(a===window.location.hash)return;let o=a||window.location.href.split(\\\"#\\\")[0];try{window.history.replaceState(window.history.state,\\\"\\\",o)}catch{window.location.hash=a.slice(1)}}function jH(){return typeof window>\\\"u\\\"||typeof window.matchMedia!=\\\"function\\\"?!1:window.matchMedia(\\\"(prefers-reduced-motion: reduce)\\\").matches}function Wr(e,t={}){if(typeof document>\\\"u\\\")return;let a=document.getElementById(e);a&&(a.scrollIntoView({behavior:jH()?\\\"auto\\\":\\\"smooth\\\",block:\\\"start\\\"}),t.updateHash!==!1&&rg(e,Ks(window.location.hash).params.toString()))}var ES=e=>({ok:!0,data:e}),MS=e=>({ok:!1,error:e});function VA(e){return typeof e==\\\"object\\\"&&e!==null&&\\\"ok\\\"in e&&typeof e.ok==\\\"boolean\\\"?e:ES(e)}function YH(e){return e.trim().toLowerCase()}function GA(e){let t=new Set;for(let a of e.features)for(let o of a.scenarios)for(let n of o.tags)t.add(n);return[...t]}function KH(e,t,a){if(t===\\\"\\\"||e.title.toLowerCase().includes(t)||a?.toLowerCase().includes(t)||e.errorMessage?.toLowerCase().includes(t))return!0;for(let o of e.tags)if(o.toLowerCase().includes(t))return!0;for(let o of e.tickets??[])if(o.id.toLowerCase().includes(t))return!0;for(let o of e.steps)if(o.text.toLowerCase().includes(t))return!0;return!1}function $H(e,t,a,o,n){return a!==\\\"all\\\"&&e.status!==a||o.length>0&&!o.some(r=>e.tags.includes(r))?!1:KH(e,t,n)}function WH(e){let t=0,a=0,o=0,n=0,r=0,s=0;for(let l of e)t+=1,s+=l.durationMs,l.status===\\\"passed\\\"?a+=1:l.status===\\\"failed\\\"?o+=1:l.status===\\\"skipped\\\"?n+=1:r+=1;return{total:t,passed:a,failed:o,skipped:n,pending:r,durationMs:s}}function sg(e,t){let a=typeof t==\\\"string\\\"?{query:t}:t,o=YH(a.query??\\\"\\\"),n=a.status??\\\"all\\\",r=a.tags??[];if(o===\\\"\\\"&&n===\\\"all\\\"&&r.length===0)return e;let s=[],l=0,i=0,u=0,c=0,f=0,d=0;for(let p of e.features){let x=p.scenarios.filter(C=>$H(C,o,n,r,p.sourceFile));if(x.length===0)continue;let b=WH(x);s.push({...p,summary:b,scenarios:x}),l+=b.total,i+=b.passed,u+=b.failed,c+=b.skipped,f+=b.pending,d+=b.durationMs}return{...e,summary:{total:l,passed:i,failed:u,skipped:c,pending:f,durationMs:d},features:s}}function XA(e){return e.features.flatMap(t=>t.scenarios.filter(a=>a.status===\\\"failed\\\"))}function jA(e){let t=[];for(let a of e.features)for(let o of a.scenarios)if(o.status===\\\"failed\\\"){let n={featureId:a.id,scenarioId:o.id,scenarioTitle:o.title};o.errorMessage!==void 0&&(n.errorMessage=o.errorMessage),t.push(n)}return t}var xo=S(D(),1);function YA({applied:e,onReset:t,onDismiss:a}){let o=[];return e.search&&o.push(`matching \\\\u201C${e.search}\\\\u201D`),e.status!==\\\"all\\\"&&o.push(e.status),e.tags.length>0&&o.push(e.tags.join(\\\", \\\")),(0,xo.jsxs)(\\\"div\\\",{role:\\\"status\\\",\\\"aria-live\\\":\\\"polite\\\",className:\\\"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-primary/40 bg-primary/5 px-3 py-2 text-sm\\\",children:[(0,xo.jsx)(Ou,{\\\"aria-hidden\\\":!0,className:\\\"size-4 shrink-0 text-primary\\\"}),(0,xo.jsxs)(\\\"span\\\",{className:\\\"min-w-0 flex-1\\\",children:[\\\"An agent filtered this report\\\",o.length>0?(0,xo.jsxs)(xo.Fragment,{children:[\\\" to \\\",o.join(\\\" \\\\xB7 \\\")]}):null,\\\" \\\\u2014\\\",\\\" \\\",(0,xo.jsxs)(\\\"span\\\",{className:\\\"tabular-nums\\\",children:[e.matched,\\\" of \\\",e.total,\\\" scenarios\\\"]}),\\\".\\\"]}),(0,xo.jsx)(\\\"button\\\",{type:\\\"button\\\",onClick:t,className:\\\"cursor-pointer rounded-md border border-border px-2 py-1 text-xs hover:bg-muted\\\",children:\\\"Show all\\\"}),(0,xo.jsx)(\\\"button\\\",{type:\\\"button\\\",onClick:a,\\\"aria-label\\\":\\\"Dismiss\\\",className:\\\"cursor-pointer rounded-md p-1 text-muted-foreground hover:text-foreground\\\",children:(0,xo.jsx)(bs,{\\\"aria-hidden\\\":!0,className:\\\"size-4\\\"})})]})}var KA=S(T(),1);var $s=S(D(),1);function $A({failures:e,onCopyAll:t}){let a=e[0],o=(0,KA.useCallback)(()=>{a&&Wr(a.scenarioId)},[a]);return e.length===0?null:(0,$s.jsxs)(\\\"div\\\",{className:\\\"es-failure-banner\\\",role:\\\"status\\\",\\\"aria-live\\\":\\\"polite\\\",\\\"aria-label\\\":\\\"Failure summary\\\",children:[(0,$s.jsxs)(\\\"span\\\",{className:\\\"es-failure-banner-text\\\",children:[(0,$s.jsx)(\\\"strong\\\",{children:e.length}),\\\" \\\",\\\"failure\\\",e.length===1?\\\"\\\":\\\"s\\\"]}),(0,$s.jsx)(\\\"button\\\",{type:\\\"button\\\",className:\\\"es-failure-banner-jump\\\",onClick:o,\\\"aria-label\\\":\\\"View first failure\\\",children:\\\"View first failure \\\\u2193\\\"}),t?(0,$s.jsxs)(\\\"button\\\",{type:\\\"button\\\",className:\\\"es-failure-banner-jump\\\",onClick:t,\\\"aria-label\\\":\\\"Copy failures for an agent\\\",children:[\\\"Copy \\\",e.length,\\\" failure\\\",e.length===1?\\\"\\\":\\\"s\\\",\\\" for an agent\\\"]}):null]})}var WA=S(T(),1);var bo=S(D(),1),lg=12;function ZA({statuses:e,status:t,onStatus:a,tags:o,activeTags:n,onToggleTag:r}){let[s,l]=(0,WA.useState)(!1);if(e.length===0&&o.length===0)return null;let i=o.length>lg&&!s,u=i?o.slice(0,lg):o;return(0,bo.jsxs)(\\\"div\\\",{className:\\\"flex flex-col gap-2\\\",children:[e.length>0?(0,bo.jsx)(\\\"div\\\",{role:\\\"group\\\",\\\"aria-label\\\":\\\"Filter by status\\\",className:\\\"flex flex-wrap gap-1\\\",children:e.map(c=>{let f=t===c.key;return(0,bo.jsxs)(\\\"button\\\",{type:\\\"button\\\",\\\"aria-pressed\\\":f,onClick:()=>a(f&&c.key!==\\\"all\\\"?\\\"all\\\":c.key),className:te(\\\"cursor-pointer rounded-md border px-2 py-1 text-xs transition-colors\\\",f?\\\"border-primary bg-primary text-primary-foreground\\\":\\\"border-border text-muted-foreground hover:bg-muted hover:text-foreground\\\"),children:[c.label,(0,bo.jsx)(\\\"span\\\",{className:\\\"ml-1 font-mono opacity-70\\\",children:c.count})]},c.key)})}):null,o.length>0?(0,bo.jsxs)(\\\"ul\\\",{\\\"aria-label\\\":\\\"Filter by tag\\\",className:\\\"flex flex-wrap items-center gap-1.5\\\",children:[u.map(c=>{let f=n.includes(c);return(0,bo.jsx)(\\\"li\\\",{children:(0,bo.jsx)(\\\"button\\\",{type:\\\"button\\\",\\\"aria-pressed\\\":f,onClick:()=>r(c),className:\\\"cursor-pointer\\\",children:(0,bo.jsx)(Jt,{variant:\\\"tag\\\",className:te(f&&\\\"border-primary bg-primary text-primary-foreground\\\"),children:c})})},c)}),o.length>lg?(0,bo.jsx)(\\\"li\\\",{children:(0,bo.jsx)(\\\"button\\\",{type:\\\"button\\\",\\\"aria-expanded\\\":s,onClick:()=>l(c=>!c),className:\\\"cursor-pointer rounded-full px-2 py-0.5 text-xs font-medium text-muted-foreground hover:text-foreground\\\",children:i?`+${o.length-lg} more`:\\\"Show fewer\\\"})}):null]}):null]})}var ig=S(T(),1);var nn=S(D(),1);function QA({lastRunMs:e,ciUrl:t,staleAfterDays:a,nowMs:o}){let[n,r]=(0,ig.useState)(o);if((0,ig.useEffect)(()=>{o===void 0&&r(Date.now())},[o]),e===void 0||n===void 0)return null;let s=ti(e,n),l=t?(0,nn.jsx)(\\\"a\\\",{href:t,target:\\\"_blank\\\",rel:\\\"noreferrer noopener\\\",className:\\\"underline underline-offset-2\\\",children:\\\"View CI run\\\"}):null;return Zd(e,a,n)?(0,nn.jsxs)(\\\"div\\\",{className:\\\"es-stale-banner\\\",role:\\\"status\\\",\\\"aria-label\\\":\\\"Report freshness\\\",children:[(0,nn.jsxs)(\\\"span\\\",{children:[(0,nn.jsxs)(\\\"strong\\\",{children:[\\\"Last verified \\\",s,\\\".\\\"]}),\\\" This report may no longer match the current behavior. Look for a newer run.\\\"]}),l]}):(0,nn.jsxs)(\\\"p\\\",{className:\\\"es-freshness\\\",\\\"aria-label\\\":\\\"Report freshness\\\",children:[\\\"Verified \\\",s,l?(0,nn.jsxs)(nn.Fragment,{children:[\\\" \\\\xB7 \\\",l]}):null]})}var ia=S(D(),1),AS=5;function JA({scenarios:e,tone:t}){return(0,ia.jsxs)(ia.Fragment,{children:[e.slice(0,AS).map((a,o)=>(0,ia.jsxs)(\\\"span\\\",{children:[o>0?\\\", \\\":\\\"\\\",(0,ia.jsx)(\\\"a\\\",{href:`#${a.id}`,className:te(\\\"underline underline-offset-2 hover:no-underline\\\",t),children:a.title})]},a.id)),e.length>AS?(0,ia.jsxs)(\\\"span\\\",{children:[\\\" and \\\",e.length-AS,\\\" more\\\"]}):null]})}function e1({history:e,report:t}){if(!e)return null;let a=t.features.flatMap(l=>l.scenarios.map(i=>({id:i.id,title:i.title}))),o=B0(e,a);if(!o)return null;let{newlyFailing:n,newlyPassing:r,added:s}=o;return n.length===0&&r.length===0&&s.length===0?(0,ia.jsx)(\\\"p\\\",{className:\\\"text-xs text-muted-foreground\\\",\\\"data-testid\\\":\\\"es-last-run-delta\\\",children:\\\"Since last run: no behavior changes.\\\"}):(0,ia.jsxs)(\\\"p\\\",{className:\\\"text-xs text-muted-foreground\\\",\\\"data-testid\\\":\\\"es-last-run-delta\\\",children:[(0,ia.jsx)(\\\"span\\\",{className:\\\"font-medium text-foreground\\\",children:\\\"Since last run:\\\"}),n.length>0?(0,ia.jsxs)(\\\"span\\\",{className:\\\"ml-2 text-fail\\\",children:[n.length,\\\" newly failing (\\\",(0,ia.jsx)(JA,{scenarios:n,tone:\\\"text-fail\\\"}),\\\")\\\"]}):null,r.length>0?(0,ia.jsxs)(\\\"span\\\",{className:\\\"ml-2 text-pass\\\",children:[r.length,\\\" fixed (\\\",(0,ia.jsx)(JA,{scenarios:r,tone:\\\"text-pass\\\"}),\\\")\\\"]}):null,s.length>0?(0,ia.jsxs)(\\\"span\\\",{className:\\\"ml-2\\\",children:[s.length,\\\" new\\\"]}):null]})}var ug=S(T(),1);var gte=S(T(),1);var a1=S(D(),1);function t1({className:e,type:t,...a}){return(0,a1.jsx)(\\\"input\\\",{type:t,\\\"data-slot\\\":\\\"input\\\",className:te(\\\"h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30\\\",\\\"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50\\\",\\\"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40\\\",e),...a})}var Zr=S(D(),1),o1=(0,ug.forwardRef)(function(t,a){let{value:o,onChange:n,matchedCount:r,totalCount:s,placeholder:l=\\\"Search scenarios, tags, tickets, errors\\\\u2026\\\",className:i}=t,u=(0,ug.useId)(),c=o.trim().length>0&&typeof r==\\\"number\\\"&&typeof s==\\\"number\\\";function f(p){n(p.target.value)}function d(p){p.key===\\\"Escape\\\"&&o!==\\\"\\\"&&(n(\\\"\\\"),p.preventDefault())}return(0,Zr.jsxs)(\\\"div\\\",{className:te(\\\"es-search flex flex-col gap-1\\\",i),children:[(0,Zr.jsx)(\\\"label\\\",{htmlFor:u,className:\\\"sr-only\\\",children:\\\"Search\\\"}),(0,Zr.jsxs)(\\\"div\\\",{className:\\\"relative w-full sm:w-72\\\",children:[(0,Zr.jsx)(Uu,{\\\"aria-hidden\\\":!0,className:\\\"pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground\\\"}),(0,Zr.jsx)(t1,{ref:a,id:u,type:\\\"search\\\",value:o,onChange:f,onKeyDown:d,placeholder:l,autoComplete:\\\"off\\\",spellCheck:!1,\\\"aria-keyshortcuts\\\":\\\"/\\\",className:\\\"pl-8\\\"})]}),c?(0,Zr.jsxs)(\\\"span\\\",{className:\\\"text-xs tabular-nums text-muted-foreground\\\",\\\"aria-live\\\":\\\"polite\\\",children:[r,\\\" of \\\",s,\\\" scenarios\\\"]}):null]})});var ki=S(T(),1);var Lte=S(T(),1);var ZH=Lr(\\\"inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\\\",{variants:{variant:{default:\\\"bg-primary text-primary-foreground hover:bg-primary/90\\\",destructive:\\\"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40\\\",outline:\\\"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\\\",secondary:\\\"bg-secondary text-secondary-foreground hover:bg-secondary/80\\\",ghost:\\\"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\\\",link:\\\"text-primary underline-offset-4 hover:underline\\\"},size:{default:\\\"h-9 px-4 py-2 has-[>svg]:px-3\\\",xs:\\\"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3\\\",sm:\\\"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5\\\",lg:\\\"h-10 rounded-md px-6 has-[>svg]:px-4\\\",icon:\\\"size-9\\\",\\\"icon-xs\\\":\\\"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3\\\",\\\"icon-sm\\\":\\\"size-8\\\",\\\"icon-lg\\\":\\\"size-10\\\"}},defaultVariants:{variant:\\\"default\\\",size:\\\"default\\\"}});function wi({className:e,variant:t=\\\"default\\\",size:a=\\\"default\\\",render:o,...n}){return Nd({defaultTagName:\\\"button\\\",render:o,props:{\\\"data-slot\\\":\\\"button\\\",\\\"data-variant\\\":t,\\\"data-size\\\":a,className:te(ZH({variant:t,size:a,className:e})),...n}})}var Vt=S(D(),1),QH=\\\"npx executable-stories share reports/\\\";function n1({command:e=QH,onCopy:t}){let[a,o]=(0,ki.useState)(!1),n=(0,ki.useRef)(null);return(0,ki.useEffect)(()=>{let r=n.current;r&&(a&&!r.open?r.showModal():!a&&r.open&&r.close())},[a]),(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsxs)(wi,{type:\\\"button\\\",variant:\\\"ghost\\\",size:\\\"sm\\\",\\\"aria-label\\\":\\\"Share this report\\\",title:\\\"Share this report\\\",onClick:()=>o(!0),children:[(0,Vt.jsx)(Hu,{\\\"aria-hidden\\\":\\\"true\\\",className:\\\"size-4\\\"}),(0,Vt.jsx)(\\\"span\\\",{className:\\\"sr-only sm:not-sr-only\\\",children:\\\"Share\\\"})]}),(0,Vt.jsxs)(\\\"dialog\\\",{ref:n,className:\\\"es-report-share m-auto w-[min(90vw,32rem)] rounded-lg border border-border bg-card p-6 text-card-foreground shadow-lg [overscroll-behavior:contain] backdrop:bg-black/40\\\",\\\"aria-label\\\":\\\"Share this report\\\",onClose:()=>o(!1),children:[(0,Vt.jsx)(\\\"h2\\\",{className:\\\"text-base font-semibold\\\",children:\\\"Share this report\\\"}),(0,Vt.jsx)(\\\"p\\\",{className:\\\"mt-2 text-sm text-muted-foreground\\\",children:\\\"Publish it to Executable Stories Cloud and send a link. Screenshots and videos go with it. Run this from your project:\\\"}),(0,Vt.jsxs)(\\\"div\\\",{className:\\\"mt-4 flex items-center gap-2\\\",children:[(0,Vt.jsx)(\\\"code\\\",{className:\\\"min-w-0 flex-1 truncate rounded border border-border bg-muted px-3 py-2 font-mono text-xs\\\",children:e}),(0,Vt.jsx)(wi,{type:\\\"button\\\",size:\\\"sm\\\",onClick:()=>t(e,\\\"Command copied\\\"),children:\\\"Copy\\\"})]}),(0,Vt.jsx)(\\\"p\\\",{className:\\\"mt-3 text-xs text-muted-foreground\\\",children:\\\"The file you are reading cannot upload itself, so the command does it: only the CLI can read the assets this report links to.\\\"}),(0,Vt.jsxs)(\\\"div\\\",{className:\\\"mt-6 flex items-center justify-between gap-4\\\",children:[(0,Vt.jsx)(\\\"a\\\",{className:\\\"text-xs underline underline-offset-2\\\",href:\\\"https://docs.executablestories.com/guides/sharing-reports/\\\",target:\\\"_blank\\\",rel:\\\"noreferrer\\\",children:\\\"How sharing works\\\"}),(0,Vt.jsx)(wi,{type:\\\"button\\\",variant:\\\"outline\\\",size:\\\"sm\\\",onClick:()=>o(!1),children:\\\"Close\\\"})]})]})]})}var Bc=S(T(),1);function r1(e,t){let a={};for(let o of e.features)for(let n of o.scenarios)a[n.id]=n.status;return{runId:e.runId,atMs:t,statuses:a}}function s1(e,t){if(!e||e.runId===t.runId)return null;let a=[],o=[],n=[];for(let r of t.features)for(let s of r.scenarios){let l={id:s.id,title:s.title},i=e.statuses[s.id];i===void 0?n.push(l):i!==\\\"failed\\\"&&s.status===\\\"failed\\\"?a.push(l):i===\\\"failed\\\"&&s.status===\\\"passed\\\"&&o.push(l)}return a.length===0&&o.length===0&&n.length===0?null:{sinceMs:e.atMs,newlyFailing:a,newlyPassing:o,added:n}}var ma=S(D(),1),i1=\\\"es-last-visit\\\",DS=5;function JH(){try{let e=localStorage.getItem(i1);if(!e)return null;let t=JSON.parse(e);if(typeof t!=\\\"object\\\"||t===null)return null;let a=t;return typeof a.runId!=\\\"string\\\"||typeof a.atMs!=\\\"number\\\"||typeof a.statuses!=\\\"object\\\"?null:{runId:a.runId,atMs:a.atMs,statuses:a.statuses}}catch{return null}}function ez(e){try{localStorage.setItem(i1,JSON.stringify(e))}catch{}}function l1({scenarios:e,tone:t}){return(0,ma.jsxs)(ma.Fragment,{children:[e.slice(0,DS).map((a,o)=>(0,ma.jsxs)(\\\"span\\\",{children:[o>0?\\\", \\\":\\\"\\\",(0,ma.jsx)(\\\"a\\\",{href:`#${a.id}`,className:te(\\\"underline underline-offset-2 hover:no-underline\\\",t),children:a.title})]},a.id)),e.length>DS?(0,ma.jsxs)(\\\"span\\\",{children:[\\\" and \\\",e.length-DS,\\\" more\\\"]}):null]})}function u1({report:e}){let[t,a]=(0,Bc.useState)(null),[o,n]=(0,Bc.useState)(0);if((0,Bc.useEffect)(()=>{let i=Date.now();a(s1(JH(),e)),n(i),ez(r1(e,i))},[e]),!t)return null;let{newlyFailing:r,newlyPassing:s,added:l}=t;return(0,ma.jsxs)(\\\"p\\\",{className:\\\"text-xs text-muted-foreground\\\",\\\"data-testid\\\":\\\"es-since-last-visit\\\",children:[(0,ma.jsxs)(\\\"span\\\",{className:\\\"font-medium text-foreground\\\",children:[\\\"Since your last visit (\\\",ti(t.sinceMs,o),\\\"):\\\"]}),r.length>0?(0,ma.jsxs)(\\\"span\\\",{className:\\\"ml-2 text-fail\\\",children:[r.length,\\\" started failing (\\\",(0,ma.jsx)(l1,{scenarios:r,tone:\\\"text-fail\\\"}),\\\")\\\"]}):null,s.length>0?(0,ma.jsxs)(\\\"span\\\",{className:\\\"ml-2 text-pass\\\",children:[s.length,\\\" fixed (\\\",(0,ma.jsx)(l1,{scenarios:s,tone:\\\"text-pass\\\"}),\\\")\\\"]}):null,l.length>0?(0,ma.jsxs)(\\\"span\\\",{className:\\\"ml-2\\\",children:[l.length,\\\" new\\\"]}):null]})}var cg=S(T(),1);var ga=S(D(),1),tz=[{keys:\\\"/\\\",description:\\\"Focus search\\\"},{keys:\\\"f\\\",description:\\\"Jump to next failure\\\"},{keys:\\\"Shift F\\\",description:\\\"Jump to previous failure\\\"},{keys:\\\"e\\\",description:\\\"Expand all\\\"},{keys:\\\"c\\\",description:\\\"Collapse all\\\"},{keys:\\\"?\\\",description:\\\"Toggle this help\\\"},{keys:\\\"Esc\\\",description:\\\"Clear search / close\\\"}];function az({keys:e}){let t=e.split(\\\" \\\");return(0,ga.jsx)(\\\"span\\\",{className:\\\"inline-flex items-center gap-1\\\",children:t.map((a,o)=>(0,ga.jsxs)(\\\"span\\\",{className:\\\"inline-flex items-center gap-1\\\",children:[o>0?(0,ga.jsx)(\\\"span\\\",{className:\\\"text-xs text-muted-foreground\\\",children:\\\"+\\\"}):null,(0,ga.jsx)(\\\"kbd\\\",{className:\\\"inline-flex h-6 min-w-6 items-center justify-center rounded border border-border bg-muted px-1.5 font-mono text-xs font-medium text-muted-foreground\\\",children:a})]},a))})}function c1({open:e,onClose:t}){let a=(0,cg.useRef)(null);return(0,cg.useEffect)(()=>{let o=a.current;o&&(e&&!o.open?o.showModal():!e&&o.open&&o.close())},[e]),(0,ga.jsxs)(\\\"dialog\\\",{ref:a,className:\\\"es-shortcuts-help m-auto w-[min(90vw,28rem)] rounded-lg border border-border bg-card p-6 text-card-foreground shadow-lg [overscroll-behavior:contain] backdrop:bg-black/40\\\",\\\"aria-label\\\":\\\"Keyboard shortcuts\\\",onClose:t,children:[(0,ga.jsx)(\\\"h2\\\",{className:\\\"text-base font-semibold\\\",children:\\\"Keyboard shortcuts\\\"}),(0,ga.jsx)(\\\"dl\\\",{className:\\\"mt-4 grid grid-cols-[auto_1fr] items-center gap-x-4 gap-y-2.5\\\",children:tz.map(o=>(0,ga.jsxs)(\\\"div\\\",{className:\\\"col-span-2 grid grid-cols-subgrid items-center\\\",children:[(0,ga.jsx)(\\\"dt\\\",{className:\\\"justify-self-start\\\",children:(0,ga.jsx)(az,{keys:o.keys})}),(0,ga.jsx)(\\\"dd\\\",{className:\\\"text-sm text-muted-foreground\\\",children:o.description})]},o.keys))}),(0,ga.jsx)(\\\"form\\\",{method:\\\"dialog\\\",className:\\\"mt-6\\\",children:(0,ga.jsx)(wi,{type:\\\"submit\\\",variant:\\\"outline\\\",size:\\\"sm\\\",children:\\\"Close\\\"})})]})}var Ti=S(T(),1);var Ya=S(D(),1),oz={passed:\\\"bg-pass\\\",failed:\\\"bg-fail\\\",skipped:\\\"bg-skip\\\",pending:\\\"bg-pend\\\"};function OS({onNavigate:e}){let t=qa(),[a,o]=(0,Ti.useState)(null),n=(0,Ti.useMemo)(()=>t.features.flatMap(r=>r.scenarios.map(s=>s.id)),[t]);return(0,Ti.useEffect)(()=>{if(typeof window>\\\"u\\\")return;let r=n.map(u=>document.getElementById(u)).filter(u=>u!==null);if(r.length===0)return;let s=0,l=()=>{s=0;let c=window.scrollY+window.innerHeight>=document.documentElement.scrollHeight-2?window.innerHeight:window.innerHeight*.2,f=r[0],d=-1/0;for(let p of r){let x=p.getBoundingClientRect().top;x<=c&&x>d&&(d=x,f=p)}o(f.id)},i=()=>{s===0&&(s=requestAnimationFrame(l))};return l(),window.addEventListener(\\\"scroll\\\",i,{passive:!0}),window.addEventListener(\\\"resize\\\",i),()=>{window.removeEventListener(\\\"scroll\\\",i),window.removeEventListener(\\\"resize\\\",i),s!==0&&cancelAnimationFrame(s)}},[n]),t.features.length===0?null:(0,Ya.jsx)(\\\"ul\\\",{className:\\\"flex list-none flex-col gap-4 pl-0\\\",children:t.features.map(r=>(0,Ya.jsxs)(\\\"li\\\",{children:[(0,Ya.jsx)(\\\"p\\\",{className:\\\"mb-1.5 font-semibold leading-snug text-foreground\\\",children:r.title}),(0,Ya.jsx)(\\\"ul\\\",{className:\\\"flex list-none flex-col gap-0.5 pl-0\\\",children:r.scenarios.map(s=>{let l=a===s.id;return(0,Ya.jsx)(\\\"li\\\",{children:(0,Ya.jsxs)(\\\"a\\\",{href:`#${s.id}`,onClick:i=>{i.preventDefault(),Wr(s.id,{updateHash:!0}),e?.()},\\\"aria-current\\\":l?\\\"true\\\":void 0,className:te(\\\"flex items-start gap-2 border-l-2 py-1 pl-2.5 leading-snug hover:text-foreground\\\",l?\\\"border-primary font-medium text-foreground\\\":\\\"border-border text-muted-foreground\\\"),children:[(0,Ya.jsx)(\\\"span\\\",{\\\"aria-hidden\\\":!0,className:te(\\\"mt-1 size-1.5 shrink-0 rounded-full\\\",oz[s.status])}),(0,Ya.jsx)(\\\"span\\\",{className:\\\"break-words\\\",children:s.title})]})},s.id)})})]},r.id))})}function f1(){return qa().features.length===0?null:(0,Ya.jsxs)(\\\"nav\\\",{\\\"aria-label\\\":\\\"Table of contents\\\",className:\\\"sticky top-4 hidden h-fit w-64 shrink-0 self-start text-xs lg:block\\\",children:[(0,Ya.jsx)(\\\"p\\\",{className:\\\"mb-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground\\\",children:\\\"Contents\\\"}),(0,Ya.jsx)(OS,{})]})}var F1=S(T(),1);var rn={};Oo(rn,{Backdrop:()=>p1,Close:()=>g1,Description:()=>x1,Handle:()=>Uc,Popup:()=>S1,Portal:()=>L1,Root:()=>M1,Title:()=>P1,Trigger:()=>N1,Viewport:()=>D1,createHandle:()=>B1});var d1=S(T(),1);var fg=S(T(),1),PS=fg.createContext(void 0);function Gt(e){let t=fg.useContext(PS);if(!e&&t===void 0)throw new Error(Pe(27));return t}var p1=d1.forwardRef(function(t,a){let{render:o,className:n,style:r,forceRender:s=!1,...l}=t,i=Gt(),u=i.useState(\\\"open\\\"),c=i.useState(\\\"nested\\\"),f=i.useState(\\\"mounted\\\"),d=i.useState(\\\"transitionStatus\\\");return le(\\\"div\\\",t,{state:{open:u,transitionStatus:d},ref:[i.context.backdropRef,a],stateAttributesMapping:oi,props:[{role:\\\"presentation\\\",hidden:!f,style:{userSelect:\\\"none\\\",WebkitUserSelect:\\\"none\\\"}},l],enabled:s||!c})});var m1=S(T(),1);var g1=m1.forwardRef(function(t,a){let{render:o,className:n,style:r,disabled:s=!1,nativeButton:l=!0,...i}=t,u=Gt(),c=u.useState(\\\"open\\\"),{getButtonProps:f,buttonRef:d}=pa({disabled:s,native:l}),p={disabled:s};function x(b){c&&u.setOpen(!1,ce(j.closePress,b.nativeEvent))}return le(\\\"button\\\",t,{state:p,ref:[a,d],props:[{onClick:x},i,f]})});var h1=S(T(),1);var x1=h1.forwardRef(function(t,a){let{render:o,className:n,style:r,id:s,...l}=t,i=Gt(),u=ot(s);return i.useSyncedValueWithCleanup(\\\"descriptionElementId\\\",u),le(\\\"p\\\",t,{ref:a,props:[{id:u},l]})});var b1=S(T(),1);var dg=S(T(),1),NS=dg.createContext(void 0);function pg(){let e=dg.useContext(NS);if(e===void 0)throw new Error(Pe(26));return e}var mg={...Es,...ai,nestedDialogOpen(e){return e?{\\\"data-nested-dialog-open\\\":\\\"\\\"}:null}};var y1=S(D(),1),S1=b1.forwardRef(function(t,a){let{render:o,className:n,style:r,finalFocus:s,initialFocus:l,...i}=t,u=Gt(),c=u.useState(\\\"descriptionElementId\\\"),f=u.useState(\\\"disablePointerDismissal\\\"),d=u.useState(\\\"floatingRootContext\\\"),p=u.useState(\\\"popupProps\\\"),x=u.useState(\\\"modal\\\"),b=u.useState(\\\"mounted\\\"),C=u.useState(\\\"nested\\\"),g=u.useState(\\\"nestedOpenDialogCount\\\"),m=u.useState(\\\"open\\\"),h=u.useState(\\\"openMethod\\\"),y=u.useState(\\\"titleElementId\\\"),v=u.useState(\\\"transitionStatus\\\"),R=u.useState(\\\"role\\\"),I=d.useState(\\\"floatingId\\\");pg(),$o({open:m,ref:u.context.popupRef,onComplete(){m&&u.context.onOpenChangeComplete?.(!0)}});let L=l===void 0?mE(u.context.popupRef):l,k=g>0,w=u.useStateSetter(\\\"popupElement\\\"),P=le(\\\"div\\\",t,{state:{open:m,nested:C,transitionStatus:v,nestedDialogOpen:k},props:[p,{id:I,\\\"aria-labelledby\\\":y,\\\"aria-describedby\\\":c,role:R,...Yp,hidden:!b,onKeyDown(U){bi.has(U.key)&&U.stopPropagation()},style:{\\\"--nested-dialogs\\\":g}},i],ref:[a,u.context.popupRef,w],stateAttributesMapping:mg});return(0,y1.jsx)(xc,{context:d,openInteractionType:h,disabled:!b,closeOnFocusOut:!f,initialFocus:L,returnFocus:s,modal:x!==!1,restoreFocus:\\\"popup\\\",children:P})});var C1=S(T(),1);var Fc=S(D(),1),L1=C1.forwardRef(function(t,a){let{keepMounted:o=!1,...n}=t,r=Gt(),s=r.useState(\\\"mounted\\\"),l=r.useState(\\\"modal\\\"),i=r.useState(\\\"open\\\");return s||o?(0,Fc.jsx)(NS.Provider,{value:o,children:(0,Fc.jsxs)(mc,{ref:a,...n,children:[s&&l===!0&&(0,Fc.jsx)(Im,{ref:r.context.internalBackdropRef,inert:yi(!i)}),t.children]})}):null});var T1=S(T(),1);var BS=S(T(),1);function R1({store:e,parentContext:t,isDrawer:a}){let o=e.useState(\\\"open\\\"),n=e.useState(\\\"disablePointerDismissal\\\"),r=e.useState(\\\"modal\\\"),s=e.useState(\\\"popupElement\\\"),l=e.useState(\\\"floatingRootContext\\\"),[i,u]=BS.useState(0),[c,f]=BS.useState(0),d=i===0,p=yc(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?\\\"intentional\\\":{mouse:r===\\\"trap-focus\\\"?\\\"sloppy\\\":\\\"intentional\\\",touch:\\\"sloppy\\\"}},outsidePress(x){if(!e.context.outsidePressEnabledRef.current||\\\"button\\\"in x&&x.button!==0)return!1;if(\\\"touches\\\"in x){if(x.type===\\\"touchend\\\"){if(x.changedTouches.length!==1||x.touches.length!==0)return!1}else if(x.touches.length!==1)return!1}let b=lt(x);if(d&&!n){if(r){let C=e.context.internalBackdropRef.current,g=e.context.backdropRef.current;return C||g?C===b||g===b||ie(b,s)&&!b?.hasAttribute(\\\"data-base-ui-portal\\\"):!0}return!0}return!1},escapeKey:d});return km(o&&r===!0,s),e.useContextCallback(\\\"onNestedDialogOpen\\\",(x,b)=>{u(x),f(b)}),G(()=>(t?.onNestedDialogOpen&&(o?t.onNestedDialogOpen(i+1,c+(a?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&o&&t.onNestedDialogOpen(0,0)}),[a,o,i,c,t]),Jp(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:i,nestedOpenDrawerCount:c}),null}var gg=S(T(),1);var v1={...tm,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},hg=class extends Qo{constructor(t,a,o){let n=new zn,r=w1(t,n,a,o);super(r,k1(n),v1)}setOpen=(t,a)=>{if(a.preventUnmountOnClose=()=>{this.set(\\\"preventUnmountingOnClose\\\",!0)},!t&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,a),a.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,a);let o={open:t};$p(o,t,a.trigger),this.update(o)}};function I1(){let e=new zn;return new Li(Object.freeze(w1(void 0,e)),Object.freeze(k1(e)),v1)}function w1(e,t,a,o=!1){let n={...em(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:\\\"dialog\\\",...e};return n.floatingRootContext=SE(t,a,o),n}function k1(e){return{popupRef:gg.createRef(),backdropRef:gg.createRef(),internalBackdropRef:gg.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}var _c=S(D(),1);function E1(e,t){let{children:a,open:o,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:s,disablePointerDismissal:l=!1,modal:i=!0,actionsRef:u,handle:c,triggerId:f,defaultTriggerId:d=null}=t,p=e===\\\"drawer\\\",x=e===\\\"alert-dialog\\\",b=x?!0:i,C=x||l,g=x?\\\"alertdialog\\\":\\\"dialog\\\",m=Gt(!0),h=m!=null,y={modal:b,disablePointerDismissal:C,nested:h,role:g},v=gE((A,P)=>new hg({open:n,openProp:o,activeTriggerId:d,triggerIdProp:f,...y},A,P),!0);v.useControlledProp(\\\"openProp\\\",o),v.useControlledProp(\\\"triggerIdProp\\\",f),v.useSyncedValues(y),v.useContextCallback(\\\"onOpenChange\\\",r),v.useContextCallback(\\\"onOpenChangeComplete\\\",s);let R=v.useState(\\\"open\\\"),I=v.useState(\\\"mounted\\\"),L=v.useState(\\\"payload\\\");xE(v,R),Zp(v);let{forceUnmount:k}=Qp(R,v);T1.useImperativeHandle(u,()=>({unmount:k,close:()=>v.setOpen(!1,ce(j.imperativeAction))}),[k,v]);let w=R||I;return(0,_c.jsxs)(PS.Provider,{value:v,children:[c&&(0,_c.jsx)(Kp,{handle:c,store:v}),w&&(0,_c.jsx)(R1,{store:v,parentContext:m?.context,isDrawer:p}),typeof a==\\\"function\\\"?a({payload:L}):a]})}function M1(e){return E1(\\\"dialog\\\",e)}var A1=S(T(),1);var D1=A1.forwardRef(function(t,a){let{render:o,className:n,style:r,children:s,...l}=t,i=pg(),u=Gt(),c=u.useState(\\\"open\\\"),f=u.useState(\\\"nested\\\"),d=u.useState(\\\"transitionStatus\\\"),p=u.useState(\\\"nestedOpenDialogCount\\\"),x=u.useState(\\\"mounted\\\"),b=u.useStateSetter(\\\"viewportElement\\\"),C=p>0;return le(\\\"div\\\",t,{enabled:i||x,state:{open:c,nested:f,transitionStatus:d,nestedDialogOpen:C},ref:[a,b],stateAttributesMapping:mg,props:[{role:\\\"presentation\\\",hidden:!x,style:{pointerEvents:c?void 0:\\\"none\\\"},children:s},l]})});var O1=S(T(),1);var P1=O1.forwardRef(function(t,a){let{render:o,className:n,style:r,id:s,...l}=t,i=Gt(),u=ot(s);return i.useSyncedValueWithCleanup(\\\"titleElementId\\\",u),le(\\\"h2\\\",t,{ref:a,props:[{id:u},l]})});var xg=S(T(),1);var N1=xg.forwardRef(function(t,a){let{render:o,className:n,style:r,disabled:s=!1,nativeButton:l=!0,id:i,payload:u,handle:c,...f}=t,d=Gt(!0),x=am(c)??d;if(!x)throw new Error(Pe(79));let b=ot(i),C=x.useState(\\\"floatingRootContext\\\"),g=x.useState(\\\"isOpenedByTrigger\\\",b),m=x.useState(\\\"triggerPopupId\\\",b),h=xg.useRef(null),{registerTrigger:y,isMountedByThisTrigger:v}=Wp(b,h,x,{payload:u}),{getButtonProps:R,buttonRef:I}=pa({disabled:s,native:l}),L=qs(C),k=cS(()=>x.select(\\\"open\\\"),P=>{x.set(\\\"openMethod\\\",P)}),w={disabled:s,open:g},A=x.useState(\\\"triggerProps\\\",v);return le(\\\"button\\\",t,{state:w,ref:[I,a,y,h],props:[L.reference,A,k,{[Fp]:\\\"\\\",id:b,\\\"aria-haspopup\\\":\\\"dialog\\\",\\\"aria-expanded\\\":g,\\\"aria-controls\\\":m},f,R],stateAttributesMapping:rp})});var Uc=class extends gi{constructor(){super(I1(),\\\"Dialog\\\",!1)}open(t){this.openByTrigger(t)}openWithPayload(t){let a=this.attachedStore;a!==null&&(a.set(\\\"payload\\\",t),a.setOpen(!0,ce(j.imperativeAction)))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(\\\"open\\\")??!1}};function B1(){return new Uc}var Ka=S(D(),1);function _1(){let e=qa(),[t,a]=(0,F1.useState)(!1);return e.features.length===0?null:(0,Ka.jsxs)(rn.Root,{open:t,onOpenChange:a,children:[(0,Ka.jsxs)(rn.Trigger,{className:\\\"flex cursor-pointer items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground lg:hidden [&_svg]:size-3.5\\\",children:[(0,Ka.jsx)(Bu,{\\\"aria-hidden\\\":!0}),\\\" Contents\\\"]}),(0,Ka.jsxs)(rn.Portal,{children:[(0,Ka.jsx)(rn.Backdrop,{className:\\\"fixed inset-0 z-50 bg-black/50 transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0\\\"}),(0,Ka.jsxs)(rn.Popup,{className:\\\"fixed inset-y-0 left-0 z-50 flex w-72 max-w-[80vw] flex-col gap-3 overflow-y-auto border-r border-border bg-background p-4 font-sans text-xs shadow-lg outline-none transition-transform duration-200 data-[ending-style]:-translate-x-full data-[starting-style]:-translate-x-full\\\",children:[(0,Ka.jsxs)(\\\"div\\\",{className:\\\"flex items-center justify-between\\\",children:[(0,Ka.jsx)(rn.Title,{className:\\\"text-xs font-semibold tracking-wide text-muted-foreground uppercase\\\",children:\\\"Contents\\\"}),(0,Ka.jsx)(rn.Close,{\\\"aria-label\\\":\\\"Close contents\\\",className:\\\"cursor-pointer rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground [&_svg]:size-4\\\",children:(0,Ka.jsx)(bs,{\\\"aria-hidden\\\":!0})})]}),(0,Ka.jsx)(OS,{onNavigate:()=>a(!1)})]})]})]})}function FS(e){return e===\\\"failed\\\"}function U1(e){let t=new Set;if(e.summary.failed===0)return t;for(let a of e.features){a.scenarios.some(n=>FS(n.status))||t.add(a.id);for(let n of a.scenarios)FS(n.status)||t.add(n.id)}return t}function H1(e){if(e.summary.failed===0)return e;let t=[],a=[];for(let o of e.features)(o.scenarios.some(n=>FS(n.status))?t:a).push(o);return t.length===0?e:{...e,features:[...t,...a]}}var bg=S(T(),1);function z1(){let e=(0,bg.useRef)(null);(0,bg.useEffect)(()=>{function t(){let{anchor:a}=Ks(window.location.hash);!a||a===e.current||(e.current=a,requestAnimationFrame(()=>{Wr(a,{updateHash:!1})}))}return t(),window.addEventListener(\\\"hashchange\\\",t),()=>window.removeEventListener(\\\"hashchange\\\",t)},[])}var yg=S(T(),1);function nz(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return!!(t===\\\"INPUT\\\"||t===\\\"TEXTAREA\\\"||t===\\\"SELECT\\\"||e.isContentEditable)}function q1(e){let t=(0,yg.useRef)(e);t.current=e,(0,yg.useEffect)(()=>{function a(o){let n=t.current;if(o.key===\\\"Escape\\\"){n.onEscape?.();return}if(!nz(o.target)&&!(o.metaKey||o.ctrlKey||o.altKey))switch(o.key){case\\\"/\\\":n.onFocusSearch?.(),o.preventDefault();return;case\\\"?\\\":n.onToggleHelp?.(),o.preventDefault();return;case\\\"f\\\":n.onNextFailure?.(),o.preventDefault();return;case\\\"F\\\":n.onPrevFailure?.(),o.preventDefault();return;case\\\"e\\\":n.onExpandAll?.(),o.preventDefault();return;case\\\"c\\\":n.onCollapseAll?.(),o.preventDefault();return;default:return}}return window.addEventListener(\\\"keydown\\\",a),()=>window.removeEventListener(\\\"keydown\\\",a)},[])}var Ws=S(T(),1),V1=\\\"es-theme\\\";function rz(){return typeof matchMedia<\\\"u\\\"&&matchMedia(\\\"(prefers-color-scheme: dark)\\\").matches}function sz(e){return e===\\\"system\\\"?rz()?\\\"dark\\\":\\\"light\\\":e}function _S(e){typeof document<\\\"u\\\"&&document.documentElement.setAttribute(\\\"data-theme\\\",sz(e))}function lz(){if(typeof localStorage<\\\"u\\\"){let e=localStorage.getItem(V1);if(e===\\\"light\\\"||e===\\\"dark\\\"||e===\\\"system\\\")return e}return\\\"system\\\"}function G1(){let[e,t]=(0,Ws.useState)(\\\"system\\\");(0,Ws.useEffect)(()=>{let o=lz();t(o),_S(o)},[]),(0,Ws.useEffect)(()=>{if(typeof matchMedia>\\\"u\\\")return;let o=matchMedia(\\\"(prefers-color-scheme: dark)\\\"),n=()=>{e===\\\"system\\\"&&_S(\\\"system\\\")};return o.addEventListener(\\\"change\\\",n),()=>o.removeEventListener(\\\"change\\\",n)},[e]);let a=(0,Ws.useCallback)(o=>{t(o),_S(o);try{localStorage.setItem(V1,o)}catch{}},[]);return{pref:e,setPref:a}}var Gn=S(T(),1);var iz=250;function X1(){let[e,t]=(0,Gn.useState)(ng),a=(0,Gn.useRef)(!1);(0,Gn.useEffect)(()=>{let n=()=>t(zA(Ks(window.location.hash).params));return n(),a.current=!0,window.addEventListener(\\\"hashchange\\\",n),()=>window.removeEventListener(\\\"hashchange\\\",n)},[]),(0,Gn.useEffect)(()=>{if(!a.current)return;let n=setTimeout(()=>rg(Ks(window.location.hash).anchor,qA(e)),iz);return()=>clearTimeout(n)},[e]);let o=(0,Gn.useCallback)(n=>t(r=>({...r,...n})),[]);return[e,o]}var Lg=[\\\"passed\\\",\\\"failed\\\",\\\"skipped\\\",\\\"pending\\\"],j1=[\\\"all\\\",...Lg],Zs=class extends Error{};function US(e){return typeof e==\\\"object\\\"&&e!==null?e:{}}function zS(e,t){let a=e[t];if(a!=null){if(typeof a!=\\\"string\\\")throw new Zs(`\\\"${t}\\\" must be a string, received ${typeof a}.`);return a}}function Cg(e,t){let a=e[t];if(a!=null){if(typeof a==\\\"string\\\")return[a];if(!Array.isArray(a)||a.some(o=>typeof o!=\\\"string\\\"))throw new Zs(`\\\"${t}\\\" must be an array of strings.`);return a}}function uz(e,t,a){let o=zS(e,t);if(o!==void 0){if(!a.includes(o))throw new Zs(`\\\"${t}\\\" must be one of: ${a.join(\\\", \\\")}. Received \\\"${o}\\\".`);return o}}function cz(e){let t=Cg(e,\\\"statuses\\\");if(t===void 0)return;let a=t.filter(o=>!Lg.includes(o));if(a.length>0)throw new Zs(`\\\"statuses\\\" must contain only: ${Lg.join(\\\", \\\")}. Received \\\"${a.join('\\\", \\\"')}\\\".`);return t}function HS(e){try{return e()}catch(t){if(t instanceof Zs)return`Invalid input \\\\u2014 ${t.message}`;throw t}}var fz={type:\\\"object\\\",properties:{statuses:{type:\\\"array\\\",items:{type:\\\"string\\\",enum:[...Lg]},description:\\\"Keep only scenarios with any of these statuses.\\\"},tags:{type:\\\"array\\\",items:{type:\\\"string\\\"},description:\\\"Keep only scenarios carrying any of these tags.\\\"},sourceFiles:{type:\\\"array\\\",items:{type:\\\"string\\\"},description:\\\"Keep only scenarios whose source file path contains any of these.\\\"}}},Sg={readOnlyHint:!0,untrustedContentHint:!0};function Y1(e){let{report:t,setView:a,onAgentFilter:o}=e,n=e.now??Date.now,r=()=>({run:ZM(t,n())}),s=l=>{let i=KM(t,l);return{...r(),total:i.length,scenarios:i}};return{list_scenarios:{title:\\\"List scenarios\\\",description:\\\"List the behaviour scenarios in this report, optionally filtered by status, tag, or source file. Returns each scenario with its steps, tags, timing and failure message.\\\",annotations:Sg,input:fz,execute:l=>HS(()=>{let i=US(l),u={},c=cz(i),f=Cg(i,\\\"tags\\\"),d=Cg(i,\\\"sourceFiles\\\");return c&&(u.statuses=c),f&&(u.tags=f),d&&(u.sourceFiles=d),s(u)})},get_failing_scenarios:{title:\\\"Get failing scenarios\\\",description:\\\"List only the scenarios that failed in this run, each with the step that failed and its error message. Use this first when asked what is broken.\\\",annotations:Sg,execute:()=>s({statuses:[\\\"failed\\\"]})},get_feature_summary:{title:\\\"Get feature summary\\\",description:'Summarise each feature in the report with its scenario counts by status. Use this for \\\"how are we doing\\\" questions rather than listing every scenario.',annotations:Sg,execute:()=>({...r(),summary:t.summary,features:WM(t)})},get_scenario:{title:\\\"Get scenario\\\",description:\\\"Get one scenario by its id or its exact title, with every step and any failure detail. Attachment and document bodies are omitted \\\\u2014 `docKinds` names what the page shows.\\\",annotations:Sg,input:{type:\\\"object\\\",properties:{idOrTitle:{type:\\\"string\\\",description:\\\"The scenario id, or its exact title as shown in the report.\\\"}},required:[\\\"idOrTitle\\\"]},execute:l=>HS(()=>{let i=zS(US(l),\\\"idOrTitle\\\")??\\\"\\\",u=$M(t,i);return u?{...r(),feature:{id:u.feature.id,title:u.feature.title,sourceFile:u.feature.sourceFile},scenario:yS(u.feature,u.scenario)}:{...r(),error:`No scenario found with id or title \\\"${i}\\\". Call list_scenarios to see what this report contains.`}})},filter_scenarios:{title:\\\"Filter the report\\\",description:`Change what the reader is looking at: set the report's search text, status filter and tag filter. Omitted fields are left as they are; pass an empty string, \\\"all\\\", or an empty array to clear one.`,input:{type:\\\"object\\\",properties:{search:{type:\\\"string\\\",description:\\\"Free text matched against scenario titles, tags and step text. Empty string clears it.\\\"},status:{type:\\\"string\\\",enum:[...j1],description:'Show only scenarios with this status. \\\"all\\\" clears the filter.'},tags:{type:\\\"array\\\",items:{type:\\\"string\\\"},description:\\\"Show only scenarios carrying any of these tags. Empty array clears the filter.\\\"}}},execute:l=>HS(()=>{let i=US(l),u=zS(i,\\\"search\\\"),c=uz(i,\\\"status\\\",j1),f=Cg(i,\\\"tags\\\"),d={search:u??e.view.query,status:c??e.view.status,tags:f??e.view.tags},p={};u!==void 0&&(p.query=u),c!==void 0&&(p.status=c),f!==void 0&&(p.tags=f),a(p);let x=sg(t,{query:d.search,status:d.status,tags:d.tags}).summary.total,b={...d,matched:x,total:t.summary.total};return o?.(b),{...r(),applied:b}})}}}var xe=S(D(),1);function K1(e){let{report:t,className:a,title:o,dataTheme:n}=e,r=VA(t);return r.ok?(0,xe.jsx)(mz,{...e,report:r.data}):(0,xe.jsx)(tA,{error:r.error,className:a,title:o,dataTheme:n})}var dz=[{value:\\\"light\\\",label:\\\"Light\\\",Icon:zu},{value:\\\"system\\\",label:\\\"System\\\",Icon:Fu},{value:\\\"dark\\\",label:\\\"Dark\\\",Icon:_u}];function pz({pref:e,onPref:t}){return(0,xe.jsx)(MA,{size:\\\"sm\\\",value:[e],onValueChange:a=>{let o=a[0];o&&t(o)},\\\"aria-label\\\":\\\"Color theme\\\",children:dz.map(({value:a,label:o,Icon:n})=>(0,xe.jsx)(AA,{value:a,\\\"aria-label\\\":o,title:o,className:\\\"px-2\\\",children:(0,xe.jsx)(n,{})},a))})}function mz({report:e,customRenderers:t,renderers:a,className:o,title:n,dataTheme:r,hideHeader:s=!1,hideToc:l=!1,staleAfterDays:i=7,scenarioHistory:u,share:c=!1,architecture:f=!1,shareCommand:d}){let[p,x]=X1(),{query:b,status:C,tags:g,detail:m}=p,h=(0,_e.useCallback)(H=>x({query:H}),[x]),y=(0,_e.useCallback)(H=>x({status:H}),[x]),v=(0,_e.useCallback)(H=>x({detail:H}),[x]),[R,I]=(0,_e.useState)(!1),{pref:L,setPref:k}=G1(),w=(0,_e.useRef)(null),A=(0,_e.useId)(),P=(0,_e.useId)(),U=(0,_e.useDeferredValue)(b),O=(0,_e.useMemo)(()=>jA(e),[e]),M=(0,_e.useMemo)(()=>H1(sg(e,{query:U,status:C,tags:g})),[e,U,C,g]),_=b!==U,q=(0,_e.useMemo)(()=>{let H=e.summary,be=[{key:\\\"all\\\",label:\\\"All\\\",count:H.total}];return H.passed&&be.push({key:\\\"passed\\\",label:\\\"Passed\\\",count:H.passed}),H.failed&&be.push({key:\\\"failed\\\",label:\\\"Failed\\\",count:H.failed}),H.skipped&&be.push({key:\\\"skipped\\\",label:\\\"Skipped\\\",count:H.skipped}),H.pending&&be.push({key:\\\"pending\\\",label:\\\"Pending\\\",count:H.pending}),be},[e]),E=(0,_e.useMemo)(()=>GA(e),[e]),N=(0,_e.useCallback)(H=>x({tags:g.includes(H)?g.filter(be=>be!==H):[...g,H]}),[g,x]),[B,ae]=(0,_e.useState)(null),X=(0,_e.useRef)(null),Q=(0,_e.useCallback)(H=>{ae(H),X.current&&clearTimeout(X.current),X.current=setTimeout(()=>ae(null),1800)},[]),$=(0,_e.useCallback)((H,be)=>{typeof navigator<\\\"u\\\"&&navigator.clipboard&&navigator.clipboard.writeText(H).then(()=>Q(be),()=>Q(\\\"Copy failed\\\"))},[Q]),ee=(0,_e.useMemo)(()=>({copyLink:H=>$(nk(H),\\\"Link copied\\\"),copyMarkdown:H=>$(tk(H),\\\"Markdown copied\\\"),copyPrompt:H=>$(ak(H),\\\"Prompt copied\\\")}),[$]),J=(0,_e.useCallback)(()=>$(ok(XA(M)),\\\"Failures copied\\\"),[$,M]),Ce=(0,_e.useRef)(0),Y=(0,_e.useMemo)(()=>e.features.flatMap(H=>[H.id,...H.scenarios.map(be=>be.id)]),[e]),W=$0((0,_e.useCallback)(()=>U1(e),[e])),me=U.trim()!==\\\"\\\"||C!==\\\"all\\\"||g.length>0,ge=(0,_e.useMemo)(()=>me?{...W.api,isCollapsed:()=>!1}:W.api,[W.api,me]),oe=(0,_e.useCallback)(()=>W.collapseAll(Y),[W,Y]),[he,pe]=(0,_e.useState)(()=>e.summary.failed===0),Le=(0,_e.useCallback)(H=>{H?W.expandAll():oe(),pe(H)},[W,oe]),[ve,ue]=(0,_e.useState)(null);YI(Y1({report:e,view:p,setView:x,onAgentFilter:ue}));let Te=ve!==null&&ve.search===b&&ve.status===C&&ve.tags.length===g.length&&ve.tags.every(H=>g.includes(H)),re=(0,_e.useCallback)(()=>x({query:\\\"\\\",status:\\\"all\\\",tags:[]}),[x]),fe=(0,_e.useCallback)(()=>{w.current?.focus()},[]),de=(0,_e.useCallback)(H=>{if(O.length===0)return;Ce.current=(Ce.current+H+O.length)%O.length;let be=O[Ce.current];be&&Wr(be.scenarioId)},[O]),Re=(0,_e.useCallback)(()=>{I(H=>!H)},[]),St=(0,_e.useCallback)(()=>{R?I(!1):b!==\\\"\\\"&&h(\\\"\\\")},[R,b,h]);q1({onFocusSearch:fe,onNextFailure:()=>de(1),onPrevFailure:()=>de(-1),onToggleHelp:Re,onEscape:St,onExpandAll:()=>Le(!0),onCollapseAll:()=>Le(!1)}),z1();let F=M.features.length>0,V=e.summary.total,Ae=M.summary.total,Z=!l&&V>3;return(0,xe.jsx)(Y0,{value:ge,children:(0,xe.jsx)(J0,{value:ee,children:(0,xe.jsx)(O0,{value:u??null,children:(0,xe.jsx)(q0,{value:{staleAfterDays:i,report:e},children:(0,xe.jsx)(UA,{report:M,customRenderers:t,renderers:a,children:(0,xe.jsxs)(\\\"main\\\",{className:te(\\\"es-report\\\",\\\"es-report-interactive\\\",o),\\\"aria-label\\\":n??\\\"Test report\\\",\\\"aria-busy\\\":_,\\\"data-theme\\\":r,\\\"data-detail-level\\\":m,children:[(0,xe.jsxs)(\\\"header\\\",{className:\\\"es-report-header\\\",children:[(0,xe.jsxs)(\\\"div\\\",{\\\"data-es-navbar\\\":!0,className:te(\\\"flex flex-wrap items-center gap-4\\\",s?\\\"justify-end\\\":\\\"justify-between\\\"),children:[s?null:(0,xe.jsx)(\\\"h1\\\",{className:\\\"min-w-0\\\",children:n??\\\"Story Report\\\"}),(0,xe.jsxs)(\\\"div\\\",{className:\\\"flex items-center gap-2\\\",children:[(0,xe.jsx)(o1,{ref:w,value:b,onChange:h,matchedCount:Ae,totalCount:V}),c?(0,xe.jsx)(n1,{command:d,onCopy:$}):null,(0,xe.jsx)(pz,{pref:L,onPref:k})]})]}),s?null:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(JM,{}),(0,xe.jsx)(QM,{})]}),f?(0,xe.jsx)(uA,{}):null,(0,xe.jsx)(QA,{lastRunMs:_0(e),ciUrl:e.ci?.url,staleAfterDays:i}),(0,xe.jsx)(e1,{history:u,report:e}),(0,xe.jsx)(u1,{report:e}),(0,xe.jsx)(ZA,{statuses:q,status:C,onStatus:y,tags:E,activeTags:g,onToggleTag:N}),(0,xe.jsxs)(\\\"div\\\",{className:\\\"flex flex-wrap items-center gap-x-6 gap-y-2 border-t border-border/60 pt-3\\\",children:[Z?(0,xe.jsx)(_1,{}):null,(0,xe.jsxs)(\\\"div\\\",{className:\\\"flex items-center gap-2\\\",children:[(0,xe.jsx)(RS,{id:A,checked:he,onCheckedChange:Le}),(0,xe.jsx)(\\\"label\\\",{htmlFor:A,className:\\\"cursor-pointer text-sm text-muted-foreground select-none\\\",children:\\\"Expand all\\\"})]}),(0,xe.jsxs)(\\\"div\\\",{className:\\\"flex items-center gap-2\\\",children:[(0,xe.jsx)(RS,{id:P,checked:m===\\\"full\\\",onCheckedChange:H=>v(H?\\\"full\\\":\\\"minimal\\\")}),(0,xe.jsx)(\\\"label\\\",{htmlFor:P,className:\\\"cursor-pointer text-sm text-muted-foreground select-none\\\",children:\\\"Show documentation\\\"})]})]})]}),Te?(0,xe.jsx)(YA,{applied:ve,onReset:re,onDismiss:()=>ue(null)}):null,(0,xe.jsx)($A,{failures:O,onCopyAll:J}),F?Z?(0,xe.jsxs)(\\\"div\\\",{className:\\\"flex gap-6\\\",children:[(0,xe.jsx)(f1,{}),(0,xe.jsx)(\\\"div\\\",{className:\\\"flex min-w-0 flex-1 flex-col gap-4\\\",children:(0,xe.jsx)(bS,{})})]}):(0,xe.jsx)(\\\"div\\\",{className:\\\"flex flex-col gap-4\\\",children:(0,xe.jsx)(bS,{})}):(0,xe.jsx)(Rw,{message:b?\\\"No scenarios match the search.\\\":void 0}),(0,xe.jsx)(\\\"button\\\",{type:\\\"button\\\",className:\\\"es-shortcuts-trigger fixed right-4 bottom-4 z-40 flex size-9 items-center justify-center rounded-full border border-border bg-card text-muted-foreground shadow-sm transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50\\\",\\\"aria-label\\\":\\\"Keyboard shortcuts\\\",\\\"aria-keyshortcuts\\\":\\\"?\\\",onClick:Re,children:\\\"?\\\"}),(0,xe.jsx)(c1,{open:R,onClose:()=>I(!1)}),B?(0,xe.jsx)(\\\"div\\\",{role:\\\"status\\\",\\\"aria-live\\\":\\\"polite\\\",className:\\\"fixed bottom-4 left-1/2 -translate-x-1/2 rounded-md bg-foreground px-3 py-1.5 text-xs font-medium text-background shadow-lg\\\",children:B}):null]})})})})})})}var Js=S(T(),1);var Qs=S(T(),1);var sn=S(D(),1);function gz(e){let t=e?.closest(\\\"[data-theme]\\\");return t?.dataset.theme===\\\"dark\\\"?!0:t?.dataset.theme===\\\"light\\\"?!1:typeof window<\\\"u\\\"&&!!window.matchMedia?.(\\\"(prefers-color-scheme: dark)\\\").matches}function $1({entry:e,load:t}){let a=(0,Qs.useRef)(null),[o,n]=(0,Qs.useState)(null),[r,s]=(0,Qs.useState)(null);return(0,Qs.useEffect)(()=>{let l=!1,i=async()=>{let f;try{f=await t()}catch{l||(n(null),s(null));return}try{f.initialize({startOnLoad:!1,securityLevel:\\\"strict\\\",theme:gz(a.current)?\\\"dark\\\":\\\"neutral\\\"}),await f.parse(e.code);let d=`es-mermaid-${Math.random().toString(36).slice(2)}`,{svg:p}=await f.render(d,e.code);l||(n(p),s(null))}catch(d){l||(n(null),s(d instanceof Error?d.message:String(d)))}};i();let u=a.current?.closest(\\\"[data-theme]\\\"),c=u?new MutationObserver(()=>{i()}):void 0;return c?.observe(u,{attributes:!0,attributeFilter:[\\\"data-theme\\\"]}),()=>{l=!0,c?.disconnect()}},[e.code,t]),o?(0,sn.jsxs)(\\\"figure\\\",{ref:a,className:\\\"my-3\\\",children:[e.title?(0,sn.jsx)(\\\"figcaption\\\",{className:\\\"mb-1.5 text-xs font-medium text-muted-foreground\\\",children:e.title}):null,(0,sn.jsx)(\\\"div\\\",{role:\\\"img\\\",\\\"aria-label\\\":e.title??\\\"Mermaid diagram\\\",className:\\\"overflow-x-auto rounded-md border border-border bg-card p-3 [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full\\\",dangerouslySetInnerHTML:{__html:o}})]}):(0,sn.jsxs)(sn.Fragment,{children:[r?(0,sn.jsxs)(\\\"p\\\",{role:\\\"alert\\\",\\\"data-es-mermaid-error\\\":!0,className:\\\"mt-3 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive\\\",children:[\\\"Diagram failed to render: \\\",r]}):null,(0,sn.jsx)(Bb,{entry:e,ref:a})]})}var Rg=S(D(),1),hz=\\\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/es/highlight.min.js\\\",xz=\\\"https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs\\\";function W1(e){let t;return()=>(t??=import(e).then(a=>a.default??a),t)}var bz=W1(xz),yz=W1(hz);function Sz({entry:e}){let[t,a]=(0,Js.useState)(null);return(0,Js.useEffect)(()=>{let o=!1;return(async()=>{try{let n=await yz(),r=e.lang&&n.getLanguage(e.lang)?e.lang:void 0,s=r?n.highlight(e.content,{language:r,ignoreIllegals:!0}):n.highlightAuto(e.content);o||a(s.value)}catch{o||a(null)}})(),()=>{o=!0}},[e.content,e.lang]),(0,Rg.jsx)(ju,{label:e.label,children:t!==null?(0,Rg.jsx)(\\\"code\\\",{className:te(\\\"hljs font-mono text-xs\\\",e.lang&&`language-${e.lang}`),dangerouslySetInnerHTML:{__html:t}}):(0,Rg.jsx)(\\\"code\\\",{className:te(\\\"font-mono text-xs\\\",e.lang&&`language-${e.lang}`),children:e.content})})}function Z1(e){let t={};return e.mermaid&&(t.mermaid=a=>(0,Js.createElement)($1,{entry:a,load:bz})),e.syntaxHighlighting&&(t.code=a=>(0,Js.createElement)(Sz,{entry:a})),t}function Q1(e){if(e===null||typeof e!=\\\"object\\\")return MS({message:\\\"Expected a StoryReport object.\\\",code:\\\"INVALID_INPUT\\\"});let t=e.schemaVersion;if(typeof t==\\\"string\\\"){let a=t.split(\\\".\\\")[0];if(a!==String(1))return MS({message:`Schema major ${a} is not supported by this version of executable-stories-react (expected ${1}.x). Upgrade the package.`,code:\\\"SCHEMA_VERSION_MISMATCH\\\"})}return ES(e)}var Lz=\\\"es-report-root\\\",Rz=\\\"es-report-data\\\",vz=\\\"es-report-history\\\";function Iz(){let e=document.getElementById(vz);if(e?.textContent)try{let t=JSON.parse(e.textContent);return typeof t!=\\\"object\\\"||t===null||Array.isArray(t)?void 0:t}catch{return}}function qS(){let e=document.getElementById(Lz),t=document.getElementById(Rz);if(!e||!t?.textContent)return;let a;try{a=JSON.parse(t.textContent)}catch{return}let o=Q1(a),n=e.getAttribute(\\\"data-title\\\")??void 0,r=Z1({syntaxHighlighting:e.getAttribute(\\\"data-es-syntax\\\")!==\\\"false\\\",mermaid:e.getAttribute(\\\"data-es-mermaid\\\")!==\\\"false\\\"}),s=e.getAttribute(\\\"data-es-share\\\")===\\\"true\\\",l=e.getAttribute(\\\"data-es-architecture\\\")===\\\"true\\\",i=e.getAttribute(\\\"data-es-share-cmd\\\")??void 0,u=e.getAttribute(\\\"data-es-stale-days\\\"),c=u===null?Number.NaN:Number(u),f=Number.isFinite(c)&&c>=0?c:7;(0,eD.createRoot)(e).render((0,J1.createElement)(K1,{report:o,title:n,renderers:r,staleAfterDays:f,scenarioHistory:Iz(),share:s,shareCommand:i,architecture:l}))}typeof document<\\\"u\\\"&&(document.readyState===\\\"loading\\\"?document.addEventListener(\\\"DOMContentLoaded\\\",qS):qS());return dD(wz);})();\\n/*! Bundled license information:\\n\\nreact/cjs/react.production.js:\\n  (**\\n   * @license React\\n   * react.production.js\\n   *\\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\\n   *\\n   * This source code is licensed under the MIT license found in the\\n   * LICENSE file in the root directory of this source tree.\\n   *)\\n\\nscheduler/cjs/scheduler.production.js:\\n  (**\\n   * @license React\\n   * scheduler.production.js\\n   *\\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\\n   *\\n   * This source code is licensed under the MIT license found in the\\n   * LICENSE file in the root directory of this source tree.\\n   *)\\n\\nreact-dom/cjs/react-dom.production.js:\\n  (**\\n   * @license React\\n   * react-dom.production.js\\n   *\\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\\n   *\\n   * This source code is licensed under the MIT license found in the\\n   * LICENSE file in the root directory of this source tree.\\n   *)\\n\\nreact-dom/cjs/react-dom-client.production.js:\\n  (**\\n   * @license React\\n   * react-dom-client.production.js\\n   *\\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\\n   *\\n   * This source code is licensed under the MIT license found in the\\n   * LICENSE file in the root directory of this source tree.\\n   *)\\n\\nreact/cjs/react-jsx-runtime.production.js:\\n  (**\\n   * @license React\\n   * react-jsx-runtime.production.js\\n   *\\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\\n   *\\n   * This source code is licensed under the MIT license found in the\\n   * LICENSE file in the root directory of this source tree.\\n   *)\\n\\nuse-sync-external-store/cjs/use-sync-external-store-shim.production.js:\\n  (**\\n   * @license React\\n   * use-sync-external-store-shim.production.js\\n   *\\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\\n   *\\n   * This source code is licensed under the MIT license found in the\\n   * LICENSE file in the root directory of this source tree.\\n   *)\\n\\nuse-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js:\\n  (**\\n   * @license React\\n   * use-sync-external-store-shim/with-selector.production.js\\n   *\\n   * Copyright (c) Meta Platforms, Inc. and affiliates.\\n   *\\n   * This source code is licensed under the MIT license found in the\\n   * LICENSE file in the root directory of this source tree.\\n   *)\\n\\nlucide-react/dist/esm/shared/src/utils/mergeClasses.mjs:\\nlucide-react/dist/esm/shared/src/utils/toKebabCase.mjs:\\nlucide-react/dist/esm/shared/src/utils/toCamelCase.mjs:\\nlucide-react/dist/esm/shared/src/utils/toPascalCase.mjs:\\nlucide-react/dist/esm/defaultAttributes.mjs:\\nlucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs:\\nlucide-react/dist/esm/context.mjs:\\nlucide-react/dist/esm/Icon.mjs:\\nlucide-react/dist/esm/createLucideIcon.mjs:\\nlucide-react/dist/esm/icons/bot.mjs:\\nlucide-react/dist/esm/icons/ellipsis.mjs:\\nlucide-react/dist/esm/icons/file-text.mjs:\\nlucide-react/dist/esm/icons/link.mjs:\\nlucide-react/dist/esm/icons/list.mjs:\\nlucide-react/dist/esm/icons/monitor.mjs:\\nlucide-react/dist/esm/icons/moon.mjs:\\nlucide-react/dist/esm/icons/search.mjs:\\nlucide-react/dist/esm/icons/share-2.mjs:\\nlucide-react/dist/esm/icons/sparkles.mjs:\\nlucide-react/dist/esm/icons/sun.mjs:\\nlucide-react/dist/esm/icons/x.mjs:\\nlucide-react/dist/esm/lucide-react.mjs:\\n  (**\\n   * @license lucide-react v1.33.0 - ISC\\n   *\\n   * This source code is licensed under the ISC license.\\n   * See the LICENSE file in the root directory of this source tree.\\n   *)\\n*/\\n\";\n","/**\n * Span Graph Formatter - Layer 3.\n *\n * The architecture a run exercised, drawn from its OTel spans: a Mermaid\n * diagram, then the scenarios behind every component. The second half is what\n * separates this from an architecture diagram someone drew, so it is not\n * optional decoration.\n *\n * Empty output for a run with no spans. The generator writes no file in that\n * case, because a page saying \"no diagram\" in every report of every\n * uninstrumented suite is worse than the format not firing.\n */\n\nimport {\n  deriveSpanGraph,\n  spanGraphNodeMark,\n  spanGraphToMermaid,\n} from \"executable-stories-core/span-graph\";\nimport type { SpanGraphDelta, SpanGraphScenario } from \"executable-stories-core/span-graph\";\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\n\nconst MARKERS = {\n  failing: \" 🔴\",\n  added: \" 🟢\",\n  changed: \" 🟡\",\n  none: \"\",\n} as const;\n\nexport interface SpanGraphFormatterOptions {\n  /** Heading for the page. Default: \"Architecture, as it ran\" */\n  title?: string;\n  /**\n   * Scenario ids from a behavioural diff, which colour the components the\n   * change is really about. Build it with `spanGraphDeltaFromRuns`, which\n   * pairs a retitled scenario by behaviour fingerprint: a scenario id hashes\n   * its title, so a rename would otherwise read as one removal plus one\n   * addition and turn a long-standing component green.\n   */\n  delta?: SpanGraphDelta;\n}\n\nexport class SpanGraphFormatter {\n  private title: string;\n  private delta?: SpanGraphDelta;\n\n  constructor(options: SpanGraphFormatterOptions = {}) {\n    this.title = options.title ?? \"Architecture, as it ran\";\n    this.delta = options.delta;\n  }\n\n  format(run: TestRunResult): string {\n    const scenarios: SpanGraphScenario[] = run.testCases.map((tc) => ({\n      id: tc.id,\n      title: tc.story.scenario,\n      ...(tc.story.otelSpans ? { otelSpans: tc.story.otelSpans } : {}),\n    }));\n    const titleById = new Map(run.testCases.map((tc) => [tc.id, tc.story.scenario]));\n\n    const graph = deriveSpanGraph(scenarios, this.delta);\n    const mermaid = spanGraphToMermaid(graph);\n    if (mermaid === \"\") return \"\";\n\n    const lines: string[] = [`# ${this.title}`, \"\"];\n    lines.push(\n      \"Every component below is here because a span named it while a scenario ran, and\",\n      \"every arrow is a call one scenario actually made. Nothing on this diagram is\",\n      \"inferred from the code. It covers instrumented, exercised paths only: a component\",\n      \"no scenario reaches does not appear, and that absence is itself worth reading.\",\n      \"\",\n    );\n    lines.push(\"```mermaid\", mermaid, \"```\", \"\");\n\n    lines.push(\"## What each component is covered by\", \"\");\n    lines.push(\"| Component | Lane | Scenarios | Covered by |\");\n    lines.push(\"| --- | --- | --- | --- |\");\n    for (const node of graph.nodes) {\n      // Same precedence as the diagram, from the same function, so the table\n      // and the picture cannot describe one component two different ways.\n      const marker = MARKERS[spanGraphNodeMark(node) ?? \"none\"];\n      const covered = node.scenarioIds\n        .map((id) => titleById.get(id) ?? id)\n        .join(\"<br>\");\n      lines.push(\n        `| \\`${node.id}\\`${marker} | ${node.kind} | ${node.scenarioIds.length} | ${covered} |`,\n      );\n    }\n    lines.push(\"\");\n\n    return lines.join(\"\\n\");\n  }\n}\n","/**\n * JUnit XML Formatter - Layer 3.\n *\n * Transforms canonical TestRunResult into JUnit XML format\n * for CI system integration.\n */\n\nimport { assertNever } from \"executable-stories-core/utils/assert-never\";\nimport type { DocEntry, StoryStep } from \"executable-stories-core/types/story\";\nimport type { TestRunResult, TestCaseResult } from \"executable-stories-core/types/test-result\";\n\n/** Options for JUnit XML formatting */\nexport interface JUnitOptions {\n  /** Test suite name. Default: \"Test Suite\" */\n  suiteName?: string;\n  /** Include system-out/system-err. Default: true */\n  includeOutput?: boolean;\n  /** Pretty-print XML output. Default: true */\n  pretty?: boolean;\n}\n\n/**\n * JUnit XML Formatter.\n *\n * Transforms TestRunResult into JUnit XML format for CI integrations.\n * Compatible with Jenkins, GitHub Actions, and other CI systems.\n */\nexport class JUnitFormatter {\n  private options: Required<JUnitOptions>;\n\n  constructor(options: JUnitOptions = {}) {\n    this.options = {\n      suiteName: options.suiteName ?? \"Test Suite\",\n      includeOutput: options.includeOutput ?? true,\n      pretty: options.pretty ?? true,\n    };\n  }\n\n  /**\n   * Format a test run into JUnit XML.\n   *\n   * @param run - Canonical test run result\n   * @returns JUnit XML string\n   */\n  format(run: TestRunResult): string {\n    const indent = this.options.pretty ? \"  \" : \"\";\n    const newline = this.options.pretty ? \"\\n\" : \"\";\n\n    // Calculate totals\n    const tests = run.testCases.length;\n    const failures = run.testCases.filter((tc) => tc.status === \"failed\").length;\n    const skipped = run.testCases.filter(\n      (tc) => tc.status === \"skipped\" || tc.status === \"pending\"\n    ).length;\n    const errors = 0; // We don't distinguish errors from failures\n    const time = (run.durationMs / 1000).toFixed(3);\n\n    // Build XML\n    const lines: string[] = [];\n    lines.push('<?xml version=\"1.0\" encoding=\"UTF-8\"?>');\n    lines.push(\n      `<testsuites name=\"${escapeXml(this.options.suiteName)}\" tests=\"${tests}\" failures=\"${failures}\" errors=\"${errors}\" skipped=\"${skipped}\" time=\"${time}\">`\n    );\n\n    // Group test cases by source file (one testsuite per file)\n    const byFile = groupBy(run.testCases, (tc) => tc.sourceFile);\n\n    for (const [file, testCases] of byFile) {\n      lines.push(...this.buildTestSuite(file, testCases, indent));\n    }\n\n    lines.push(\"</testsuites>\");\n\n    return lines.join(newline);\n  }\n\n  /**\n   * Build a testsuite element for a file.\n   */\n  private buildTestSuite(\n    file: string,\n    testCases: TestCaseResult[],\n    indent: string\n  ): string[] {\n    const lines: string[] = [];\n\n    const tests = testCases.length;\n    const failures = testCases.filter((tc) => tc.status === \"failed\").length;\n    const skipped = testCases.filter(\n      (tc) => tc.status === \"skipped\" || tc.status === \"pending\"\n    ).length;\n    const time = testCases\n      .reduce((sum, tc) => sum + tc.durationMs, 0) / 1000;\n\n    // Normalize path separators for consistent output across platforms\n    const normalizedFile = file.replace(/\\\\/g, \"/\");\n\n    lines.push(\n      `${indent}<testsuite name=\"${escapeXml(normalizedFile)}\" tests=\"${tests}\" failures=\"${failures}\" errors=\"0\" skipped=\"${skipped}\" time=\"${time.toFixed(3)}\">`\n    );\n\n    for (const tc of testCases) {\n      lines.push(...this.buildTestCase(tc, indent + indent));\n    }\n\n    lines.push(`${indent}</testsuite>`);\n\n    return lines;\n  }\n\n  /**\n   * Build a testcase element.\n   */\n  private buildTestCase(tc: TestCaseResult, indent: string): string[] {\n    const lines: string[] = [];\n\n    // Build classname from titlePath or sourceFile\n    // Normalize path separators (Windows backslashes and Unix forward slashes)\n    const classname = tc.titlePath.length > 0\n      ? tc.titlePath.join(\".\")\n      : tc.sourceFile\n          .replace(/[\\\\/]+/g, \".\") // Replace path separators with dots\n          .replace(/\\.[^.]+$/, \"\"); // Remove file extension\n\n    const name = tc.story.scenario;\n    const time = (tc.durationMs / 1000).toFixed(3);\n\n    const hasFailure = tc.status === \"failed\";\n    const hasSkipped = tc.status === \"skipped\" || tc.status === \"pending\";\n    const hasOutput = this.options.includeOutput && tc.story.steps.length > 0;\n\n    // Use full form if there's any content to include\n    if (hasFailure || hasSkipped || hasOutput) {\n      lines.push(\n        `${indent}<testcase classname=\"${escapeXml(classname)}\" name=\"${escapeXml(name)}\" time=\"${time}\">`\n      );\n\n      if (hasFailure) {\n        const message = tc.errorMessage\n          ? escapeXml(tc.errorMessage.split(\"\\n\")[0])\n          : \"Test failed\";\n        lines.push(`${indent}${indent}<failure message=\"${message}\">`);\n        if (tc.errorMessage) {\n          lines.push(escapeXml(tc.errorMessage));\n        }\n        if (tc.errorStack) {\n          lines.push(\"\");\n          lines.push(escapeXml(tc.errorStack));\n        }\n        lines.push(`${indent}${indent}</failure>`);\n      } else if (hasSkipped) {\n        const message = tc.status === \"pending\" ? \"Test pending\" : \"Test skipped\";\n        lines.push(`${indent}${indent}<skipped message=\"${message}\"/>`);\n      }\n\n      // Include system-out with step info and docs if requested\n      if (hasOutput) {\n        const output = this.buildSystemOut(tc);\n        lines.push(`${indent}${indent}<system-out>${escapeXml(output)}</system-out>`);\n      }\n\n      lines.push(`${indent}</testcase>`);\n    } else {\n      // Self-closing tag for tests without content\n      lines.push(\n        `${indent}<testcase classname=\"${escapeXml(classname)}\" name=\"${escapeXml(name)}\" time=\"${time}\"/>`\n      );\n    }\n\n    return lines;\n  }\n\n  /**\n   * Build system-out content with steps and docs.\n   */\n  private buildSystemOut(tc: TestCaseResult): string {\n    const outputLines: string[] = [];\n\n    // Story-level docs\n    if (tc.story.docs && tc.story.docs.length > 0) {\n      for (const doc of tc.story.docs) {\n        outputLines.push(this.renderDocEntry(doc));\n      }\n      outputLines.push(\"\");\n    }\n\n    // Steps with their docs\n    for (const step of tc.story.steps) {\n      outputLines.push(this.renderStep(step));\n    }\n\n    return outputLines.join(\"\\n\").trim();\n  }\n\n  /**\n   * Render a step with its docs.\n   */\n  private renderStep(step: StoryStep): string {\n    const lines: string[] = [];\n    lines.push(`${step.keyword} ${step.text}`);\n\n    // Step docs\n    if (step.docs && step.docs.length > 0) {\n      for (const doc of step.docs) {\n        const rendered = this.renderDocEntry(doc, \"  \");\n        if (rendered) {\n          lines.push(rendered);\n        }\n      }\n    }\n\n    return lines.join(\"\\n\");\n  }\n\n  /**\n   * Render a doc entry as plain text.\n   */\n  private renderDocEntry(entry: DocEntry, indent = \"\"): string {\n    switch (entry.kind) {\n      case \"note\":\n        return `${indent}> ${entry.text}`;\n\n      case \"tag\":\n        return `${indent}Tags: ${entry.names.join(\", \")}`;\n\n      case \"kv\": {\n        const val = typeof entry.value === \"string\"\n          ? entry.value\n          : JSON.stringify(entry.value);\n        return `${indent}${entry.label}: ${val}`;\n      }\n\n      case \"code\": {\n        const langLabel = entry.lang ? ` (${entry.lang})` : \"\";\n        const header = entry.label ? `${indent}${entry.label}${langLabel}:\\n` : \"\";\n        const codeLines = entry.content.split(\"\\n\").map((l) => `${indent}  ${l}`).join(\"\\n\");\n        return `${header}${codeLines}`;\n      }\n\n      case \"table\": {\n        const lines: string[] = [];\n        if (entry.label) {\n          lines.push(`${indent}${entry.label}:`);\n        }\n        lines.push(`${indent}| ${entry.columns.join(\" | \")} |`);\n        lines.push(`${indent}| ${entry.columns.map(() => \"---\").join(\" | \")} |`);\n        for (const row of entry.rows) {\n          lines.push(`${indent}| ${row.join(\" | \")} |`);\n        }\n        return lines.join(\"\\n\");\n      }\n\n      case \"link\":\n        return `${indent}${entry.label}: ${entry.url}`;\n\n      case \"section\": {\n        const lines: string[] = [];\n        lines.push(`${indent}${entry.title}:`);\n        for (const line of entry.markdown.split(\"\\n\")) {\n          lines.push(`${indent}  ${line}`);\n        }\n        return lines.join(\"\\n\");\n      }\n\n      case \"mermaid\": {\n        const lines: string[] = [];\n        if (entry.title) {\n          lines.push(`${indent}${entry.title}:`);\n        }\n        for (const line of entry.code.split(\"\\n\")) {\n          lines.push(`${indent}  ${line}`);\n        }\n        return lines.join(\"\\n\");\n      }\n\n      case \"screenshot\":\n        // Both halves: the alt is what a reader wants, the path is what they\n        // open. Dropping the path when an alt exists left the artifact\n        // unreachable from the one output CI actually parses.\n        return `${indent}Screenshot: ${entry.alt ? `${entry.alt} (${entry.path})` : entry.path}`;\n\n      case \"video\":\n        return `${indent}Video: ${entry.caption ? `${entry.caption} (${entry.path})` : entry.path}`;\n\n      case \"state\":\n        return `${indent}State${entry.label ? ` (${entry.label})` : \"\"}: ${JSON.stringify(entry.value) ?? \"null\"}`;\n\n      case \"html\":\n        return `${indent}HTML: ${entry.title ?? \"Embedded HTML\"} (${entry.url ?? entry.path ?? \"inline\"})`;\n\n      case \"custom\": {\n        const dataStr = JSON.stringify(entry.data, null, 2);\n        const lines: string[] = [];\n        lines.push(`${indent}[${entry.type}]:`);\n        for (const line of dataStr.split(\"\\n\")) {\n          lines.push(`${indent}  ${line}`);\n        }\n        return lines.join(\"\\n\");\n      }\n    }\n\n    return assertNever(entry, \"JUnit XML: unhandled doc kind\");\n  }\n}\n\n/**\n * Escape special XML characters.\n */\nfunction escapeXml(str: string): string {\n  return str\n    .replace(/&/g, \"&amp;\")\n    .replace(/</g, \"&lt;\")\n    .replace(/>/g, \"&gt;\")\n    .replace(/\"/g, \"&quot;\")\n    .replace(/'/g, \"&apos;\");\n}\n\n/**\n * Group array items by a key function.\n */\nfunction groupBy<T, K>(items: T[], keyFn: (item: T) => K): Map<K, T[]> {\n  const map = new Map<K, T[]>();\n  for (const item of items) {\n    const key = keyFn(item);\n    const existing = map.get(key);\n    if (existing) {\n      existing.push(item);\n    } else {\n      map.set(key, [item]);\n    }\n  }\n  return map;\n}\n","/**\n * Markdown Formatter - Layer 3.\n *\n * Transforms canonical TestRunResult into Markdown documentation.\n * Compatible with existing markdown output from framework reporters.\n */\n\nimport { diffStateValues, summarizeStateChanges } from \"executable-stories-core\";\nimport { summarizeAccumulation } from \"executable-stories-core/utils/accumulation\";\nimport { assertNever } from \"executable-stories-core/utils/assert-never\";\nimport { assertionState, assertiveSteps } from \"executable-stories-core/utils/assertive-steps\";\nimport type { StoryStep, DocEntry } from \"executable-stories-core/types/story\";\nimport type { FeatureDeclaration, TestRunResult, TestCaseResult, TestStatus } from \"executable-stories-core/types/test-result\";\nimport type { MarkdownRenderers } from \"../types/options\";\nimport { bySourcePosition, earliestSourceLine } from \"./source-order\";\n\n/**\n * True for a local filesystem path (`/foo`, `\\foo`, `C:\\foo`) rather than a\n * URL. Screenshot/video paths are meant to be rewritten to a relative\n * `assets/...` path (or embedded as a `data:` URI) by capture-time inlining\n * or the report's asset bundler; a path that's still absolute by the time it\n * reaches this formatter means that never happened — most often because the\n * bundler doesn't run at all in this pipeline (e.g. Markdown posted straight\n * to a GitHub PR comment, with no asset-copy step in between). Embedding it\n * verbatim (`![alt](path)` / `<source src=\"path\">`) would be a\n * guaranteed-broken reference wherever the Markdown ends up rendered.\n */\nfunction isLocalFsPath(value: string): boolean {\n  return /^(?:[/\\\\]|[A-Za-z]:[/\\\\])/.test(value);\n}\n\n/** Options for Markdown formatting */\nexport interface MarkdownOptions {\n  /** Report title. Default: \"User Stories\" */\n  title?: string;\n  /** Include status icons on scenarios. Default: true */\n  includeStatusIcons?: boolean;\n  /** Include metadata table (date, version). Default: true */\n  includeMetadata?: boolean;\n  /** Include error details for failed scenarios. Default: true */\n  includeErrors?: boolean;\n  /** Scenario heading level. Default: 3 */\n  scenarioHeadingLevel?: 2 | 3 | 4;\n  /** Step rendering style. Default: \"bullets\" */\n  stepStyle?: \"bullets\" | \"gherkin\";\n  /** Group scenarios by. Default: \"file\" */\n  groupBy?: \"file\" | \"suite\" | \"none\";\n  /** Sort scenarios. Default: \"source\" */\n  sortScenarios?: \"alpha\" | \"source\" | \"none\";\n  /** Suite path separator. Default: \" - \" */\n  suiteSeparator?: string;\n  /** Include YAML front-matter for machine parsing. Default: false */\n  includeFrontMatter?: boolean;\n  /** Include summary table (counts, duration). Default: false */\n  includeSummaryTable?: boolean;\n  /** Base URL for source permalinks. E.g., \"https://github.com/user/repo/blob\" */\n  permalinkBaseUrl?: string;\n  /** URL template for ticket links. Use {ticket} as placeholder */\n  ticketUrlTemplate?: string;\n  /** URL template for trace links. Use {traceId} as placeholder. E.g. \"https://grafana.example.com/explore?traceId={traceId}\" */\n  traceUrlTemplate?: string;\n  /** Include source links when permalinkBaseUrl is set. Default: true */\n  includeSourceLinks?: boolean;\n  /** Custom renderers for doc entries */\n  customRenderers?: MarkdownRenderers;\n  /**\n   * Write a local screenshot/video path as an ordinary markdown reference\n   * instead of the \"unavailable\" line. Only for markdown handed to\n   * `gh pr comment|create|edit --attach <path>` (GitHub CLI 2.99+), which\n   * uploads the file and rewrites the reference. Anywhere else the reference\n   * is dead, which is why this is off by default. Default: false\n   */\n  attachImages?: boolean;\n  /**\n   * Emit a stable in-page anchor before each scenario heading, so external tools\n   * can deep-link to a scenario by fragment. Given a test case, return the anchor\n   * id (without `#`), or undefined to skip. Off by default — only the living-docs\n   * site opts in, so plain markdown output is unchanged.\n   */\n  scenarioAnchor?: (tc: TestCaseResult) => string | undefined;\n  /**\n   * Render a short badge line directly under a scenario heading (e.g. a\n   * what's-changed marker like \"🆕 New\" / \"⚠️ Regressed\"). Return the markdown\n   * line, or undefined to skip. Off by default — only the living-docs site opts in.\n   */\n  scenarioBadge?: (tc: TestCaseResult) => string | undefined;\n  /**\n   * Render a link line under a scenario heading pointing at hand-written context\n   * (the scenario's note page). Return the markdown line, or undefined to skip.\n   * Off by default — only the living-docs site opts in.\n   */\n  scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;\n}\n\n/** Resolved options with all defaults */\ntype ResolvedMarkdownOptions = {\n  title: string;\n  includeStatusIcons: boolean;\n  includeMetadata: boolean;\n  includeErrors: boolean;\n  scenarioHeadingLevel: 2 | 3 | 4;\n  stepStyle: \"bullets\" | \"gherkin\";\n  groupBy: \"file\" | \"suite\" | \"none\";\n  sortScenarios: \"alpha\" | \"source\" | \"none\";\n  suiteSeparator: string;\n  includeFrontMatter: boolean;\n  includeSummaryTable: boolean;\n  permalinkBaseUrl?: string;\n  ticketUrlTemplate?: string;\n  traceUrlTemplate?: string;\n  includeSourceLinks: boolean;\n  customRenderers?: MarkdownRenderers;\n  attachImages: boolean;\n  scenarioAnchor?: (tc: TestCaseResult) => string | undefined;\n  scenarioBadge?: (tc: TestCaseResult) => string | undefined;\n  scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;\n};\n\n/**\n * Markdown Formatter.\n *\n * Transforms TestRunResult into Markdown documentation that matches\n * the output format of existing framework reporters.\n */\nexport class MarkdownFormatter {\n  private options: ResolvedMarkdownOptions;\n  /**\n   * Previous `state` snapshot per label lane (label ?? \"\") — reset per\n   * scenario, mirroring storyboard lane semantics, so repeat captures render\n   * a diff summary against the prior same-label snapshot.\n   */\n  private stateLanes = new Map<string, unknown>();\n\n  constructor(options: MarkdownOptions = {}) {\n    this.options = {\n      title: options.title ?? \"User Stories\",\n      includeStatusIcons: options.includeStatusIcons ?? true,\n      includeMetadata: options.includeMetadata ?? true,\n      includeErrors: options.includeErrors ?? true,\n      scenarioHeadingLevel: options.scenarioHeadingLevel ?? 3,\n      stepStyle: options.stepStyle ?? \"bullets\",\n      groupBy: options.groupBy ?? \"file\",\n      sortScenarios: options.sortScenarios ?? \"source\",\n      suiteSeparator: options.suiteSeparator ?? \" - \",\n      includeFrontMatter: options.includeFrontMatter ?? false,\n      includeSummaryTable: options.includeSummaryTable ?? false,\n      permalinkBaseUrl: options.permalinkBaseUrl,\n      ticketUrlTemplate: options.ticketUrlTemplate,\n      traceUrlTemplate: options.traceUrlTemplate,\n      includeSourceLinks: options.includeSourceLinks ?? true,\n      customRenderers: options.customRenderers,\n      attachImages: options.attachImages ?? false,\n      scenarioAnchor: options.scenarioAnchor,\n      scenarioBadge: options.scenarioBadge,\n      scenarioNoteLink: options.scenarioNoteLink,\n    };\n  }\n\n  /**\n   * Format a test run into Markdown.\n   *\n   * @param run - Canonical test run result\n   * @returns Markdown string\n   */\n  format(run: TestRunResult): string {\n    const lines: string[] = [];\n\n    // Front-matter\n    if (this.options.includeFrontMatter) {\n      this.renderFrontMatter(lines, run);\n    }\n\n    // Title\n    lines.push(`# ${this.options.title}`);\n    lines.push(\"\");\n\n    // Metadata\n    if (this.options.includeMetadata) {\n      this.renderMetadata(lines, run);\n      lines.push(\"\");\n    }\n\n    // Summary table\n    if (this.options.includeSummaryTable) {\n      this.renderSummaryTable(lines, run);\n      lines.push(\"\");\n    }\n\n    // Render scenarios based on grouping\n    switch (this.options.groupBy) {\n      case \"none\":\n        this.renderFlatList(lines, run.testCases);\n        break;\n      case \"suite\":\n        this.renderBySuite(lines, run.testCases);\n        break;\n      case \"file\":\n      default:\n        this.renderByFile(lines, run.testCases, run.features);\n        break;\n    }\n\n    // Custom footer\n    if (this.options.customRenderers?.renderFooter) {\n      const footer = this.options.customRenderers.renderFooter(run);\n      if (footer) {\n        lines.push(\"\");\n        lines.push(footer);\n      }\n    }\n\n    return lines.join(\"\\n\").trimEnd();\n  }\n\n  /**\n   * Render YAML front-matter.\n   */\n  private renderFrontMatter(lines: string[], run: TestRunResult): void {\n    const data: Record<string, unknown> = {\n      title: this.options.title,\n      generatedAt: new Date(run.startedAtMs).toISOString(),\n      durationMs: run.durationMs,\n      scenarios: run.testCases.length,\n      passed: run.testCases.filter((tc) => tc.status === \"passed\").length,\n      failed: run.testCases.filter((tc) => tc.status === \"failed\").length,\n      skipped: run.testCases.filter((tc) => tc.status === \"skipped\").length,\n      pending: run.testCases.filter((tc) => tc.status === \"pending\").length,\n    };\n\n    if (run.packageVersion) data.version = run.packageVersion;\n    if (run.gitSha) data.gitSha = run.gitSha.length > 7 ? run.gitSha.slice(0, 7) : run.gitSha;\n    if (run.coverage) data.coverage = run.coverage;\n\n    lines.push(\"---\");\n    for (const [key, value] of Object.entries(data)) {\n      if (value === undefined) continue;\n      if (typeof value === \"object\") {\n        lines.push(`${key}:`);\n        for (const [k, v] of Object.entries(value as Record<string, unknown>)) {\n          lines.push(`  ${k}: ${v}`);\n        }\n      } else {\n        lines.push(`${key}: ${value}`);\n      }\n    }\n    lines.push(\"---\");\n    lines.push(\"\");\n  }\n\n  /**\n   * Render summary table.\n   */\n  private renderSummaryTable(lines: string[], run: TestRunResult): void {\n    const totalScenarios = run.testCases.length;\n    const totalSteps = run.testCases.reduce((acc, tc) => acc + tc.story.steps.length, 0);\n    const passed = run.testCases.filter((tc) => tc.status === \"passed\").length;\n    const failed = run.testCases.filter((tc) => tc.status === \"failed\").length;\n    const skipped = run.testCases.filter((tc) => tc.status === \"skipped\").length;\n    const pending = run.testCases.filter((tc) => tc.status === \"pending\").length;\n\n    lines.push(\"| Scenarios | Steps | Passed | Failed | Skipped | Pending | Duration |\");\n    lines.push(\"| ---: | ---: | ---: | ---: | ---: | ---: | ---: |\");\n    lines.push(`| ${totalScenarios} | ${totalSteps} | ${passed} | ${failed} | ${skipped} | ${pending} | ${this.formatDuration(run.durationMs)} |`);\n\n    // Coverage summary if available\n    if (run.coverage) {\n      lines.push(\"\");\n      lines.push(\"| Coverage | % |\");\n      lines.push(\"| --- | ---: |\");\n      if (run.coverage.statementsPct !== undefined) {\n        lines.push(`| Statements | ${run.coverage.statementsPct}% |`);\n      }\n      if (run.coverage.branchesPct !== undefined) {\n        lines.push(`| Branches | ${run.coverage.branchesPct}% |`);\n      }\n      if (run.coverage.functionsPct !== undefined) {\n        lines.push(`| Functions | ${run.coverage.functionsPct}% |`);\n      }\n      if (run.coverage.linesPct !== undefined) {\n        lines.push(`| Lines | ${run.coverage.linesPct}% |`);\n      }\n    }\n  }\n\n  /**\n   * Format duration in human-readable form.\n   */\n  private formatDuration(ms: number): string {\n    if (ms < 1000) return `${ms}ms`;\n    return `${(ms / 1000).toFixed(2)}s`;\n  }\n\n  /**\n   * Render metadata table.\n   */\n  private renderMetadata(lines: string[], run: TestRunResult): void {\n    const rows: Array<[string, string]> = [];\n\n    const startDate = new Date(run.startedAtMs);\n    rows.push([\"Date\", startDate.toISOString()]);\n\n    if (run.packageVersion) {\n      rows.push([\"Version\", run.packageVersion]);\n    }\n\n    if (run.gitSha) {\n      const shortSha = run.gitSha.length > 7 ? run.gitSha.slice(0, 7) : run.gitSha;\n      rows.push([\"Git SHA\", shortSha]);\n    }\n\n    // Say so when this is a composite. Without it the only explanation for a\n    // scenario that did not just run lives in state the reader cannot see.\n    const accumulated = summarizeAccumulation(run.testCases);\n    if (accumulated) {\n      const oldest = new Date(accumulated.oldestRunAtMs).toISOString();\n      const newest = new Date(accumulated.newestRunAtMs).toISOString();\n      rows.push([\n        \"Source\",\n        `accumulated from ${accumulated.runs} runs (${oldest} to ${newest})`,\n      ]);\n    }\n\n    if (rows.length > 0) {\n      lines.push(\"| Key | Value |\");\n      lines.push(\"| --- | --- |\");\n      for (const [key, value] of rows) {\n        lines.push(`| ${key} | ${value} |`);\n      }\n    }\n  }\n\n  /**\n   * Render scenarios grouped by file.\n   */\n  private renderByFile(\n    lines: string[],\n    testCases: TestCaseResult[],\n    features?: FeatureDeclaration[]\n  ): void {\n    const byFile = groupBy(testCases, (tc) => tc.sourceFile);\n    const declarations = new Map((features ?? []).map((f) => [f.sourceFile, f]));\n\n    for (const [file, fileTestCases] of byFile) {\n      const declared = declarations.get(file);\n      lines.push(`## ${declared ? formatFeatureHeading(declared) : file}`);\n      lines.push(\"\");\n\n      if (declared) {\n        this.renderFeatureDeclaration(lines, declared, file);\n      }\n\n      // Group by suite path within file\n      this.renderSuiteGroups(lines, fileTestCases, 3);\n    }\n  }\n\n  /**\n   * Render what a feature is for, ahead of the scenarios that prove it.\n   */\n  private renderFeatureDeclaration(\n    lines: string[],\n    declared: FeatureDeclaration,\n    file: string\n  ): void {\n    lines.push(`_${file}_`);\n    lines.push(\"\");\n\n    if (declared.narrative) {\n      lines.push(dedentNarrative(declared.narrative));\n      lines.push(\"\");\n    }\n\n    if (declared.glossary?.length) {\n      for (const { term, definition } of declared.glossary) {\n        lines.push(`- **${term}** — ${definition}`);\n      }\n      lines.push(\"\");\n    }\n  }\n\n  /**\n   * Render scenarios grouped by suite path.\n   */\n  private renderBySuite(lines: string[], testCases: TestCaseResult[]): void {\n    this.renderSuiteGroups(lines, testCases, 2);\n  }\n\n  /**\n   * Render suite groups.\n   */\n  private renderSuiteGroups(\n    lines: string[],\n    testCases: TestCaseResult[],\n    baseLevel: number\n  ): void {\n    const bySuite = groupBy(testCases, (tc) =>\n      tc.titlePath.join(this.options.suiteSeparator)\n    );\n\n    // Sort suite groups\n    const sortedSuites = this.sortSuiteGroups([...bySuite.entries()]);\n\n    for (const [suitePath, suiteTestCases] of sortedSuites) {\n      if (suitePath) {\n        lines.push(`${\"#\".repeat(baseLevel)} ${suitePath}`);\n        lines.push(\"\");\n      }\n\n      const sorted = this.sortScenarios(suiteTestCases);\n      for (const tc of sorted) {\n        this.renderScenario(lines, tc);\n      }\n    }\n  }\n\n  /**\n   * Render flat list of scenarios.\n   */\n  private renderFlatList(lines: string[], testCases: TestCaseResult[]): void {\n    const sorted = this.sortScenarios(testCases);\n    for (const tc of sorted) {\n      this.renderScenario(lines, tc);\n    }\n  }\n\n  /**\n   * Render a single scenario.\n   */\n  private renderScenario(lines: string[], tc: TestCaseResult): void {\n    // Stable deep-link target — an explicit anchor just above the heading, so a\n    // fragment like `#scenario-foo` resolves regardless of how the renderer slugs\n    // heading text. Opt-in (living-docs site only); see `scenarioAnchor` option.\n    const anchorId = this.options.scenarioAnchor?.(tc);\n    if (anchorId) {\n      lines.push(`<a id=\"${anchorId}\"></a>`);\n      lines.push(\"\");\n    }\n\n    // Check for custom scenario header renderer\n    if (this.options.customRenderers?.renderScenarioHeader) {\n      const custom = this.options.customRenderers.renderScenarioHeader(tc);\n      if (custom !== null) {\n        lines.push(custom);\n        lines.push(\"\");\n        // Still render steps and docs after custom header\n        this.renderScenarioBody(lines, tc);\n        return;\n      }\n    }\n\n    const headingPrefix = \"#\".repeat(this.options.scenarioHeadingLevel);\n\n    // Status icon\n    let icon = \"\";\n    if (this.options.includeStatusIcons) {\n      icon = this.getStatusIcon(tc.status) + \" \";\n    }\n\n    // Scenario heading. Planned scenarios (it.todo) say so — canonical\n    // status is \"pending\" but the reader should see intent, not limbo.\n    const plannedSuffix = tc.rawStatus === \"todo\" ? \" _(planned)_\" : \"\";\n    lines.push(`${headingPrefix} ${icon}${tc.story.scenario}${plannedSuffix}`);\n\n    // What's-changed badge (opt-in) — sits directly under the heading.\n    const badge = this.options.scenarioBadge?.(tc);\n    if (badge) {\n      lines.push(badge);\n    }\n\n    // Business-context link (opt-in) — points to the scenario's hand-written note.\n    const noteLink = this.options.scenarioNoteLink?.(tc);\n    if (noteLink) {\n      lines.push(noteLink);\n    }\n\n    // Source link\n    if (this.options.includeSourceLinks && this.options.permalinkBaseUrl && tc.sourceFile !== \"unknown\") {\n      const permalink = this.buildPermalink(tc);\n      lines.push(`Source: [${tc.sourceFile}](${permalink})`);\n    }\n\n    // Tags and tickets\n    const meta: string[] = [];\n    if (tc.tags.length > 0) {\n      meta.push(`Tags: ${tc.tags.map((t) => `\\`${t}\\``).join(\", \")}`);\n    }\n    if (tc.story.tickets && tc.story.tickets.length > 0) {\n      const ticketTemplate = this.options.ticketUrlTemplate;\n      const ticketLinks = tc.story.tickets.map((t) => {\n        if (t.url) {\n          return `[${t.id}](${t.url})`;\n        }\n        if (ticketTemplate) {\n          return `[${t.id}](${ticketTemplate.replace(\"{ticket}\", t.id)})`;\n        }\n        return `\\`${t.id}\\``;\n      });\n      meta.push(`Tickets: ${ticketLinks.join(\", \")}`);\n    }\n    if (tc.rawStatus === \"timeout\" || tc.rawStatus === \"interrupted\") {\n      meta.push(`Outcome: \\`${tc.rawStatus}\\``);\n    }\n    // Trace context (injected by OTel bridge in story.init())\n    const otelMeta = (tc.story.meta as Record<string, unknown> | undefined)\n      ?.otel as { traceId?: string } | undefined;\n    if (otelMeta?.traceId) {\n      const traceTemplate = this.options.traceUrlTemplate;\n      if (traceTemplate) {\n        const url = traceTemplate.replace(/\\{traceId\\}/g, otelMeta.traceId);\n        meta.push(\n          `Trace: [${otelMeta.traceId.slice(0, 16)}…](${url})`,\n        );\n      } else {\n        meta.push(`Trace: \\`${otelMeta.traceId}\\``);\n      }\n    }\n\n    if (meta.length > 0) {\n      lines.push(meta.join(\" | \"));\n    }\n\n    lines.push(\"\");\n\n    this.renderScenarioBody(lines, tc);\n  }\n\n  /**\n   * Render scenario body (docs, steps, errors).\n   */\n  private renderScenarioBody(lines: string[], tc: TestCaseResult): void {\n    // State diffs are scoped to one scenario.\n    this.stateLanes = new Map();\n\n    // Story-level docs\n    if (tc.story.docs && tc.story.docs.length > 0) {\n      for (const doc of tc.story.docs) {\n        this.renderDocEntry(lines, doc);\n      }\n    }\n\n    // Steps\n    // A scenario whose claim checked nothing is flagged in the prose, on the\n    // steps that make the claim. Judged per scenario rather than per step: a\n    // marker credits its trailing assertion to one step, so a scenario that\n    // declares two claims and checks once would otherwise flag the first for\n    // nothing. Same rule the grade and the CLI summary use, so the report tells\n    // one story.\n    const unasserted = new Set(\n      assertionState(tc.story.steps) === \"unasserted\"\n        ? assertiveSteps(tc.story.steps)\n        : []\n    );\n    for (const step of tc.story.steps) {\n      this.renderStep(lines, step, unasserted.has(step));\n    }\n\n    // Error\n    if (tc.status === \"failed\" && tc.errorMessage && this.options.includeErrors) {\n      lines.push(\"**Failure**\");\n      lines.push(\"\");\n      lines.push(\"```text\");\n      lines.push(tc.errorMessage);\n      if (tc.errorStack) {\n        lines.push(\"\");\n        lines.push(tc.errorStack);\n      }\n      lines.push(\"```\");\n      lines.push(\"\");\n    }\n\n    lines.push(\"\");\n  }\n\n  /**\n   * Build permalink URL for a test case.\n   */\n  private buildPermalink(tc: TestCaseResult): string {\n    const base = this.options.permalinkBaseUrl!.replace(/\\/$/, \"\");\n    const file = tc.sourceFile;\n    const line = tc.sourceLine > 0 ? `#L${tc.sourceLine}` : \"\";\n    return `${base}/${file}${line}`;\n  }\n\n  /**\n   * Render a step.\n   */\n  private renderStep(lines: string[], step: StoryStep, unasserted = false): void {\n    // Check for custom step renderer\n    if (this.options.customRenderers?.renderStep) {\n      const custom = this.options.customRenderers.renderStep(step);\n      if (custom !== null) {\n        lines.push(custom);\n        // Still render step docs\n        if (step.docs && step.docs.length > 0) {\n          const indent = this.options.stepStyle === \"gherkin\" ? \"\" : \"    \";\n          for (const doc of step.docs) {\n            this.renderDocEntry(lines, doc, indent);\n          }\n        }\n        return;\n      }\n    }\n\n    // Mode indicator\n    let modeIndicator = \"\";\n    if (step.mode === \"skip\") {\n      modeIndicator = \" _(skipped)_\";\n    } else if (step.mode === \"todo\") {\n      modeIndicator = \" _(todo)_\";\n    } else if (step.mode === \"fails\") {\n      modeIndicator = \" _(expected to fail)_\";\n    }\n    // Reads as part of the sentence rather than a badge: the claim itself has\n    // to look unbacked, or the reader takes it at face value.\n    if (unasserted) modeIndicator += \" _(no assertion)_\";\n\n    if (this.options.stepStyle === \"gherkin\") {\n      lines.push(`**${step.keyword}** ${step.text}${modeIndicator}`);\n    } else {\n      lines.push(`- **${step.keyword}** ${step.text}${modeIndicator}`);\n    }\n\n    // Render step docs\n    if (step.docs && step.docs.length > 0) {\n      const indent = this.options.stepStyle === \"gherkin\" ? \"\" : \"    \";\n      for (const doc of step.docs) {\n        this.renderDocEntry(lines, doc, indent);\n      }\n    }\n  }\n\n  /**\n   * Render a documentation entry.\n   */\n  private renderDocEntry(lines: string[], entry: DocEntry, indent = \"\"): void {\n    // Check for custom doc entry renderer\n    if (this.options.customRenderers?.renderDocEntry) {\n      const custom = this.options.customRenderers.renderDocEntry(entry);\n      if (custom !== null) {\n        lines.push(`${indent}${custom}`);\n        return;\n      }\n    }\n\n    switch (entry.kind) {\n      case \"note\":\n        lines.push(`${indent}> ${entry.text}`);\n        break;\n\n      case \"tag\":\n        lines.push(`${indent}${entry.names.map((n) => `\\`${n}\\``).join(\" \")}`);\n        break;\n\n      case \"kv\": {\n        const val = typeof entry.value === \"string\"\n          ? entry.value\n          : JSON.stringify(entry.value);\n        lines.push(`${indent}- **${entry.label}:** ${val}`);\n        break;\n      }\n\n      case \"code\":\n        if (entry.label) {\n          lines.push(`${indent}**${entry.label}**`);\n          lines.push(`${indent}`);\n        }\n        lines.push(`${indent}\\`\\`\\`${entry.lang ?? \"\"}`);\n        for (const line of (entry.content ?? \"\").split(\"\\n\")) {\n          lines.push(`${indent}${line}`);\n        }\n        lines.push(`${indent}\\`\\`\\``);\n        lines.push(`${indent}`);\n        break;\n\n      case \"table\":\n        if (entry.label) {\n          lines.push(`${indent}**${entry.label}**`);\n          lines.push(`${indent}`);\n        }\n        lines.push(`${indent}| ${entry.columns.join(\" | \")} |`);\n        lines.push(`${indent}| ${entry.columns.map(() => \"---\").join(\" | \")} |`);\n        for (const row of entry.rows) {\n          lines.push(`${indent}| ${row.join(\" | \")} |`);\n        }\n        lines.push(`${indent}`);\n        break;\n\n      case \"link\":\n        lines.push(`${indent}[${entry.label}](${entry.url})`);\n        break;\n\n      case \"section\":\n        lines.push(`${indent}**${entry.title}**`);\n        lines.push(`${indent}`);\n        for (const line of dedentNarrative(entry.markdown ?? \"\").split(\"\\n\")) {\n          lines.push(`${indent}${line}`);\n        }\n        lines.push(`${indent}`);\n        break;\n\n      case \"mermaid\":\n        if (entry.title) {\n          lines.push(`${indent}**${entry.title}**`);\n        }\n        lines.push(`${indent}\\`\\`\\`mermaid`);\n        for (const line of (entry.code ?? \"\").split(\"\\n\")) {\n          lines.push(`${indent}${line}`);\n        }\n        lines.push(`${indent}\\`\\`\\``);\n        break;\n\n      case \"screenshot\":\n        // Only `data:`/`http(s):` sources, or a relative path a bundler is\n        // meant to resolve, render as an embedded image.\n        if (isLocalFsPath(entry.path) && !this.options.attachImages) {\n          lines.push(`${indent}*Screenshot unavailable${entry.alt ? ` — ${entry.alt}` : \"\"} (\\`${entry.path}\\` was not readable when the report was generated)*`);\n        } else {\n          lines.push(`${indent}![${entry.alt ?? \"Screenshot\"}](${entry.path})`);\n        }\n        break;\n\n      case \"video\": {\n        // Raw HTML so a real, playable clip renders inline — Markdown and\n        // Astro/Starlight MDX both pass <video> through untouched. The asset\n        // bundler scans <source src> and copies the file into the docs site.\n        // Video is never inlined as a data URI (bytes are too large), so an\n        // absolute path here — unlike screenshot, which at least sometimes\n        // inlines successfully — means it will *always* be broken wherever\n        // Markdown reaches an audience without that bundling step in between\n        // (e.g. posted straight to a GitHub PR comment).\n        if (isLocalFsPath(entry.path)) {\n          if (!this.options.attachImages) {\n            lines.push(`${indent}*Video unavailable${entry.caption ? ` — ${entry.caption}` : \"\"} (\\`${entry.path}\\` was not readable when the report was generated)*`);\n            break;\n          }\n          // gh rewrites markdown image syntax, and GitHub plays an uploaded\n          // clip from that same reference, so `<video>` is not the shape to\n          // write here.\n          lines.push(`${indent}![${entry.caption ?? \"Video\"}](${entry.path})`);\n          break;\n        }\n        const poster = entry.poster ? ` poster=\"${entry.poster}\"` : \"\";\n        lines.push(`${indent}`);\n        lines.push(`${indent}<video controls preload=\"metadata\"${poster} class=\"doc-video\">`);\n        lines.push(`${indent}  <source src=\"${entry.path}\" />`);\n        lines.push(`${indent}</video>`);\n        if (entry.caption) {\n          lines.push(`${indent}`);\n          lines.push(`${indent}*${entry.caption}*`);\n        }\n        lines.push(`${indent}`);\n        break;\n      }\n\n      case \"html\": {\n        // The sandboxed iframe is HTML-report-only. Markdown degrades to a\n        // link for url/path sources; inline content goes in a collapsible\n        // fenced block (dumping live HTML into MD is unpredictable across\n        // renderers, and GitHub strips iframes anyway).\n        const htmlLabel = entry.title ?? \"Embedded HTML\";\n        if (entry.url !== undefined || entry.path !== undefined) {\n          lines.push(`${indent}[${htmlLabel}](${entry.url ?? entry.path})`);\n          break;\n        }\n        lines.push(`${indent}<details>`);\n        lines.push(`${indent}<summary>${htmlLabel}</summary>`);\n        lines.push(`${indent}`);\n        lines.push(`${indent}\\`\\`\\`html`);\n        for (const line of (entry.content ?? \"\").split(\"\\n\")) {\n          lines.push(`${indent}${line}`);\n        }\n        lines.push(`${indent}\\`\\`\\``);\n        lines.push(`${indent}`);\n        lines.push(`${indent}</details>`);\n        lines.push(`${indent}`);\n        break;\n      }\n\n      case \"state\": {\n        const lane = entry.label ?? \"\";\n        lines.push(`${indent}**${entry.label ?? \"State\"}**`);\n        if (this.stateLanes.has(lane)) {\n          const summary = summarizeStateChanges(diffStateValues(this.stateLanes.get(lane), entry.value));\n          for (const line of summary) lines.push(`${indent}- ${line}`);\n        }\n        this.stateLanes.set(lane, entry.value);\n        lines.push(`${indent}`);\n        lines.push(`${indent}<details>`);\n        lines.push(`${indent}<summary>snapshot</summary>`);\n        lines.push(`${indent}`);\n        lines.push(`${indent}\\`\\`\\`json`);\n        for (const line of JSON.stringify(entry.value ?? null, null, 2).split(\"\\n\")) {\n          lines.push(`${indent}${line}`);\n        }\n        lines.push(`${indent}\\`\\`\\``);\n        lines.push(`${indent}`);\n        lines.push(`${indent}</details>`);\n        lines.push(`${indent}`);\n        break;\n      }\n\n      case \"custom\":\n        if (entry.type === \"visual\" && entry.data && typeof entry.data === \"object\") {\n          const data = entry.data as Record<string, unknown>;\n          const status = typeof data.status === \"string\" ? data.status : \"unknown\";\n          lines.push(`${indent}**Visual Check** (${status})`);\n          if (typeof data.baseline === \"string\") lines.push(`${indent}- Baseline: ${data.baseline}`);\n          if (typeof data.actual === \"string\") lines.push(`${indent}- Actual: ${data.actual}`);\n          if (typeof data.diff === \"string\") lines.push(`${indent}- Diff: ${data.diff}`);\n          lines.push(`${indent}`);\n          break;\n        }\n        lines.push(`${indent}**[${entry.type}]**`);\n        lines.push(`${indent}`);\n        lines.push(`${indent}\\`\\`\\`json`);\n        for (const line of JSON.stringify(entry.data ?? null, null, 2).split(\"\\n\")) {\n          lines.push(`${indent}${line}`);\n        }\n        lines.push(`${indent}\\`\\`\\``);\n        lines.push(`${indent}`);\n        break;\n\n      default:\n        assertNever(entry, \"Markdown: unhandled doc kind\");\n    }\n\n    // Render children with increased indentation\n    if (Array.isArray(entry.children) && entry.children.length > 0) {\n      const childIndent = indent + \"  \";\n      for (const child of entry.children) {\n        this.renderDocEntry(lines, child, childIndent);\n      }\n    }\n  }\n\n  /**\n   * Get status icon for a status.\n   */\n  private getStatusIcon(status: TestStatus): string {\n    switch (status) {\n      case \"passed\":\n        return \"✅\";\n      case \"failed\":\n        return \"❌\";\n      case \"skipped\":\n        return \"⏩\";\n      case \"pending\":\n        return \"📝\";\n      default:\n        return \"⚠️\";\n    }\n  }\n\n  /**\n   * Sort scenarios based on options.\n   */\n  private sortScenarios(testCases: TestCaseResult[]): TestCaseResult[] {\n    if (this.options.sortScenarios === \"alpha\") {\n      return [...testCases].sort((a, b) =>\n        a.story.scenario.localeCompare(b.story.scenario)\n      );\n    }\n    if (this.options.sortScenarios === \"source\") {\n      return [...testCases].sort(bySourcePosition);\n    }\n    return testCases;\n  }\n\n  /**\n   * Sort suite groups.\n   */\n  private sortSuiteGroups(\n    entries: [string, TestCaseResult[]][]\n  ): [string, TestCaseResult[]][] {\n    if (this.options.sortScenarios === \"alpha\") {\n      return entries.sort(([a], [b]) => a.localeCompare(b));\n    }\n    if (this.options.sortScenarios === \"source\") {\n      return entries.sort(([, a], [, b]) => {\n        return earliestSourceLine(a) - earliestSourceLine(b);\n      });\n    }\n    return entries;\n  }\n}\n\n/**\n * Group array items by a key function.\n */\nfunction groupBy<T, K>(items: T[], keyFn: (item: T) => K): Map<K, T[]> {\n  const map = new Map<K, T[]>();\n  for (const item of items) {\n    const key = keyFn(item);\n    const existing = map.get(key);\n    if (existing) {\n      existing.push(item);\n    } else {\n      map.set(key, [item]);\n    }\n  }\n  return map;\n}\n\n/**\n * Label the feature the way it was declared.\n *\n * An ability reads as something a person can now do; a business need covers the\n * cross-cutting concerns nobody asks for by name, like security or performance.\n * Naming the kind in the heading keeps that distinction visible to a reader who\n * never sees the test code.\n */\nfunction formatFeatureHeading(declared: FeatureDeclaration): string {\n  const label =\n    declared.kind === \"ability\"\n      ? \"Ability\"\n      : declared.kind === \"business-need\"\n        ? \"Business Need\"\n        : \"Feature\";\n  return `${label}: ${declared.title}`;\n}\n\n/**\n * Strip the leading indentation a template literal picks up from its source.\n *\n * Narratives are written inline in test files, so they arrive indented to match\n * the surrounding code. Left alone, four spaces would make Markdown render the\n * whole paragraph as a code block.\n */\nfunction dedentNarrative(narrative: string): string {\n  const lines = narrative.replace(/\\t/g, \"  \").split(\"\\n\");\n  const indents = lines\n    .filter((line) => line.trim().length > 0)\n    .map((line) => line.length - line.trimStart().length);\n  const shortest = indents.length > 0 ? Math.min(...indents) : 0;\n  return lines\n    .map((line) => line.slice(shortest))\n    .join(\"\\n\")\n    .trim();\n}\n","import type { TestCaseResult } from \"executable-stories-core\";\n\n/**\n * Order two scenarios by where they sit in their source file.\n *\n * `story.sourceOrder` counts `story.init()` calls, so it records the order\n * tests *ran*. Under parallel workers that is not the order they were written:\n * each worker is its own process and restarts the counter at zero, so the\n * numbers both scramble and collide. `sourceLine` comes from the framework's\n * own location for the test and says where it actually is.\n *\n * Scenarios from different files are grouped by file before this runs, so\n * comparing bare line numbers is safe; the file name breaks ties only when a\n * caller sorts across files.\n */\nexport function bySourcePosition(a: TestCaseResult, b: TestCaseResult): number {\n  if (a.sourceLine !== b.sourceLine) return a.sourceLine - b.sourceLine;\n  if (a.sourceFile !== b.sourceFile) return a.sourceFile < b.sourceFile ? -1 : 1;\n  return (a.story.sourceOrder ?? 0) - (b.story.sourceOrder ?? 0);\n}\n\n/** Earliest source line in a group, for ordering the groups themselves. */\nexport function earliestSourceLine(cases: TestCaseResult[]): number {\n  return Math.min(...cases.map((c) => c.sourceLine));\n}\n","import { createHash } from \"node:crypto\";\n\nimport type { TestCaseResult, TestRunResult } from \"executable-stories-core/types/test-result\";\n\nexport interface ReleaseManifest {\n  schemaVersion: \"1.0\";\n  generatedAt: string;\n  run: {\n    startedAt: string;\n    finishedAt: string;\n    gitSha?: string;\n    branch?: string;\n    total: number;\n    passed: number;\n    failed: number;\n    skipped: number;\n    pending: number;\n  };\n  testedTogetherHash: string;\n  scenarios: Array<{\n    id: string;\n    title: string;\n    status: string;\n    sourceFile: string;\n    sourceLine: number;\n    tags: string[];\n  }>;\n}\n\nexport class ReleaseManifestFormatter {\n  format(run: TestRunResult): string {\n    const manifest = toReleaseManifest(run);\n    const lines: string[] = [];\n\n    lines.push(\"# Release Manifest\");\n    lines.push(\"\");\n    lines.push(`Generated: ${manifest.generatedAt}`);\n    lines.push(`Run: ${manifest.run.startedAt} to ${manifest.run.finishedAt}`);\n    if (manifest.run.branch) lines.push(`Branch: ${manifest.run.branch}`);\n    if (manifest.run.gitSha) lines.push(`Commit: ${manifest.run.gitSha}`);\n    lines.push(`Tested-together hash: \\`${manifest.testedTogetherHash}\\``);\n    lines.push(\"\");\n    lines.push(\"| Scenarios | Passed | Failed | Skipped | Pending |\");\n    lines.push(\"| ---: | ---: | ---: | ---: | ---: |\");\n    lines.push(`| ${manifest.run.total} | ${manifest.run.passed} | ${manifest.run.failed} | ${manifest.run.skipped} | ${manifest.run.pending} |`);\n    lines.push(\"\");\n    lines.push(\"## Scenarios\");\n    lines.push(\"\");\n    lines.push(\"| Status | Scenario | Source | Tags |\");\n    lines.push(\"| --- | --- | --- | --- |\");\n    for (const scenario of manifest.scenarios) {\n      const source = `${scenario.sourceFile}:${scenario.sourceLine}`;\n      const tags = scenario.tags.length > 0 ? scenario.tags.map((tag) => `\\`${tag}\\``).join(\", \") : \"\";\n      lines.push(`| ${renderStatus(scenario.status)} | ${escapePipe(scenario.title)} | \\`${source}\\` | ${tags} |`);\n    }\n\n    return lines.join(\"\\n\");\n  }\n}\n\nexport function toReleaseManifest(run: TestRunResult): ReleaseManifest {\n  const scenarios = [...run.testCases]\n    .sort((a, b) => a.id.localeCompare(b.id))\n    .map((tc) => ({\n      id: tc.id,\n      title: tc.story.scenario,\n      status: tc.status,\n      sourceFile: tc.sourceFile,\n      sourceLine: tc.sourceLine,\n      tags: tc.tags,\n    }));\n\n  const fingerprint = scenarios.map((scenario) => `${scenario.id}:${scenario.status}`).join(\"\\n\");\n\n  return {\n    schemaVersion: \"1.0\",\n    generatedAt: new Date().toISOString(),\n    run: {\n      startedAt: new Date(run.startedAtMs).toISOString(),\n      finishedAt: new Date(run.finishedAtMs).toISOString(),\n      gitSha: run.gitSha,\n      branch: getBranch(run),\n      total: run.testCases.length,\n      passed: count(run.testCases, \"passed\"),\n      failed: count(run.testCases, \"failed\"),\n      skipped: count(run.testCases, \"skipped\"),\n      pending: count(run.testCases, \"pending\"),\n    },\n    testedTogetherHash: createHash(\"sha256\").update(fingerprint).digest(\"hex\"),\n    scenarios,\n  };\n}\n\nfunction getBranch(run: TestRunResult): string | undefined {\n  return run.ci?.branch;\n}\n\nfunction count(testCases: TestCaseResult[], status: TestCaseResult[\"status\"]): number {\n  return testCases.filter((tc) => tc.status === status).length;\n}\n\nfunction renderStatus(status: string): string {\n  switch (status) {\n    case \"passed\":\n      return \"passed\";\n    case \"failed\":\n      return \"failed\";\n    case \"skipped\":\n      return \"skipped\";\n    case \"pending\":\n      return \"pending\";\n    default:\n      return status;\n  }\n}\n\nfunction escapePipe(value: string): string {\n  return value.replace(/\\|/g, \"\\\\|\");\n}\n","/**\n * Review domain — `buildReview(run, context)` mirrors `diffRuns(baseline, current)`.\n *\n * A pure function that enriches a canonical run into a {@link ReviewResult}:\n * each test case becomes a graded claim, and (when diff context is supplied)\n * changed source files are correlated to claims and banded\n * uncovered → weak → covered. The review formatters render the result.\n */\n\nimport type { DocEntry } from \"executable-stories-core/types/story\";\nimport { assertionState } from \"executable-stories-core\";\nimport type { TestCaseResult } from \"executable-stories-core/types/test-result\";\nimport type {\n  ChangeType,\n  ChangedFileReview,\n  CodeDiffEvidence,\n  CodeDiffInput,\n  EvidenceStrength,\n  ReviewAudience,\n  ReviewClaim,\n  ReviewContext,\n  ReviewResult,\n  ReviewSummary,\n} from \"../types/review\";\nimport { parseUnifiedDiff, relocateAnchor } from \"./diff-anchor\";\nimport {\n  VALID_CHANGE_TYPES,\n  deriveAudience,\n  deriveChangeType,\n  isReviewableSource,\n  sourceBaseKey,\n  testBaseKey,\n} from \"./conventions\";\nimport { asChoice, type JevClient } from \"../jev\";\n\nconst STRENGTH_RANK: Record<EvidenceStrength, number> = {\n  none: 0,\n  weak: 1,\n  moderate: 2,\n  strong: 3,\n};\n\nconst INTENT_SECTION_TITLE = /\\b(why|intent|approach|rationale|reasoning)\\b/i;\n\n/** Recursively find the first doc entry (including children) matching a predicate. */\nfunction findDoc(\n  docs: DocEntry[] | undefined,\n  predicate: (doc: DocEntry) => boolean\n): DocEntry | undefined {\n  if (!docs) return undefined;\n  for (const doc of docs) {\n    if (predicate(doc)) return doc;\n    const nested = findDoc(doc.children, predicate);\n    if (nested) return nested;\n  }\n  return undefined;\n}\n\nfunction anyDoc(\n  docs: DocEntry[] | undefined,\n  predicate: (doc: DocEntry) => boolean\n): boolean {\n  return findDoc(docs, predicate) !== undefined;\n}\n\n/** Pull the intent/approach narrative from a \"Why\"-style section, falling back to a note. */\nfunction extractIntent(testCase: TestCaseResult): string | undefined {\n  const docs = testCase.story.docs;\n  const section = findDoc(\n    docs,\n    (d): d is Extract<DocEntry, { kind: \"section\" }> =>\n      d.kind === \"section\" && INTENT_SECTION_TITLE.test(d.title)\n  );\n  if (section && section.kind === \"section\") return section.markdown;\n\n  const note = findDoc(docs, (d) => d.kind === \"note\");\n  if (note && note.kind === \"note\") return note.text;\n  return undefined;\n}\n\n/** True when the test case carries a screenshot (attachment or `screenshot` doc). */\nfunction hasScreenshot(testCase: TestCaseResult): boolean {\n  if (testCase.attachments.some((a) => a.mediaType.startsWith(\"image/\"))) {\n    return true;\n  }\n  if (anyDoc(testCase.story.docs, (d) => d.kind === \"screenshot\")) return true;\n  return testCase.story.steps.some((step) =>\n    anyDoc(step.docs, (d) => d.kind === \"screenshot\")\n  );\n}\n\nfunction hasOtelTrace(testCase: TestCaseResult): boolean {\n  return (testCase.story.otelSpans?.length ?? 0) > 0;\n}\n\n/**\n * Grade how credible a claim's proof is.\n *\n * A passing self-authored test is the weakest evidence. Strength climbs as\n * tamper-resistant or constraint-proving signals appear: a screenshot/trace, a\n * decent mutation score, and — strongest — failing-first verification.\n */\nexport function gradeEvidence(\n  testCase: TestCaseResult,\n  audience: ReviewAudience\n): { strength: EvidenceStrength; reasons: string[] } {\n  if (testCase.status !== \"passed\") {\n    return {\n      strength: \"none\",\n      reasons: [`test is ${testCase.status} — the proof does not hold`],\n    };\n  }\n\n  // A scenario that asserted nothing cannot fail, so it proves nothing, and no\n  // attached artifact changes that. This floor sits above every other signal:\n  // mutation score and failing-first are unreachable for a test that is green\n  // by construction.\n  if (assertionState(testCase.story.steps) === \"unasserted\") {\n    return {\n      strength: \"none\",\n      reasons: [\"the scenario passed without asserting anything\"],\n    };\n  }\n\n  const ev = testCase.evidence;\n  const screenshot = hasScreenshot(testCase);\n  const otel = hasOtelTrace(testCase);\n  const isIntegration = /\\.int\\.test\\./i.test(testCase.sourceFile);\n  const mutation = ev?.mutationScorePct;\n  const changedCov = ev?.changedLineCoveragePct;\n\n  const strong: string[] = [];\n  if (ev?.failingFirstVerified) {\n    strong.push(\"failing-first verified (red on base ref, green on head)\");\n  }\n  if (typeof mutation === \"number\" && mutation >= 80) {\n    strong.push(`mutation score ${mutation}% (≥80%)`);\n  }\n  if (screenshot && otel) {\n    strong.push(\"backed by screenshot + OTEL trace\");\n  } else if (audience === \"stakeholder\" && (screenshot || otel)) {\n    strong.push(`stakeholder proof: ${screenshot ? \"screenshot\" : \"OTEL trace\"}`);\n  }\n  if (strong.length > 0) return { strength: \"strong\", reasons: strong };\n\n  const moderate: string[] = [];\n  if (screenshot) moderate.push(\"screenshot attached\");\n  if (otel) moderate.push(\"OTEL trace attached\");\n  if (typeof mutation === \"number\" && mutation >= 50) {\n    moderate.push(`mutation score ${mutation}%`);\n  }\n  if (typeof changedCov === \"number\" && changedCov >= 80) {\n    moderate.push(`changed-line coverage ${changedCov}%`);\n  }\n  if (isIntegration) moderate.push(\"integration-level test\");\n  if (moderate.length > 0) return { strength: \"moderate\", reasons: moderate };\n\n  return {\n    strength: \"weak\",\n    reasons: [\n      \"passing test only — no corroborating evidence (add e2e proof, mutation score, or failing-first)\",\n    ],\n  };\n}\n\nfunction toClaim(\n  testCase: TestCaseResult,\n  changedSourcePaths: string[]\n): ReviewClaim {\n  const audience = deriveAudience(testCase.sourceFile, testCase.tags);\n  const changeType = deriveChangeType(testCase.tags);\n  const { strength, reasons } = gradeEvidence(testCase, audience);\n\n  // Colocated-filename correlation: a test covers a changed source file when the\n  // test's base path (infix stripped) matches the source file's base path.\n  const key = testBaseKey(testCase.sourceFile);\n  const coversFiles = changedSourcePaths.filter(\n    (path) => sourceBaseKey(path) === key\n  );\n\n  return {\n    id: testCase.id,\n    scenario: testCase.story.scenario,\n    sourceFile: testCase.sourceFile,\n    sourceLine: testCase.sourceLine,\n    status: testCase.status,\n    audience,\n    changeType,\n    strength,\n    strengthReasons: reasons,\n    intent: extractIntent(testCase),\n    coversFiles,\n    testCase,\n  };\n}\n\nfunction bandFor(claims: ReviewClaim[]): ChangedFileReview[\"band\"] {\n  if (claims.length === 0) return \"uncovered\";\n  const maxRank = Math.max(...claims.map((c) => STRENGTH_RANK[c.strength]));\n  return maxRank >= STRENGTH_RANK.moderate ? \"covered\" : \"weak\";\n}\n\nconst AUDIENCE_ORDER: Record<ReviewAudience, number> = {\n  stakeholder: 0,\n  engineer: 1,\n};\n\n/**\n * Resolve one Code Diff evidence group: parse the patch, relocate each\n * annotation's content anchor, and resolve cited scenario IDs against the\n * run. Ambiguous/orphaned anchors and unresolved scenario IDs stay visible\n * in the result — they are never dropped or silently reattached.\n */\nfunction buildCodeDiff(\n  input: CodeDiffInput,\n  run: ReviewResult[\"run\"],\n  context: ReviewContext\n): CodeDiffEvidence {\n  const files = parseUnifiedDiff(input.patch);\n  const byId = new Map(run.testCases.map((tc) => [tc.id, tc]));\n  return {\n    title: input.title,\n    patch: input.patch,\n    patchUrl: input.patchUrl,\n    baseLabel: input.baseLabel ?? context.baseRef,\n    headLabel: input.headLabel ?? context.headRef,\n    files,\n    annotations: input.annotations.map((annotation) => ({\n      anchorHash: annotation.anchor?.hash,\n      text: annotation.text,\n      label: annotation.label,\n      resolution: annotation.anchor\n        ? relocateAnchor(annotation.anchor, files)\n        : { state: annotation.unresolved ?? (\"orphaned\" as const) },\n      scenarios: (annotation.scenarioIds ?? []).map((id) => {\n        const testCase = byId.get(id);\n        return testCase\n          ? {\n              id,\n              resolved: true,\n              scenario: testCase.story.scenario,\n              status: testCase.status,\n            }\n          : { id, resolved: false };\n      }),\n    })),\n  };\n}\n\n/**\n * Build the review model from a canonical run and optional diff context.\n *\n * With no `changedFiles`, the report degrades gracefully to \"claims only\"\n * (no banding). With diff context, changed source files are correlated and\n * banded — the 🔴 uncovered band being the reviewer's first stop.\n */\nexport function buildReview(\n  run: ReviewResult[\"run\"],\n  context: ReviewContext = { changedFiles: [] }\n): ReviewResult {\n  const changedSource = context.changedFiles.filter((f) =>\n    isReviewableSource(f.path)\n  );\n  const changedSourcePaths = changedSource.map((f) => f.path);\n\n  const claims = run.testCases.map((tc) => toClaim(tc, changedSourcePaths));\n\n  const changedFiles: ChangedFileReview[] = changedSource.map((file) => {\n    const covering = claims.filter((c) => c.coversFiles.includes(file.path));\n    return {\n      path: file.path,\n      changeKind: file.changeKind,\n      band: bandFor(covering),\n      claims: covering.map((c) => ({\n        id: c.id,\n        scenario: c.scenario,\n        strength: c.strength,\n      })),\n    };\n  });\n\n  // Claims: stakeholder first, then weakest evidence first (surface risk), then stable.\n  const sortedClaims = [...claims].sort((a, b) => {\n    if (AUDIENCE_ORDER[a.audience] !== AUDIENCE_ORDER[b.audience]) {\n      return AUDIENCE_ORDER[a.audience] - AUDIENCE_ORDER[b.audience];\n    }\n    if (STRENGTH_RANK[a.strength] !== STRENGTH_RANK[b.strength]) {\n      return STRENGTH_RANK[a.strength] - STRENGTH_RANK[b.strength];\n    }\n    if (a.sourceFile !== b.sourceFile) {\n      return a.sourceFile.localeCompare(b.sourceFile);\n    }\n    return a.scenario.localeCompare(b.scenario);\n  });\n\n  const bandRank = { uncovered: 0, weak: 1, covered: 2 } as const;\n  const sortedFiles = [...changedFiles].sort((a, b) => {\n    if (bandRank[a.band] !== bandRank[b.band]) {\n      return bandRank[a.band] - bandRank[b.band];\n    }\n    return a.path.localeCompare(b.path);\n  });\n\n  const summary = buildSummary(sortedClaims, sortedFiles);\n\n  return {\n    run,\n    context,\n    summary,\n    claims: sortedClaims,\n    changedFiles: sortedFiles,\n    codeDiffs: (context.codeDiffs ?? []).map((d) => buildCodeDiff(d, run, context)),\n  };\n}\n\n/**\n * Code Diff integrity diagnostics: orphaned/ambiguous anchors and unverified\n * scenario references. The CLI prints these as warnings; `--strict-code-diff`\n * turns them into review-gate failures so CI catches explainers that lost\n * their grounding.\n */\n/** Below this confidence the claim stays `unknown`. */\nexport const REVIEW_CHANGE_TYPE_MIN_CONFIDENCE = 0.6;\n/** Enough patch to classify; a claim rarely covers more than a few hunks. */\nconst PATCH_EXCERPT_CHARS = 4000;\n\nconst CHANGE_TYPE_CRITERIA: Record<Exclude<ChangeType, \"unknown\">, string> = {\n  feature: \"new user-visible behaviour or capability\",\n  bugfix: \"corrects behaviour that was wrong\",\n  refactor: \"restructures code without changing behaviour\",\n  perf: \"same behaviour, faster or cheaper\",\n  deps: \"dependency, toolchain, or lockfile change\",\n};\n\n/**\n * For claims with no `change:*` tag, ask Jev to pick the change-type from the\n * scenario plus the hunks of the files it covers. Confident answers are\n * written back with their confidence so every renderer can say \"inferred\";\n * the rest stay `unknown`.\n */\nexport async function enrichReview(review: ReviewResult, jev: JevClient): Promise<ReviewResult> {\n  const untagged = review.claims.filter((c) => c.changeType === \"unknown\" && c.coversFiles.length > 0);\n  if (untagged.length === 0) return review;\n\n  const hunksByPath = new Map<string, string[]>();\n  for (const group of review.context.codeDiffs ?? []) {\n    for (const file of parseUnifiedDiff(group.patch)) {\n      const path = file.newPath ?? file.oldPath;\n      if (!path) continue;\n      const text = file.hunks.flatMap((h) => h.lines.map((l) => (l.kind === \"add\" ? \"+\" : l.kind === \"del\" ? \"-\" : \" \") + l.text));\n      hunksByPath.set(path, [...(hunksByPath.get(path) ?? []), ...text]);\n    }\n  }\n\n  const inferred = new Map<string, { changeType: ChangeType; confidence: number }>();\n  await Promise.all(\n    untagged.map(async (claim) => {\n      const patch = claim.coversFiles.flatMap((f) => hunksByPath.get(f) ?? []).join(\"\\n\").slice(0, PATCH_EXCERPT_CHARS);\n      const answers = await jev.ask(\n        {\n          scenario: claim.scenario,\n          steps: claim.testCase.story.steps.map((s) => `${s.keyword} ${s.text}`),\n          ...(claim.intent ? { intent: claim.intent } : {}),\n          changedFiles: claim.coversFiles,\n          ...(patch ? { patch } : {}),\n        },\n        {\n          changeType: {\n            type: \"choice\",\n            instructions: \"What kind of change does this scenario prove?\",\n            criteria: CHANGE_TYPE_CRITERIA,\n          },\n        },\n      );\n      const answer = asChoice(answers.changeType);\n      if (!answer || answer.confidence < REVIEW_CHANGE_TYPE_MIN_CONFIDENCE) return;\n      const changeType = answer.choice as ChangeType;\n      if (VALID_CHANGE_TYPES.has(changeType)) inferred.set(claim.id, { changeType, confidence: answer.confidence });\n    }),\n  );\n\n  return {\n    ...review,\n    claims: review.claims.map((claim) => {\n      const hit = inferred.get(claim.id);\n      return hit ? { ...claim, changeType: hit.changeType, changeTypeConfidence: hit.confidence } : claim;\n    }),\n  };\n}\n\nexport function codeDiffDiagnostics(review: ReviewResult): string[] {\n  const issues: string[] = [];\n  for (const evidence of review.codeDiffs) {\n    evidence.annotations.forEach((annotation, i) => {\n      const name = annotation.label ?? `annotation ${i + 1}`;\n      if (annotation.resolution.state !== \"anchored\") {\n        issues.push(\n          `\"${evidence.title}\" ${name}: anchor is ${annotation.resolution.state} in the current patch`\n        );\n      }\n      for (const ref of annotation.scenarios) {\n        if (!ref.resolved) {\n          issues.push(\n            `\"${evidence.title}\" ${name}: cites scenario \"${ref.id}\" which is not in this run`\n          );\n        }\n      }\n    });\n  }\n  return issues;\n}\n\nfunction buildSummary(\n  claims: ReviewClaim[],\n  changedFiles: ChangedFileReview[]\n): ReviewSummary {\n  const byAudience: Record<ReviewAudience, number> = {\n    stakeholder: 0,\n    engineer: 0,\n  };\n  const byStrength: Record<EvidenceStrength, number> = {\n    none: 0,\n    weak: 0,\n    moderate: 0,\n    strong: 0,\n  };\n  for (const claim of claims) {\n    byAudience[claim.audience] += 1;\n    byStrength[claim.strength] += 1;\n  }\n\n  return {\n    totalClaims: claims.length,\n    byAudience,\n    byStrength,\n    changedSourceFiles: changedFiles.length,\n    uncovered: changedFiles.filter((f) => f.band === \"uncovered\").length,\n    weaklyCovered: changedFiles.filter((f) => f.band === \"weak\").length,\n    covered: changedFiles.filter((f) => f.band === \"covered\").length,\n  };\n}\n","/**\n * Diff anchoring — content-anchored annotation targets for Code Diff evidence.\n *\n * An annotation must stay attached to the right hunk after the patch is\n * regenerated (which, for AI-authored changes, happens constantly). Line\n * numbers are the wrong key: they detach on rebase/force-push. This module\n * anchors by content instead, the way `patch(1)` does — the anchor is the\n * changed lines plus a bounded window of surrounding context, and relocation\n * matches that content in the new patch with progressive fuzz (outermost\n * context lines are dropped first; the changed lines are never dropped).\n *\n * Resolution states:\n * - `anchored`  — exactly one match above the fuzz threshold.\n * - `ambiguous` — multiple matches (e.g. duplicate identical lines); the\n *                 annotation must render visibly un-located, never guessed.\n * - `orphaned`  — no match; the annotation renders with a \"could not locate\n *                 in current patch\" notice, never silently reattached.\n *\n * Pure functions, no I/O — patches are generated at the CLI/Action layer\n * (with `git diff --histogram` for hunk stability), never by adapters.\n */\n\nimport { createHash } from \"node:crypto\";\n\nimport type {\n  AnchorResolution,\n  DiffAnchor,\n  DiffHunk,\n  DiffLine,\n  FileDiff,\n} from \"../types/diff\";\n\n/** Context lines captured per side when creating an anchor (git's default context size). */\nexport const CONTEXT_WINDOW = 3;\n/** Maximum outermost context lines dropped per side during relocation (patch(1)'s default max fuzz). */\nexport const MAX_FUZZ = 2;\n\n/** Whitespace-normalize a line for anchor identity and matching. */\nconst normalize = (line: string): string => line.trim();\n\nconst HUNK_HEADER = /^@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@ ?(.*)$/;\n\nfunction stripPathPrefix(raw: string): string | undefined {\n  const path = raw.split(\"\\t\")[0].trim();\n  if (path === \"/dev/null\") return undefined;\n  return path.replace(/^[ab]\\//, \"\");\n}\n\n/**\n * Parse a unified diff into files and hunks. Hunk bodies are consumed by\n * line count from the `@@` header, so content lines that look like file\n * headers (e.g. a context line starting with `--- `) parse correctly.\n */\nexport function parseUnifiedDiff(patch: string): FileDiff[] {\n  const files: FileDiff[] = [];\n  let current: FileDiff | undefined;\n  let hunk: DiffHunk | undefined;\n  let oldRemaining = 0;\n  let newRemaining = 0;\n\n  for (const line of patch.split(\"\\n\")) {\n    if (hunk && (oldRemaining > 0 || newRemaining > 0)) {\n      if (line.startsWith(\"\\\\\")) continue; // \"\\ No newline at end of file\"\n      const kind = line.startsWith(\"+\") ? \"add\" : line.startsWith(\"-\") ? \"del\" : \"context\";\n      hunk.lines.push({ kind, text: line.slice(1) });\n      if (kind !== \"add\") oldRemaining--;\n      if (kind !== \"del\") newRemaining--;\n      continue;\n    }\n    hunk = undefined;\n\n    if (line.startsWith(\"diff --git \")) {\n      current = { hunks: [] };\n      files.push(current);\n      continue;\n    }\n    if (line.startsWith(\"--- \")) {\n      // Plain patches have no \"diff --git\" line; \"---\" starts a new file then.\n      if (!current || current.oldPath !== undefined || current.hunks.length > 0) {\n        current = { hunks: [] };\n        files.push(current);\n      }\n      current.oldPath = stripPathPrefix(line.slice(4));\n      continue;\n    }\n    if (line.startsWith(\"+++ \") && current) {\n      current.newPath = stripPathPrefix(line.slice(4));\n      continue;\n    }\n    const match = HUNK_HEADER.exec(line);\n    if (match && current) {\n      hunk = {\n        oldStart: Number(match[1]),\n        newStart: Number(match[3]),\n        header: match[5] ?? \"\",\n        lines: [],\n      };\n      oldRemaining = match[2] === undefined ? 1 : Number(match[2]);\n      newRemaining = match[4] === undefined ? 1 : Number(match[4]);\n      current.hunks.push(hunk);\n    }\n  }\n  return files;\n}\n\n/**\n * Create an anchor for the contiguous run of changed lines starting at\n * `lines[lineIndex]` in the given hunk (the authoring seam — used by the\n * CLI/sidecar assembly helper, not by hand).\n */\nexport function createAnchor(args: {\n  file: FileDiff;\n  hunkIndex: number;\n  lineIndex: number;\n}): DiffAnchor {\n  const { file, hunkIndex, lineIndex } = args;\n  const lines = file.hunks[hunkIndex].lines;\n  if (lines[lineIndex].kind === \"context\") {\n    throw new Error(`Line ${lineIndex} is a context line; anchors target changed lines`);\n  }\n  const changed: DiffAnchor[\"changed\"] = [];\n  let end = lineIndex;\n  while (end < lines.length && lines[end].kind !== \"context\") {\n    changed.push({ kind: lines[end].kind as \"add\" | \"del\", text: lines[end].text });\n    end++;\n  }\n  const contextBefore = lines\n    .slice(Math.max(0, lineIndex - CONTEXT_WINDOW), lineIndex)\n    .map((l) => l.text);\n  const contextAfter = lines.slice(end, end + CONTEXT_WINDOW).map((l) => l.text);\n\n  const hash = createHash(\"sha256\")\n    .update(\n      JSON.stringify({\n        changed: changed.map((l) => `${l.kind}:${normalize(l.text)}`),\n        before: contextBefore.map(normalize),\n        after: contextAfter.map(normalize),\n      })\n    )\n    .digest(\"hex\");\n\n  return {\n    hash,\n    file: file.newPath ?? file.oldPath ?? \"\",\n    changed,\n    contextBefore,\n    contextAfter,\n  };\n}\n\ninterface Candidate {\n  fileIndex: number;\n  file: string;\n  hunkIndex: number;\n  lineIndex: number;\n  lines: DiffLine[];\n}\n\n/** All positions in a file where the anchor's changed run matches (kind + normalized text). */\nfunction changedRunCandidates(\n  anchor: DiffAnchor,\n  file: FileDiff,\n  fileIndex: number\n): Candidate[] {\n  const path = file.newPath ?? file.oldPath ?? \"\";\n  const out: Candidate[] = [];\n  file.hunks.forEach((hunk, hunkIndex) => {\n    outer: for (let i = 0; i + anchor.changed.length <= hunk.lines.length; i++) {\n      for (let j = 0; j < anchor.changed.length; j++) {\n        const line = hunk.lines[i + j];\n        const want = anchor.changed[j];\n        if (line.kind !== want.kind || normalize(line.text) !== normalize(want.text)) {\n          continue outer;\n        }\n      }\n      out.push({ fileIndex, file: path, hunkIndex, lineIndex: i, lines: hunk.lines });\n    }\n  });\n  return out;\n}\n\n/**\n * Does the candidate's surrounding context match the anchor's, ignoring the\n * `fuzz` outermost lines per side? A required context line falling outside\n * the hunk counts as a mismatch (higher fuzz recovers boundary cases).\n */\nfunction contextMatches(anchor: DiffAnchor, candidate: Candidate, fuzz: number): boolean {\n  const before = anchor.contextBefore.slice(Math.min(fuzz, anchor.contextBefore.length));\n  const after = anchor.contextAfter.slice(\n    0,\n    Math.max(0, anchor.contextAfter.length - fuzz)\n  );\n  for (let i = 0; i < before.length; i++) {\n    const line = candidate.lines[candidate.lineIndex - before.length + i];\n    if (line === undefined || normalize(line.text) !== normalize(before[i])) return false;\n  }\n  const end = candidate.lineIndex + anchor.changed.length;\n  for (let i = 0; i < after.length; i++) {\n    const line = candidate.lines[end + i];\n    if (line === undefined || normalize(line.text) !== normalize(after[i])) return false;\n  }\n  return true;\n}\n\nfunction resolveCandidates(\n  anchor: DiffAnchor,\n  candidates: Candidate[]\n): AnchorResolution | undefined {\n  for (let fuzz = 0; fuzz <= MAX_FUZZ; fuzz++) {\n    const matches = candidates.filter((c) => contextMatches(anchor, c, fuzz));\n    if (matches.length === 1) {\n      const m = matches[0];\n      return {\n        state: \"anchored\",\n        fileIndex: m.fileIndex,\n        file: m.file,\n        hunkIndex: m.hunkIndex,\n        lineIndex: m.lineIndex,\n        lineCount: anchor.changed.length,\n        fuzz,\n      };\n    }\n    if (matches.length > 1) return { state: \"ambiguous\" };\n  }\n  return undefined;\n}\n\n/**\n * Relocate an anchor in a (re)generated patch. The anchor's own file is\n * searched first so a duplicate block elsewhere in the repo cannot make an\n * exact in-file match ambiguous; other files are the rename fallback.\n */\nexport function relocateAnchor(anchor: DiffAnchor, files: FileDiff[]): AnchorResolution {\n  const own: Candidate[] = [];\n  const others: Candidate[] = [];\n  files.forEach((file, fileIndex) => {\n    const isOwn = file.newPath === anchor.file || file.oldPath === anchor.file;\n    (isOwn ? own : others).push(...changedRunCandidates(anchor, file, fileIndex));\n  });\n  return (\n    resolveCandidates(anchor, own) ??\n    resolveCandidates(anchor, others) ?? { state: \"orphaned\" }\n  );\n}\n","/**\n * Convention-based derivation for the review report.\n *\n * Audience and change-type are derived with ZERO authoring burden: audience\n * from the test file's name/location, change-type from a `change:*` tag. This\n * keeps the review capability a formatter concern — no new story API, no\n * adapter changes (see the Evidence-Driven Review design).\n */\n\nimport type { ChangeType, ReviewAudience } from \"../types/review\";\n\n/** Tag prefix that declares a claim's change-type, e.g. `change:bugfix`. */\nconst CHANGE_TAG_PREFIX = \"change:\";\n/** Tag prefix that explicitly overrides the derived audience, e.g. `audience:stakeholder`. */\nconst AUDIENCE_TAG_PREFIX = \"audience:\";\n\nexport const VALID_CHANGE_TYPES: ReadonlySet<ChangeType> = new Set<ChangeType>([\n  \"feature\",\n  \"bugfix\",\n  \"refactor\",\n  \"perf\",\n  \"deps\",\n]);\n\n/**\n * Tests whose name/location marks them as end-to-end / behavioural, and so\n * addressed to the stakeholder audience. Matches `*.e2e.*`, an `e2e/` path\n * segment, and Playwright specs (`.spec.` — Playwright is the e2e tier here).\n */\nconst STAKEHOLDER_FILE = /(?:\\.e2e\\.)|(?:^|\\/)e2e\\/|(?:\\.spec\\.)/i;\n\n/** Source-file extensions we treat as reviewable code. */\nconst CODE_EXTENSIONS = new Set([\n  \"ts\",\n  \"tsx\",\n  \"js\",\n  \"jsx\",\n  \"mjs\",\n  \"cjs\",\n  \"py\",\n  \"go\",\n  \"rs\",\n  \"kt\",\n  \"kts\",\n  \"java\",\n  \"cs\",\n  \"rb\",\n]);\n\n/** Infixes that mark a file as a test, stripped to recover the source base key. */\nconst TEST_INFIX = /\\.(?:story\\.)?(?:int\\.|e2e\\.|unit\\.)?(?:test|spec|cy)\\.[a-z]+$/i;\n\n/**\n * Derive the audience for a claim.\n *\n * An explicit `audience:<value>` tag always wins; otherwise the file convention\n * decides (e2e/spec → stakeholder, everything else → engineer).\n */\nexport function deriveAudience(sourceFile: string, tags: string[]): ReviewAudience {\n  const override = tags\n    .map((t) => t.toLowerCase())\n    .find((t) => t.startsWith(AUDIENCE_TAG_PREFIX));\n  if (override) {\n    const value = override.slice(AUDIENCE_TAG_PREFIX.length);\n    if (value === \"stakeholder\" || value === \"engineer\") return value;\n  }\n  return STAKEHOLDER_FILE.test(sourceFile) ? \"stakeholder\" : \"engineer\";\n}\n\n/** Derive the change-type from a `change:*` tag (defaults to `unknown`). */\nexport function deriveChangeType(tags: string[]): ChangeType {\n  for (const tag of tags) {\n    const lower = tag.toLowerCase();\n    if (lower.startsWith(CHANGE_TAG_PREFIX)) {\n      const value = lower.slice(CHANGE_TAG_PREFIX.length) as ChangeType;\n      if (VALID_CHANGE_TYPES.has(value)) return value;\n    }\n  }\n  return \"unknown\";\n}\n\n/** The file extension (lower-case, no dot), or \"\" if none. */\nfunction extensionOf(path: string): string {\n  const base = path.split(\"/\").pop() ?? path;\n  const dot = base.lastIndexOf(\".\");\n  return dot === -1 ? \"\" : base.slice(dot + 1).toLowerCase();\n}\n\n/** Whether a path looks like a test file. */\nexport function isTestFile(path: string): boolean {\n  return TEST_INFIX.test(path);\n}\n\n/**\n * Whether a changed file is reviewable application code — i.e. code we expect a\n * claim to back. Excludes test files, type decls, and non-code (docs, config,\n * locks). Only these files are eligible for the 🔴 uncovered alarm.\n */\nexport function isReviewableSource(path: string): boolean {\n  if (isTestFile(path)) return false;\n  if (path.endsWith(\".d.ts\")) return false;\n  return CODE_EXTENSIONS.has(extensionOf(path));\n}\n\n/**\n * The correlation key for a test file: its path with the test infix stripped,\n * so `src/foo/bar.int.test.ts` → `src/foo/bar`. Used to match colocated tests\n * to the source file they sit next to (the v1 correlation heuristic).\n */\nexport function testBaseKey(testFile: string): string {\n  return testFile.replace(TEST_INFIX, \"\");\n}\n\n/** The correlation key for a source file: its path with the extension stripped. */\nexport function sourceBaseKey(sourceFile: string): string {\n  const dot = sourceFile.lastIndexOf(\".\");\n  const slash = sourceFile.lastIndexOf(\"/\");\n  return dot > slash ? sourceFile.slice(0, dot) : sourceFile;\n}\n","/**\n * Jev (TypeSafe AI \"System One\"): bounded semantic judgments behind the\n * deterministic agent commands. Rules run first and stay authoritative. Jev\n * fills what rules leave blank (`triage` failures with no `covers`, `goal`\n * scenarios rewritten without shrinking, `review` claims with no `change:*`\n * tag). Every answer carries its probability, so each threshold lives in code\n * next to its consequence.\n *\n * Without `JEV_API_KEY` there is no client and every command produces its\n * deterministic output. With it, Jev adds suggestions and advisories; exit\n * codes stay rule-driven.\n */\n\nexport const JEV_ENDPOINT = \"https://api.typesafe.ai/v1/systemone\";\nexport const JEV_MODEL = \"jev-latest\";\n\nexport type JevQuestion =\n  | { type: \"noul\"; instructions: string }\n  | { type: \"choice\"; instructions: string; criteria: Record<string, string | null> }\n  | { type: \"score\"; instructions: string; criteria: string[] };\n\nexport type JevAnswer =\n  | { type: \"noul\"; noul: number }\n  | { type: \"choice\"; choice: string; probabilities: Record<string, number>; confidence: number }\n  | { type: \"score\"; score: number; probabilities: Record<string, number>; confidence: number };\n\nexport interface JevClient {\n  model: string;\n  ask(state: unknown, questions: Record<string, JevQuestion>): Promise<Record<string, JevAnswer>>;\n}\n\nexport interface JevClientOptions {\n  apiKey: string;\n  model?: string;\n  endpoint?: string;\n  fetch?: typeof globalThis.fetch;\n  timeoutMs?: number;\n}\n\nexport function createJevClient(options: JevClientOptions): JevClient {\n  const {\n    apiKey,\n    model = JEV_MODEL,\n    endpoint = JEV_ENDPOINT,\n    fetch = globalThis.fetch,\n    timeoutMs = 10_000,\n  } = options;\n  return {\n    model,\n    // One attempt per question set; add backoff on 429/529 if a loop hits rate limits.\n    async ask(state, questions) {\n      const response = await fetch(endpoint, {\n        method: \"POST\",\n        headers: { Authorization: `Bearer ${apiKey}`, \"Content-Type\": \"application/json\" },\n        body: JSON.stringify({ model, state, questions }),\n        signal: AbortSignal.timeout(timeoutMs),\n      });\n      if (!response.ok) throw new Error(`Jev ${response.status}: ${(await response.text()).slice(0, 200)}`);\n      const body = (await response.json()) as { answers?: Record<string, JevAnswer> };\n      if (!body.answers) throw new Error(\"Jev response has no answers\");\n      return body.answers;\n    },\n  };\n}\n\n/** A client when `JEV_API_KEY` is set, else undefined (deterministic output only). */\nexport function jevFromEnv(env: NodeJS.ProcessEnv = process.env): JevClient | undefined {\n  const apiKey = env.JEV_API_KEY;\n  if (!apiKey) return undefined;\n  return createJevClient({\n    apiKey,\n    ...(env.JEV_MODEL ? { model: env.JEV_MODEL } : {}),\n    ...(env.JEV_ENDPOINT ? { endpoint: env.JEV_ENDPOINT } : {}),\n  });\n}\n\n/** Answer as a choice, or undefined when Jev returned a different shape. */\nexport function asChoice(answer: JevAnswer | undefined): Extract<JevAnswer, { type: \"choice\" }> | undefined {\n  return answer?.type === \"choice\" ? answer : undefined;\n}\n\nexport function asNoul(answer: JevAnswer | undefined): number | undefined {\n  return answer?.type === \"noul\" ? answer.noul : undefined;\n}\n","import type { TestCaseResult, TestRunResult, TestStatus } from \"executable-stories-core/types/test-result\";\n\nimport { gradeEvidence } from \"../review/build-review\";\nimport { deriveAudience } from \"../review/conventions\";\nimport type { EvidenceStrength } from \"../types/review\";\n\n/**\n * Requirement-first view of a run. Groups scenarios under the ticket/user-story\n * they verify, rolls up the code each requirement covers and whether it passed,\n * and surfaces two gaps a scenario-keyed index hides: requirements with a failing\n * scenario, and scenarios linked to no requirement at all (untraced behavior).\n *\n * The set of requirements is derived from the tickets found on scenarios — the\n * tests are the source of truth, so a requirement only appears once a scenario\n * claims it.\n */\nexport interface TraceabilityRequirement {\n  /** Ticket / user-story id (e.g. \"US-101\", \"JIRA-42\"). */\n  ticket: string;\n  /** Direct URL when a scenario supplied one. */\n  url?: string;\n  /** \"verified\" = every scenario passed; \"failing\" = at least one failed; \"incomplete\" = only skipped/pending. */\n  status: \"verified\" | \"failing\" | \"incomplete\";\n  scenarios: Array<{\n    id: string;\n    title: string;\n    status: TestStatus;\n    sourceFile: string;\n    sourceLine: number;\n    covers: string[];\n  }>;\n  /** Union of every covered path across this requirement's scenarios. */\n  covers: string[];\n}\n\nexport interface TraceabilityMatrix {\n  schemaVersion: \"1.0\";\n  generatedAt: string;\n  run: {\n    startedAt: string;\n    finishedAt: string;\n    gitSha?: string;\n    branch?: string;\n  };\n  summary: {\n    requirements: number;\n    requirementsVerified: number;\n    requirementsFailing: number;\n    scenarios: number;\n    untracedScenarios: number;\n  };\n  requirements: TraceabilityRequirement[];\n  /** Scenarios with no ticket — behavior verified but not linked to a requirement. */\n  untraced: Array<{\n    id: string;\n    title: string;\n    status: TestStatus;\n    sourceFile: string;\n    sourceLine: number;\n  }>;\n}\n\nexport class TraceabilityMatrixFormatter {\n  format(run: TestRunResult): string {\n    const matrix = toTraceabilityMatrix(run);\n    const lines: string[] = [];\n\n    lines.push(\"# Traceability Matrix\");\n    lines.push(\"\");\n    lines.push(`Generated: ${matrix.generatedAt}`);\n    lines.push(`Run: ${matrix.run.startedAt} to ${matrix.run.finishedAt}`);\n    if (matrix.run.branch) lines.push(`Branch: ${matrix.run.branch}`);\n    if (matrix.run.gitSha) lines.push(`Commit: ${matrix.run.gitSha}`);\n    lines.push(\"\");\n    lines.push(\"| Requirements | Verified | Failing | Scenarios | Untraced |\");\n    lines.push(\"| ---: | ---: | ---: | ---: | ---: |\");\n    lines.push(\n      `| ${matrix.summary.requirements} | ${matrix.summary.requirementsVerified} | ${matrix.summary.requirementsFailing} | ${matrix.summary.scenarios} | ${matrix.summary.untracedScenarios} |`,\n    );\n    lines.push(\"\");\n\n    for (const req of matrix.requirements) {\n      const heading = req.url ? `[${req.ticket}](${req.url})` : req.ticket;\n      lines.push(`## ${heading}`);\n      lines.push(\"\");\n      lines.push(`Status: ${renderRequirementStatus(req.status)}`);\n      if (req.covers.length > 0) {\n        lines.push(`Covers: ${req.covers.map((path) => `\\`${path}\\``).join(\", \")}`);\n      }\n      lines.push(\"\");\n      lines.push(\"| Status | Scenario | Source | Covers |\");\n      lines.push(\"| --- | --- | --- | --- |\");\n      for (const scenario of req.scenarios) {\n        const source = `${scenario.sourceFile}:${scenario.sourceLine}`;\n        const covers = scenario.covers.length > 0 ? scenario.covers.map((path) => `\\`${path}\\``).join(\", \") : \"\";\n        lines.push(`| ${scenario.status} | ${escapePipe(scenario.title)} | \\`${source}\\` | ${covers} |`);\n      }\n      lines.push(\"\");\n    }\n\n    if (matrix.untraced.length > 0) {\n      lines.push(\"## Untraced scenarios\");\n      lines.push(\"\");\n      lines.push(\"Behavior with no requirement link. Add a `ticket` to each so it appears against a requirement.\");\n      lines.push(\"\");\n      lines.push(\"| Status | Scenario | Source |\");\n      lines.push(\"| --- | --- | --- |\");\n      for (const scenario of matrix.untraced) {\n        const source = `${scenario.sourceFile}:${scenario.sourceLine}`;\n        lines.push(`| ${scenario.status} | ${escapePipe(scenario.title)} | \\`${source}\\` |`);\n      }\n      lines.push(\"\");\n    }\n\n    return lines.join(\"\\n\").trimEnd();\n  }\n}\n\n/**\n * Flat CSV projection of the traceability matrix for auditors and\n * spreadsheets: one row per (requirement, scenario) pair, plus one row per\n * untraced scenario with an empty ticket column. Same derivation as the\n * Markdown matrix, so the two can never disagree.\n */\nexport class TraceabilityCsvFormatter {\n  format(run: TestRunResult): string {\n    const matrix = toTraceabilityMatrix(run);\n    // Evidence grade per scenario, same grading the Evidence Review uses\n    // (screenshot/trace/mutation/failing-first signals), so the audit CSV says\n    // not just \"passed\" but how credible the proof is. Duplicate scenario ids\n    // keep the WEAKEST grade — an audit column must never overstate.\n    const RANK: Record<EvidenceStrength, number> = { none: 0, weak: 1, moderate: 2, strong: 3 };\n    const gradeById = new Map<string, EvidenceStrength>();\n    for (const tc of run.testCases) {\n      const strength = gradeEvidence(tc, deriveAudience(tc.sourceFile, tc.tags)).strength;\n      const prior = gradeById.get(tc.id);\n      if (prior === undefined || RANK[strength] < RANK[prior]) gradeById.set(tc.id, strength);\n    }\n    const rows: string[][] = [\n      [\"ticket\", \"ticket_url\", \"requirement_status\", \"scenario_id\", \"scenario_title\", \"scenario_status\", \"evidence_grade\", \"source\", \"covers\"],\n    ];\n    for (const req of matrix.requirements) {\n      for (const s of req.scenarios) {\n        rows.push([\n          req.ticket,\n          req.url ?? \"\",\n          req.status,\n          s.id,\n          s.title,\n          s.status,\n          gradeById.get(s.id) ?? \"\",\n          `${s.sourceFile}:${s.sourceLine}`,\n          s.covers.join(\"; \"),\n        ]);\n      }\n    }\n    for (const s of matrix.untraced) {\n      rows.push([\"\", \"\", \"untraced\", s.id, s.title, s.status, gradeById.get(s.id) ?? \"\", `${s.sourceFile}:${s.sourceLine}`, \"\"]);\n    }\n    return rows.map((row) => row.map(csvCell).join(\",\")).join(\"\\r\\n\");\n  }\n}\n\n/**\n * RFC 4180 quoting, plus formula-injection neutralization: a cell starting\n * with = + - @ (or tab/CR) executes as a formula when the audit CSV is opened\n * in Excel/Sheets, and every cell here is adapter-supplied (ticket ids,\n * titles, URLs, paths). Prefix a leading ' so it renders as text (OWASP CSV\n * injection guidance). No cell in this export is numeric, so the guard never\n * corrupts a legitimate value.\n */\nfunction csvCell(value: string): string {\n  const guarded = /^[=+\\-@\\t\\r]/.test(value) ? `'${value}` : value;\n  return /[\",\\r\\n]/.test(guarded) ? `\"${guarded.replace(/\"/g, '\"\"')}\"` : guarded;\n}\n\nexport function toTraceabilityMatrix(run: TestRunResult): TraceabilityMatrix {\n  const sorted = [...run.testCases].sort((a, b) => a.id.localeCompare(b.id));\n\n  const byTicket = new Map<string, { url?: string; cases: TestCaseResult[] }>();\n  const untraced: TraceabilityMatrix[\"untraced\"] = [];\n\n  for (const tc of sorted) {\n    const tickets = tc.story.tickets ?? [];\n    if (tickets.length === 0) {\n      untraced.push({\n        id: tc.id,\n        title: tc.story.scenario,\n        status: tc.status,\n        sourceFile: tc.sourceFile,\n        sourceLine: tc.sourceLine,\n      });\n      continue;\n    }\n    for (const ticket of tickets) {\n      const entry = byTicket.get(ticket.id) ?? { url: ticket.url, cases: [] };\n      if (!entry.url && ticket.url) entry.url = ticket.url;\n      entry.cases.push(tc);\n      byTicket.set(ticket.id, entry);\n    }\n  }\n\n  const requirements: TraceabilityRequirement[] = [...byTicket.entries()]\n    .sort(([a], [b]) => a.localeCompare(b))\n    .map(([ticket, entry]) => {\n      const scenarios = entry.cases.map((tc) => ({\n        id: tc.id,\n        title: tc.story.scenario,\n        status: tc.status,\n        sourceFile: tc.sourceFile,\n        sourceLine: tc.sourceLine,\n        covers: tc.story.covers ?? [],\n      }));\n      const covers = [...new Set(scenarios.flatMap((s) => s.covers))].sort();\n      return { ticket, url: entry.url, status: requirementStatus(entry.cases), scenarios, covers };\n    });\n\n  return {\n    schemaVersion: \"1.0\",\n    generatedAt: new Date().toISOString(),\n    run: {\n      startedAt: new Date(run.startedAtMs).toISOString(),\n      finishedAt: new Date(run.finishedAtMs).toISOString(),\n      gitSha: run.gitSha,\n      branch: run.ci?.branch,\n    },\n    summary: {\n      requirements: requirements.length,\n      requirementsVerified: requirements.filter((r) => r.status === \"verified\").length,\n      requirementsFailing: requirements.filter((r) => r.status === \"failing\").length,\n      scenarios: run.testCases.length,\n      untracedScenarios: untraced.length,\n    },\n    requirements,\n    untraced,\n  };\n}\n\nfunction requirementStatus(cases: TestCaseResult[]): TraceabilityRequirement[\"status\"] {\n  if (cases.some((tc) => tc.status === \"failed\")) return \"failing\";\n  if (cases.some((tc) => tc.status === \"passed\")) return \"verified\";\n  return \"incomplete\";\n}\n\nfunction renderRequirementStatus(status: TraceabilityRequirement[\"status\"]): string {\n  switch (status) {\n    case \"verified\":\n      return \"verified (all scenarios passed)\";\n    case \"failing\":\n      return \"failing (a scenario failed)\";\n    default:\n      return \"incomplete (no scenario passed yet)\";\n  }\n}\n\nfunction escapePipe(value: string): string {\n  return value.replace(/\\|/g, \"\\\\|\");\n}\n","/**\n * Synthesize .feature file text and a line map from TestCaseResult[].\n *\n * Used to produce Source and GherkinDocument messages when real .feature\n * files don't exist (all test cases come from e.g. Jest/Vitest/Playwright).\n */\n\nimport type { TestCaseResult } from \"executable-stories-core/types/test-result\";\n\n/** Map from scenario name → { scenarioLine, stepLines: Map<stepIndex, line> } */\nexport interface LineMap {\n  featureLine: number;\n  scenarios: Map<\n    string,\n    { scenarioLine: number; stepLines: Map<number, number> }\n  >;\n  /** Tag lines for each scenario, keyed by scenario name */\n  scenarioTagLines: Map<string, number>;\n  /** Feature-level tag line (if any) */\n  featureTagLine?: number;\n}\n\nexport interface SynthesizedFeature {\n  /** The synthesized .feature text */\n  text: string;\n  /** Line map for building the GherkinDocument AST */\n  lineMap: LineMap;\n  /** Extracted feature name */\n  featureName: string;\n  /** Feature-level tags (union of all scenario tags) */\n  featureTags: string[];\n}\n\n/**\n * Extract a feature name from grouped test cases.\n *\n * Uses the first element of the first titlePath, or derives from the URI.\n */\nexport function extractFeatureName(\n  testCases: TestCaseResult[],\n  uri: string\n): string {\n  for (const tc of testCases) {\n    if (tc.titlePath.length > 0) {\n      return tc.titlePath[0];\n    }\n  }\n  // Fallback: derive from filename\n  const basename = uri.replace(/^.*[\\\\/]/, \"\").replace(/\\.[^.]+$/, \"\");\n  return basename\n    .replace(/[-_]+/g, \" \")\n    .replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\n/**\n * Synthesize a .feature file from a group of test cases belonging to the same source file.\n */\nexport function synthesizeFeature(\n  uri: string,\n  testCases: TestCaseResult[]\n): SynthesizedFeature {\n  const featureName = extractFeatureName(testCases, uri);\n\n  // Collect feature-level tags (union of all scenario tags)\n  const featureTagSet = new Set<string>();\n  for (const tc of testCases) {\n    for (const tag of tc.tags) {\n      featureTagSet.add(tag);\n    }\n  }\n  const featureTags = [...featureTagSet].sort();\n\n  const lines: string[] = [];\n  const lineMap: LineMap = {\n    featureLine: 0,\n    scenarios: new Map(),\n    scenarioTagLines: new Map(),\n  };\n\n  let currentLine = 1;\n\n  // Feature-level tags\n  if (featureTags.length > 0) {\n    lines.push(featureTags.map((t) => `@${t}`).join(\" \"));\n    lineMap.featureTagLine = currentLine;\n    currentLine++;\n  }\n\n  // Feature declaration\n  lines.push(`Feature: ${featureName}`);\n  lineMap.featureLine = currentLine;\n  currentLine++;\n\n  // Blank line after feature\n  lines.push(\"\");\n  currentLine++;\n\n  for (const tc of testCases) {\n    const scenario = tc.story.scenario;\n\n    // Scenario tags\n    if (tc.tags.length > 0) {\n      lines.push(`  ${tc.tags.map((t) => `@${t}`).join(\" \")}`);\n      lineMap.scenarioTagLines.set(scenario, currentLine);\n      currentLine++;\n    }\n\n    // Scenario declaration\n    const scenarioLine = currentLine;\n    lines.push(`  Scenario: ${scenario}`);\n    currentLine++;\n\n    // Steps\n    const stepLines = new Map<number, number>();\n    for (let i = 0; i < tc.story.steps.length; i++) {\n      const step = tc.story.steps[i];\n      stepLines.set(i, currentLine);\n      lines.push(`    ${step.keyword} ${step.text}`);\n      currentLine++;\n    }\n\n    lineMap.scenarios.set(scenario, { scenarioLine, stepLines });\n\n    // Blank line between scenarios\n    lines.push(\"\");\n    currentLine++;\n  }\n\n  return {\n    text: lines.join(\"\\n\"),\n    lineMap,\n    featureName,\n    featureTags,\n  };\n}\n","/**\n * Build a GherkinDocument envelope from synthesized feature data.\n */\n\nimport { assertNever } from \"executable-stories-core/utils/assert-never\";\nimport type { TestCaseResult } from \"executable-stories-core/types/test-result\";\nimport type { DocEntry, StepKeyword, StoryStep } from \"executable-stories-core/types/story\";\nimport type {\n  GherkinDocument,\n  Feature,\n  FeatureChild,\n  Scenario,\n  Step,\n  Tag,\n  Envelope,\n  DocString,\n  DataTable,\n  TableRow,\n} from \"executable-stories-core/types/cucumber-messages\";\nimport type { SynthesizedFeature } from \"./synthesize-feature\";\nimport { deterministicId, keywordToKeywordType } from \"../../utils/cucumber-messages\";\n\n/**\n * Build GherkinDocument + Source envelopes for a group of test cases from one file.\n */\nexport function buildGherkinDocumentEnvelopes(\n  uri: string,\n  testCases: TestCaseResult[],\n  synthesized: SynthesizedFeature,\n  salt: string\n): { sourceEnvelope: Envelope; gherkinDocumentEnvelope: Envelope } {\n  const { lineMap, featureName, featureTags, text } = synthesized;\n\n  // Build feature-level tags\n  const featureTagNodes: Tag[] = featureTags.map((tag) => ({\n    location: {\n      line: lineMap.featureTagLine ?? 1,\n      column: undefined,\n    },\n    name: `@${tag}`,\n    id: deterministicId(\"featureTag\", salt, uri, tag),\n  }));\n\n  // Build children (scenarios)\n  const children: FeatureChild[] = [];\n\n  for (const tc of testCases) {\n    const scenarioName = tc.story.scenario;\n    const scenarioInfo = lineMap.scenarios.get(scenarioName);\n    if (!scenarioInfo) continue;\n\n    const scenarioId = deterministicId(\"scenario\", salt, uri, scenarioName);\n\n    // Build scenario tags\n    const scenarioTags: Tag[] = tc.tags.map((tag) => ({\n      location: {\n        line: lineMap.scenarioTagLines.get(scenarioName) ?? scenarioInfo.scenarioLine,\n      },\n      name: `@${tag}`,\n      id: deterministicId(\"scenarioTag\", salt, uri, scenarioName, tag),\n    }));\n\n    // An AST step keeps its own keyword type: And/But stay \"Conjunction\" here,\n    // as they do in Gherkin's own parser. Inheriting the previous non-\n    // conjunction type is a pickle concern, and resolvePickleStepTypes does it.\n    const steps: Step[] = tc.story.steps.map((step, i) => {\n      const keyword = step.keyword as StepKeyword;\n\n      const stepLine = scenarioInfo.stepLines.get(i) ?? 0;\n      const astStep: Step = {\n        location: { line: stepLine },\n        keyword: `${keyword} `,\n        keywordType: keywordToKeywordType(keyword),\n        text: step.text,\n        id: deterministicId(\"astStep\", salt, uri, scenarioName, String(i)),\n      };\n\n      // Convert doc entries to DocString/DataTable\n      const { docString, dataTable } = buildStepArguments(step, stepLine);\n      if (docString) astStep.docString = docString;\n      if (dataTable) astStep.dataTable = dataTable;\n\n      return astStep;\n    });\n\n    const scenario: Scenario = {\n      location: { line: scenarioInfo.scenarioLine },\n      tags: scenarioTags,\n      keyword: \"Scenario\",\n      name: scenarioName,\n      description: \"\",\n      steps,\n      id: scenarioId,\n    };\n\n    children.push({ scenario });\n  }\n\n  const feature: Feature = {\n    location: { line: lineMap.featureLine },\n    tags: featureTagNodes,\n    language: \"en\",\n    keyword: \"Feature\",\n    name: featureName,\n    description: \"\",\n    children,\n  };\n\n  const gherkinDocument: GherkinDocument = { uri, feature };\n\n  return {\n    sourceEnvelope: {\n      source: {\n        uri,\n        data: text,\n        mediaType: \"text/x.cucumber.gherkin+plain\",\n      },\n    },\n    gherkinDocumentEnvelope: { gherkinDocument },\n  };\n}\n\n/**\n * Convert step doc entries to DocString or DataTable for the GherkinDocument AST.\n *\n * Priority: first \"table\" doc → DataTable, else first \"code\"/\"note\"/\"section\"/\"mermaid\" → DocString.\n * Screenshots are handled as attachments, not arguments.\n */\nfunction buildStepArguments(\n  step: StoryStep,\n  stepLine: number\n): { docString?: DocString; dataTable?: DataTable } {\n  if (!step.docs || step.docs.length === 0) return {};\n\n  // Look for table first (takes priority)\n  const tableDocs = step.docs.filter((d): d is Extract<DocEntry, { kind: \"table\" }> => d.kind === \"table\");\n  if (tableDocs.length > 0) {\n    const table = tableDocs[0];\n    return { dataTable: buildDataTable(table, stepLine + 1) };\n  }\n\n  // Look for doc-string-like entries\n  for (const doc of step.docs) {\n    const ds = docEntryToDocString(doc, stepLine + 1);\n    if (ds) return { docString: ds };\n  }\n\n  return {};\n}\n\nfunction docEntryToDocString(doc: DocEntry, line: number): DocString | undefined {\n  switch (doc.kind) {\n    case \"code\":\n      return {\n        location: { line },\n        mediaType: doc.lang,\n        content: doc.content,\n        delimiter: '\"\"\"',\n      };\n    case \"note\":\n      return {\n        location: { line },\n        mediaType: \"text/plain\",\n        content: doc.text,\n        delimiter: '\"\"\"',\n      };\n    case \"section\":\n      return {\n        location: { line },\n        mediaType: \"text/markdown\",\n        content: doc.markdown,\n        delimiter: '\"\"\"',\n      };\n    case \"mermaid\":\n      return {\n        location: { line },\n        mediaType: \"text/x-mermaid\",\n        content: doc.code,\n        delimiter: '\"\"\"',\n      };\n    case \"kv\":\n      return {\n        location: { line },\n        mediaType: \"text/plain\",\n        content: `${doc.label}: ${typeof doc.value === \"string\" ? doc.value : JSON.stringify(doc.value)}`,\n        delimiter: '\"\"\"',\n      };\n    case \"link\":\n      return {\n        location: { line },\n        mediaType: \"text/markdown\",\n        content: `[${doc.label}](${doc.url})`,\n        delimiter: '\"\"\"',\n      };\n    case \"custom\":\n      return {\n        location: { line },\n        mediaType: \"application/json\",\n        content: JSON.stringify(doc.data, null, 2),\n        delimiter: '\"\"\"',\n      };\n    case \"state\":\n      return {\n        location: { line },\n        mediaType: \"application/json\",\n        content: JSON.stringify({ state: doc.label ?? \"State\", value: doc.value ?? null }, null, 2),\n        delimiter: '\"\"\"',\n      };\n    case \"tag\":\n      return {\n        location: { line },\n        mediaType: \"text/plain\",\n        content: doc.names.map((n) => `@${n}`).join(\" \"),\n        delimiter: '\"\"\"',\n      };\n    // Deliberately not doc strings: a table becomes a DataTable, and an image,\n    // clip or html fragment has no textual body a Gherkin doc string could\n    // carry. Listed rather than left to a `default` so doc kind fourteen is a\n    // decision someone makes.\n    case \"table\":\n    case \"screenshot\":\n    case \"video\":\n    case \"html\":\n      return undefined;\n  }\n\n  return assertNever(doc, \"Gherkin document: unhandled doc kind\");\n}\n\nfunction buildDataTable(\n  table: Extract<DocEntry, { kind: \"table\" }>,\n  line: number\n): DataTable {\n  const rows: TableRow[] = [];\n\n  // Header row\n  rows.push({\n    location: { line },\n    cells: table.columns.map((col) => ({\n      location: { line },\n      value: col,\n    })),\n    id: \"\",\n  });\n\n  // Data rows\n  for (let r = 0; r < table.rows.length; r++) {\n    const rowLine = line + 1 + r;\n    rows.push({\n      location: { line: rowLine },\n      cells: table.rows[r].map((cell) => ({\n        location: { line: rowLine },\n        value: cell,\n      })),\n      id: \"\",\n    });\n  }\n\n  return {\n    location: { line },\n    rows,\n  };\n}\n","/**\n * Utility functions for Cucumber Messages NDJSON format.\n */\n\nimport { createHash } from \"node:crypto\";\nimport type {\n  Timestamp,\n  Duration,\n  KeywordType,\n  PickleStepType,\n  TestStepResultStatus,\n} from \"executable-stories-core/types/cucumber-messages\";\nimport type { TestStatus } from \"executable-stories-core/types/test-result\";\nimport type { StepKeyword } from \"executable-stories-core/types/story\";\n\n/**\n * Convert epoch milliseconds to protobuf Timestamp.\n */\nexport function msToTimestamp(ms: number): Timestamp {\n  const seconds = Math.floor(ms / 1000);\n  const nanos = Math.round((ms % 1000) * 1_000_000);\n  return { seconds, nanos };\n}\n\n/**\n * Convert milliseconds to protobuf Duration.\n */\nexport function msToDuration(ms: number): Duration {\n  const seconds = Math.floor(ms / 1000);\n  const nanos = Math.round((ms % 1000) * 1_000_000);\n  return { seconds, nanos };\n}\n\n/**\n * Map a StepKeyword to a Cucumber KeywordType.\n *\n * And/But/* inherit from the previous non-conjunction keyword type.\n */\nexport function keywordToKeywordType(keyword: StepKeyword): KeywordType {\n  switch (keyword) {\n    case \"Given\":\n      return \"Context\";\n    case \"When\":\n      return \"Action\";\n    case \"Then\":\n      return \"Outcome\";\n    case \"And\":\n    case \"But\":\n      return \"Conjunction\";\n    default:\n      return \"Unknown\";\n  }\n}\n\n/**\n * Resolve the effective PickleStepType for a sequence of steps,\n * inheriting the previous non-conjunction type for And/But.\n *\n * Returns an array of resolved types, one per step.\n */\nexport function resolvePickleStepTypes(\n  keywords: StepKeyword[]\n): PickleStepType[] {\n  let lastNonConjunction: PickleStepType = \"Unknown\";\n  return keywords.map((kw) => {\n    const kt = keywordToKeywordType(kw);\n    if (kt === \"Conjunction\") {\n      return lastNonConjunction;\n    }\n    const resolved = keywordTypeToPickleStepType(kt);\n    lastNonConjunction = resolved;\n    return resolved;\n  });\n}\n\n/**\n * Convert a non-conjunction KeywordType to PickleStepType.\n */\nfunction keywordTypeToPickleStepType(kt: KeywordType): PickleStepType {\n  switch (kt) {\n    case \"Context\":\n      return \"Context\";\n    case \"Action\":\n      return \"Action\";\n    case \"Outcome\":\n      return \"Outcome\";\n    default:\n      return \"Unknown\";\n  }\n}\n\n/**\n * Map TestStatus to Cucumber TestStepResultStatus.\n */\nexport function statusToCucumberStatus(\n  status: TestStatus\n): TestStepResultStatus {\n  switch (status) {\n    case \"passed\":\n      return \"PASSED\";\n    case \"failed\":\n      return \"FAILED\";\n    case \"skipped\":\n      return \"SKIPPED\";\n    case \"pending\":\n      return \"PENDING\";\n    default:\n      return \"UNKNOWN\";\n  }\n}\n\n/**\n * Generate a deterministic ID using SHA-1.\n *\n * @param kind - Namespace to prevent collisions between entity types (e.g., \"pickle\", \"testCase\")\n * @param salt - Optional salt from options (idSalt)\n * @param parts - Strings to hash\n * @returns 36-character hex string (UUID-length without dashes)\n */\nexport function deterministicId(\n  kind: string,\n  salt: string,\n  ...parts: string[]\n): string {\n  const input = [salt, kind, ...parts].join(\"::\");\n  return createHash(\"sha1\").update(input).digest(\"hex\").slice(0, 36);\n}\n","/**\n * Build Pickle envelopes from test cases and GherkinDocument data.\n *\n * Each TestCaseResult becomes one Pickle (the compiled, runnable scenario).\n */\n\nimport { assertNever } from \"executable-stories-core/utils/assert-never\";\nimport type { TestCaseResult } from \"executable-stories-core/types/test-result\";\nimport type { DocEntry, StepKeyword, StoryStep } from \"executable-stories-core/types/story\";\nimport type {\n  Pickle,\n  PickleStep,\n  PickleTag,\n  PickleStepArgument,\n  PickleDocString,\n  PickleTable,\n  PickleTableRow,\n  Envelope,\n} from \"executable-stories-core/types/cucumber-messages\";\nimport {\n  deterministicId,\n  resolvePickleStepTypes,\n} from \"../../utils/cucumber-messages\";\n\n/**\n * Build Pickle envelopes for a group of test cases from one file.\n */\nexport function buildPickleEnvelopes(\n  uri: string,\n  testCases: TestCaseResult[],\n  salt: string\n): Envelope[] {\n  const envelopes: Envelope[] = [];\n\n  for (const tc of testCases) {\n    const scenarioName = tc.story.scenario;\n    const pickleId = deterministicId(\"pickle\", salt, uri, scenarioName);\n    const scenarioAstId = deterministicId(\"scenario\", salt, uri, scenarioName);\n\n    // Resolve step types with And/But inheritance\n    const keywords = tc.story.steps.map((s) => s.keyword as StepKeyword);\n    const resolvedTypes = resolvePickleStepTypes(keywords);\n\n    const pickleSteps: PickleStep[] = tc.story.steps.map((step, i) => {\n      const ps: PickleStep = {\n        astNodeIds: [\n          deterministicId(\"astStep\", salt, uri, scenarioName, String(i)),\n        ],\n        id: deterministicId(\"pickleStep\", salt, uri, scenarioName, String(i)),\n        type: resolvedTypes[i],\n        text: step.text,\n      };\n\n      const argument = buildPickleStepArgument(step);\n      if (argument) ps.argument = argument;\n\n      return ps;\n    });\n\n    const pickleTags: PickleTag[] = tc.tags.map((tag) => ({\n      name: `@${tag}`,\n      astNodeId: deterministicId(\"scenarioTag\", salt, uri, scenarioName, tag),\n    }));\n\n    const pickle: Pickle = {\n      id: pickleId,\n      uri,\n      name: scenarioName,\n      language: \"en\",\n      steps: pickleSteps,\n      tags: pickleTags,\n      astNodeIds: [scenarioAstId],\n    };\n\n    envelopes.push({ pickle });\n  }\n\n  return envelopes;\n}\n\n/**\n * Build a PickleStepArgument from step docs.\n * Priority: first table → PickleTable, else first doc-string-like → PickleDocString.\n */\nfunction buildPickleStepArgument(step: StoryStep): PickleStepArgument | undefined {\n  if (!step.docs || step.docs.length === 0) return undefined;\n\n  // Table takes priority\n  const tableDocs = step.docs.filter(\n    (d): d is Extract<DocEntry, { kind: \"table\" }> => d.kind === \"table\"\n  );\n  if (tableDocs.length > 0) {\n    return { dataTable: buildPickleTable(tableDocs[0]) };\n  }\n\n  // Doc-string-like entries\n  for (const doc of step.docs) {\n    const ds = docEntryToPickleDocString(doc);\n    if (ds) return { docString: ds };\n  }\n\n  return undefined;\n}\n\nfunction docEntryToPickleDocString(doc: DocEntry): PickleDocString | undefined {\n  switch (doc.kind) {\n    case \"code\":\n      return { mediaType: doc.lang, content: doc.content };\n    case \"note\":\n      return { mediaType: \"text/plain\", content: doc.text };\n    case \"section\":\n      return { mediaType: \"text/markdown\", content: doc.markdown };\n    case \"mermaid\":\n      return { mediaType: \"text/x-mermaid\", content: doc.code };\n    case \"kv\":\n      return {\n        mediaType: \"text/plain\",\n        content: `${doc.label}: ${typeof doc.value === \"string\" ? doc.value : JSON.stringify(doc.value)}`,\n      };\n    case \"link\":\n      return { mediaType: \"text/markdown\", content: `[${doc.label}](${doc.url})` };\n    case \"custom\":\n      return { mediaType: \"application/json\", content: JSON.stringify(doc.data, null, 2) };\n    case \"state\":\n      return {\n        mediaType: \"application/json\",\n        content: JSON.stringify({ state: doc.label ?? \"State\", value: doc.value ?? null }, null, 2),\n      };\n    case \"tag\":\n      return { mediaType: \"text/plain\", content: doc.names.map((n) => `@${n}`).join(\" \") };\n    // See build-gherkin-document.ts: these carry no textual body.\n    case \"table\":\n    case \"screenshot\":\n    case \"video\":\n    case \"html\":\n      return undefined;\n  }\n\n  return assertNever(doc, \"Pickle: unhandled doc kind\");\n}\n\nfunction buildPickleTable(\n  table: Extract<DocEntry, { kind: \"table\" }>\n): PickleTable {\n  const rows: PickleTableRow[] = [];\n\n  // Header row\n  rows.push({\n    cells: table.columns.map((col) => ({ value: col })),\n  });\n\n  // Data rows\n  for (const row of table.rows) {\n    rows.push({\n      cells: row.map((cell) => ({ value: cell })),\n    });\n  }\n\n  return { rows };\n}\n","/**\n * Build execution envelopes: TestCase, TestCaseStarted/Finished,\n * TestStepStarted/Finished, and Attachment messages.\n *\n * Attachment placement:\n * - Step-level doc screenshots → Attachment tied to that specific step\n * - Test-case level attachments → Attachment tied to failed step or last step\n * - All Attachment envelopes appear after the relevant TestStepFinished\n */\n\nimport type { TestCaseResult, TestRunResult } from \"executable-stories-core/types/test-result\";\nimport type { StoryStep } from \"executable-stories-core/types/story\";\nimport type {\n  Envelope,\n  TestCase,\n  TestStep,\n  AttachmentContentEncoding,\n} from \"executable-stories-core/types/cucumber-messages\";\nimport {\n  deterministicId,\n  msToTimestamp,\n  msToDuration,\n  statusToCucumberStatus,\n} from \"../../utils/cucumber-messages\";\n\n/**\n * Build TestRunStarted envelope.\n */\nexport function buildTestRunStarted(run: TestRunResult): Envelope {\n  return {\n    testRunStarted: {\n      timestamp: msToTimestamp(run.startedAtMs),\n    },\n  };\n}\n\n/**\n * Build TestRunFinished envelope.\n */\nexport function buildTestRunFinished(run: TestRunResult): Envelope {\n  const allPassed = run.testCases.every((tc) => tc.status === \"passed\");\n  return {\n    testRunFinished: {\n      timestamp: msToTimestamp(run.finishedAtMs),\n      success: allPassed,\n    },\n  };\n}\n\n/**\n * Build all execution envelopes for a single test case:\n * TestCase, then for each attempt:\n *   TestCaseStarted, [TestStepStarted + TestStepFinished + Attachment*]*, TestCaseFinished\n *\n * When tc.attempts exists with multiple entries, prior attempts are emitted\n * with willBeRetried=true, and the final attempt with willBeRetried=false.\n */\nexport function buildTestCaseExecutionEnvelopes(\n  uri: string,\n  tc: TestCaseResult,\n  salt: string\n): Envelope[] {\n  const envelopes: Envelope[] = [];\n  const scenarioName = tc.story.scenario;\n\n  const pickleId = deterministicId(\"pickle\", salt, uri, scenarioName);\n  const testCaseId = deterministicId(\"testCase\", salt, uri, scenarioName);\n\n  // Build test steps (shared across all attempts — the TestCase is the same)\n  const testSteps: TestStep[] = tc.story.steps.map((_step, i) => ({\n    id: deterministicId(\"testStep\", salt, uri, scenarioName, String(i)),\n    pickleStepId: deterministicId(\n      \"pickleStep\",\n      salt,\n      uri,\n      scenarioName,\n      String(i)\n    ),\n    stepDefinitionIds: [],\n  }));\n\n  // TestCase envelope (emitted once, before all attempts)\n  const testCase: TestCase = {\n    id: testCaseId,\n    pickleId,\n    testSteps,\n  };\n  envelopes.push({ testCase });\n\n  // If there are explicit attempts, emit each one\n  if (tc.attempts && tc.attempts.length > 1) {\n    for (let a = 0; a < tc.attempts.length; a++) {\n      const attempt = tc.attempts[a];\n      const isLastAttempt = a === tc.attempts.length - 1;\n\n      const attemptEnvelopes = buildAttemptEnvelopes({\n        testCaseId,\n        testSteps,\n        tc,\n        uri,\n        scenarioName,\n        salt,\n        attemptNumber: attempt.attempt,\n        attemptStatus: attempt.status,\n        attemptDurationMs: attempt.durationMs,\n        attemptErrorMessage: attempt.errorMessage,\n        willBeRetried: !isLastAttempt,\n        // Only emit attachments and doc screenshots on the final attempt\n        emitAttachments: isLastAttempt,\n      });\n      envelopes.push(...attemptEnvelopes);\n    }\n  } else {\n    // Single attempt (normal case)\n    const attemptEnvelopes = buildAttemptEnvelopes({\n      testCaseId,\n      testSteps,\n      tc,\n      uri,\n      scenarioName,\n      salt,\n      attemptNumber: tc.retry,\n      attemptStatus: undefined, // Use tc.stepResults\n      attemptDurationMs: undefined,\n      attemptErrorMessage: undefined,\n      willBeRetried: false,\n      emitAttachments: true,\n    });\n    envelopes.push(...attemptEnvelopes);\n  }\n\n  return envelopes;\n}\n\ninterface AttemptParams {\n  testCaseId: string;\n  testSteps: TestStep[];\n  tc: TestCaseResult;\n  uri: string;\n  scenarioName: string;\n  salt: string;\n  attemptNumber: number;\n  attemptStatus: import(\"executable-stories-core/types/test-result\").TestStatus | undefined;\n  attemptDurationMs: number | undefined;\n  attemptErrorMessage: string | undefined;\n  willBeRetried: boolean;\n  emitAttachments: boolean;\n}\n\n/**\n * Build envelopes for a single attempt:\n * TestCaseStarted, [TestStepStarted, TestStepFinished, Attachment*]*, TestCaseFinished\n */\nfunction buildAttemptEnvelopes(params: AttemptParams): Envelope[] {\n  const {\n    testCaseId, testSteps, tc, uri, scenarioName, salt,\n    attemptNumber, attemptStatus, attemptDurationMs, attemptErrorMessage,\n    willBeRetried, emitAttachments,\n  } = params;\n\n  const envelopes: Envelope[] = [];\n  const testCaseStartedId = deterministicId(\n    \"testCaseStarted\",\n    salt,\n    uri,\n    scenarioName,\n    String(attemptNumber)\n  );\n\n  // TestCaseStarted\n  envelopes.push({\n    testCaseStarted: {\n      id: testCaseStartedId,\n      testCaseId,\n      timestamp: msToTimestamp(0),\n      attempt: attemptNumber,\n    },\n  });\n\n  // Determine which step receives test-case-level attachments\n  const tcAttachmentStepIndex = emitAttachments\n    ? findTestCaseAttachmentStepIndex(tc)\n    : -1;\n\n  // Step execution envelopes\n  let cumulativeMs = 0;\n\n  for (let i = 0; i < testSteps.length; i++) {\n    const testStep = testSteps[i];\n    const storyStep = tc.story.steps[i];\n\n    // Determine step status for this attempt\n    let stepStatus: import(\"executable-stories-core/types/test-result\").TestStatus;\n    let stepDurationMs: number;\n    let stepErrorMessage: string | undefined;\n\n    if (attemptStatus !== undefined) {\n      // For prior attempts, derive step statuses from attempt-level status\n      // (we don't have per-step data for prior attempts)\n      stepStatus = attemptStatus === \"failed\" && i === tc.story.steps.length - 1\n        ? \"failed\"\n        : attemptStatus === \"failed\" && i < tc.story.steps.length - 1\n          ? \"passed\"\n          : attemptStatus;\n      stepDurationMs = attemptDurationMs !== undefined\n        ? attemptDurationMs / tc.story.steps.length\n        : 0;\n      stepErrorMessage = stepStatus === \"failed\" ? attemptErrorMessage : undefined;\n    } else {\n      // Final/only attempt: use actual step results\n      const stepResult = tc.stepResults[i];\n      stepStatus = stepResult?.status ?? \"passed\";\n      stepDurationMs = stepResult?.durationMs ?? 0;\n      // Include stack trace from test case if this is the failed step\n      stepErrorMessage = stepResult?.errorMessage;\n      if (stepStatus === \"failed\" && tc.errorStack && stepErrorMessage) {\n        stepErrorMessage = stepErrorMessage + \"\\n\" + tc.errorStack;\n      } else if (stepStatus === \"failed\" && tc.errorStack && !stepErrorMessage) {\n        stepErrorMessage = tc.errorStack;\n      }\n    }\n\n    // TestStepStarted\n    envelopes.push({\n      testStepStarted: {\n        testCaseStartedId,\n        testStepId: testStep.id,\n        timestamp: msToTimestamp(cumulativeMs),\n      },\n    });\n\n    // TestStepFinished\n    cumulativeMs += stepDurationMs;\n    envelopes.push({\n      testStepFinished: {\n        testCaseStartedId,\n        testStepId: testStep.id,\n        testStepResult: {\n          duration: msToDuration(stepDurationMs),\n          status: statusToCucumberStatus(stepStatus),\n          message: stepErrorMessage,\n        },\n        timestamp: msToTimestamp(cumulativeMs),\n      },\n    });\n\n    // Per-step doc screenshots (only on final attempt)\n    if (emitAttachments) {\n      const docAttachments = extractDocAttachments(storyStep);\n      for (const att of docAttachments) {\n        envelopes.push({\n          attachment: {\n            testCaseStartedId,\n            testStepId: testStep.id,\n            body: att.body,\n            mediaType: att.mediaType,\n            contentEncoding: att.contentEncoding,\n          },\n        });\n      }\n    }\n\n    // Test-case level attachments (only on final attempt, on failed/last step)\n    if (i === tcAttachmentStepIndex) {\n      for (const att of tc.attachments) {\n        envelopes.push({\n          attachment: {\n            testCaseStartedId,\n            testStepId: testStep.id,\n            body: att.body,\n            mediaType: att.mediaType,\n            contentEncoding: att.contentEncoding,\n          },\n        });\n      }\n    }\n  }\n\n  // TestCaseFinished\n  envelopes.push({\n    testCaseFinished: {\n      testCaseStartedId,\n      timestamp: msToTimestamp(cumulativeMs),\n      willBeRetried,\n    },\n  });\n\n  return envelopes;\n}\n\n/**\n * Extract attachments from a step's doc entries.\n *\n * Handles:\n * - screenshot docs with data: URIs → BASE64 attachment\n * - screenshot docs with other paths → IDENTITY attachment\n */\nfunction extractDocAttachments(\n  step: StoryStep\n): Array<{ body: string; mediaType: string; contentEncoding: AttachmentContentEncoding }> {\n  if (!step.docs) return [];\n\n  const attachments: Array<{\n    body: string;\n    mediaType: string;\n    contentEncoding: AttachmentContentEncoding;\n  }> = [];\n\n  for (const doc of step.docs) {\n    if (doc.kind !== \"screenshot\") continue;\n\n    // Parse data URI: data:image/png;base64,ABC123...\n    const match = doc.path.match(/^data:([^;]+);base64,(.+)$/);\n    if (match) {\n      attachments.push({\n        body: match[2],\n        mediaType: match[1],\n        contentEncoding: \"BASE64\",\n      });\n    } else {\n      // Non-data-URI screenshot (file path or URL) → IDENTITY\n      attachments.push({\n        body: doc.path,\n        mediaType: guessMediaType(doc.path),\n        contentEncoding: \"IDENTITY\",\n      });\n    }\n  }\n\n  return attachments;\n}\n\n/**\n * Guess media type from a file path or URL.\n */\nfunction guessMediaType(path: string): string {\n  const lower = path.toLowerCase();\n  if (lower.endsWith(\".png\")) return \"image/png\";\n  if (lower.endsWith(\".jpg\") || lower.endsWith(\".jpeg\")) return \"image/jpeg\";\n  if (lower.endsWith(\".gif\")) return \"image/gif\";\n  if (lower.endsWith(\".webp\")) return \"image/webp\";\n  if (lower.endsWith(\".svg\")) return \"image/svg+xml\";\n  return \"image/png\"; // Default assumption for screenshots\n}\n\n/**\n * Determine which step index should receive test-case-level attachments.\n * Attach to the failed step if one exists, otherwise the last step.\n * Returns -1 if there are no attachments.\n */\nfunction findTestCaseAttachmentStepIndex(tc: TestCaseResult): number {\n  if (tc.attachments.length === 0) return -1;\n\n  const failedIndex = tc.stepResults.findIndex((sr) => sr.status === \"failed\");\n  if (failedIndex >= 0) return failedIndex;\n\n  return tc.stepResults.length - 1;\n}\n","/**\n * CucumberMessagesFormatter — produces NDJSON compatible with @cucumber/html-formatter.\n *\n * Message stream order:\n * Meta → Source* → GherkinDocument* → Pickle* → TestRunStarted →\n * [TestCase, TestCaseStarted, TestStep*, TestCaseFinished]* → TestRunFinished\n */\n\nimport type { TestRunResult, TestCaseResult } from \"executable-stories-core/types/test-result\";\nimport type { Envelope, Meta } from \"executable-stories-core/types/cucumber-messages\";\nimport { synthesizeFeature } from \"./synthesize-feature\";\nimport { buildGherkinDocumentEnvelopes } from \"./build-gherkin-document\";\nimport { buildPickleEnvelopes } from \"./build-pickles\";\nimport {\n  buildTestRunStarted,\n  buildTestRunFinished,\n  buildTestCaseExecutionEnvelopes,\n} from \"./build-execution\";\n\nexport interface CucumberMessagesOptions {\n  /** Strategy for deriving Source.uri. Default: \"sourceFile\" */\n  uriStrategy?: \"sourceFile\" | \"virtual\";\n  /** Whether to emit Source/GherkinDocument for synthesized features. Default: true */\n  includeSynthetics?: boolean;\n  /** Salt for deterministic IDs. Default: \"\" */\n  idSalt?: string;\n  /** Tool metadata for Meta envelope */\n  meta?: { toolName?: string; toolVersion?: string };\n}\n\nexport class CucumberMessagesFormatter {\n  private options: Required<\n    Pick<CucumberMessagesOptions, \"uriStrategy\" | \"includeSynthetics\" | \"idSalt\">\n  > & { meta?: CucumberMessagesOptions[\"meta\"] };\n\n  constructor(options: CucumberMessagesOptions = {}) {\n    this.options = {\n      uriStrategy: options.uriStrategy ?? \"sourceFile\",\n      includeSynthetics: options.includeSynthetics ?? true,\n      idSalt: options.idSalt ?? \"\",\n      meta: options.meta,\n    };\n  }\n\n  /**\n   * Format a TestRunResult into an array of Envelope objects.\n   */\n  format(run: TestRunResult): Envelope[] {\n    const envelopes: Envelope[] = [];\n    const salt = this.options.idSalt;\n\n    // 1. Meta envelope\n    envelopes.push(this.buildMetaEnvelope(run));\n\n    // Group test cases by source file\n    const grouped = this.groupBySourceFile(run.testCases);\n\n    // 2. Source + GherkinDocument + Pickle envelopes (definition phase)\n    const allPickleEnvelopes: Envelope[] = [];\n\n    for (const [uri, testCases] of grouped) {\n      const synthesized = synthesizeFeature(uri, testCases);\n\n      if (this.options.includeSynthetics) {\n        const { sourceEnvelope, gherkinDocumentEnvelope } =\n          buildGherkinDocumentEnvelopes(uri, testCases, synthesized, salt);\n        envelopes.push(sourceEnvelope);\n        envelopes.push(gherkinDocumentEnvelope);\n      }\n\n      const pickles = buildPickleEnvelopes(uri, testCases, salt);\n      allPickleEnvelopes.push(...pickles);\n    }\n\n    // All pickles after all source/gherkin documents\n    envelopes.push(...allPickleEnvelopes);\n\n    // 3. TestRunStarted\n    envelopes.push(buildTestRunStarted(run));\n\n    // 4. Execution envelopes per test case\n    for (const [uri, testCases] of grouped) {\n      for (const tc of testCases) {\n        const executionEnvelopes = buildTestCaseExecutionEnvelopes(\n          uri,\n          tc,\n          salt\n        );\n        envelopes.push(...executionEnvelopes);\n      }\n    }\n\n    // 5. TestRunFinished (always last)\n    envelopes.push(buildTestRunFinished(run));\n\n    return envelopes;\n  }\n\n  /**\n   * Format as NDJSON string (one JSON line per envelope).\n   */\n  formatToString(run: TestRunResult): string {\n    const envelopes = this.format(run);\n    return envelopes.map((e) => JSON.stringify(e)).join(\"\\n\") + \"\\n\";\n  }\n\n  /**\n   * Build the Meta envelope.\n   */\n  private buildMetaEnvelope(run: TestRunResult): Envelope {\n    const meta: Meta = {\n      protocolVersion: \"25.0.1\",\n      implementation: {\n        name: this.options.meta?.toolName ?? \"executable-stories\",\n        version:\n          this.options.meta?.toolVersion ?? run.packageVersion ?? \"0.0.0\",\n      },\n      runtime: {\n        name: \"node.js\",\n        version: process.version,\n      },\n      os: {\n        name: process.platform,\n      },\n      cpu: {\n        name: process.arch,\n      },\n    };\n\n    return { meta };\n  }\n\n  /**\n   * Group test cases by source file, preserving order.\n   */\n  private groupBySourceFile(\n    testCases: TestCaseResult[]\n  ): Map<string, TestCaseResult[]> {\n    const grouped = new Map<string, TestCaseResult[]>();\n    for (const tc of testCases) {\n      const uri = tc.sourceFile;\n      const existing = grouped.get(uri);\n      if (existing) {\n        existing.push(tc);\n      } else {\n        grouped.set(uri, [tc]);\n      }\n    }\n    return grouped;\n  }\n}\n","/**\n * CucumberHtmlFormatter — produces the official Cucumber HTML report.\n *\n * Thin wrapper: reuses CucumberMessagesFormatter to generate NDJSON envelopes,\n * then pipes them through @cucumber/html-formatter's CucumberHtmlStream.\n */\n\nimport { Writable } from \"node:stream\";\nimport { CucumberHtmlStream } from \"@cucumber/html-formatter\";\nimport { CucumberMessagesFormatter } from \"./cucumber-messages/formatter\";\nimport type { CucumberMessagesOptions } from \"./cucumber-messages/formatter\";\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\n\nexport interface CucumberHtmlOptions {\n  /** Options forwarded to the underlying CucumberMessagesFormatter */\n  messages?: CucumberMessagesOptions;\n}\n\nexport class CucumberHtmlFormatter {\n  private messagesFormatter: CucumberMessagesFormatter;\n\n  constructor(options: CucumberHtmlOptions = {}) {\n    this.messagesFormatter = new CucumberMessagesFormatter(options.messages);\n  }\n\n  /**\n   * Format a TestRunResult into official Cucumber HTML.\n   *\n   * Returns a Promise because CucumberHtmlStream is a Node.js Transform stream.\n   */\n  async format(run: TestRunResult): Promise<string> {\n    return this.formatToString(run);\n  }\n\n  /**\n   * Format a TestRunResult into official Cucumber HTML string.\n   */\n  async formatToString(run: TestRunResult): Promise<string> {\n    // 1. Generate NDJSON envelopes as plain objects\n    const envelopes = this.messagesFormatter.format(run);\n\n    // 2. Create the Cucumber HTML stream\n    const htmlStream = new CucumberHtmlStream();\n\n    // 3. Collect output chunks\n    const chunks: Buffer[] = [];\n    const collector = new Writable({\n      write(chunk, _encoding, callback) {\n        chunks.push(Buffer.from(chunk));\n        callback();\n      },\n    });\n\n    // 4. Pipe HTML stream output to collector\n    htmlStream.pipe(collector);\n\n    // 5. Write each envelope through the stream\n    for (const envelope of envelopes) {\n      const accepted = htmlStream.write(envelope);\n      if (!accepted) {\n        await new Promise<void>((resolve) => htmlStream.once(\"drain\", resolve));\n      }\n    }\n\n    // 6. End the stream and wait for completion\n    await new Promise<void>((resolve, reject) => {\n      collector.on(\"finish\", resolve);\n      collector.on(\"error\", reject);\n      htmlStream.end();\n    });\n\n    return Buffer.concat(chunks).toString(\"utf8\");\n  }\n}\n","/**\n * Entry point for a colocated report tree.\n *\n * Colocated/mirrored output writes one report per source file, which is great\n * for reading a single suite's docs next to its code — but leaves a directory\n * of files with no front door. Someone handed the output folder has nothing to\n * open. This generates a small `index.html` listing every report that was\n * written, with per-file status counts, so the tree is navigable.\n *\n * Only for colocated mode: aggregated output already writes a single file that\n * IS the entry point.\n */\nimport path from \"node:path\";\n\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\nimport { REPORT_FAVICON_LINK } from \"executable-stories-core/utils/report-favicon\";\n\nfunction escapeHtml(value: string): string {\n  return value\n    .replace(/&/g, \"&amp;\")\n    .replace(/</g, \"&lt;\")\n    .replace(/>/g, \"&gt;\")\n    .replace(/\"/g, \"&quot;\");\n}\n\nexport interface ColocatedIndexEntry {\n  /** Report path, relative to the index file. */\n  href: string;\n  /** Source file the report documents. */\n  sourceFile: string;\n  counts: { passed: number; failed: number; skipped: number; pending: number };\n}\n\n/** Map a canonical status onto the four buckets the index counts. */\nfunction bucket(status: string): keyof ColocatedIndexEntry[\"counts\"] | undefined {\n  if (status === \"passed\" || status === \"pass\") return \"passed\";\n  if (status === \"failed\" || status === \"fail\") return \"failed\";\n  if (status === \"skipped\" || status === \"skip\") return \"skipped\";\n  if (status === \"pending\" || status === \"todo\") return \"pending\";\n  return undefined;\n}\n\n/**\n * Pair each written report with the source file it documents and the status\n * counts for that file. `reportPaths` are the paths the generator wrote, in the\n * same order as the source files it grouped by.\n */\nexport function buildIndexEntries(\n  run: TestRunResult,\n  reportsBySourceFile: ReadonlyMap<string, string>,\n  indexDir: string,\n): ColocatedIndexEntry[] {\n  const entries: ColocatedIndexEntry[] = [];\n  for (const [sourceFile, reportPath] of reportsBySourceFile) {\n    const counts = { passed: 0, failed: 0, skipped: 0, pending: 0 };\n    for (const tc of run.testCases) {\n      if (tc.sourceFile !== sourceFile) continue;\n      const key = bucket(tc.status as string);\n      if (key) counts[key] += 1;\n    }\n    // Posix separators: this is an href, not a filesystem path.\n    const href = path.relative(indexDir, reportPath).split(path.sep).join(\"/\");\n    entries.push({ href, sourceFile, counts });\n  }\n  return entries.sort((a, b) => {\n    // Files with failures first — the index is a triage surface too.\n    if (a.counts.failed !== b.counts.failed) return b.counts.failed - a.counts.failed;\n    return a.sourceFile.localeCompare(b.sourceFile);\n  });\n}\n\n/** Total the per-file counts for the header line. */\nfunction totals(entries: ColocatedIndexEntry[]): ColocatedIndexEntry[\"counts\"] {\n  const t = { passed: 0, failed: 0, skipped: 0, pending: 0 };\n  for (const e of entries) {\n    t.passed += e.counts.passed;\n    t.failed += e.counts.failed;\n    t.skipped += e.counts.skipped;\n    t.pending += e.counts.pending;\n  }\n  return t;\n}\n\n/**\n * Render the index page. Self-contained (inline CSS, no scripts, no CDN) so it\n * works from a file:// path or any static host, matching the standalone report.\n */\nexport function renderColocatedIndex(entries: ColocatedIndexEntry[], title = \"Test Reports\"): string {\n  const t = totals(entries);\n  const total = t.passed + t.failed + t.skipped + t.pending;\n  const rows = entries\n    .map((e) => {\n      const pills = ([\"failed\", \"passed\", \"skipped\", \"pending\"] as const)\n        .filter((k) => e.counts[k] > 0)\n        .map((k) => `<span class=\"pill ${k}\">${e.counts[k]} ${k}</span>`)\n        .join(\" \");\n      return (\n        `<li class=\"${e.counts.failed > 0 ? \"has-failures\" : \"\"}\">` +\n        `<a href=\"${escapeHtml(e.href)}\">${escapeHtml(e.sourceFile)}</a>` +\n        `<span class=\"counts\">${pills}</span></li>`\n      );\n    })\n    .join(\"\\n      \");\n\n  return `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n${REPORT_FAVICON_LINK}\n<title>${escapeHtml(title)}</title>\n<style>\n  :root { color-scheme: light dark; --fg: #1c1e21; --muted: #6b7280; --border: #d9dbe0; --bg: #fff;\n    --pass: #0f5a23; --fail: #c11d28; --warn: #8a3f06; --pending: #6b27c9; }\n  @media (prefers-color-scheme: dark) {\n    :root { --fg: #e6e6e6; --muted: #9aa0a6; --border: #33373d; --bg: #16181d;\n      --pass: #4ade80; --fail: #f87171; --warn: #fbbf24; --pending: #c4b5fd; }\n  }\n  body { margin: 0; padding: 2rem 1.25rem; background: var(--bg); color: var(--fg);\n    font: 16px/1.5 \"IBM Plex Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; }\n  main { max-width: 60rem; margin: 0 auto; }\n  h1 { font-size: 1.4rem; margin: 0 0 .25rem; }\n  .summary { color: var(--muted); font-size: .9rem; margin: 0 0 1.5rem; }\n  ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: .6rem; overflow: hidden; }\n  li { display: flex; align-items: center; justify-content: space-between; gap: 1rem;\n    padding: .7rem 1rem; border-bottom: 1px solid var(--border); }\n  li:last-child { border-bottom: 0; }\n  li.has-failures { background: color-mix(in srgb, var(--fail) 8%, transparent); }\n  a { color: inherit; font-family: \"IBM Plex Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;\n    font-size: .9rem; text-decoration: none; }\n  a:hover { text-decoration: underline; }\n  .counts { display: flex; gap: .4rem; flex-wrap: wrap; }\n  .pill { font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap;\n    border: 1px solid currentColor; }\n  .pill.passed { color: var(--pass); } .pill.failed { color: var(--fail); }\n  .pill.skipped { color: var(--warn); } .pill.pending { color: var(--pending); }\n  .empty { color: var(--muted); padding: 1rem; }\n</style>\n</head>\n<body>\n<main>\n  <h1>${escapeHtml(title)}</h1>\n  <p class=\"summary\">${entries.length} file${entries.length === 1 ? \"\" : \"s\"} · ${total} scenario${total === 1 ? \"\" : \"s\"} · ${t.passed} passed${t.failed > 0 ? `, ${t.failed} failed` : \"\"}${t.skipped > 0 ? `, ${t.skipped} skipped` : \"\"}${t.pending > 0 ? `, ${t.pending} pending` : \"\"}</p>\n  ${\n    entries.length === 0\n      ? '<p class=\"empty\">No reports were written.</p>'\n      : `<ul>\n      ${rows}\n    </ul>`\n  }\n</main>\n</body>\n</html>\n`;\n}\n","/**\n * One report per test source file.\n *\n * A test run reports only what it ran. `vitest run one-file`, `vitest -t \"one\n * scenario\"` and the MCP `run_scenario` tool all cover a fraction of the suite,\n * so rendering a run directly would drop every scenario it skipped out of the\n * docs.\n *\n * So the unit of storage is the test source file, not the run: each one owns a\n * canonical report, and running a file rewrites that report and leaves the rest\n * alone. One writer per file, nothing merged across files, and nothing hidden —\n * these are ordinary reports you can list, read and delete. Combined views are\n * derived from them (see aggregate-reports), never accumulated into a store\n * that could fall out of step with what is on disk.\n *\n * Retiring anything is the one destructive act here, so it takes certainty: only\n * a run that positively determined it covered a whole file may drop that file's\n * scenarios, and it says so in the log when it does.\n */\nimport path from \"node:path\";\nimport * as fsPromises from \"node:fs/promises\";\n\nimport type {\n  FeatureDeclaration,\n  RunScope,\n  TestCaseResult,\n  TestRunResult,\n} from \"executable-stories-core/types/test-result\";\n\n/**\n * Directory under `outputDir` holding one canonical run per test source file.\n *\n * Visible on purpose. These are reports, not hidden state: you can list them,\n * read one, delete one, and the effect is obvious. The alternative — a hidden\n * merge database whose contents change what the aggregate says — makes \"why is\n * this scenario still here\" unanswerable without knowing a secret.\n */\nexport const BY_FILE_DIR = \"by-file\";\n\nexport interface FileReportDeps {\n  readFile: (filePath: string) => string;\n  listDir: (dir: string) => string[] | undefined;\n  fileExists: (filePath: string) => boolean;\n  writeFile: (filePath: string, contents: string) => Promise<void>;\n  removeFile: (filePath: string) => Promise<void>;\n  logger: { warn(msg: string): void };\n}\n\n/**\n * What one file's report holds: a complete canonical run covering a single\n * source file. Shaping it as a run rather than a bespoke envelope means anything\n * that already reads a run JSON reads one of these too — the Astro loader points\n * straight at the directory with no special-casing.\n */\ntype FileReport = TestRunResult;\n\n/** The source file a report covers. Every case in it shares one. */\nfunction reportSourceFile(report: FileReport): string | undefined {\n  return report.testCases[0]?.sourceFile;\n}\n\n/**\n * Report filename for a source file: the flattened path, the test extension\n * stripped, and a short digest of the full path — `src/pay.story.test.ts`\n * becomes `src-pay-1a2b3c.story-report.json`.\n *\n * The digest is always there rather than only on collision. Adding it lazily\n * made ownership depend on history: two paths that flatten alike would share a\n * name until one existed, and deleting the first owner left the second writing\n * a fresh plain-named file while its digested one lingered, unreachable by\n * pruning. Always digesting makes a source file's report name a pure function\n * of its path.\n */\nexport function reportFileNameFor(sourceFile: string): string {\n  const stem = toPosix(sourceFile)\n    .replace(/\\.(story\\.)?(test|spec)\\.[cm]?[jt]sx?$/i, \"\")\n    .replace(/\\.[^/.]+$/, \"\")\n    .replace(/\\//g, \"-\");\n  return `${stem}-${shortDigest(sourceFile)}.story-report.json`;\n}\n\n/** Stable short digest, used only to separate two files that flatten alike. */\nfunction shortDigest(value: string): string {\n  let hash = 5381;\n  for (let i = 0; i < value.length; i++) hash = ((hash << 5) + hash + value.charCodeAt(i)) >>> 0;\n  return hash.toString(36).slice(0, 6);\n}\n\n/** Posix-normalise a path. */\nfunction toPosix(p: string): string {\n  return p.replace(/\\\\/g, \"/\");\n}\n\nexport function byFileDirFor(outputDir: string): string {\n  return path.posix.join(outputDir.replace(/\\\\/g, \"/\"), BY_FILE_DIR);\n}\n\n/** Read every report in the directory. An unreadable one is skipped, not fatal. */\nfunction readFileReports(dir: string, deps: FileReportDeps): FileReport[] {\n  const names = deps.listDir(dir);\n  if (!names) return [];\n\n  const reports: FileReport[] = [];\n  for (const name of names.filter((n) => n.endsWith(\".json\")).sort()) {\n    const filePath = path.posix.join(dir, name);\n    try {\n      const parsed = JSON.parse(deps.readFile(filePath)) as FileReport;\n      if (Array.isArray(parsed?.testCases) && reportSourceFile(parsed)) {\n        reports.push(parsed);\n      }\n    } catch {\n      // A corrupt report must not take the rest down with it: the run in hand\n      // is still renderable, and the next run of that file rewrites it.\n      deps.logger.warn(`Ignoring unreadable report: ${filePath}`);\n    }\n  }\n  return reports;\n}\n\n/**\n * Fold this run into the stored per-file reports and return the run as it now\n * stands across every source file seen so far.\n *\n * Scenarios this run produced win over the stored copies of the same id.\n * Scenarios in a report that this run did not produce are kept as they were.\n */\nexport async function updateFileReports(\n  args: { run: TestRunResult; outputDir: string },\n  deps: FileReportDeps\n): Promise<TestRunResult> {\n  const dir = byFileDirFor(args.outputDir);\n\n  // Stamp before storing. A report outlives the run that wrote it, so without\n  // this a result carried forward would look as fresh as the run rendering it.\n  const bySource = new Map<string, TestCaseResult[]>();\n  for (const testCase of args.run.testCases) {\n    const stamped: TestCaseResult = {\n      ...testCase,\n      lastRunAtMs: args.run.finishedAtMs,\n      ...(args.run.gitSha ? { lastRunGitSha: args.run.gitSha } : {}),\n    };\n    const existing = bySource.get(stamped.sourceFile);\n    if (existing) existing.push(stamped);\n    else bySource.set(stamped.sourceFile, [stamped]);\n  }\n\n  // A file the run covered but that produced nothing still has to be visited,\n  // or its previous scenarios outlive their deletion.\n  for (const sourceFile of args.run.coveredSourceFiles ?? []) {\n    if (!bySource.has(sourceFile)) bySource.set(sourceFile, []);\n  }\n\n  const stored = new Map(\n    readFileReports(dir, deps).map((report) => [reportSourceFile(report)!, report])\n  );\n\n  // Same as the report writes: create the directory before writing into it.\n  // Skipped for an empty run so a read-only render never makes a directory.\n  if (bySource.size > 0) await fsPromises.mkdir(dir, { recursive: true });\n\n  const scope = args.run.runScope;\n  // A file whose collection broke cannot speak for itself, whatever the rest of\n  // the run managed. Retiring its scenarios would delete documentation because\n  // a hook threw.\n  const incomplete = new Set(args.run.incompleteSourceFiles ?? []);\n\n  for (const [sourceFile, testCases] of bySource) {\n    const previous = stored.get(sourceFile)?.testCases ?? [];\n    const reported = new Set(testCases.map((tc) => tc.id));\n    const unreported = previous.filter((tc) => !reported.has(tc.id));\n\n    // Only a run that positively claims full coverage of its files may retire a\n    // scenario. Anything less keeps what it did not report, because deleting on\n    // a guess is destructive and silent while keeping on a guess is merely\n    // stale and visible.\n    const retires = scope === \"full\" && !incomplete.has(sourceFile);\n    const merged = new Map(\n      retires ? [] : previous.map((tc) => [tc.id, tc] as const)\n    );\n    for (const testCase of testCases) merged.set(testCase.id, testCase);\n\n    if (unreported.length > 0) warnAboutUnreported(\n      { sourceFile, unreported, scope, incomplete: incomplete.has(sourceFile) },\n      deps\n    );\n\n    // Sorting by id makes a report's bytes a function of its contents alone, so\n    // an unchanged file rewrites to an identical report.\n    const declared = args.run.features?.find((f) => f.sourceFile === sourceFile);\n    // A declaration follows the same rule as a scenario: only a run that claims\n    // the whole file may drop one. A filtered run never mentioned the file's\n    // declaration, so it is in no position to say it is gone.\n    const kept = declared ?? (retires ? undefined : stored.get(sourceFile)?.features?.[0]);\n    const report: FileReport = {\n      ...args.run,\n      testCases: [...merged.values()].sort((a, b) => a.id.localeCompare(b.id)),\n      ...(kept ? { features: [kept] } : { features: undefined }),\n    };\n    // An emptied report has nothing to own it and nothing to say; remove it\n    // rather than leave a file claiming a suite that no longer has scenarios.\n    if (report.testCases.length === 0) {\n      stored.delete(sourceFile);\n      await removeReportsFor({ dir, sourceFile }, deps);\n      continue;\n    }\n\n    stored.set(sourceFile, report);\n    await removeOtherReportsFor(\n      { dir, sourceFile, keep: reportFileNameFor(sourceFile) },\n      deps\n    );\n    await deps.writeFile(\n      path.posix.join(dir, reportFileNameFor(sourceFile)),\n      `${JSON.stringify(report, null, 2)}\\n`\n    );\n  }\n\n  for (const sourceFile of prunable(\n    { stored: [...stored.keys()], ran: [...bySource.keys()], projectRoot: args.run.projectRoot },\n    deps\n  )) {\n    stored.delete(sourceFile);\n    await removeReportsFor({ dir, sourceFile }, deps);\n  }\n\n  const sourceFiles = [...stored.keys()].sort();\n  const testCases = sourceFiles.flatMap(\n    (sourceFile) => stored.get(sourceFile)?.testCases ?? []\n  );\n  // Declarations are per source file, so they accumulate exactly as scenarios\n  // do. Without this a filtered run strips every other file's feature heading\n  // and narrative out of the docs.\n  const features = sourceFiles\n    .flatMap((sourceFile) => stored.get(sourceFile)?.features ?? [])\n    .filter((f): f is FeatureDeclaration => f !== undefined);\n\n  return {\n    ...args.run,\n    testCases,\n    ...(features.length > 0 ? { features } : {}),\n  };\n}\n\n/**\n * Delete any other file in the directory that claims this source file.\n *\n * One test file owns one report. A second claiming the same file — left behind\n * by an older naming scheme, or copied by hand — would be counted again by\n * everything that reads the directory whole.\n */\nasync function removeReportsFor(\n  args: { dir: string; sourceFile: string },\n  deps: FileReportDeps\n): Promise<void> {\n  return removeOtherReportsFor({ ...args, keep: undefined }, deps);\n}\n\nasync function removeOtherReportsFor(\n  args: { dir: string; sourceFile: string; keep?: string },\n  deps: FileReportDeps\n): Promise<void> {\n  for (const name of deps.listDir(args.dir) ?? []) {\n    if (!name.endsWith(\".json\") || name === args.keep) continue;\n    const filePath = path.posix.join(args.dir, name);\n    try {\n      const other = JSON.parse(deps.readFile(filePath)) as FileReport;\n      if (reportSourceFile(other) !== args.sourceFile) continue;\n    } catch {\n      continue; // Unreadable: leave it alone and let the reader report it.\n    }\n    if (args.keep) {\n      deps.logger.warn(\n        `Removing ${filePath}: ${args.sourceFile} already has a report at ${args.keep}.`\n      );\n    }\n    await deps.removeFile(filePath);\n  }\n}\n\n/**\n * Say what happened to scenarios a run did not report.\n *\n * Removal is the one destructive act in the pipeline, so it leaves evidence\n * naming the file and every scenario dropped: an adapter that wrongly claims\n * full coverage then shows up in the log instead of quietly shrinking the docs.\n * Unknown scope keeps them and says so, which is how incomplete detection fails\n * stale rather than destructive.\n */\nfunction warnAboutUnreported(\n  args: {\n    sourceFile: string;\n    unreported: TestCaseResult[];\n    scope?: RunScope;\n    incomplete: boolean;\n  },\n  deps: FileReportDeps\n): void {\n  const { sourceFile, unreported, scope, incomplete } = args;\n  if (scope === \"filtered\") return; // Expected: the run said it saw only part of the file.\n\n  const names = unreported\n    .map((tc) => tc.story.scenario?.trim() || tc.id)\n    .sort()\n    .join(\", \");\n  const count = `${unreported.length} previously recorded scenario${unreported.length === 1 ? \"\" : \"s\"}`;\n\n  if (incomplete) {\n    deps.logger.warn(\n      `Run for ${sourceFile} could not collect its scenarios in full, so ${count} ` +\n        `were kept rather than retired. Fix the failure and rerun to confirm they are gone: ${names}`\n    );\n    return;\n  }\n\n  if (scope === \"full\") {\n    deps.logger.warn(\n      `Authoritative run for ${sourceFile} omitted ${count}; removing them from the accumulated report: ${names}`\n    );\n    return;\n  }\n\n  deps.logger.warn(\n    `Run for ${sourceFile} did not report ${count} and did not state its scope; keeping them. ` +\n      `If this run covered the whole file they are stale: ${names}`\n  );\n}\n\n/**\n * Shards whose test file is gone from the working tree. Deleting a test deletes\n * its scenarios, otherwise a renamed file shows up twice and a removed feature\n * documents itself forever.\n *\n * Guarded on the run's own files resolving on disk first. A run whose\n * `projectRoot` does not line up with the recorded source paths makes every\n * lookup miss, and pruning on that would wipe the accumulated history instead\n * of the one file the author actually deleted.\n */\nfunction prunable(\n  args: { stored: string[]; ran: string[]; projectRoot: string },\n  deps: FileReportDeps\n): string[] {\n  const resolve = (sourceFile: string) =>\n    path.resolve(args.projectRoot, sourceFile);\n\n  const canResolveSources = args.ran.some((sourceFile) =>\n    deps.fileExists(resolve(sourceFile))\n  );\n  if (!canResolveSources) return [];\n\n  const ran = new Set(args.ran);\n  return args.stored.filter(\n    (sourceFile) => !ran.has(sourceFile) && !deps.fileExists(resolve(sourceFile))\n  );\n}\n","/**\n * Astro Formatter - Layer 3.\n *\n * Wraps the MarkdownFormatter to produce .md files with YAML frontmatter\n * (title, description, sidebar.badge) for Starlight content collections.\n * The scaffolded docs site uses themed CSS matching the HTML report design system.\n */\n\nimport { MarkdownFormatter } from \"./markdown\";\nimport type { MarkdownOptions } from \"./markdown\";\nimport type { TestRunResult, TestCaseResult } from \"executable-stories-core/types/test-result\";\nimport { humanizeSourceFile } from \"executable-stories-core/utils/source-file\";\n\nexport interface StarlightBadge {\n  text: string;\n  variant: \"success\" | \"danger\" | \"caution\" | \"note\" | \"tip\";\n}\n\nexport interface AstroFormatterOptions {\n  assetsBaseUrl?: string;\n  /**\n   * Title each page by its own suite/file rather than the configured title.\n   * Set by colocated mode (one page per file) so the docs nav reads with\n   * distinct, meaningful labels.\n   */\n  perFileTitle?: boolean;\n  markdown?: Omit<MarkdownOptions, \"includeFrontMatter\" | \"includeSummaryTable\" | \"includeMetadata\" | \"stepStyle\">;\n}\n\nexport class AstroFormatter {\n  private markdownFormatter: MarkdownFormatter;\n  private title: string;\n  private perFileTitle: boolean;\n\n  constructor(options: AstroFormatterOptions = {}) {\n    this.title = options.markdown?.title ?? \"User Stories\";\n    this.perFileTitle = options.perFileTitle ?? false;\n    this.markdownFormatter = new MarkdownFormatter({\n      ...options.markdown,\n      title: this.title,\n      stepStyle: \"gherkin\",\n      includeFrontMatter: false,\n      includeSummaryTable: false,\n      includeMetadata: false,\n      // A per-file page is one file already — group by suite/describe so the\n      // body shows clean section headings, not the redundant source path.\n      groupBy: this.perFileTitle ? \"suite\" : (options.markdown?.groupBy ?? \"file\"),\n    });\n  }\n\n  format(run: TestRunResult): string {\n    const markdown = this.markdownFormatter.format(run);\n    // Strip the h1 title — Starlight renders its own from frontmatter\n    const body = markdown.replace(/^# .+\\n\\n?/, \"\");\n    const frontmatter = this.buildFrontmatter(run);\n    return `${frontmatter}\\n${body}`;\n  }\n\n  /**\n   * Title for the page. A per-file page (one source file — i.e. colocated mode)\n   * is titled by its suite/describe name, falling back to a humanized filename,\n   * so the docs nav reads \"Convert Currency\" not \"User Stories\" six times over.\n   * Multi-file (aggregated) pages keep the configured title.\n   */\n  private deriveTitle(run: TestRunResult): string {\n    if (!this.perFileTitle) return this.title;\n    const sourceFiles = new Set(\n      run.testCases.map((tc) => tc.sourceFile).filter((f) => f && f !== \"unknown\"),\n    );\n    if (sourceFiles.size !== 1) return this.title;\n\n    const suites = new Set(\n      run.testCases.map((tc) => tc.titlePath?.[0]).filter((s): s is string => Boolean(s)),\n    );\n    if (suites.size === 1) return [...suites][0];\n    return humanizeSourceFile([...sourceFiles][0]) || this.title;\n  }\n\n  private buildFrontmatter(run: TestRunResult): string {\n    const badge = AstroFormatter.computeBadge(run.testCases);\n    const count = run.testCases.length;\n    const description = `${count} scenario${count !== 1 ? \"s\" : \"\"} — ${badge.text.toLowerCase()}`;\n    const lines = [\n      \"---\",\n      `title: ${yamlScalar(this.deriveTitle(run))}`,\n      `description: ${description}`,\n      \"sidebar:\",\n      \"  badge:\",\n      `    text: ${badge.text}`,\n      `    variant: ${badge.variant}`,\n      \"---\",\n    ];\n    return lines.join(\"\\n\");\n  }\n\n  static computeBadge(testCases: Pick<TestCaseResult, \"status\">[]): StarlightBadge {\n    const statuses = new Set(testCases.map((tc) => tc.status));\n    if (statuses.has(\"failed\")) return { text: \"Failed\", variant: \"danger\" };\n    if (statuses.has(\"pending\")) return { text: \"Pending\", variant: \"caution\" };\n    if (statuses.has(\"skipped\") && !statuses.has(\"passed\")) return { text: \"Skipped\", variant: \"caution\" };\n    return { text: \"Passed\", variant: \"success\" };\n  }\n}\n\n/** Single-quote a YAML scalar when it could otherwise be misparsed (colons, etc.). */\nfunction yamlScalar(value: string): string {\n  if (/[:#[\\]{}&*!|>'\"%@`]|^[\\s-]|\\s$/.test(value)) {\n    return `'${value.replace(/'/g, \"''\")}'`;\n  }\n  return value;\n}\n","/**\n * Confluence (ADF) Formatter — Layer 3.\n *\n * Emits Atlassian Document Format JSON. Suitable for Confluence pages\n * and Jira issue descriptions via the REST API. Built directly from\n * TestRunResult so code blocks, tables, links, and mermaid all round-trip\n * with higher fidelity than converting markdown → ADF.\n */\n\nimport { assertNever } from \"executable-stories-core/utils/assert-never\";\nimport type { StoryStep, DocEntry } from \"executable-stories-core/types/story\";\nimport type { TestRunResult, TestCaseResult, TestStatus } from \"executable-stories-core/types/test-result\";\nimport { bySourcePosition, earliestSourceLine } from \"./source-order\";\n\n/** Options for ConfluenceFormatter */\nexport interface ConfluenceFormatterOptions {\n  /** Page title. Default: \"User Stories\" */\n  title?: string;\n  /** Include status icons (emoji) in scenario headings. Default: true */\n  includeStatusIcons?: boolean;\n  /** Include metadata table (date, version). Default: true */\n  includeMetadata?: boolean;\n  /** Include summary table (counts, duration). Default: true */\n  includeSummaryTable?: boolean;\n  /** Include error details for failed scenarios. Default: true */\n  includeErrors?: boolean;\n  /** Scenario heading level (1-6). Default: 3 */\n  scenarioHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n  /** Group scenarios by. Default: \"file\" */\n  groupBy?: \"file\" | \"suite\" | \"none\";\n  /** Sort scenarios. Default: \"source\" */\n  sortScenarios?: \"alpha\" | \"source\" | \"none\";\n  /** Pretty-print JSON output. Default: true */\n  pretty?: boolean;\n  /** Base URL for source permalinks (Git). Rendered as link marks */\n  permalinkBaseUrl?: string;\n  /** URL template for ticket links. Use {ticket} as placeholder */\n  ticketUrlTemplate?: string;\n}\n\ntype ResolvedOptions = Required<\n  Omit<ConfluenceFormatterOptions, \"permalinkBaseUrl\" | \"ticketUrlTemplate\">\n> & {\n  permalinkBaseUrl?: string;\n  ticketUrlTemplate?: string;\n};\n\n// ============================================================================\n// ADF node types (minimal — just what we emit)\n// ============================================================================\n\ninterface AdfMark {\n  type: string;\n  attrs?: Record<string, unknown>;\n}\n\ninterface AdfNode {\n  type: string;\n  attrs?: Record<string, unknown>;\n  content?: AdfNode[];\n  marks?: AdfMark[];\n  text?: string;\n  /** Only on the root doc node */\n  version?: number;\n}\n\n/**\n * Confluence / Atlassian Document Format formatter.\n *\n * Emits a top-level `{ version: 1, type: \"doc\", content: [...] }` tree that\n * can be posted to the Confluence or Jira REST API.\n */\nexport class ConfluenceFormatter {\n  private options: ResolvedOptions;\n\n  constructor(options: ConfluenceFormatterOptions = {}) {\n    this.options = {\n      title: options.title ?? \"User Stories\",\n      includeStatusIcons: options.includeStatusIcons ?? true,\n      includeMetadata: options.includeMetadata ?? true,\n      includeSummaryTable: options.includeSummaryTable ?? true,\n      includeErrors: options.includeErrors ?? true,\n      scenarioHeadingLevel: options.scenarioHeadingLevel ?? 3,\n      groupBy: options.groupBy ?? \"file\",\n      sortScenarios: options.sortScenarios ?? \"source\",\n      pretty: options.pretty ?? true,\n      permalinkBaseUrl: options.permalinkBaseUrl,\n      ticketUrlTemplate: options.ticketUrlTemplate,\n    };\n  }\n\n  /** Build the ADF document tree. Returns the JS object (not stringified). */\n  formatToAdf(run: TestRunResult): AdfNode {\n    const content: AdfNode[] = [];\n\n    content.push(heading(1, [text(this.options.title)]));\n\n    if (this.options.includeMetadata) {\n      const metaTable = this.renderMetadataTable(run);\n      if (metaTable) content.push(metaTable);\n    }\n\n    if (this.options.includeSummaryTable) {\n      content.push(this.renderSummaryTable(run));\n    }\n\n    switch (this.options.groupBy) {\n      case \"none\":\n        this.renderFlat(content, run.testCases);\n        break;\n      case \"suite\":\n        this.renderBySuite(content, run.testCases);\n        break;\n      case \"file\":\n      default:\n        this.renderByFile(content, run.testCases);\n        break;\n    }\n\n    return { version: 1, type: \"doc\", content };\n  }\n\n  /** Format a test run as an ADF JSON string. */\n  format(run: TestRunResult): string {\n    const adf = this.formatToAdf(run);\n    return this.options.pretty\n      ? JSON.stringify(adf, null, 2)\n      : JSON.stringify(adf);\n  }\n\n  // --------------------------------------------------------------------------\n  // Metadata / summary tables\n  // --------------------------------------------------------------------------\n\n  private renderMetadataTable(run: TestRunResult): AdfNode | null {\n    const rows: Array<[string, string]> = [];\n    rows.push([\"Date\", new Date(run.startedAtMs).toISOString()]);\n    if (run.packageVersion) rows.push([\"Version\", run.packageVersion]);\n    if (run.gitSha) {\n      const shortSha = run.gitSha.length > 7 ? run.gitSha.slice(0, 7) : run.gitSha;\n      rows.push([\"Git SHA\", shortSha]);\n    }\n    if (rows.length === 0) return null;\n    return table([\n      tableRow([tableHeader(\"Key\"), tableHeader(\"Value\")]),\n      ...rows.map(([k, v]) => tableRow([tableCell(k), tableCell(v)])),\n    ]);\n  }\n\n  private renderSummaryTable(run: TestRunResult): AdfNode {\n    const total = run.testCases.length;\n    const steps = run.testCases.reduce(\n      (acc, tc) => acc + tc.story.steps.length,\n      0,\n    );\n    const passed = run.testCases.filter((tc) => tc.status === \"passed\").length;\n    const failed = run.testCases.filter((tc) => tc.status === \"failed\").length;\n    const skipped = run.testCases.filter((tc) => tc.status === \"skipped\").length;\n    const pending = run.testCases.filter((tc) => tc.status === \"pending\").length;\n\n    return table([\n      tableRow([\n        tableHeader(\"Scenarios\"),\n        tableHeader(\"Steps\"),\n        tableHeader(\"Passed\"),\n        tableHeader(\"Failed\"),\n        tableHeader(\"Skipped\"),\n        tableHeader(\"Pending\"),\n        tableHeader(\"Duration\"),\n      ]),\n      tableRow([\n        tableCell(String(total)),\n        tableCell(String(steps)),\n        tableCell(String(passed)),\n        tableCell(String(failed)),\n        tableCell(String(skipped)),\n        tableCell(String(pending)),\n        tableCell(formatDuration(run.durationMs)),\n      ]),\n    ]);\n  }\n\n  // --------------------------------------------------------------------------\n  // Grouping\n  // --------------------------------------------------------------------------\n\n  private renderByFile(content: AdfNode[], testCases: TestCaseResult[]): void {\n    const byFile = groupBy(testCases, (tc) => tc.sourceFile);\n    for (const [file, fileCases] of byFile) {\n      content.push(heading(2, [codeInline(file)]));\n      this.renderSuiteGroups(content, fileCases, 3);\n    }\n  }\n\n  private renderBySuite(content: AdfNode[], testCases: TestCaseResult[]): void {\n    this.renderSuiteGroups(content, testCases, 2);\n  }\n\n  private renderFlat(content: AdfNode[], testCases: TestCaseResult[]): void {\n    const sorted = this.sortCases(testCases);\n    for (const tc of sorted) this.renderScenario(content, tc);\n  }\n\n  private renderSuiteGroups(\n    content: AdfNode[],\n    testCases: TestCaseResult[],\n    baseLevel: number,\n  ): void {\n    const bySuite = groupBy(testCases, (tc) => tc.titlePath.join(\" - \"));\n    const entries = this.sortSuiteGroups([...bySuite.entries()]);\n    for (const [suitePath, cases] of entries) {\n      if (suitePath) {\n        content.push(\n          heading(clampHeadingLevel(baseLevel), [text(suitePath)]),\n        );\n      }\n      for (const tc of this.sortCases(cases)) {\n        this.renderScenario(content, tc);\n      }\n    }\n  }\n\n  // --------------------------------------------------------------------------\n  // Scenario\n  // --------------------------------------------------------------------------\n\n  private renderScenario(content: AdfNode[], tc: TestCaseResult): void {\n    const level = clampHeadingLevel(this.options.scenarioHeadingLevel);\n    const headingNodes: AdfNode[] = [];\n    if (this.options.includeStatusIcons) {\n      headingNodes.push(text(`${statusIcon(tc.status)} `));\n    }\n    headingNodes.push(text(tc.story.scenario));\n    content.push(heading(level, headingNodes));\n\n    const metaChildren: AdfNode[] = [];\n    if (tc.tags.length > 0) {\n      metaChildren.push(text(\"Tags: \", strong()));\n      tc.tags.forEach((t, i) => {\n        if (i > 0) metaChildren.push(text(\", \"));\n        metaChildren.push(codeInline(t));\n      });\n    }\n    if (tc.story.tickets && tc.story.tickets.length > 0) {\n      if (metaChildren.length > 0) metaChildren.push(text(\" | \"));\n      metaChildren.push(text(\"Tickets: \", strong()));\n      tc.story.tickets.forEach((ticket, i) => {\n        if (i > 0) metaChildren.push(text(\", \"));\n        const url =\n          ticket.url ??\n          (this.options.ticketUrlTemplate\n            ? this.options.ticketUrlTemplate.replace(\"{ticket}\", ticket.id)\n            : undefined);\n        metaChildren.push(\n          url ? link(ticket.id, url) : codeInline(ticket.id),\n        );\n      });\n    }\n    if (\n      this.options.permalinkBaseUrl &&\n      tc.sourceFile !== \"unknown\" &&\n      tc.sourceFile\n    ) {\n      if (metaChildren.length > 0) metaChildren.push(text(\" | \"));\n      metaChildren.push(text(\"Source: \", strong()));\n      const base = this.options.permalinkBaseUrl.replace(/\\/$/, \"\");\n      const url = `${base}/${tc.sourceFile}${\n        tc.sourceLine > 0 ? `#L${tc.sourceLine}` : \"\"\n      }`;\n      metaChildren.push(link(tc.sourceFile, url));\n    }\n    if (metaChildren.length > 0) {\n      content.push(paragraph(metaChildren));\n    }\n\n    if (tc.story.docs && tc.story.docs.length > 0) {\n      for (const doc of tc.story.docs) this.renderDocEntry(content, doc);\n    }\n\n    if (tc.story.steps.length > 0) {\n      content.push(this.renderStepsList(tc.story.steps));\n      for (const step of tc.story.steps) {\n        if (step.docs && step.docs.length > 0) {\n          for (const doc of step.docs) this.renderDocEntry(content, doc);\n        }\n      }\n    }\n\n    if (\n      tc.status === \"failed\" &&\n      tc.errorMessage &&\n      this.options.includeErrors\n    ) {\n      const errorContent =\n        (tc.errorMessage ?? \"\") +\n        (tc.errorStack ? `\\n\\n${tc.errorStack}` : \"\");\n      content.push(\n        panel(\"warning\", [paragraph([text(\"Failure\", strong())])]),\n      );\n      content.push(codeBlock(errorContent, \"text\"));\n    }\n  }\n\n  private renderStepsList(steps: StoryStep[]): AdfNode {\n    return {\n      type: \"bulletList\",\n      content: steps.map((step) => {\n        const children: AdfNode[] = [text(`${step.keyword} `, strong()), text(step.text)];\n        if (step.mode && step.mode !== \"normal\") {\n          children.push(text(` (${step.mode})`, em()));\n        }\n        return {\n          type: \"listItem\",\n          content: [paragraph(children)],\n        };\n      }),\n    };\n  }\n\n  // --------------------------------------------------------------------------\n  // Doc entries\n  // --------------------------------------------------------------------------\n\n  private renderDocEntry(content: AdfNode[], entry: DocEntry): void {\n    switch (entry.kind) {\n      case \"note\":\n        content.push(panel(\"info\", [paragraph([text(entry.text)])]));\n        break;\n\n      case \"tag\": {\n        const kids: AdfNode[] = [];\n        entry.names.forEach((name, i) => {\n          if (i > 0) kids.push(text(\" \"));\n          kids.push(codeInline(name));\n        });\n        if (kids.length > 0) content.push(paragraph(kids));\n        break;\n      }\n\n      case \"kv\": {\n        const val =\n          typeof entry.value === \"string\"\n            ? entry.value\n            : JSON.stringify(entry.value);\n        content.push(\n          paragraph([text(`${entry.label}: `, strong()), codeInline(val)]),\n        );\n        break;\n      }\n\n      case \"code\":\n        if (entry.label) {\n          content.push(paragraph([text(entry.label, strong())]));\n        }\n        content.push(codeBlock(entry.content ?? \"\", entry.lang));\n        break;\n\n      case \"table\":\n        if (entry.label) {\n          content.push(paragraph([text(entry.label, strong())]));\n        }\n        content.push(\n          table([\n            tableRow(entry.columns.map((c) => tableHeader(c))),\n            ...entry.rows.map((row) =>\n              tableRow(row.map((cell) => tableCell(cell))),\n            ),\n          ]),\n        );\n        break;\n\n      case \"link\":\n        content.push(paragraph([link(entry.label, entry.url)]));\n        break;\n\n      case \"section\":\n        if (entry.title) {\n          content.push(paragraph([text(entry.title, strong())]));\n        }\n        // Section markdown is rendered as a plain-text paragraph; deep markdown\n        // parsing inside sections is out of scope for the ADF formatter.\n        if (entry.markdown) {\n          for (const para of entry.markdown.split(/\\n{2,}/)) {\n            const trimmed = para.trim();\n            if (trimmed) content.push(paragraph([text(trimmed)]));\n          }\n        }\n        break;\n\n      case \"mermaid\":\n        if (entry.title) {\n          content.push(paragraph([text(entry.title, strong())]));\n        }\n        content.push(codeBlock(entry.code ?? \"\", \"mermaid\"));\n        break;\n\n      case \"screenshot\":\n        content.push(\n          paragraph([\n            text(entry.alt ?? \"Screenshot\", strong()),\n            text(\": \"),\n            link(entry.path, entry.path),\n          ]),\n        );\n        break;\n\n      case \"video\":\n        // ADF has no inline video node, so surface a captioned link.\n        content.push(\n          paragraph([\n            text(entry.caption ?? \"Video\", strong()),\n            text(\": \"),\n            link(entry.path, entry.path),\n          ]),\n        );\n        break;\n\n      case \"html\":\n        // ADF has no iframe node — surface a captioned link for url/path,\n        // a code block for inline content.\n        if (entry.url !== undefined || entry.path !== undefined) {\n          const target = entry.url ?? entry.path ?? \"\";\n          content.push(\n            paragraph([\n              text(entry.title ?? \"Embedded HTML\", strong()),\n              text(\": \"),\n              link(target, target),\n            ]),\n          );\n          break;\n        }\n        content.push(paragraph([text(entry.title ?? \"Embedded HTML\", strong())]));\n        content.push(codeBlock(entry.content ?? \"\", \"html\"));\n        break;\n\n      case \"state\":\n        content.push(paragraph([text(entry.label ?? \"State\", strong())]));\n        content.push(codeBlock(JSON.stringify(entry.value ?? null, null, 2), \"json\"));\n        break;\n\n      case \"custom\":\n        content.push(paragraph([text(`[${entry.type}]`, strong())]));\n        content.push(codeBlock(JSON.stringify(entry.data ?? null, null, 2), \"json\"));\n        break;\n\n      default:\n        assertNever(entry, \"Confluence ADF: unhandled doc kind\");\n    }\n\n    if (Array.isArray(entry.children) && entry.children.length > 0) {\n      for (const child of entry.children) {\n        this.renderDocEntry(content, child);\n      }\n    }\n  }\n\n  // --------------------------------------------------------------------------\n  // Sorting\n  // --------------------------------------------------------------------------\n\n  private sortCases(cases: TestCaseResult[]): TestCaseResult[] {\n    if (this.options.sortScenarios === \"alpha\") {\n      return [...cases].sort((a, b) =>\n        a.story.scenario.localeCompare(b.story.scenario),\n      );\n    }\n    if (this.options.sortScenarios === \"source\") {\n      return [...cases].sort(bySourcePosition);\n    }\n    return cases;\n  }\n\n  private sortSuiteGroups(\n    entries: [string, TestCaseResult[]][],\n  ): [string, TestCaseResult[]][] {\n    if (this.options.sortScenarios === \"alpha\") {\n      return entries.sort(([a], [b]) => a.localeCompare(b));\n    }\n    if (this.options.sortScenarios === \"source\") {\n      return entries.sort(([, a], [, b]) => {\n        return earliestSourceLine(a) - earliestSourceLine(b);\n      });\n    }\n    return entries;\n  }\n}\n\n// ============================================================================\n// ADF node builders\n// ============================================================================\n\nfunction text(value: string, mark?: AdfMark | AdfMark[]): AdfNode {\n  const node: AdfNode = { type: \"text\", text: value };\n  if (mark) {\n    node.marks = Array.isArray(mark) ? mark : [mark];\n  }\n  return node;\n}\n\nfunction strong(): AdfMark {\n  return { type: \"strong\" };\n}\n\nfunction em(): AdfMark {\n  return { type: \"em\" };\n}\n\nfunction codeMark(): AdfMark {\n  return { type: \"code\" };\n}\n\nfunction codeInline(value: string): AdfNode {\n  return text(value, codeMark());\n}\n\nfunction link(label: string, href: string): AdfNode {\n  return text(label, { type: \"link\", attrs: { href } });\n}\n\nfunction paragraph(content: AdfNode[]): AdfNode {\n  return { type: \"paragraph\", content };\n}\n\nfunction heading(level: number, content: AdfNode[]): AdfNode {\n  return {\n    type: \"heading\",\n    attrs: { level: clampHeadingLevel(level) },\n    content,\n  };\n}\n\nfunction codeBlock(content: string, lang?: string): AdfNode {\n  return {\n    type: \"codeBlock\",\n    attrs: lang ? { language: lang } : {},\n    content: content ? [{ type: \"text\", text: content }] : [],\n  };\n}\n\nfunction panel(\n  panelType: \"info\" | \"note\" | \"warning\" | \"success\" | \"error\",\n  content: AdfNode[],\n): AdfNode {\n  return { type: \"panel\", attrs: { panelType }, content };\n}\n\nfunction table(rows: AdfNode[]): AdfNode {\n  return {\n    type: \"table\",\n    attrs: { isNumberColumnEnabled: false, layout: \"default\" },\n    content: rows,\n  };\n}\n\nfunction tableRow(cells: AdfNode[]): AdfNode {\n  return { type: \"tableRow\", content: cells };\n}\n\nfunction tableHeader(value: string): AdfNode {\n  return { type: \"tableHeader\", content: [paragraph([text(value)])] };\n}\n\nfunction tableCell(value: string): AdfNode {\n  return { type: \"tableCell\", content: [paragraph([text(value)])] };\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction clampHeadingLevel(level: number): 1 | 2 | 3 | 4 | 5 | 6 {\n  if (level < 1) return 1;\n  if (level > 6) return 6;\n  return level as 1 | 2 | 3 | 4 | 5 | 6;\n}\n\nfunction statusIcon(status: TestStatus): string {\n  switch (status) {\n    case \"passed\":\n      return \"✅\";\n    case \"failed\":\n      return \"❌\";\n    case \"skipped\":\n      return \"⏩\";\n    case \"pending\":\n      return \"📝\";\n    default:\n      return \"⚠️\";\n  }\n}\n\nfunction formatDuration(ms: number): string {\n  if (ms < 1000) return `${ms}ms`;\n  return `${(ms / 1000).toFixed(2)}s`;\n}\n\nfunction groupBy<T, K>(items: T[], keyFn: (item: T) => K): Map<K, T[]> {\n  const map = new Map<K, T[]>();\n  for (const item of items) {\n    const key = keyFn(item);\n    const existing = map.get(key);\n    if (existing) existing.push(item);\n    else map.set(key, [item]);\n  }\n  return map;\n}\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { copyAsset } from \"../bundler/copy-asset\";\n\nexport interface AstroAssetResult {\n  markdown: string;\n  copiedCount: number;\n  missingCount: number;\n  missing: string[];\n}\n\nexport interface CopyMarkdownAssetsOptions {\n  markdown: string;\n  markdownDir: string;\n  assetsDir: string;\n  assetsBaseUrl: string;\n  allowMissing?: boolean;\n}\n\nconst SKIP_PREFIXES = [\"http://\", \"https://\", \"data:\", \"#\"];\n\n/** Remote (http/data) or in-page anchor refs — never copied or rewritten. */\nfunction isRemoteRef(src: string): boolean {\n  const trimmed = src.trim();\n  return SKIP_PREFIXES.some((prefix) => trimmed.startsWith(prefix));\n}\n\n/** An absolute filesystem path (posix or windows). */\nfunction isAbsoluteRef(src: string): boolean {\n  const trimmed = src.trim();\n  return path.posix.isAbsolute(trimmed) || path.win32.isAbsolute(trimmed);\n}\n\n/**\n * A path that should be copied from `markdownDir` — i.e. a relative local ref.\n * Absolute paths are handled separately (resolved as-is, and only bundled when\n * they point at a real file) because story doc entries — notably Playwright\n * videos — frequently carry absolute paths, while served URLs like\n * `/stories/assets/x` are also absolute but must be left untouched.\n */\nfunction isRelativeLocalPath(src: string): boolean {\n  return !isRemoteRef(src) && !isAbsoluteRef(src);\n}\n\n/** Strip fenced code blocks and inline code spans so their contents aren't treated as real references. */\nfunction stripCodeContent(markdown: string): string {\n  // Strip fenced code blocks (allow leading whitespace for indented fences in lists/quotes)\n  let result = markdown.replace(/^[ \\t]*(`{3,}|~{3,})[^\\n]*\\n[\\s\\S]*?^[ \\t]*\\1\\s*$/gm, \"\");\n  // Strip inline code spans — backreference ensures opening and closing delimiters match\n  result = result.replace(/(`+)(?:(?!\\1).)+\\1/g, \"\");\n  // Strip HTML code/pre blocks so literal snippets are not scanned as assets\n  result = result.replace(/<pre\\b[^>]*>[\\s\\S]*?<\\/pre>/gi, \"\");\n  result = result.replace(/<code\\b[^>]*>[\\s\\S]*?<\\/code>/gi, \"\");\n  return result;\n}\n\n/**\n * Scan markdown for local asset references (images, videos).\n * Returns an array of unique local paths found.\n * Ignores references inside fenced code blocks.\n */\nexport function scanMarkdownAssets(markdown: string): string[] {\n  const found = new Set<string>();\n  const stripped = stripCodeContent(markdown);\n\n  // Markdown image syntax: ![alt](path) or ![alt](path \"title\")\n  const mdImageRe = /!\\[[^\\]]*\\]\\(([^)\"'\\s]+)(?:\\s+[\"'][^\"']*[\"'])?\\s*\\)/g;\n  let match: RegExpExecArray | null;\n  while ((match = mdImageRe.exec(stripped)) !== null) {\n    const src = match[1].trim();\n    if (!isRemoteRef(src)) {\n      found.add(src);\n    }\n  }\n\n  // HTML tags: <img src=\"...\">, <source src=\"...\">, <video src=\"...\">\n  const htmlSrcRe = /<(?:img|source|video)[^>]+\\bsrc=[\"']([^\"']+)[\"'][^>]*>/gi;\n  while ((match = htmlSrcRe.exec(stripped)) !== null) {\n    const src = match[1].trim();\n    if (!isRemoteRef(src)) {\n      found.add(src);\n    }\n  }\n\n  // Video poster frames: <video ... poster=\"...\">\n  const posterRe = /<video[^>]+\\bposter=[\"']([^\"']+)[\"'][^>]*>/gi;\n  while ((match = posterRe.exec(stripped)) !== null) {\n    const src = match[1].trim();\n    if (!isRemoteRef(src)) {\n      found.add(src);\n    }\n  }\n\n  return Array.from(found);\n}\n\n/**\n * Split markdown into alternating [prose, code, prose, code, ...] segments.\n * Fenced code blocks and inline code spans are returned verbatim;\n * only prose segments are rewritten.\n */\nfunction splitByCode(markdown: string): string[] {\n  // Match fenced code blocks (with optional indentation), HTML code blocks, or inline code spans.\n  const codeRe =\n    /^[ \\t]*(`{3,}|~{3,})[^\\n]*\\n[\\s\\S]*?^[ \\t]*\\1\\s*$|<pre\\b[^>]*>[\\s\\S]*?<\\/pre>|<code\\b[^>]*>[\\s\\S]*?<\\/code>|(`+)(?:(?!\\2).)+\\2/gim;\n  const segments: string[] = [];\n  let lastIndex = 0;\n\n  for (const match of markdown.matchAll(codeRe)) {\n    if (match.index! > lastIndex) {\n      segments.push(markdown.slice(lastIndex, match.index!));\n    }\n    segments.push(match[0]); // code — preserved as-is\n    lastIndex = match.index! + match[0].length;\n  }\n  if (lastIndex < markdown.length) {\n    segments.push(markdown.slice(lastIndex));\n  }\n  return segments;\n}\n\n/** Returns true if segment is a code block or inline code span. */\nfunction isCode(segment: string): boolean {\n  const trimmed = segment.trimStart();\n  return trimmed.startsWith(\"`\") || trimmed.startsWith(\"~\") || trimmed.startsWith(\"<pre\") || trimmed.startsWith(\"<code\");\n}\n\n/**\n * Resolve a single asset ref to its served path, or null when it should be left\n * unchanged. Remote/anchor refs are skipped. With a pathMap (the copy pipeline),\n * only refs that were actually copied are rewritten — so absolute paths bundle\n * correctly and unknown served URLs pass through. Without a pathMap, only\n * relative local refs get the base-url prefix.\n */\nfunction resolveRewrite(\n  trimmed: string,\n  assetsBaseUrl: string,\n  pathMap?: Map<string, string>,\n): string | null {\n  if (isRemoteRef(trimmed)) return null;\n  if (pathMap) {\n    const mapped = pathMap.get(trimmed);\n    return mapped === undefined ? null : `${assetsBaseUrl}/${mapped}`;\n  }\n  if (!isRelativeLocalPath(trimmed)) return null;\n  return `${assetsBaseUrl}/${trimmed}`;\n}\n\n/** Rewrite asset paths in a single prose (non-fenced) segment. */\nfunction rewriteProseSegment(\n  prose: string,\n  assetsBaseUrl: string,\n  pathMap?: Map<string, string>,\n): string {\n  const rewrite = (full: string, pre: string, src: string, post: string): string => {\n    const target = resolveRewrite(src.trim(), assetsBaseUrl, pathMap);\n    return target === null ? full : `${pre}${target}${post}`;\n  };\n\n  return prose\n    // Markdown image syntax: ![alt](path) or ![alt](path \"title\")\n    .replace(/(!\\[[^\\]]*\\]\\()([^)\"'\\s]+)((?:\\s+[\"'][^\"']*[\"'])?\\s*\\))/g, rewrite)\n    // HTML src attributes in img/source/video tags\n    .replace(/(<(?:img|source|video)[^>]+\\bsrc=[\"'])([^\"']+)([\"'][^>]*>)/gi, rewrite)\n    // poster attributes on video tags\n    .replace(/(<video[^>]+\\bposter=[\"'])([^\"']+)([\"'][^>]*>)/gi, rewrite);\n}\n\n/**\n * Rewrite local asset paths in markdown using a path map or a base URL.\n * Paths not present in the pathMap are left unchanged.\n * Content inside fenced code blocks and inline code spans is never rewritten.\n */\nexport function rewriteAssetPaths(\n  markdown: string,\n  assetsBaseUrl: string,\n  pathMap?: Map<string, string>,\n): string {\n  return splitByCode(markdown)\n    .map((seg) => (isCode(seg) ? seg : rewriteProseSegment(seg, assetsBaseUrl, pathMap)))\n    .join(\"\");\n}\n\n/**\n * Full pipeline: scan markdown for local asset refs, copy them to assetsDir\n * with content-hashed names, and rewrite the paths in the markdown.\n */\nexport function copyMarkdownAssets(options: CopyMarkdownAssetsOptions): AstroAssetResult {\n  const {\n    markdown,\n    markdownDir,\n    assetsDir,\n    assetsBaseUrl,\n    allowMissing = false,\n  } = options;\n\n  const refs = scanMarkdownAssets(markdown);\n  const pathMap = new Map<string, string>();\n  const missing: string[] = [];\n\n  for (const ref of refs) {\n    const absPath = isAbsoluteRef(ref) ? ref : path.resolve(markdownDir, ref);\n    if (!fs.existsSync(absPath)) {\n      // An absolute path that isn't a real file is an already-served URL\n      // (e.g. /stories/assets/x, /demo-assets/x) — leave it untouched, never error.\n      if (isAbsoluteRef(ref)) continue;\n      if (!allowMissing) {\n        throw new Error(`Asset not found: ${absPath}`);\n      }\n      missing.push(ref);\n      continue;\n    }\n    // copyAsset returns \"assets/<hashed-name>\"\n    const relativeCopied = copyAsset(absPath, assetsDir);\n    // Strip leading \"assets/\" prefix since assetsBaseUrl already points there\n    const fileName = relativeCopied.replace(/^assets\\//, \"\");\n    pathMap.set(ref, fileName);\n  }\n\n  const rewritten = rewriteAssetPaths(markdown, assetsBaseUrl, pathMap);\n\n  return {\n    markdown: rewritten,\n    copiedCount: pathMap.size,\n    missingCount: missing.length,\n    missing,\n  };\n}\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport * as crypto from \"node:crypto\";\n\n/**\n * Copy a source file into assetsDir with a content-hashed filename.\n *\n * Returns the relative path from the HTML file's directory to the copied asset\n * (e.g. \"assets/video-3f2c1a7b.webm\").\n *\n * Idempotent: if the destination already exists, skips the copy.\n */\nexport function copyAsset(sourcePath: string, assetsDir: string): string {\n  if (!fs.existsSync(assetsDir)) {\n    fs.mkdirSync(assetsDir, { recursive: true });\n  }\n\n  const content = fs.readFileSync(sourcePath);\n  const hash = crypto.createHash(\"sha256\").update(content).digest(\"hex\").slice(0, 8);\n\n  const ext = path.extname(sourcePath);\n  const baseName = sanitize(path.basename(sourcePath, ext));\n  const destName = `${baseName}-${hash}${ext}`;\n  const destPath = path.join(assetsDir, destName);\n\n  if (!fs.existsSync(destPath)) {\n    fs.copyFileSync(sourcePath, destPath);\n  }\n\n  return `assets/${destName}`;\n}\n\n/** Replace non-alphanumeric/hyphen/dot characters with hyphens, collapse runs. */\nfunction sanitize(name: string): string {\n  return name\n    .replace(/[^a-zA-Z0-9._-]/g, \"-\")\n    .replace(/-{2,}/g, \"-\")\n    .replace(/^-|-$/g, \"\");\n}\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { scanHtmlAssets } from \"./scan-html-assets\";\nimport { copyAsset } from \"./copy-asset\";\n\nexport interface BundleOptions {\n  /** If true, warn about missing assets instead of throwing. Default: false. */\n  allowMissing?: boolean;\n}\n\nexport interface BundleResult {\n  /** Number of assets successfully copied */\n  copiedCount: number;\n  /** Number of missing assets */\n  missingCount: number;\n  /** Paths of missing assets (original references) */\n  missing: string[];\n}\n\n/**\n * Post-process an HTML report file: copy referenced local assets into\n * an `assets/` directory beside it and rewrite paths in the HTML.\n */\nexport function bundleAssets(\n  htmlPath: string,\n  options: BundleOptions = {},\n): BundleResult {\n  const htmlDir = path.dirname(htmlPath);\n  const assetsDir = path.join(htmlDir, \"assets\");\n\n  let html = fs.readFileSync(htmlPath, \"utf8\");\n  const refs = scanHtmlAssets(html);\n\n  let copiedCount = 0;\n  const missing: string[] = [];\n\n  for (const ref of refs) {\n    const absolutePath = path.resolve(htmlDir, ref);\n\n    if (!fs.existsSync(absolutePath)) {\n      missing.push(ref);\n      continue;\n    }\n\n    const newRelPath = copyAsset(absolutePath, assetsDir);\n    html = replaceAssetRef(html, ref, newRelPath);\n    // Also point the embedded report JSON at the bundled asset: the interactive\n    // island re-renders doc entries (screenshots, video) from that JSON, so\n    // without this a bundled-and-interactive report would 404 its media on\n    // client takeover. No-op for non-interactive reports (no data script).\n    html = replaceAssetRefInData(html, ref, newRelPath);\n    copiedCount++;\n  }\n\n  if (missing.length > 0 && !options.allowMissing) {\n    throw new Error(\n      `Missing asset${missing.length > 1 ? \"s\" : \"\"}: ${missing.join(\", \")}`,\n    );\n  }\n\n  fs.writeFileSync(htmlPath, html, \"utf8\");\n\n  return {\n    copiedCount,\n    missingCount: missing.length,\n    missing,\n  };\n}\n\n/**\n * Replace an asset reference only in bundleable contexts:\n * - src=\"...\" on <img>/<video>/<iframe> elements\n * - href=\"...\" on <a class=\"attachment\"> elements\n *\n * Ordinary doc links sharing the same path are left untouched.\n */\nfunction replaceAssetRef(html: string, original: string, replacement: string): string {\n  const escaped = original.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n  // Rewrite src= on <img>, <video>, and <iframe>\n  const srcPattern = new RegExp(\n    `(<(?:img|video|iframe)\\\\b[^>]*?\\\\bsrc=[\"'])${escaped}([\"'])`,\n    \"g\",\n  );\n  html = html.replace(srcPattern, `$1${replacement}$2`);\n\n  // Rewrite href= on <a class=\"attachment\"> (class before href)\n  const hrefClassFirst = new RegExp(\n    `(<a\\\\b[^>]*?\\\\bclass=[\"']attachment[\"'][^>]*?\\\\bhref=[\"'])${escaped}([\"'])`,\n    \"g\",\n  );\n  html = html.replace(hrefClassFirst, `$1${replacement}$2`);\n\n  // Rewrite href= on <a class=\"attachment\"> (href before class)\n  const hrefHrefFirst = new RegExp(\n    `(<a\\\\b[^>]*?\\\\bhref=[\"'])${escaped}([\"'][^>]*?\\\\bclass=[\"']attachment[\"'])`,\n    \"g\",\n  );\n  html = html.replace(hrefHrefFirst, `$1${replacement}$2`);\n\n  return html;\n}\n\n/**\n * Rewrite a path inside the embedded report JSON (`<script\n * type=\"application/json\">…</script>`) so the interactive island, which\n * re-renders doc entries from that JSON, resolves the bundled asset. Scoped to\n * the data script (like replaceAssetRef is scoped to attributes) so ordinary\n * text that happens to match a path is left alone. Returns html unchanged when\n * there is no data script (a non-interactive report).\n */\nfunction replaceAssetRefInData(html: string, original: string, replacement: string): string {\n  const escaped = original.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n  const quoted = new RegExp(`\"${escaped}\"`, \"g\");\n  return html.replace(\n    /(<script\\b[^>]*\\btype=[\"']application\\/json[\"'][^>]*>)([\\s\\S]*?)(<\\/script>)/g,\n    (_full, open: string, body: string, close: string) =>\n      open + body.replace(quoted, `\"${replacement}\"`) + close,\n  );\n}\n","/**\n * Scan generated HTML for local asset references.\n *\n * Targets: src=\"...\" on img/video/iframe, href=\"...\" on a.attachment.\n * Skips: data: URIs, http/https URLs, empty strings, fragment-only refs.\n * Returns deduplicated list of local path strings.\n */\nexport function scanHtmlAssets(html: string): string[] {\n  const seen = new Set<string>();\n\n  // Strip <script> and <style> blocks before matching: an interactive report\n  // inlines the hydration island (minified JS) and the report JSON, both of\n  // which contain src=-like text (e.g. `src=\"${e}\"`) that is code/data, not a\n  // real element. The actual <img>/<video> elements live in the markup outside\n  // these blocks; the embedded JSON is rewritten separately in bundle-assets.\n  const scannable = html\n    .replace(/<script\\b[^>]*>[\\s\\S]*?<\\/script>/gi, \"\")\n    .replace(/<style\\b[^>]*>[\\s\\S]*?<\\/style>/gi, \"\");\n\n  // Only match src=\"...\" on <img>, <video>, and <iframe> elements, and\n  // href=\"...\" on <a class=\"attachment\"> elements.\n  // This avoids treating ordinary doc links as bundleable assets.\n  const patterns: RegExp[] = [\n    /<(?:img|video|iframe)\\b[^>]*?\\bsrc=[\"']([^\"']+)[\"']/g,\n    /<a\\b[^>]*?\\bclass=[\"']attachment[\"'][^>]*?\\bhref=[\"']([^\"']+)[\"']/g,\n    /<a\\b[^>]*?\\bhref=[\"']([^\"']+)[\"'][^>]*?\\bclass=[\"']attachment[\"']/g,\n  ];\n\n  for (const pattern of patterns) {\n    let match: RegExpExecArray | null;\n    while ((match = pattern.exec(scannable)) !== null) {\n      const ref = match[1];\n      if (isLocalAssetRef(ref) && !seen.has(ref)) {\n        seen.add(ref);\n      }\n    }\n  }\n\n  return [...seen];\n}\n\nfunction isLocalAssetRef(ref: string): boolean {\n  if (!ref) return false;\n  if (ref.startsWith(\"data:\")) return false;\n  if (ref.startsWith(\"http://\") || ref.startsWith(\"https://\")) return false;\n  if (ref.startsWith(\"#\")) return false;\n  return true;\n}\n","/**\n * Build one run from the per-file reports.\n *\n * Each test source file owns a report; the combined view people read is derived\n * from those, explicitly. That keeps the storage model and the presentation\n * model separate: running one test file replaces one report, and any aggregate\n * is a pure function over whatever reports exist at the time.\n *\n * Deriving rather than accumulating is the point. There is no state here to get\n * out of step with the files on disk, because the files on disk are the state.\n */\nimport path from \"node:path\";\n\nimport type {\n  FeatureDeclaration,\n  TestCaseResult,\n  TestRunResult,\n} from \"executable-stories-core/types/test-result\";\n\nexport interface AggregateDeps {\n  readFile: (filePath: string) => string;\n  listDir: (dir: string) => string[] | undefined;\n  logger: { warn(msg: string): void };\n}\n\nexport interface AggregateResult {\n  run: TestRunResult;\n  /** How many per-file reports went into it. */\n  files: number;\n  /** Reports that could not be parsed. Named, never silently skipped. */\n  unreadable: string[];\n  /** Scenario ids claimed by more than one report. */\n  duplicateIds: string[];\n}\n\n/** Files this treats as a per-file report. */\nfunction isReportFile(name: string): boolean {\n  return name.endsWith(\".json\");\n}\n\n/**\n * Read every per-file report in `dir` and combine them into one run.\n *\n * Returns undefined when the directory holds no reports, so a caller can tell\n * \"nothing here yet\" from \"here is an empty run\".\n */\nexport function aggregateReports(\n  args: { dir: string },\n  deps: AggregateDeps\n): AggregateResult | undefined {\n  const names = (deps.listDir(args.dir) ?? []).filter(isReportFile);\n  if (names.length === 0) return undefined;\n\n  const runs: TestRunResult[] = [];\n  const unreadable: string[] = [];\n\n  for (const name of [...names].sort()) {\n    const filePath = path.posix.join(args.dir, name);\n    try {\n      const parsed = JSON.parse(deps.readFile(filePath)) as TestRunResult;\n      if (!Array.isArray(parsed?.testCases)) throw new Error(\"no testCases\");\n      runs.push(parsed);\n    } catch {\n      // One unreadable report must not take the aggregate down with it, but it\n      // must not vanish either: the reader needs to know their view is partial.\n      unreadable.push(filePath);\n      deps.logger.warn(\n        `Ignoring unreadable report ${filePath}; the combined report is missing whatever it held.`\n      );\n    }\n  }\n\n  if (runs.length === 0 && unreadable.length === 0) return undefined;\n\n  const testCases: TestCaseResult[] = [];\n  const seenIds = new Set<string>();\n  const duplicateIds: string[] = [];\n\n  // Sorted by source file so the same reports always produce the same document,\n  // whatever order the filesystem hands them back.\n  const ordered = runs\n    .flatMap((run) => run.testCases)\n    .sort(\n      (a, b) => a.sourceFile.localeCompare(b.sourceFile) || a.id.localeCompare(b.id)\n    );\n\n  for (const testCase of ordered) {\n    if (seenIds.has(testCase.id)) {\n      duplicateIds.push(testCase.id);\n      continue;\n    }\n    seenIds.add(testCase.id);\n    testCases.push(testCase);\n  }\n\n  if (duplicateIds.length > 0) {\n    deps.logger.warn(\n      `${duplicateIds.length} scenario id(s) claimed by more than one report; keeping the first of each: ${duplicateIds.join(\", \")}`\n    );\n  }\n\n  const features: FeatureDeclaration[] = [];\n  const seenFeatureFiles = new Set<string>();\n  for (const run of runs) {\n    for (const feature of run.features ?? []) {\n      if (seenFeatureFiles.has(feature.sourceFile)) continue;\n      seenFeatureFiles.add(feature.sourceFile);\n      features.push(feature);\n    }\n  }\n  features.sort((a, b) => a.sourceFile.localeCompare(b.sourceFile));\n\n  // The aggregate spans its inputs rather than claiming a single moment: these\n  // reports were produced by different runs at different times.\n  const starts = runs.map((r) => r.startedAtMs).filter((n) => typeof n === \"number\" && n > 0);\n  const finishes = runs.map((r) => r.finishedAtMs).filter((n) => typeof n === \"number\" && n > 0);\n  const startedAtMs = starts.length > 0 ? Math.min(...starts) : 0;\n  const finishedAtMs = finishes.length > 0 ? Math.max(...finishes) : startedAtMs;\n\n  const newest = runs.reduce<TestRunResult | undefined>(\n    (best, run) => (!best || run.finishedAtMs > best.finishedAtMs ? run : best),\n    undefined\n  );\n\n  const run: TestRunResult = {\n    testCases,\n    ...(features.length > 0 ? { features } : {}),\n    startedAtMs,\n    finishedAtMs,\n    durationMs: Math.max(0, finishedAtMs - startedAtMs),\n    projectRoot: newest?.projectRoot ?? runs[0]?.projectRoot ?? \"\",\n    runId: newest?.runId ?? \"aggregate\",\n    ...(newest?.packageVersion ? { packageVersion: newest.packageVersion } : {}),\n    ...(newest?.gitSha ? { gitSha: newest.gitSha } : {}),\n    ...(newest?.ci ? { ci: newest.ci } : {}),\n  };\n\n  return { run, files: runs.length, unreadable, duplicateIds };\n}\n","/**\n * Lifecycle for the per-file reports under `<outputDir>/by-file/`.\n *\n * The directory is plain and visible, so `ls` and `rm` already answer most\n * questions about it. What a listing cannot show is how old each file's results\n * are, and that is the question behind \"why does the combined report still say\n * this passes\" — the file is right there, its contents are simply from a run\n * three weeks ago.\n *\n * Neither command changes how a report is produced.\n */\nimport path from \"node:path\";\n\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\n\nimport { byFileDirFor } from \"./file-reports\";\n\nexport interface RunsLifecycleDeps {\n  readFile: (filePath: string) => string;\n  listDir: (dir: string) => string[] | undefined;\n  removeFile: (filePath: string) => void;\n  logger: { warn(msg: string): void };\n}\n\n/** What one test file's report looks like from the outside. */\nexport interface AccumulatedFile {\n  sourceFile: string;\n  scenarios: number;\n  /** When this file's newest scenario last ran, or undefined if none say. */\n  lastRunAtMs?: number;\n  lastRunGitSha?: string;\n}\n\nexport interface RunsStatusReport {\n  /** Path of the reports directory, for the reader to go look. */\n  directory: string;\n  exists: boolean;\n  files: AccumulatedFile[];\n  totalScenarios: number;\n  /** Reports that could not be parsed. Named, never silently skipped. */\n  unreadable: string[];\n  /** Human-readable rendering, what the CLI prints. */\n  text: string;\n}\n\n/** Human-readable age. Mirrors the report's own wording. */\nfunction relativeAge(thenMs: number, nowMs: number): string {\n  const deltaMs = Math.max(0, nowMs - thenMs);\n  const minutes = Math.floor(deltaMs / 60_000);\n  if (minutes < 1) return \"just now\";\n  if (minutes < 60) return `${minutes} minute${minutes === 1 ? \"\" : \"s\"} ago`;\n  const hours = Math.floor(minutes / 60);\n  if (hours < 24) return `${hours} hour${hours === 1 ? \"\" : \"s\"} ago`;\n  const days = Math.floor(hours / 24);\n  return `${days} day${days === 1 ? \"\" : \"s\"} ago`;\n}\n\nfunction readFileReports(\n  dir: string,\n  deps: RunsLifecycleDeps\n): { files: AccumulatedFile[]; unreadable: string[]; names: string[] } {\n  const names = (deps.listDir(dir) ?? []).filter((n) => n.endsWith(\".json\")).sort();\n  const files: AccumulatedFile[] = [];\n  const unreadable: string[] = [];\n\n  for (const name of names) {\n    const filePath = path.posix.join(dir, name);\n    try {\n      const run = JSON.parse(deps.readFile(filePath)) as TestRunResult;\n      const testCases = run.testCases ?? [];\n      const sourceFile = testCases[0]?.sourceFile;\n      if (!sourceFile) {\n        unreadable.push(filePath);\n        continue;\n      }\n      const stamps = testCases\n        .map((tc) => tc.lastRunAtMs)\n        .filter((ms): ms is number => typeof ms === \"number\");\n      files.push({\n        sourceFile,\n        scenarios: testCases.length,\n        ...(stamps.length > 0 ? { lastRunAtMs: Math.max(...stamps) } : {}),\n        ...(testCases[0]?.lastRunGitSha ? { lastRunGitSha: testCases[0].lastRunGitSha } : {}),\n      });\n    } catch {\n      unreadable.push(filePath);\n    }\n  }\n\n  files.sort((a, b) => a.sourceFile.localeCompare(b.sourceFile));\n  return { files, unreadable, names };\n}\n\n/**\n * What the report would be built from right now: every test file the state\n * holds, how many scenarios each contributes, and how old those results are.\n */\nexport function runsStatus(\n  args: { outputDir: string; nowMs: number },\n  deps: RunsLifecycleDeps\n): RunsStatusReport {\n  const directory = byFileDirFor(args.outputDir);\n  const { files, unreadable, names } = readFileReports(directory, deps);\n  const exists = names.length > 0 || unreadable.length > 0;\n  const totalScenarios = files.reduce((sum, f) => sum + f.scenarios, 0);\n\n  const lines: string[] = [];\n  if (!exists) {\n    lines.push(\n      `No per-file reports in ${directory}.`,\n      \"Your next test run writes them, one per test source file.\"\n    );\n  } else {\n    lines.push(`Reports in ${directory}, one per test source file:`, \"\");\n    for (const file of files) {\n      const age =\n        file.lastRunAtMs === undefined\n          ? \"age unknown\"\n          : relativeAge(file.lastRunAtMs, args.nowMs);\n      const sha = file.lastRunGitSha ? ` @ ${file.lastRunGitSha.slice(0, 8)}` : \"\";\n      const count = `${file.scenarios} scenario${file.scenarios === 1 ? \"\" : \"s\"}`;\n      lines.push(`  ${file.sourceFile}  ${count}, last ran ${age}${sha}`);\n    }\n    lines.push(\n      \"\",\n      `${totalScenarios} scenario${totalScenarios === 1 ? \"\" : \"s\"} across ${files.length} file${files.length === 1 ? \"\" : \"s\"}.`\n    );\n    if (unreadable.length > 0) {\n      lines.push(\"\", \"Unreadable, and therefore not in the report:\");\n      for (const file of unreadable) lines.push(`  ${file}`);\n    }\n    lines.push(\n      \"\",\n      `Combine them with: executable-stories format ${directory} --format html`,\n      \"Start over with: executable-stories runs reset\"\n    );\n  }\n\n  return { directory, exists, files, totalScenarios, unreadable, text: lines.join(\"\\n\") };\n}\n\nexport interface RunsResetResult {\n  directory: string;\n  removed: number;\n  text: string;\n}\n\n/**\n * Delete every per-file report. The next full test run writes them again.\n *\n * Removes only this directory's reports; anything rendered beside it in the\n * output folder is the user's own output and is left alone.\n */\nexport function runsReset(\n  args: { outputDir: string },\n  deps: RunsLifecycleDeps\n): RunsResetResult {\n  const directory = byFileDirFor(args.outputDir);\n  const names = (deps.listDir(directory) ?? []).filter((n) => n.endsWith(\".json\"));\n\n  for (const name of names) deps.removeFile(path.posix.join(directory, name));\n\n  const text =\n    names.length === 0\n      ? `Nothing to reset: no per-file reports in ${directory}.`\n      : `Removed ${names.length} per-file report${names.length === 1 ? \"\" : \"s\"} from ${directory}.\\n` +\n        \"Run your full test suite to write them again.\";\n\n  return { directory, removed: names.length, text };\n}\n","import type { ScenarioChangeKind } from \"./types/compare\";\nimport type { ReportScenario, StoryReport, TestStatus } from \"executable-stories-core/types/story-report\";\n\nexport interface BehaviorDiffEntry {\n  id: string;\n  title: string;\n  sourceFile: string;\n  kind: ScenarioChangeKind;\n  baselineStatus?: TestStatus;\n  currentStatus?: TestStatus;\n}\n\nexport interface BehaviorDiff {\n  schemaVersion: \"1.0\";\n  summary: {\n    added: number;\n    removed: number;\n    regressed: number;\n    fixed: number;\n    changed: number;\n    unchanged: number;\n  };\n  scenarios: BehaviorDiffEntry[];\n}\n\n/**\n * Classify a single scenario's status transition between two runs.\n * Shares the `ScenarioChangeKind` vocabulary with the full compare engine.\n */\nexport function classifyStatusChange(\n  baseline: TestStatus | undefined,\n  current: TestStatus | undefined,\n): ScenarioChangeKind {\n  if (baseline === undefined) return \"added\";\n  if (current === undefined) return \"removed\";\n  if (baseline === current) return \"unchanged\";\n  if (baseline === \"passed\" && current === \"failed\") return \"regressed\";\n  if (baseline === \"failed\" && current === \"passed\") return \"fixed\";\n  return \"changed\";\n}\n\nfunction scenarioMap(\n  report: StoryReport,\n): Map<string, { scenario: ReportScenario; sourceFile: string }> {\n  const map = new Map<string, { scenario: ReportScenario; sourceFile: string }>();\n  for (const feature of report.features) {\n    for (const scenario of feature.scenarios) {\n      map.set(scenario.id, { scenario, sourceFile: feature.sourceFile });\n    }\n  }\n  return map;\n}\n\n/**\n * Scenario-level diff of two StoryReports, keyed by scenario id. Reports status\n * transitions (the agent triage signal), not the full field-by-field diff that\n * the human-facing compare engine produces.\n */\nexport function diffStoryReports(baseline: StoryReport, current: StoryReport): BehaviorDiff {\n  const base = scenarioMap(baseline);\n  const curr = scenarioMap(current);\n  const ids = [...new Set([...base.keys(), ...curr.keys()])];\n\n  const scenarios: BehaviorDiffEntry[] = ids.map((id) => {\n    const b = base.get(id);\n    const c = curr.get(id);\n    const kind = classifyStatusChange(b?.scenario.status, c?.scenario.status);\n    const meta = c ?? b!;\n    return {\n      id,\n      title: meta.scenario.title,\n      sourceFile: meta.sourceFile,\n      kind,\n      baselineStatus: b?.scenario.status,\n      currentStatus: c?.scenario.status,\n    };\n  });\n\n  const summary = { added: 0, removed: 0, regressed: 0, fixed: 0, changed: 0, unchanged: 0 };\n  for (const s of scenarios) {\n    // This status-only diff is keyed by scenario id and never re-identifies renames/moves\n    // (that is the full compare engine's job), so those kinds cannot occur here.\n    if (s.kind === \"renamed\" || s.kind === \"moved\") continue;\n    summary[s.kind] += 1;\n  }\n\n  return { schemaVersion: \"1.0\", summary, scenarios };\n}\n","/**\n * Confluence publisher.\n *\n * Pushes an ADF JSON document to a Confluence Cloud page via the REST API v2.\n * - If `pageId` is provided, the page is updated in place (title + body + version).\n * - If `spaceId` is provided instead, a new page is created (optionally under `parentId`).\n *\n * Authentication: Basic auth with an Atlassian email + API token.\n * Generate tokens at https://id.atlassian.com/manage-profile/security/api-tokens.\n */\n\n/** HTTP fetch function (injectable for tests). Matches global fetch signature. */\nexport type FetchFn = (\n  url: string,\n  init: {\n    method: string;\n    headers: Record<string, string>;\n    body?: string;\n  },\n) => Promise<{\n  ok: boolean;\n  status: number;\n  statusText: string;\n  text(): Promise<string>;\n  json(): Promise<unknown>;\n}>;\n\nexport interface ConfluenceAuth {\n  /** Atlassian account email */\n  email: string;\n  /** Atlassian API token */\n  token: string;\n}\n\nexport interface PublishConfluenceArgs {\n  /** ADF document JSON string (the `{ version, type: \"doc\", content }` envelope) */\n  adf: string;\n  /** Page ID to update (mutually exclusive with spaceId for create) */\n  pageId?: string;\n  /** Space ID required when creating a new page */\n  spaceId?: string;\n  /** Parent page ID (optional, for new pages) */\n  parentId?: string;\n  /** Page title. Required for create; updates existing title if provided on update */\n  title?: string;\n  /** Base URL of the Confluence instance, e.g. https://acme.atlassian.net/wiki */\n  baseUrl: string;\n}\n\nexport interface PublishConfluenceDeps {\n  auth: ConfluenceAuth;\n  /** Defaults to globalThis.fetch */\n  fetch?: FetchFn;\n}\n\nexport interface PublishConfluenceResult {\n  id: string;\n  version: number;\n  title: string;\n  /** Canonical URL to view the page in Confluence */\n  url: string;\n  action: \"created\" | \"updated\";\n}\n\n/**\n * Validate that the supplied string parses to a valid ADF document envelope.\n * Returns the parsed object, or throws with a descriptive error.\n */\nfunction parseAdf(adf: string): {\n  version: number;\n  type: string;\n  content: unknown[];\n} {\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(adf);\n  } catch (err) {\n    throw new Error(`ADF payload is not valid JSON: ${(err as Error).message}`, {\n      cause: err,\n    });\n  }\n  if (\n    !parsed ||\n    typeof parsed !== \"object\" ||\n    (parsed as { type?: unknown }).type !== \"doc\" ||\n    !Array.isArray((parsed as { content?: unknown }).content)\n  ) {\n    throw new Error(\n      `ADF payload must be an object with { version, type: \"doc\", content: [...] }`,\n    );\n  }\n  return parsed as { version: number; type: string; content: unknown[] };\n}\n\nfunction basicAuthHeader(auth: ConfluenceAuth): string {\n  const raw = `${auth.email}:${auth.token}`;\n  const encoded =\n    typeof Buffer !== \"undefined\"\n      ? Buffer.from(raw, \"utf8\").toString(\"base64\")\n      : btoa(raw);\n  return `Basic ${encoded}`;\n}\n\nasync function parseErrorBody(\n  response: { text(): Promise<string> },\n): Promise<string> {\n  try {\n    const body = await response.text();\n    return body ? body.slice(0, 800) : \"\";\n  } catch {\n    return \"\";\n  }\n}\n\n/**\n * Publish an ADF document to Confluence. Creates a new page if `pageId` is\n * omitted, otherwise updates the existing page.\n */\nexport async function publishConfluencePage(\n  args: PublishConfluenceArgs,\n  deps: PublishConfluenceDeps,\n): Promise<PublishConfluenceResult> {\n  // Validate ADF up front so we fail fast with a clear message.\n  parseAdf(args.adf);\n\n  if (!args.pageId && !args.spaceId) {\n    throw new Error(\n      \"publishConfluencePage requires either pageId (update) or spaceId (create)\",\n    );\n  }\n  if (!args.pageId && !args.title) {\n    throw new Error(\"Creating a new page requires a title\");\n  }\n\n  const base = args.baseUrl.replace(/\\/$/, \"\");\n  const fetchFn: FetchFn = deps.fetch ?? (globalThis.fetch as unknown as FetchFn);\n  if (!fetchFn) {\n    throw new Error(\"No fetch implementation available (Node >= 22 expected)\");\n  }\n\n  const headers = {\n    Authorization: basicAuthHeader(deps.auth),\n    Accept: \"application/json\",\n    \"Content-Type\": \"application/json\",\n  };\n\n  if (args.pageId) {\n    return updatePage(args, base, headers, fetchFn);\n  }\n  return createPage(args, base, headers, fetchFn);\n}\n\nasync function updatePage(\n  args: PublishConfluenceArgs,\n  base: string,\n  headers: Record<string, string>,\n  fetchFn: FetchFn,\n): Promise<PublishConfluenceResult> {\n  // Look up current page to get version and default title.\n  const getUrl = `${base}/api/v2/pages/${encodeURIComponent(args.pageId!)}`;\n  const getResp = await fetchFn(getUrl, { method: \"GET\", headers });\n  if (!getResp.ok) {\n    const body = await parseErrorBody(getResp);\n    throw new Error(\n      `GET ${getUrl} failed with ${getResp.status} ${getResp.statusText}${body ? `: ${body}` : \"\"}`,\n    );\n  }\n  const current = (await getResp.json()) as {\n    id: string;\n    title: string;\n    version: { number: number };\n    _links?: { webui?: string; base?: string };\n  };\n  const nextVersion = current.version.number + 1;\n  const title = args.title ?? current.title;\n\n  const putUrl = `${base}/api/v2/pages/${encodeURIComponent(args.pageId!)}`;\n  const putResp = await fetchFn(putUrl, {\n    method: \"PUT\",\n    headers,\n    body: JSON.stringify({\n      id: args.pageId,\n      status: \"current\",\n      title,\n      body: {\n        representation: \"atlas_doc_format\",\n        value: args.adf,\n      },\n      version: { number: nextVersion },\n    }),\n  });\n  if (!putResp.ok) {\n    const body = await parseErrorBody(putResp);\n    throw new Error(\n      `PUT ${putUrl} failed with ${putResp.status} ${putResp.statusText}${body ? `: ${body}` : \"\"}`,\n    );\n  }\n  const updated = (await putResp.json()) as {\n    id: string;\n    title: string;\n    version: { number: number };\n    _links?: { webui?: string; base?: string };\n  };\n\n  return {\n    id: updated.id,\n    title: updated.title,\n    version: updated.version.number,\n    url: buildPageUrl(base, updated._links?.webui, updated.id),\n    action: \"updated\",\n  };\n}\n\nasync function createPage(\n  args: PublishConfluenceArgs,\n  base: string,\n  headers: Record<string, string>,\n  fetchFn: FetchFn,\n): Promise<PublishConfluenceResult> {\n  const body: Record<string, unknown> = {\n    spaceId: args.spaceId,\n    status: \"current\",\n    title: args.title,\n    body: {\n      representation: \"atlas_doc_format\",\n      value: args.adf,\n    },\n  };\n  if (args.parentId) body.parentId = args.parentId;\n\n  const postUrl = `${base}/api/v2/pages`;\n  const resp = await fetchFn(postUrl, {\n    method: \"POST\",\n    headers,\n    body: JSON.stringify(body),\n  });\n  if (!resp.ok) {\n    const errBody = await parseErrorBody(resp);\n    throw new Error(\n      `POST ${postUrl} failed with ${resp.status} ${resp.statusText}${errBody ? `: ${errBody}` : \"\"}`,\n    );\n  }\n  const created = (await resp.json()) as {\n    id: string;\n    title: string;\n    version: { number: number };\n    _links?: { webui?: string; base?: string };\n  };\n\n  return {\n    id: created.id,\n    title: created.title,\n    version: created.version.number,\n    url: buildPageUrl(base, created._links?.webui, created.id),\n    action: \"created\",\n  };\n}\n\nfunction buildPageUrl(base: string, webui: string | undefined, id: string): string {\n  if (webui) {\n    return webui.startsWith(\"http\") ? webui : `${base}${webui}`;\n  }\n  return `${base}/pages/${id}`;\n}\n","/**\n * Jira publisher.\n *\n * Pushes an ADF JSON document to a Jira Cloud issue via the REST API v3.\n * - mode \"comment\"     adds the ADF as a new comment (default, non-destructive)\n * - mode \"description\" replaces the issue description field with the ADF\n *\n * Authentication: Basic auth with an Atlassian email + API token (same token\n * system as Confluence — create one at id.atlassian.com).\n *\n * Note: unlike Confluence v2 (which expects the ADF as a stringified value),\n * Jira v3 accepts ADF as a native JSON object in the request body.\n */\n\nimport type { FetchFn, ConfluenceAuth } from \"./confluence\";\n\n/** Reuses the same auth + fetch shape as the Confluence publisher */\nexport type JiraAuth = ConfluenceAuth;\n\n/** Update mode — default \"comment\" is non-destructive and append-only */\nexport type JiraPublishMode = \"comment\" | \"description\";\n\nexport interface PublishJiraArgs {\n  /** ADF document JSON string (the `{ version, type: \"doc\", content }` envelope) */\n  adf: string;\n  /** Issue key, e.g. \"PROJ-123\" */\n  issueKey: string;\n  /** Base URL of the Jira instance, e.g. https://acme.atlassian.net */\n  baseUrl: string;\n  /** Defaults to \"comment\" */\n  mode?: JiraPublishMode;\n}\n\nexport interface PublishJiraDeps {\n  auth: JiraAuth;\n  /** Defaults to globalThis.fetch */\n  fetch?: FetchFn;\n}\n\nexport interface PublishJiraResult {\n  issueKey: string;\n  action: \"description-updated\" | \"comment-added\";\n  /** Canonical URL to view the issue (and comment, if applicable) */\n  url: string;\n  /** Set only when mode = \"comment\" */\n  commentId?: string;\n}\n\n/** Parse ADF and return the object (Jira accepts the full JSON object, not a string). */\nfunction parseAdf(adf: string): Record<string, unknown> {\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(adf);\n  } catch (err) {\n    throw new Error(`ADF payload is not valid JSON: ${(err as Error).message}`, {\n      cause: err,\n    });\n  }\n  if (\n    !parsed ||\n    typeof parsed !== \"object\" ||\n    (parsed as { type?: unknown }).type !== \"doc\" ||\n    !Array.isArray((parsed as { content?: unknown }).content)\n  ) {\n    throw new Error(\n      `ADF payload must be an object with { version, type: \"doc\", content: [...] }`,\n    );\n  }\n  return parsed as Record<string, unknown>;\n}\n\nfunction basicAuthHeader(auth: JiraAuth): string {\n  const raw = `${auth.email}:${auth.token}`;\n  const encoded =\n    typeof Buffer !== \"undefined\"\n      ? Buffer.from(raw, \"utf8\").toString(\"base64\")\n      : btoa(raw);\n  return `Basic ${encoded}`;\n}\n\nasync function parseErrorBody(resp: {\n  text(): Promise<string>;\n}): Promise<string> {\n  try {\n    const body = await resp.text();\n    return body ? body.slice(0, 800) : \"\";\n  } catch {\n    return \"\";\n  }\n}\n\n/**\n * Publish an ADF document to a Jira issue. Defaults to adding a new comment.\n * Use mode: \"description\" to replace the issue's description field.\n */\nexport async function publishJiraIssue(\n  args: PublishJiraArgs,\n  deps: PublishJiraDeps,\n): Promise<PublishJiraResult> {\n  const adfObject = parseAdf(args.adf);\n  if (!args.issueKey) {\n    throw new Error(\"publishJiraIssue requires an issueKey, e.g. PROJ-123\");\n  }\n\n  const base = args.baseUrl.replace(/\\/$/, \"\");\n  const fetchFn: FetchFn = deps.fetch ?? (globalThis.fetch as unknown as FetchFn);\n  if (!fetchFn) {\n    throw new Error(\"No fetch implementation available (Node >= 22 expected)\");\n  }\n\n  const headers = {\n    Authorization: basicAuthHeader(deps.auth),\n    Accept: \"application/json\",\n    \"Content-Type\": \"application/json\",\n  };\n\n  const mode = args.mode ?? \"comment\";\n  if (mode === \"description\") {\n    return updateDescription(args.issueKey, base, adfObject, headers, fetchFn);\n  }\n  return addComment(args.issueKey, base, adfObject, headers, fetchFn);\n}\n\nasync function addComment(\n  issueKey: string,\n  base: string,\n  adf: Record<string, unknown>,\n  headers: Record<string, string>,\n  fetchFn: FetchFn,\n): Promise<PublishJiraResult> {\n  const url = `${base}/rest/api/3/issue/${encodeURIComponent(issueKey)}/comment`;\n  const resp = await fetchFn(url, {\n    method: \"POST\",\n    headers,\n    body: JSON.stringify({ body: adf }),\n  });\n  if (!resp.ok) {\n    const body = await parseErrorBody(resp);\n    throw new Error(\n      `POST ${url} failed with ${resp.status} ${resp.statusText}${body ? `: ${body}` : \"\"}`,\n    );\n  }\n  const comment = (await resp.json()) as { id: string };\n  const issueUrl = `${base}/browse/${encodeURIComponent(issueKey)}`;\n  return {\n    issueKey,\n    action: \"comment-added\",\n    url: `${issueUrl}?focusedCommentId=${encodeURIComponent(comment.id)}`,\n    commentId: comment.id,\n  };\n}\n\nasync function updateDescription(\n  issueKey: string,\n  base: string,\n  adf: Record<string, unknown>,\n  headers: Record<string, string>,\n  fetchFn: FetchFn,\n): Promise<PublishJiraResult> {\n  const url = `${base}/rest/api/3/issue/${encodeURIComponent(issueKey)}`;\n  const resp = await fetchFn(url, {\n    method: \"PUT\",\n    headers,\n    body: JSON.stringify({ fields: { description: adf } }),\n  });\n  // Jira returns 204 No Content on a successful PUT.\n  if (!resp.ok) {\n    const body = await parseErrorBody(resp);\n    throw new Error(\n      `PUT ${url} failed with ${resp.status} ${resp.statusText}${body ? `: ${body}` : \"\"}`,\n    );\n  }\n  return {\n    issueKey,\n    action: \"description-updated\",\n    url: `${base}/browse/${encodeURIComponent(issueKey)}`,\n  };\n}\n","/**\n * Git information utilities.\n *\n * Read git SHA and other info from the local repository.\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\n/**\n * Read the current git SHA.\n *\n * Checks environment variables first (for CI), then reads from .git directory.\n *\n * @param cwd - Working directory to start search from\n * @returns Git SHA or undefined if not in a git repo\n */\nexport function readGitSha(cwd: string = process.cwd()): string | undefined {\n  // Check CI environment variables first\n  const envSha = process.env.GITHUB_SHA || process.env.GIT_COMMIT || process.env.CI_COMMIT_SHA;\n  if (envSha) return envSha;\n\n  // Find .git directory\n  const gitDir = findGitDir(cwd);\n  if (!gitDir) return undefined;\n\n  try {\n    const headPath = path.join(gitDir, \"HEAD\");\n    const head = fs.readFileSync(headPath, \"utf8\").trim();\n\n    // If HEAD is a direct SHA (detached HEAD state)\n    if (!head.startsWith(\"ref:\")) {\n      return head;\n    }\n\n    // HEAD points to a ref, resolve it\n    const refPath = head.replace(\"ref:\", \"\").trim();\n    const refFile = path.join(gitDir, refPath);\n\n    if (fs.existsSync(refFile)) {\n      return fs.readFileSync(refFile, \"utf8\").trim();\n    }\n\n    // Check packed-refs\n    const packedRefs = path.join(gitDir, \"packed-refs\");\n    if (fs.existsSync(packedRefs)) {\n      const content = fs.readFileSync(packedRefs, \"utf8\");\n      for (const line of content.split(\"\\n\")) {\n        if (!line || line.startsWith(\"#\") || line.startsWith(\"^\")) continue;\n        const [sha, ref] = line.split(\" \");\n        if (ref === refPath) return sha;\n      }\n    }\n\n    return undefined;\n  } catch {\n    return undefined;\n  }\n}\n\n/**\n * Find the .git directory starting from a given directory.\n *\n * @param start - Directory to start search from\n * @returns Path to .git directory or undefined if not found\n */\nexport function findGitDir(start: string): string | undefined {\n  let current = start;\n  while (true) {\n    const candidate = path.join(current, \".git\");\n    if (fs.existsSync(candidate)) {\n      // Handle git worktrees where .git is a file\n      const stat = fs.statSync(candidate);\n      if (stat.isFile()) {\n        const content = fs.readFileSync(candidate, \"utf8\").trim();\n        const match = content.match(/^gitdir: (.+)$/);\n        if (match) {\n          return path.resolve(current, match[1]);\n        }\n      }\n      return candidate;\n    }\n    const parent = path.dirname(current);\n    if (parent === current) return undefined;\n    current = parent;\n  }\n}\n\n/**\n * Read the current branch name.\n *\n * @param cwd - Working directory\n * @returns Branch name or undefined\n */\nexport function readBranchName(cwd: string = process.cwd()): string | undefined {\n  // Check CI environment variables first\n  const envBranch = process.env.GITHUB_REF_NAME || process.env.CI_COMMIT_REF_NAME;\n  if (envBranch) return envBranch;\n\n  const gitDir = findGitDir(cwd);\n  if (!gitDir) return undefined;\n\n  try {\n    const headPath = path.join(gitDir, \"HEAD\");\n    const head = fs.readFileSync(headPath, \"utf8\").trim();\n\n    if (head.startsWith(\"ref:\")) {\n      const refPath = head.replace(\"ref:\", \"\").trim();\n      // Extract branch name from refs/heads/branch-name\n      const match = refPath.match(/^refs\\/heads\\/(.+)$/);\n      return match ? match[1] : refPath;\n    }\n\n    // Detached HEAD\n    return undefined;\n  } catch {\n    return undefined;\n  }\n}\n","/**\n * Metadata utilities for reading package information.\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\n/** Cache for package versions by root directory */\nconst versionCache = new Map<string, string | undefined>();\n\n/**\n * Read the package version from the closest package.json.\n *\n * Results are cached by root directory.\n *\n * @param root - Directory to start searching from\n * @returns Package version string or undefined if not found\n */\nexport function readPackageVersion(root: string): string | undefined {\n  if (versionCache.has(root)) {\n    return versionCache.get(root);\n  }\n\n  const version = findPackageVersion(root);\n  versionCache.set(root, version);\n  return version;\n}\n\n/**\n * Find package.json version by walking up the directory tree.\n */\nfunction findPackageVersion(startDir: string): string | undefined {\n  let current = path.resolve(startDir);\n\n  while (true) {\n    const pkgPath = path.join(current, \"package.json\");\n    try {\n      if (fs.existsSync(pkgPath)) {\n        const raw = fs.readFileSync(pkgPath, \"utf8\");\n        const parsed = JSON.parse(raw) as { version?: string };\n        return parsed.version;\n      }\n    } catch {\n      // Continue searching\n    }\n\n    const parent = path.dirname(current);\n    if (parent === current) {\n      // Reached root\n      return undefined;\n    }\n    current = parent;\n  }\n}\n\n/**\n * Clear the package version cache.\n * Useful for testing.\n */\nexport function clearVersionCache(): void {\n  versionCache.clear();\n}\n","/**\n * No-dependency ANSI escape sequence stripper.\n */\n\n/** Strip ANSI escape sequences. Regex: \\x1B\\[[0-?]*[ -/]*[@-~] */\nexport function stripAnsi(text: string): string {\n  // eslint-disable-next-line no-control-regex\n  return text.replace(/\\x1B\\[[0-?]*[ -/]*[@-~]/g, \"\");\n}\n","/**\n * Slack webhook notifier using Block Kit.\n *\n * Follows the fn(args, deps) pattern.\n * Never logs the webhook URL.\n */\n\nimport type { NotificationSummary } from \"./types\";\nimport { stripAnsi } from \"./ansi-strip\";\n\n/** Arguments for sendSlackNotification. */\nexport interface SlackNotificationArgs {\n  summary: NotificationSummary;\n  webhookUrl: string;\n  maxFailedTests?: number;\n}\n\n/** Injectable dependencies for sendSlackNotification. */\nexport interface SlackNotificationDeps {\n  fetch: typeof globalThis.fetch;\n  logger: { warn(msg: string): void };\n}\n\n/** Result of a notification send attempt. */\nexport interface NotificationResult {\n  ok: boolean;\n  error?: string;\n}\n\n/** Truncate text to a maximum length, appending ellipsis if needed. */\nfunction truncate(text: string, maxLen: number): string {\n  if (text.length <= maxLen) return text;\n  return text.slice(0, maxLen - 3) + \"...\";\n}\n\n/** Format milliseconds as a human-readable duration string. */\nfunction formatDuration(ms: number): string {\n  const seconds = ms / 1000;\n  if (seconds < 60) return `${seconds.toFixed(1)}s`;\n  const minutes = Math.floor(seconds / 60);\n  const remainingSeconds = seconds % 60;\n  return `${minutes}m ${remainingSeconds.toFixed(0)}s`;\n}\n\n/** Build Slack Block Kit payload from a notification summary. */\nfunction buildSlackPayload(\n  summary: NotificationSummary,\n  maxFailedTests: number,\n): Record<string, unknown> {\n  const allPassed = summary.failed === 0;\n  const emoji = allPassed ? \":white_check_mark:\" : \":x:\";\n  const statusText = allPassed ? \"Passed\" : \"Failed\";\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const blocks: any[] = [];\n\n  // Header block\n  blocks.push({\n    type: \"header\",\n    text: {\n      type: \"plain_text\",\n      text: `${emoji} Test Results: ${summary.passed} passed, ${summary.failed} failed`,\n      emoji: true,\n    },\n  });\n\n  // Summary fields section\n  blocks.push({\n    type: \"section\",\n    fields: [\n      { type: \"mrkdwn\", text: `*Total:* ${summary.total}` },\n      { type: \"mrkdwn\", text: `*Passed:* ${summary.passed}` },\n      { type: \"mrkdwn\", text: `*Failed:* ${summary.failed}` },\n      { type: \"mrkdwn\", text: `*Skipped:* ${summary.skipped}` },\n      { type: \"mrkdwn\", text: `*Duration:* ${formatDuration(summary.durationMs)}` },\n      { type: \"mrkdwn\", text: `*Status:* ${statusText}` },\n    ],\n  });\n\n  // Failed tests section\n  if (summary.failedTests.length > 0) {\n    const displayedTests = summary.failedTests.slice(0, maxFailedTests);\n    const lines = displayedTests.map((t) => {\n      const name = t.name;\n      if (t.error) {\n        const cleanError = truncate(stripAnsi(t.error), 500);\n        return `*${name}*\\n\\`\\`\\`${cleanError}\\`\\`\\``;\n      }\n      return `*${name}*`;\n    });\n\n    let text = lines.join(\"\\n\\n\");\n    if (summary.failedTests.length > maxFailedTests) {\n      text += `\\n\\n_...and ${summary.failedTests.length - maxFailedTests} more_`;\n    }\n\n    blocks.push({\n      type: \"section\",\n      text: {\n        type: \"mrkdwn\",\n        text,\n      },\n    });\n  }\n\n  // CI context block\n  if (summary.ci) {\n    const elements: Array<{ type: string; text: string }> = [];\n\n    if (summary.ci.displayName) {\n      elements.push({ type: \"mrkdwn\", text: `*CI:* ${summary.ci.displayName}` });\n    }\n    if (summary.ci.branch) {\n      elements.push({ type: \"mrkdwn\", text: `*Branch:* ${summary.ci.branch}` });\n    }\n    if (summary.ci.commitSha) {\n      elements.push({ type: \"mrkdwn\", text: `*Commit:* ${summary.ci.commitSha.slice(0, 7)}` });\n    }\n    if (summary.ci.buildNumber) {\n      elements.push({ type: \"mrkdwn\", text: `*Build:* #${summary.ci.buildNumber}` });\n    }\n\n    if (elements.length > 0) {\n      blocks.push({\n        type: \"context\",\n        elements,\n      });\n    }\n  }\n\n  // Actions block with \"View Report\" button\n  if (summary.reportUrl) {\n    blocks.push({\n      type: \"actions\",\n      elements: [\n        {\n          type: \"button\",\n          text: {\n            type: \"plain_text\",\n            text: \"View Report\",\n            emoji: true,\n          },\n          url: summary.reportUrl,\n          action_id: \"view_report\",\n        },\n      ],\n    });\n  }\n\n  return { blocks };\n}\n\n/**\n * Send a Slack notification via incoming webhook.\n *\n * Never throws. Returns `{ ok, error? }`.\n * Never logs the webhook URL.\n */\nexport async function sendSlackNotification(\n  args: SlackNotificationArgs,\n  deps: SlackNotificationDeps,\n): Promise<NotificationResult> {\n  const { summary, webhookUrl, maxFailedTests = 5 } = args;\n  const { fetch, logger } = deps;\n\n  const payload = buildSlackPayload(summary, maxFailedTests);\n\n  try {\n    const response = await fetch(webhookUrl, {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application/json\" },\n      body: JSON.stringify(payload),\n    });\n\n    if (!response.ok) {\n      const requestId = response.headers.get(\"x-request-id\") ?? undefined;\n      let bodyText = \"\";\n      try {\n        bodyText = await response.text();\n      } catch {\n        // ignore body read errors\n      }\n      const truncatedBody = truncate(bodyText, 200);\n      const idPart = requestId ? ` x-request-id=${requestId}` : \"\";\n      const errorMsg = `Slack notifier failed: HTTP ${response.status}${idPart} ${truncatedBody}`;\n      logger.warn(errorMsg);\n      return { ok: false, error: errorMsg };\n    }\n\n    return { ok: true };\n  } catch (err) {\n    const msg = err instanceof Error ? err.message : String(err);\n    const errorMsg = `Slack notifier failed: ${msg}`;\n    logger.warn(errorMsg);\n    return { ok: false, error: errorMsg };\n  }\n}\n","/**\n * Microsoft Teams webhook notifier using Adaptive Cards.\n *\n * Follows the fn(args, deps) pattern.\n * Never logs the webhook URL.\n */\n\nimport type { NotificationSummary } from \"./types\";\nimport { stripAnsi } from \"./ansi-strip\";\n\n/** Arguments for sendTeamsNotification. */\nexport interface TeamsNotificationArgs {\n  summary: NotificationSummary;\n  webhookUrl: string;\n  maxFailedTests?: number;\n}\n\n/** Injectable dependencies for sendTeamsNotification. */\nexport interface TeamsNotificationDeps {\n  fetch: typeof globalThis.fetch;\n  logger: { warn(msg: string): void };\n}\n\n/** Result of a notification send attempt. */\nexport interface TeamsNotificationResult {\n  ok: boolean;\n  error?: string;\n}\n\n/** Truncate text to a maximum length, appending ellipsis if needed. */\nfunction truncate(text: string, maxLen: number): string {\n  if (text.length <= maxLen) return text;\n  return text.slice(0, maxLen - 3) + \"...\";\n}\n\n/** Format milliseconds as a human-readable duration string. */\nfunction formatDuration(ms: number): string {\n  const seconds = ms / 1000;\n  if (seconds < 60) return `${seconds.toFixed(1)}s`;\n  const minutes = Math.floor(seconds / 60);\n  const remainingSeconds = seconds % 60;\n  return `${minutes}m ${remainingSeconds.toFixed(0)}s`;\n}\n\n/** Build an Adaptive Card payload from a notification summary. */\nfunction buildTeamsPayload(\n  summary: NotificationSummary,\n  maxFailedTests: number,\n): Record<string, unknown> {\n  const allPassed = summary.failed === 0;\n  const statusEmoji = allPassed ? \"\\u2705\" : \"\\u274C\"; // check mark / cross mark\n  const statusColor = allPassed ? \"good\" : \"attention\";\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const bodyItems: any[] = [];\n\n  // Header with status\n  bodyItems.push({\n    type: \"TextBlock\",\n    size: \"Large\",\n    weight: \"Bolder\",\n    text: `${statusEmoji} Test Results`,\n    color: statusColor,\n  });\n\n  // FactSet with summary\n  bodyItems.push({\n    type: \"FactSet\",\n    facts: [\n      { title: \"Total\", value: String(summary.total) },\n      { title: \"Passed\", value: String(summary.passed) },\n      { title: \"Failed\", value: String(summary.failed) },\n      { title: \"Skipped\", value: String(summary.skipped) },\n      { title: \"Duration\", value: formatDuration(summary.durationMs) },\n    ],\n  });\n\n  // Failed tests container\n  if (summary.failedTests.length > 0) {\n    const displayedTests = summary.failedTests.slice(0, maxFailedTests);\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const failedItems: any[] = [\n      {\n        type: \"TextBlock\",\n        text: \"Failed Tests\",\n        weight: \"Bolder\",\n        spacing: \"Medium\",\n      },\n    ];\n\n    for (const t of displayedTests) {\n      failedItems.push({\n        type: \"TextBlock\",\n        text: `**${t.name}**`,\n        wrap: true,\n      });\n      if (t.error) {\n        const cleanError = truncate(stripAnsi(t.error), 500);\n        failedItems.push({\n          type: \"TextBlock\",\n          text: cleanError,\n          wrap: true,\n          fontType: \"Monospace\",\n          size: \"Small\",\n          color: \"Attention\",\n        });\n      }\n    }\n\n    if (summary.failedTests.length > maxFailedTests) {\n      failedItems.push({\n        type: \"TextBlock\",\n        text: `...and ${summary.failedTests.length - maxFailedTests} more`,\n        isSubtle: true,\n        spacing: \"Small\",\n      });\n    }\n\n    bodyItems.push({\n      type: \"Container\",\n      items: failedItems,\n    });\n  }\n\n  // CI info facts\n  if (summary.ci) {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const ciFacts: any[] = [];\n\n    if (summary.ci.displayName) {\n      ciFacts.push({ title: \"CI\", value: summary.ci.displayName });\n    }\n    if (summary.ci.branch) {\n      ciFacts.push({ title: \"Branch\", value: summary.ci.branch });\n    }\n    if (summary.ci.commitSha) {\n      ciFacts.push({ title: \"Commit\", value: summary.ci.commitSha.slice(0, 7) });\n    }\n    if (summary.ci.buildNumber) {\n      ciFacts.push({ title: \"Build\", value: `#${summary.ci.buildNumber}` });\n    }\n\n    if (ciFacts.length > 0) {\n      bodyItems.push({\n        type: \"FactSet\",\n        facts: ciFacts,\n        separator: true,\n      });\n    }\n  }\n\n  // Build the Adaptive Card\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const card: Record<string, any> = {\n    type: \"AdaptiveCard\",\n    $schema: \"http://adaptivecards.io/schemas/adaptive-card.json\",\n    version: \"1.4\",\n    body: bodyItems,\n  };\n\n  // \"View Report\" action\n  if (summary.reportUrl) {\n    card.actions = [\n      {\n        type: \"Action.OpenUrl\",\n        title: \"View Report\",\n        url: summary.reportUrl,\n      },\n    ];\n  }\n\n  return {\n    type: \"message\",\n    attachments: [\n      {\n        contentType: \"application/vnd.microsoft.card.adaptive\",\n        content: card,\n      },\n    ],\n  };\n}\n\n/**\n * Send a Teams notification via incoming webhook.\n *\n * Never throws. Returns `{ ok, error? }`.\n * Never logs the webhook URL.\n */\nexport async function sendTeamsNotification(\n  args: TeamsNotificationArgs,\n  deps: TeamsNotificationDeps,\n): Promise<TeamsNotificationResult> {\n  const { summary, webhookUrl, maxFailedTests = 5 } = args;\n  const { fetch, logger } = deps;\n\n  const payload = buildTeamsPayload(summary, maxFailedTests);\n\n  try {\n    const response = await fetch(webhookUrl, {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application/json\" },\n      body: JSON.stringify(payload),\n    });\n\n    if (!response.ok) {\n      const requestId = response.headers.get(\"x-request-id\") ?? undefined;\n      let bodyText = \"\";\n      try {\n        bodyText = await response.text();\n      } catch {\n        // ignore body read errors\n      }\n      const truncatedBody = truncate(bodyText, 200);\n      const idPart = requestId ? ` x-request-id=${requestId}` : \"\";\n      const errorMsg = `Teams notifier failed: HTTP ${response.status}${idPart} ${truncatedBody}`;\n      logger.warn(errorMsg);\n      return { ok: false, error: errorMsg };\n    }\n\n    return { ok: true };\n  } catch (err) {\n    const msg = err instanceof Error ? err.message : String(err);\n    const errorMsg = `Teams notifier failed: ${msg}`;\n    logger.warn(errorMsg);\n    return { ok: false, error: errorMsg };\n  }\n}\n","/**\n * HMAC-SHA256 signing for generic webhook payloads.\n *\n * Pure function, isolated for testing.\n * Uses node:crypto — zero new dependencies.\n */\n\nimport { createHmac } from \"node:crypto\";\n\n/** Result of HMAC signing. */\nexport interface HmacSignResult {\n  /** Signature in format \"sha256=<hex>\" (GitHub-style, widely recognized) */\n  signature: string;\n  /** ISO 8601 timestamp, only present when includeTimestamp is true */\n  timestamp?: string;\n}\n\n/**\n * Compute HMAC-SHA256 signature for a request body.\n *\n * When `includeTimestamp` is true, the signed input is `\"<timestamp>.<body>\"` and the\n * timestamp is returned for the caller to emit as a header.\n */\nexport function signBody(args: {\n  body: string;\n  secret: string;\n  includeTimestamp?: boolean;\n  /** Injectable for deterministic testing */\n  timestamp?: string;\n}): HmacSignResult {\n  let input: string;\n  let timestamp: string | undefined;\n\n  if (args.includeTimestamp) {\n    timestamp = args.timestamp ?? new Date().toISOString();\n    input = `${timestamp}.${args.body}`;\n  } else {\n    input = args.body;\n  }\n\n  const hex = createHmac(\"sha256\", args.secret)\n    .update(input, \"utf8\")\n    .digest(\"hex\");\n\n  return {\n    signature: `sha256=${hex}`,\n    timestamp,\n  };\n}\n","/**\n * Generic webhook notifier.\n *\n * Sends a versioned JSON envelope to arbitrary HTTP endpoints with optional\n * HMAC-SHA256 signing. Follows the fn(args, deps) pattern.\n *\n * Never throws. Never logs the webhook URL.\n */\n\nimport type { NotificationSummary } from \"./types\";\nimport type { GenericWebhookNotifierOptions, WebhookPayload } from \"./types\";\nimport { signBody } from \"./hmac\";\n\n/** Arguments for sendWebhookNotification. */\nexport interface WebhookNotificationArgs {\n  summary: NotificationSummary;\n  options: GenericWebhookNotifierOptions;\n  maxFailedTests?: number;\n}\n\n/** Injectable dependencies for sendWebhookNotification. */\nexport interface WebhookNotificationDeps {\n  fetch: typeof globalThis.fetch;\n  logger: { warn(msg: string): void };\n}\n\n/** Result of a webhook send attempt. */\nexport interface WebhookNotificationResult {\n  ok: boolean;\n  error?: string;\n}\n\n/**\n * Send a notification to a generic webhook endpoint.\n *\n * Never throws. Returns `{ ok, error? }`.\n * Never logs the webhook URL.\n */\nexport async function sendWebhookNotification(\n  args: WebhookNotificationArgs,\n  deps: WebhookNotificationDeps,\n): Promise<WebhookNotificationResult> {\n  const { summary, options } = args;\n  const { fetch, logger } = deps;\n\n  // Build versioned envelope\n  const payload: WebhookPayload = {\n    schemaVersion: 1,\n    event: \"test_run_finished\",\n    summary,\n  };\n  const body = JSON.stringify(payload);\n\n  // Build headers\n  const headers: Record<string, string> = { \"Content-Type\": \"application/json\" };\n\n  // Apply user-provided headers (can override Content-Type)\n  if (options.headers) {\n    for (const [key, value] of Object.entries(options.headers)) {\n      headers[key] = value;\n    }\n  }\n\n  // HMAC signing — headers always override user-supplied values\n  if (options.signer) {\n    const { secret, header, includeTimestamp, timestampHeader } = options.signer;\n    const result = signBody({ body, secret, includeTimestamp });\n    headers[header] = result.signature;\n    if (result.timestamp) {\n      headers[timestampHeader ?? \"X-Timestamp\"] = result.timestamp;\n    }\n  }\n\n  try {\n    const response = await fetch(options.url, {\n      method: options.method ?? \"POST\",\n      headers,\n      body,\n    });\n\n    if (!response.ok) {\n      const requestId = response.headers.get(\"x-request-id\") ?? undefined;\n      let snippet = \"\";\n      try {\n        snippet = (await response.text()).slice(0, 200);\n      } catch {\n        /* ignore */\n      }\n      const idPart = requestId ? ` x-request-id=${requestId}` : \"\";\n      const errorMsg = `webhook: HTTP ${response.status}${idPart} ${snippet}`;\n      logger.warn(errorMsg);\n      return { ok: false, error: errorMsg };\n    }\n\n    return { ok: true };\n  } catch (err) {\n    const msg = err instanceof Error ? err.message : String(err);\n    const errorMsg = `webhook: ${msg}`;\n    logger.warn(errorMsg);\n    return { ok: false, error: errorMsg };\n  }\n}\n","/**\n * Notification orchestrator.\n *\n * Builds a NotificationSummary from a TestRunResult and dispatches\n * to configured notifiers (Slack, Teams, generic webhooks) based on condition.\n *\n * Env fallback and defaults are resolved internally so CLI and reporters\n * behave identically with zero duplication.\n *\n * Follows the fn(args, deps) pattern.\n * Never throws. Never logs webhook URLs.\n */\n\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\nimport type { CIInfo } from \"executable-stories-core/types/ci\";\nimport type { RawCIInfo } from \"executable-stories-core/types/raw\";\nimport type { NotificationSummary, NotifyCondition, GenericWebhookNotifierOptions } from \"./types\";\nimport { sendSlackNotification } from \"./slack\";\nimport { sendTeamsNotification } from \"./teams\";\nimport { sendWebhookNotification } from \"./webhook\";\n\n/** Arguments for sendNotifications. */\nexport interface SendNotificationsArgs {\n  run: TestRunResult;\n  /** Notification config from FormatterOptions.notification (or CLI-assembled equivalent) */\n  notification?: {\n    slackWebhookUrl?: string;\n    teamsWebhookUrl?: string;\n    condition?: NotifyCondition;\n    reportUrl?: string;\n    maxFailedTests?: number;\n    webhooks?: GenericWebhookNotifierOptions[];\n  };\n}\n\n/** Injectable dependencies for sendNotifications. */\nexport interface SendNotificationsDeps {\n  fetch?: typeof globalThis.fetch;\n  logger: { warn(msg: string): void };\n  toCIInfo: (raw?: RawCIInfo) => CIInfo | undefined;\n  env?: Record<string, string | undefined>;\n}\n\n/** Build a NotificationSummary from a TestRunResult. */\nfunction buildSummary(\n  run: TestRunResult,\n  reportUrl: string | undefined,\n  toCIInfo: SendNotificationsDeps[\"toCIInfo\"],\n): NotificationSummary {\n  let passed = 0;\n  let failed = 0;\n  let skipped = 0;\n\n  const failedTests: NotificationSummary[\"failedTests\"] = [];\n\n  for (const tc of run.testCases) {\n    switch (tc.status) {\n      case \"passed\":\n        passed++;\n        break;\n      case \"failed\":\n        failed++;\n        failedTests.push({\n          testId: tc.id,\n          name: tc.story.scenario,\n          error: tc.errorMessage,\n        });\n        break;\n      case \"skipped\":\n      case \"pending\":\n        skipped++;\n        break;\n    }\n  }\n\n  // Derive CI info: use typed CIInfo from run.ci if available\n  // run.ci is the legacy CIInfo shape { name, url?, buildNumber? }\n  // Cast to RawCIInfo to pass through the converter\n  let ci: CIInfo | undefined;\n  if (run.ci) {\n    ci = toCIInfo(run.ci as unknown as RawCIInfo);\n  }\n\n  return {\n    total: run.testCases.length,\n    passed,\n    failed,\n    skipped,\n    durationMs: run.durationMs,\n    failedTests,\n    ci,\n    reportUrl,\n  };\n}\n\n/** Check if a notifier should fire given condition and failure count. */\nfunction shouldNotify(condition: NotifyCondition, failedCount: number): boolean {\n  if (condition === \"never\") return false;\n  if (condition === \"on-failure\" && failedCount === 0) return false;\n  return true;\n}\n\n/**\n * Send notifications to all configured channels.\n *\n * Resolves env fallbacks and defaults internally.\n * Never throws. Logs warnings for failures.\n * Never logs webhook URLs.\n */\nexport async function sendNotifications(\n  args: SendNotificationsArgs,\n  deps: SendNotificationsDeps,\n): Promise<void> {\n  const { run, notification } = args;\n  const { logger, toCIInfo } = deps;\n  const env = deps.env ?? process.env;\n\n  // Guard: if fetch is unavailable, warn and bail\n  if (!deps.fetch) {\n    logger.warn(\"notifications: skipped (fetch unavailable)\");\n    return;\n  }\n  const fetch = deps.fetch;\n\n  // Resolve env fallbacks + defaults\n  const slackWebhookUrl = notification?.slackWebhookUrl ?? env.SLACK_WEBHOOK_URL;\n  const teamsWebhookUrl = notification?.teamsWebhookUrl ?? env.TEAMS_WEBHOOK_URL;\n  const globalCondition: NotifyCondition = notification?.condition ?? \"on-failure\";\n  const reportUrl = notification?.reportUrl;\n  const maxFailedTests = notification?.maxFailedTests ?? 5;\n  const webhooks = notification?.webhooks ?? [];\n\n  // Nothing configured → early return\n  if (!slackWebhookUrl && !teamsWebhookUrl && webhooks.length === 0) {\n    return;\n  }\n\n  const summary = buildSummary(run, reportUrl, toCIInfo);\n\n  // Dispatch to configured notifiers concurrently\n  const promises: Promise<void>[] = [];\n\n  if (slackWebhookUrl && shouldNotify(globalCondition, summary.failed)) {\n    promises.push(\n      sendSlackNotification(\n        { summary, webhookUrl: slackWebhookUrl, maxFailedTests },\n        { fetch, logger },\n      ).then(() => undefined),\n    );\n  }\n\n  if (teamsWebhookUrl && shouldNotify(globalCondition, summary.failed)) {\n    promises.push(\n      sendTeamsNotification(\n        { summary, webhookUrl: teamsWebhookUrl, maxFailedTests },\n        { fetch, logger },\n      ).then(() => undefined),\n    );\n  }\n\n  // Generic webhooks — per-webhook condition override\n  for (const webhook of webhooks) {\n    const effectiveCondition = webhook.condition ?? globalCondition;\n    if (!shouldNotify(effectiveCondition, summary.failed)) continue;\n\n    promises.push(\n      sendWebhookNotification(\n        { summary, options: webhook, maxFailedTests },\n        { fetch, logger },\n      ).then(() => undefined),\n    );\n  }\n\n  // Wait for all, never throw\n  await Promise.allSettled(promises);\n}\n","/**\n * History store: load, save, update (fn(args, deps) pattern).\n */\n\nimport type { TestRunResult } from \"executable-stories-core/types/test-result\";\nimport type { HistoryEntry, HistoryStore, TestHistory } from \"./types\";\n\n// ============================================================================\n// Load\n// ============================================================================\n\nexport interface LoadHistoryArgs {\n  filePath: string;\n}\n\nexport interface LoadHistoryDeps {\n  readFile: (path: string) => string | undefined;\n  logger: { warn(msg: string): void };\n}\n\nfunction emptyStore(): HistoryStore {\n  return { version: 1, maxRuns: 10, tests: {}, lastUpdated: 0 };\n}\n\nexport function loadHistory(args: LoadHistoryArgs, deps: LoadHistoryDeps): HistoryStore {\n  const content = deps.readFile(args.filePath);\n  if (content === undefined) {\n    return emptyStore();\n  }\n\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(content);\n  } catch {\n    deps.logger.warn(`Failed to parse history file: ${args.filePath}`);\n    return emptyStore();\n  }\n\n  if (\n    typeof parsed !== \"object\" ||\n    parsed === null ||\n    (parsed as Record<string, unknown>).version !== 1\n  ) {\n    deps.logger.warn(\n      `Unknown history version in ${args.filePath}, expected version 1`,\n    );\n    return emptyStore();\n  }\n\n  const obj = parsed as Record<string, unknown>;\n  if (typeof obj.tests !== \"object\" || obj.tests === null || Array.isArray(obj.tests)) {\n    deps.logger.warn(\n      `Malformed history store in ${args.filePath}: tests must be a non-null object`,\n    );\n    return emptyStore();\n  }\n\n  return parsed as HistoryStore;\n}\n\n// ============================================================================\n// Save\n// ============================================================================\n\nexport interface SaveHistoryArgs {\n  filePath: string;\n  store: HistoryStore;\n}\n\nexport interface SaveHistoryDeps {\n  writeFile: (path: string, content: string) => void;\n}\n\nexport function saveHistory(args: SaveHistoryArgs, deps: SaveHistoryDeps): void {\n  deps.writeFile(args.filePath, JSON.stringify(args.store, null, 2));\n}\n\n// ============================================================================\n// Update (pure function, no deps)\n// ============================================================================\n\nexport interface UpdateHistoryArgs {\n  store: HistoryStore;\n  run: TestRunResult;\n  maxRuns: number;\n}\n\nexport function updateHistory(args: UpdateHistoryArgs): HistoryStore {\n  const { store, run, maxRuns } = args;\n  const newTests: Record<string, TestHistory> = { ...store.tests };\n\n  for (const tc of run.testCases) {\n    const entry: HistoryEntry = {\n      runId: run.runId,\n      timestamp: run.startedAtMs,\n      status: tc.status,\n      durationMs: tc.durationMs,\n      ci: run.ci\n        ? {\n            provider: undefined,\n            branch: run.ci.branch,\n            commitSha: run.ci.commitSha,\n          }\n        : undefined,\n    };\n\n    const existing = newTests[tc.id];\n    if (existing) {\n      const updatedEntries = [...existing.entries, entry];\n      // Trim per-test entries to maxRuns (keep latest)\n      const trimmed =\n        updatedEntries.length > maxRuns\n          ? updatedEntries.slice(updatedEntries.length - maxRuns)\n          : updatedEntries;\n      newTests[tc.id] = {\n        ...existing,\n        testName: tc.story.scenario,\n        sourceFile: tc.sourceFile,\n        sourceLine: tc.sourceLine,\n        entries: trimmed,\n      };\n    } else {\n      newTests[tc.id] = {\n        testId: tc.id,\n        testName: tc.story.scenario,\n        sourceFile: tc.sourceFile,\n        sourceLine: tc.sourceLine,\n        entries: [entry],\n      };\n    }\n  }\n\n  return {\n    version: 1,\n    maxRuns,\n    tests: newTests,\n    lastUpdated: Date.now(),\n  };\n}\n","/**\n * Centralized sample-size policy for history metrics.\n *\n * Easy to tune without hunting across files.\n */\n\n/** Minimum duration-bearing entries for performance trend analysis. */\nexport const MIN_PERF_SAMPLES = 6;\n\n/** Minimum entries before showing badges/metrics in reports. */\nexport const MIN_METRIC_SAMPLES = 5;\n\n/** Minimum entries for flakiness calculation (below this → \"stable\"). */\nexport const MIN_FLAKINESS_SAMPLES = 3;\n\n/** Check whether an array meets the minimum sample threshold. */\nexport function hasSufficientHistory(\n  entries: unknown[],\n  min: number,\n): boolean {\n  return entries.length >= min;\n}\n","/**\n * Flakiness calculation based on status transitions.\n */\n\nimport type { HistoryEntry, FlakinessLevel } from \"./types\";\nimport { MIN_FLAKINESS_SAMPLES } from \"./sample-policy\";\n\nexport interface FlakinessResult {\n  flakinessLevel: FlakinessLevel;\n  flakinessScore: number;\n  failureRate: number;\n  longestPassStreak: number;\n  longestFailStreak: number;\n}\n\nexport function calculateFlakiness(args: {\n  entries: HistoryEntry[];\n}): FlakinessResult {\n  const { entries } = args;\n\n  // Only count pass/fail entries (exclude skipped/pending)\n  const countable = entries.filter(\n    (e) => e.status === \"passed\" || e.status === \"failed\",\n  );\n\n  const failures = countable.filter((e) => e.status === \"failed\").length;\n  const failureRate = countable.length > 0 ? failures / countable.length : 0;\n\n  // Calculate streaks\n  let longestPassStreak = 0;\n  let longestFailStreak = 0;\n  let currentPassStreak = 0;\n  let currentFailStreak = 0;\n\n  for (const e of countable) {\n    if (e.status === \"passed\") {\n      currentPassStreak++;\n      currentFailStreak = 0;\n      if (currentPassStreak > longestPassStreak) {\n        longestPassStreak = currentPassStreak;\n      }\n    } else {\n      currentFailStreak++;\n      currentPassStreak = 0;\n      if (currentFailStreak > longestFailStreak) {\n        longestFailStreak = currentFailStreak;\n      }\n    }\n  }\n\n  // The sample threshold gates the *classification* only: two runs cannot tell\n  // you a scenario is flaky. The counts above are plain arithmetic and stay\n  // honest at any sample size — reporting failureRate 0 for a scenario that has\n  // only ever failed is worse than reporting nothing.\n  if (countable.length < MIN_FLAKINESS_SAMPLES) {\n    return {\n      flakinessLevel: \"stable\",\n      flakinessScore: 0,\n      failureRate,\n      longestPassStreak,\n      longestFailStreak,\n    };\n  }\n\n  // Count transitions (consecutive entries with different status)\n  let transitions = 0;\n  for (let i = 1; i < countable.length; i++) {\n    if (countable[i].status !== countable[i - 1].status) {\n      transitions++;\n    }\n  }\n\n  const transitionScore = transitions / (countable.length - 1);\n\n  // Classification\n  let flakinessLevel: FlakinessLevel;\n  if (\n    transitionScore > 0.5 ||\n    (transitionScore > 0.3 && failureRate > 0.2)\n  ) {\n    flakinessLevel = \"flaky\";\n  } else if (transitionScore > 0.2 || failureRate > 0.3) {\n    flakinessLevel = \"unstable\";\n  } else {\n    flakinessLevel = \"stable\";\n  }\n\n  return {\n    flakinessLevel,\n    flakinessScore: transitionScore,\n    failureRate,\n    longestPassStreak,\n    longestFailStreak,\n  };\n}\n","/**\n * Performance trend detection via half-split comparison.\n */\n\nimport type { HistoryEntry, PerformanceTrend } from \"./types\";\nimport { MIN_PERF_SAMPLES } from \"./sample-policy\";\n\nexport interface PerformanceResult {\n  trend: PerformanceTrend;\n  avgDurationMs: number;\n}\n\nexport function detectPerformanceTrend(args: {\n  entries: HistoryEntry[];\n}): PerformanceResult {\n  const { entries } = args;\n\n  // Filter out entries with no meaningful duration data\n  const countable = entries.filter(\n    (e) => e.status !== \"skipped\" && e.status !== \"pending\",\n  );\n\n  if (countable.length === 0) {\n    return { trend: \"stable\", avgDurationMs: 0 };\n  }\n\n  const avgAll =\n    countable.reduce((sum, e) => sum + e.durationMs, 0) / countable.length;\n\n  if (countable.length < MIN_PERF_SAMPLES) {\n    return { trend: \"stable\", avgDurationMs: avgAll };\n  }\n\n  // Split into earlier half and recent half\n  const mid = Math.floor(countable.length / 2);\n  const earlier = countable.slice(0, mid);\n  const recent = countable.slice(mid);\n\n  const earlierAvg =\n    earlier.reduce((sum, e) => sum + e.durationMs, 0) / earlier.length;\n  const recentAvg =\n    recent.reduce((sum, e) => sum + e.durationMs, 0) / recent.length;\n\n  let trend: PerformanceTrend;\n  if (earlierAvg === 0) {\n    trend = \"stable\";\n  } else {\n    const change = (recentAvg - earlierAvg) / earlierAvg;\n    if (change > 0.1) {\n      trend = \"regressing\";\n    } else if (change < -0.1) {\n      trend = \"improving\";\n    } else {\n      trend = \"stable\";\n    }\n  }\n\n  return { trend, avgDurationMs: avgAll };\n}\n","/**\n * Stability grade calculation (composite score).\n */\n\nimport type { StabilityGrade } from \"./types\";\n\nexport interface CalculateStabilityArgs {\n  passRate: number;\n  flakinessScore: number;\n  longestPassStreak: number;\n  sampleSize: number;\n}\n\nexport function calculateStability(args: CalculateStabilityArgs): StabilityGrade {\n  const { passRate, flakinessScore, longestPassStreak, sampleSize } = args;\n\n  const inverseFlakiness = 1 - flakinessScore;\n  const streakNorm = longestPassStreak / Math.min(sampleSize, 10);\n\n  const score = passRate * 0.6 + inverseFlakiness * 0.3 + streakNorm * 0.1;\n\n  if (score >= 0.95) return \"A\";\n  if (score >= 0.85) return \"B\";\n  if (score >= 0.70) return \"C\";\n  if (score >= 0.50) return \"D\";\n  return \"F\";\n}\n","/**\n * Composite test metrics from history entries.\n */\n\nimport type { HistoryEntry, TestMetrics } from \"./types\";\nimport { calculateFlakiness } from \"./flakiness\";\nimport { detectPerformanceTrend } from \"./performance\";\nimport { calculateStability } from \"./stability\";\n\nexport function computeTestMetrics(args: {\n  testId: string;\n  entries: HistoryEntry[];\n}): TestMetrics {\n  const { testId, entries } = args;\n\n  const flakiness = calculateFlakiness({ entries });\n  const perf = detectPerformanceTrend({ entries });\n\n  // Calculate pass rate (excluding skipped/pending)\n  const countable = entries.filter(\n    (e) => e.status === \"passed\" || e.status === \"failed\",\n  );\n  const passRate =\n    countable.length > 0\n      ? countable.filter((e) => e.status === \"passed\").length / countable.length\n      : 1;\n\n  const stabilityGrade = calculateStability({\n    passRate,\n    flakinessScore: flakiness.flakinessScore,\n    longestPassStreak: flakiness.longestPassStreak,\n    sampleSize: entries.length,\n  });\n\n  // Calculate consecutive failures from the tail end\n  let consecutiveFailures = 0;\n  for (let i = entries.length - 1; i >= 0; i--) {\n    if (entries[i].status === \"failed\") {\n      consecutiveFailures++;\n    } else {\n      break;\n    }\n  }\n\n  return {\n    testId,\n    flakinessLevel: flakiness.flakinessLevel,\n    flakinessScore: flakiness.flakinessScore,\n    failureRate: flakiness.failureRate,\n    stabilityGrade,\n    performanceTrend: perf.trend,\n    avgDurationMs: perf.avgDurationMs,\n    passRate,\n    longestPassStreak: flakiness.longestPassStreak,\n    consecutiveFailures,\n    sampleSize: entries.length,\n  };\n}\n","/**\n * List scenarios from a test run (fn(args, deps) pattern).\n * Produces text table or JSON output.\n */\n\nimport type { TestCaseResult } from \"executable-stories-core/types/test-result\";\nimport type { StoryStep } from \"executable-stories-core/types/story\";\n\nexport interface ListScenariosArgs {\n  testCases: TestCaseResult[];\n  format: \"text\" | \"json\" | \"csv\" | \"markdown-table\";\n  /** Emit compact (single-line) JSON for agent consumption. Only affects \"json\". Default false. */\n  minify?: boolean;\n}\n\nexport type ListScenariosDeps = Record<string, never>;\n\nconst STATUS_ICONS: Record<string, string> = {\n  passed: \"\\u2705\",\n  failed: \"\\u274C\",\n  skipped: \"\\u23ED\\uFE0F\",\n  pending: \"\\u23F3\",\n};\n\nexport function listScenarios(\n  args: ListScenariosArgs,\n  _deps: ListScenariosDeps,\n): string {\n  const { testCases, format, minify = false } = args;\n\n  if (format === \"json\") {\n    const items = testCases.map((tc) => ({\n      id: tc.id,\n      scenario: tc.story.scenario,\n      status: tc.status,\n      sourceFile: tc.sourceFile,\n      sourceLine: tc.sourceLine,\n      suitePath: tc.story.suitePath ?? tc.titlePath.slice(0, -1),\n      tags: tc.tags,\n      tickets: tc.story.tickets ?? [],\n      covers: tc.story.covers ?? [],\n      durationMs: tc.durationMs,\n      error: tc.errorMessage\n        ? {\n            message: tc.errorMessage,\n            stack: tc.errorStack,\n          }\n        : undefined,\n      steps: tc.story.steps.map((step, index) => toScenarioStep(step, index, tc)),\n      docKinds: collectDocKinds(tc),\n    }));\n    return minify ? JSON.stringify(items) : JSON.stringify(items, null, 2);\n  }\n\n  if (format === \"csv\") {\n    const header = \"id,scenario,status,sourceFile,sourceLine,tags\";\n    const rows = testCases.map((tc) => {\n      const fields = [\n        tc.id,\n        tc.story.scenario,\n        tc.status,\n        tc.sourceFile,\n        String(tc.sourceLine),\n        tc.tags.join(\" \"),\n      ];\n      return fields\n        .map((f) => {\n          if (f.includes(\",\") || f.includes('\"') || f.includes(\"\\n\")) {\n            return `\"${f.replace(/\"/g, '\"\"')}\"`;\n          }\n          return f;\n        })\n        .join(\",\");\n    });\n    return [header, ...rows].join(\"\\n\");\n  }\n\n  if (format === \"markdown-table\") {\n    const header = \"| Status | Scenario | Location | Tags |\";\n    const divider = \"|--------|----------|----------|------|\";\n    const rows = testCases.map((tc) => {\n      const icon = STATUS_ICONS[tc.status] ?? \"?\";\n      const location = `${tc.sourceFile}:${tc.sourceLine}`;\n      const tags = tc.tags.map((t) => `@${t}`).join(\" \");\n      return `| ${icon} | ${tc.story.scenario} | ${location} | ${tags} |`;\n    });\n    return [header, divider, ...rows].join(\"\\n\");\n  }\n\n  // Text format\n  if (testCases.length === 0) {\n    return \"No scenarios found.\";\n  }\n\n  const sorted = [...testCases].sort((a, b) => {\n    const rank = { failed: 0, pending: 1, skipped: 2, passed: 3 };\n    if (rank[a.status] !== rank[b.status]) {\n      return rank[a.status] - rank[b.status];\n    }\n    if (a.sourceFile !== b.sourceFile) {\n      return a.sourceFile.localeCompare(b.sourceFile);\n    }\n    if (a.sourceLine !== b.sourceLine) {\n      return a.sourceLine - b.sourceLine;\n    }\n    return a.story.scenario.localeCompare(b.story.scenario);\n  });\n\n  const summary = {\n    total: sorted.length,\n    failed: sorted.filter((tc) => tc.status === \"failed\").length,\n    pending: sorted.filter((tc) => tc.status === \"pending\").length,\n    skipped: sorted.filter((tc) => tc.status === \"skipped\").length,\n    passed: sorted.filter((tc) => tc.status === \"passed\").length,\n  };\n\n  const lines = [\n    `Review summary: ${summary.failed} failed, ${summary.pending} pending, ${summary.skipped} skipped, ${summary.passed} passed (${summary.total} total)`,\n    summary.failed > 0\n      ? \"Priority: failed scenarios are listed first for review.\"\n      : \"Priority: no failed scenarios detected.\",\n    \"\",\n    ...sorted.map((tc) => {\n    const icon = STATUS_ICONS[tc.status] ?? \"?\";\n    const status = tc.status.padEnd(7);\n    const scenario = tc.story.scenario;\n    const location = `${tc.sourceFile}:${tc.sourceLine}`;\n    const tags = tc.tags.length > 0 ? tc.tags.join(\", \") : \"\";\n    return `${icon} ${status}  ${scenario}  ${location}${tags ? `  ${tags}` : \"\"}`;\n    }),\n  ];\n\n  return lines.join(\"\\n\");\n}\n\nfunction toScenarioStep(\n  step: StoryStep,\n  index: number,\n  testCase: TestCaseResult,\n): {\n  id?: string;\n  index: number;\n  keyword: StoryStep[\"keyword\"];\n  text: string;\n  status: TestCaseResult[\"status\"];\n  durationMs: number;\n  errorMessage?: string;\n  mode?: StoryStep[\"mode\"];\n  docKinds: string[];\n} {\n  const result = testCase.stepResults.find(\n    (candidate) => candidate.index === index || candidate.stepId === step.id,\n  );\n\n  return {\n    id: step.id,\n    index,\n    keyword: step.keyword,\n    text: step.text,\n    status: result?.status ?? testCase.status,\n    durationMs: result?.durationMs ?? step.durationMs ?? 0,\n    errorMessage: result?.errorMessage,\n    mode: step.mode,\n    docKinds: (step.docs ?? []).map((doc) => doc.kind),\n  };\n}\n\nfunction collectDocKinds(testCase: TestCaseResult): string[] {\n  const kinds = new Set<string>();\n\n  for (const doc of testCase.story.docs ?? []) {\n    kinds.add(doc.kind);\n  }\n\n  for (const step of testCase.story.steps) {\n    for (const doc of step.docs ?? []) {\n      kinds.add(doc.kind);\n    }\n  }\n\n  return [...kinds].sort();\n}\n","/**\n * `check` — context-efficient backpressure for coding agents.\n *\n * The principle (from \"Stop Babysitting Your Coding Agent. Give It Backpressure.\"):\n * compress success, expand failure. Passing scenarios collapse to a single count\n * line. Each failing scenario expands to its Given/When/Then narrative, the step\n * that broke, the error, and the product code it `covers` — so the agent gets an\n * actionable, intent-carrying signal instead of a wall of green.\n *\n * When a baseline run is supplied, the report also folds in what *regressed* and\n * what got *fixed* since the last run — the \"retained\" property of effective\n * feedback. Reuses the same status-transition vocabulary as {@link classifyStatusChange}.\n */\n\nimport type { TestCaseResult, TestStatus } from \"executable-stories-core/types/test-result\";\nimport type { StepKeyword } from \"executable-stories-core/types/story\";\nimport { formatDuration } from \"executable-stories-core/utils/duration\";\nimport { failingScenarioMessage } from \"./scenario-failure\";\n\nexport interface CheckArgs {\n  testCases: TestCaseResult[];\n  /** Baseline scenario statuses keyed by scenario id, for regressed/fixed deltas. */\n  baseline?: Map<string, TestStatus>;\n  /** Per-scenario time budget. Scenarios above it are named (see {@link CheckSlow}). */\n  maxDurationMs?: number;\n  format: \"text\" | \"json\";\n}\n\nexport type CheckDeps = Record<string, never>;\n\n/** A single rendered step inside a failing scenario. */\nexport interface CheckStep {\n  keyword: StepKeyword;\n  text: string;\n  /** True when this step is the one that failed. */\n  failed: boolean;\n}\n\n/** Expanded detail for one failing scenario — the actionable payload. */\nexport interface CheckFailure {\n  id: string;\n  scenario: string;\n  /** `sourceFile:sourceLine` */\n  location: string;\n  steps: CheckStep[];\n  /** Failing step's error if isolated, else the scenario-level error. */\n  errorMessage?: string;\n  /** Product-code paths/globs this scenario exercises (what to fix). */\n  covers: string[];\n  tickets: string[];\n  /** True when this scenario was passing in the baseline run. */\n  regressed: boolean;\n}\n\n/**\n * A scenario that is switched off: skipped or pending, but not `it.todo`.\n * A planned scenario is a spec waiting for code; a turned-off one is a spec\n * you stopped validating, and the pack forgets it exists unless it is named.\n */\nexport interface CheckTurnedOff {\n  id: string;\n  scenario: string;\n  /** `sourceFile:sourceLine` */\n  location: string;\n  status: \"skipped\" | \"pending\";\n  tickets: string[];\n}\n\n/**\n * A scenario that took longer than the budget. A slow suite is usually two or\n * three scenarios, and nobody knows which until something names them.\n */\nexport interface CheckSlow {\n  id: string;\n  scenario: string;\n  /** `sourceFile:sourceLine` */\n  location: string;\n  durationMs: number;\n}\n\nexport interface CheckReport {\n  summary: {\n    total: number;\n    passed: number;\n    failed: number;\n    skipped: number;\n    pending: number;\n  };\n  failures: CheckFailure[];\n  /** Scenarios switched off — named, not just counted (see {@link CheckTurnedOff}). */\n  turnedOff: CheckTurnedOff[];\n  /** Scenarios over `--max-duration`, longest first. Empty without a budget. */\n  overBudget: CheckSlow[];\n  /** The budget those scenarios broke, for the message that names it. */\n  maxDurationMs?: number;\n  /** Count of scenarios that went passed → failed vs. the baseline. */\n  regressed: number;\n  /** Count of scenarios that went failed → passed vs. the baseline. */\n  fixed: number;\n  /** Whether a baseline was supplied (so callers know if deltas are meaningful). */\n  comparedToBaseline: boolean;\n}\n\nconst ICON_PASS = \"✓\"; // ✓\nconst ICON_FAIL = \"✗\"; // ✗\nconst ICON_SKIP = \"⊘\"; // ⊘\nconst ICON_PENDING = \"⏳\"; // ⏳\nconst ICON_WARN = \"⚠\"; // ⚠\n\n/**\n * Build a structured check report from canonical test cases.\n * Pure: no IO. Callers render it as text or JSON and decide the exit code.\n */\nexport function buildCheck(args: CheckArgs, _deps: CheckDeps = {}): CheckReport {\n  const { testCases, baseline, maxDurationMs } = args;\n\n  const summary = {\n    total: testCases.length,\n    passed: testCases.filter((tc) => tc.status === \"passed\").length,\n    failed: testCases.filter((tc) => tc.status === \"failed\").length,\n    skipped: testCases.filter((tc) => tc.status === \"skipped\").length,\n    pending: testCases.filter((tc) => tc.status === \"pending\").length,\n  };\n\n  let regressed = 0;\n  let fixed = 0;\n  if (baseline) {\n    for (const tc of testCases) {\n      const before = baseline.get(tc.id);\n      if (before === \"passed\" && tc.status === \"failed\") regressed += 1;\n      if (before === \"failed\" && tc.status === \"passed\") fixed += 1;\n    }\n  }\n\n  const failures: CheckFailure[] = testCases\n    .filter((tc) => tc.status === \"failed\")\n    .map((tc) => toFailure(tc, baseline))\n    // Regressions first (most actionable: an edit just broke a green scenario),\n    // then stable by source location for deterministic output.\n    .sort((a, b) => {\n      if (a.regressed !== b.regressed) return a.regressed ? -1 : 1;\n      return a.location.localeCompare(b.location);\n    });\n\n  const turnedOff: CheckTurnedOff[] = testCases\n    .filter(\n      (tc) =>\n        (tc.status === \"skipped\" || tc.status === \"pending\") && tc.rawStatus !== \"todo\",\n    )\n    .map((tc) => ({\n      id: tc.id,\n      scenario: tc.story.scenario,\n      location: `${tc.sourceFile}:${tc.sourceLine}`,\n      status: tc.status as \"skipped\" | \"pending\",\n      tickets: (tc.story.tickets ?? []).map((t) => t.id),\n    }))\n    .sort((a, b) => a.location.localeCompare(b.location));\n\n  const overBudget: CheckSlow[] =\n    maxDurationMs === undefined\n      ? []\n      : testCases\n          .filter((tc) => tc.durationMs > maxDurationMs)\n          .map((tc) => ({\n            id: tc.id,\n            scenario: tc.story.scenario,\n            location: `${tc.sourceFile}:${tc.sourceLine}`,\n            durationMs: tc.durationMs,\n          }))\n          .sort((a, b) => b.durationMs - a.durationMs);\n\n  return {\n    summary,\n    failures,\n    turnedOff,\n    overBudget,\n    ...(maxDurationMs === undefined ? {} : { maxDurationMs }),\n    regressed,\n    fixed,\n    comparedToBaseline: baseline !== undefined,\n  };\n}\n\nfunction toFailure(\n  tc: TestCaseResult,\n  baseline?: Map<string, TestStatus>,\n): CheckFailure {\n  const failedIndexes = new Set(\n    tc.stepResults.filter((s) => s.status === \"failed\").map((s) => s.index),\n  );\n\n  const steps: CheckStep[] = tc.story.steps.map((step, index) => ({\n    keyword: step.keyword,\n    text: step.text,\n    failed: failedIndexes.has(index),\n  }));\n\n  return {\n    id: tc.id,\n    scenario: tc.story.scenario,\n    location: `${tc.sourceFile}:${tc.sourceLine}`,\n    steps,\n    errorMessage: failingScenarioMessage(tc),\n    covers: tc.story.covers ?? [],\n    tickets: (tc.story.tickets ?? []).map((t) => t.id),\n    regressed: baseline?.get(tc.id) === \"passed\",\n  };\n}\n\n/**\n * Render the check report. Text is the default agent/human surface\n * (compressed success, expanded failure); JSON is the machine contract.\n */\nexport function renderCheck(report: CheckReport, format: \"text\" | \"json\"): string {\n  return format === \"json\"\n    ? JSON.stringify(report, null, 2)\n    : renderCheckText(report);\n}\n\nfunction renderCheckText(report: CheckReport): string {\n  const { summary, failures } = report;\n\n  // One-line headline. Success is compressed to counts — no per-scenario noise.\n  const headlineParts = [`${ICON_PASS} ${summary.passed} passed`];\n  if (summary.failed > 0) headlineParts.push(`${ICON_FAIL} ${summary.failed} failed`);\n  if (summary.skipped > 0) headlineParts.push(`${ICON_SKIP} ${summary.skipped} skipped`);\n  if (summary.pending > 0) headlineParts.push(`${ICON_PENDING} ${summary.pending} pending`);\n  const headline = `${headlineParts.join(\"   \")}   (${summary.total} scenarios)`;\n\n  if (failures.length === 0) {\n    const lines = [headline];\n    if (report.comparedToBaseline && report.fixed > 0) {\n      lines.push(`${ICON_PASS} ${report.fixed} fixed since baseline.`);\n    }\n    // \"Green\" has to mean the whole pack ran. A run with scenarios switched\n    // off is green about less than it looks, so say which ones.\n    lines.push(\n      report.turnedOff.length === 0\n        ? \"All scenarios green.\"\n        : \"All running scenarios green.\",\n    );\n    lines.push(...turnedOffLines(report.turnedOff));\n    lines.push(...overBudgetLines(report));\n    return lines.join(\"\\n\").trimEnd();\n  }\n\n  const lines = [headline, \"\"];\n\n  for (const f of failures) {\n    lines.push(`${ICON_FAIL} ${f.scenario}${f.regressed ? \"  (regressed)\" : \"\"}`);\n    lines.push(`  ${f.location}`);\n    for (const step of f.steps) {\n      const marker = step.failed ? `  ${ICON_FAIL} ` : \"    \";\n      lines.push(`${marker}${step.keyword} ${step.text}`);\n    }\n    if (f.errorMessage) {\n      // Keep the error to its first line in text mode; full detail lives in JSON.\n      const firstLine = f.errorMessage.split(\"\\n\")[0];\n      lines.push(`    → ${firstLine}`);\n    }\n    if (f.covers.length > 0) {\n      lines.push(`  covers: ${f.covers.join(\", \")}`);\n    }\n    if (f.tickets.length > 0) {\n      lines.push(`  ticket: ${f.tickets.join(\", \")}`);\n    }\n    lines.push(\"\");\n  }\n\n  lines.push(...turnedOffLines(report.turnedOff));\n  if (report.turnedOff.length > 0) lines.push(\"\");\n  lines.push(...overBudgetLines(report));\n\n  // Retained signal: what changed since the baseline.\n  if (report.comparedToBaseline) {\n    if (report.regressed > 0) {\n      lines.push(`${ICON_WARN} ${report.regressed} regressed since baseline (was passing).`);\n    }\n    if (report.fixed > 0) {\n      lines.push(`${ICON_PASS} ${report.fixed} fixed since baseline.`);\n    }\n    if (report.regressed === 0 && report.fixed === 0) {\n      lines.push(\"No status changes vs. baseline.\");\n    }\n  }\n\n  return lines.join(\"\\n\").trimEnd();\n}\n\n/**\n * Name every switched-off scenario. Counting them is how a pack quietly rots:\n * someone turns one off for a decision that never comes back, and the headline\n * still reads green. A ticket next to each one is what makes the list\n * reviewable; missing tickets are called out rather than left blank.\n */\nfunction overBudgetLines(report: CheckReport): string[] {\n  if (report.overBudget.length === 0 || report.maxDurationMs === undefined) return [];\n  const budget = formatDuration(report.maxDurationMs);\n  const lines = [\n    `${ICON_WARN} ${report.overBudget.length} scenario${report.overBudget.length === 1 ? \" is\" : \"s are\"} over the ${budget} budget:`,\n  ];\n  for (const s of report.overBudget) {\n    lines.push(`  ${formatDuration(s.durationMs)}  ${s.scenario}  (${s.location})`);\n  }\n  return lines;\n}\n\nfunction turnedOffLines(turnedOff: CheckTurnedOff[]): string[] {\n  if (turnedOff.length === 0) return [];\n  const lines = [\"\", `${ICON_WARN} ${turnedOff.length} turned off (not validated):`];\n  for (const t of turnedOff) {\n    const icon = t.status === \"skipped\" ? ICON_SKIP : ICON_PENDING;\n    lines.push(`  ${icon} ${t.scenario}`);\n    lines.push(\n      `    ${t.location}  ${t.tickets.length > 0 ? `ticket: ${t.tickets.join(\", \")}` : \"no ticket\"}`,\n    );\n  }\n  return lines;\n}\n","import type { TestCaseResult } from \"executable-stories-core/types/test-result\";\n\n/**\n * The error message a reader should see for a failed scenario: the failing\n * step's message when one is isolated (most specific), otherwise the\n * scenario-level error. Shared by the agent-facing commands (`check`,\n * `triage`) so the choice stays consistent between them.\n */\nexport function failingScenarioMessage(tc: TestCaseResult): string | undefined {\n  const failingStep = tc.stepResults.find((s) => s.status === \"failed\" && s.errorMessage);\n  return failingStep?.errorMessage ?? tc.errorMessage;\n}\n","/**\n * `goal` — a behavioral definition-of-done for autonomous agent loops.\n *\n * A `/goal`-style loop keeps working until a verifiable condition holds. This\n * expresses that condition in behavior, not \"tests green and lint clean\": the\n * required scenarios pass, nothing regressed, and nobody weakened a scenario to\n * fake done (the ratchet). It returns a clear met / not-met verdict and what is\n * left, so the loop and the human reading after it can both trust \"done\".\n */\n\nimport type { TestCaseResult, TestRunResult, TestStatus } from \"executable-stories-core/types/test-result\";\nimport { asNoul, type JevClient } from \"./jev\";\n\n/** Result of one required selector (a tag, ticket, or scenario that must pass). */\nexport interface GoalRequirementResult {\n  /** Human-readable selector, e.g. \"tag:US-101\", \"ticket:CART-9\", \"all scenarios\". */\n  selector: string;\n  matched: number;\n  passed: number;\n  /** Titles of matched scenarios that did not pass. */\n  failing: string[];\n  /** matched > 0 and every matched scenario passed. */\n  met: boolean;\n}\n\n/** A scenario that was removed or weakened versus the baseline (anti-fake-done). */\nexport interface RatchetViolation {\n  id: string;\n  title: string;\n  kind: \"removed\" | \"disabled\" | \"weakened\";\n  detail: string;\n}\n\nexport interface GoalReport {\n  /** True only when every requirement is met and no enforced guard fired. */\n  met: boolean;\n  requirements: GoalRequirementResult[];\n  /** Scenarios that went passed -> failed versus baseline (when --no-regressions). */\n  regressions: Array<{ id: string; title: string }>;\n  regressionsEnforced: boolean;\n  ratchet: {\n    enforced: boolean;\n    violations: RatchetViolation[];\n    /** Jev's read of scenarios that changed without shrinking. Never affects `met`. */\n    advisories: RatchetViolation[];\n  };\n}\n\nexport interface GoalArgs {\n  run: TestRunResult;\n  baseline?: TestRunResult;\n  requireTags: string[];\n  requireTickets: string[];\n  requireScenarios: string[];\n  enforceNoRegressions: boolean;\n  enforceRatchet: boolean;\n  format: \"text\" | \"json\";\n}\n\nexport type GoalDeps = Record<string, never>;\n\nconst ACTIVE: TestStatus[] = [\"passed\", \"failed\"];\n\nexport function buildGoal(args: GoalArgs, _deps: GoalDeps = {}): GoalReport {\n  const { run, baseline } = args;\n  const cases = run.testCases;\n\n  // Each required tag/ticket/scenario becomes a selector that must resolve to\n  // at least one passing scenario. With none declared, the goal is \"all pass\".\n  const selectors: Array<{ label: string; match: (tc: TestCaseResult) => boolean }> = [\n    ...args.requireTags.map((tag) => ({ label: `tag:${tag}`, match: (tc: TestCaseResult) => tc.tags.includes(tag) })),\n    ...args.requireTickets.map((id) => ({ label: `ticket:${id}`, match: (tc: TestCaseResult) => (tc.story.tickets ?? []).some((t) => t.id === id) })),\n    ...args.requireScenarios.map((sel) => ({ label: `scenario:${sel}`, match: (tc: TestCaseResult) => tc.id === sel || tc.story.scenario === sel })),\n  ];\n\n  const requirements: GoalRequirementResult[] =\n    selectors.length === 0\n      ? [evaluate(\"all scenarios\", cases)]\n      : selectors.map((s) => evaluate(s.label, cases.filter(s.match)));\n\n  const regressions: GoalReport[\"regressions\"] = [];\n  if (baseline && args.enforceNoRegressions) {\n    const before = statusMap(baseline);\n    for (const tc of cases) {\n      if (before.get(tc.id) === \"passed\" && tc.status === \"failed\") {\n        regressions.push({ id: tc.id, title: tc.story.scenario });\n      }\n    }\n  }\n\n  const violations: RatchetViolation[] = [];\n  if (baseline && args.enforceRatchet) {\n    const current = new Map(cases.map((tc) => [tc.id, tc]));\n    for (const base of baseline.testCases) {\n      const now = current.get(base.id);\n      if (!now) {\n        violations.push({ id: base.id, title: base.story.scenario, kind: \"removed\", detail: \"scenario no longer present\" });\n        continue;\n      }\n      if (ACTIVE.includes(base.status) && (now.status === \"skipped\" || now.status === \"pending\")) {\n        violations.push({ id: base.id, title: base.story.scenario, kind: \"disabled\", detail: `${base.status} -> ${now.status}` });\n      }\n      const baseSteps = base.story.steps.length;\n      const nowSteps = now.story.steps.length;\n      if (nowSteps < baseSteps) {\n        violations.push({ id: base.id, title: base.story.scenario, kind: \"weakened\", detail: `${baseSteps} steps -> ${nowSteps} steps` });\n      }\n    }\n  }\n\n  const met =\n    requirements.every((r) => r.met) &&\n    regressions.length === 0 &&\n    violations.length === 0;\n\n  return {\n    met,\n    requirements,\n    regressions,\n    regressionsEnforced: Boolean(baseline && args.enforceNoRegressions),\n    ratchet: { enforced: Boolean(baseline && args.enforceRatchet), violations, advisories: [] },\n  };\n}\n\n/** Jev must be this sure before a rewrite is called out as weakening. */\nexport const GOAL_WEAKENED_MIN_PROBABILITY = 0.75;\n\nconst stepText = (tc: TestCaseResult) => tc.story.steps.map((s) => `${s.keyword} ${s.text}`);\n\n/**\n * The step-count ratchet sees counts, so merging two steps keeps it clean.\n * When a baseline scenario's steps were rewritten without shrinking, ask Jev\n * whether the new version checks less. Advisory only: `met` is decided by\n * the rules above, and this is a judgment.\n */\nexport async function enrichGoal(report: GoalReport, args: GoalArgs, jev: JevClient): Promise<GoalReport> {\n  const { baseline } = args;\n  if (!baseline || !report.ratchet.enforced) return report;\n  const current = new Map(args.run.testCases.map((tc) => [tc.id, tc]));\n  const flagged = new Set(report.ratchet.violations.map((v) => v.id));\n\n  const rewritten = baseline.testCases.flatMap((base) => {\n    const now = current.get(base.id);\n    if (!now || flagged.has(base.id)) return [];\n    const before = stepText(base);\n    const after = stepText(now);\n    return before.join(\"\\n\") === after.join(\"\\n\") ? [] : [{ base, before, after }];\n  });\n\n  const advisories = (\n    await Promise.all(\n      rewritten.map(async ({ base, before, after }) => {\n        const answers = await jev.ask(\n          { baseline: before, now: after },\n          {\n            weakened: {\n              type: \"noul\",\n              instructions:\n                \"Does the NOW scenario check less than the BASELINE scenario: fewer or weaker assertions, looser expectations, or a removed check?\",\n            },\n          },\n        );\n        const p = asNoul(answers.weakened);\n        if (p === undefined || p < GOAL_WEAKENED_MIN_PROBABILITY) return [];\n        return [{ id: base.id, title: base.story.scenario, kind: \"weakened\" as const, detail: `jev ${p.toFixed(2)}: steps rewritten, checks less` }];\n      }),\n    )\n  ).flat();\n\n  return { ...report, ratchet: { ...report.ratchet, advisories } };\n}\n\nfunction evaluate(selector: string, matched: TestCaseResult[]): GoalRequirementResult {\n  const passed = matched.filter((tc) => tc.status === \"passed\").length;\n  const failing = matched.filter((tc) => tc.status !== \"passed\").map((tc) => tc.story.scenario);\n  return {\n    selector,\n    matched: matched.length,\n    passed,\n    failing,\n    met: matched.length > 0 && failing.length === 0,\n  };\n}\n\nfunction statusMap(run: TestRunResult): Map<string, TestStatus> {\n  return new Map(run.testCases.map((tc) => [tc.id, tc.status]));\n}\n\nexport function renderGoal(report: GoalReport, format: \"text\" | \"json\"): string {\n  if (format === \"json\") return JSON.stringify(report, null, 2);\n\n  const lines = [`GOAL: ${report.met ? \"met\" : \"not met\"}`];\n\n  for (const req of report.requirements) {\n    if (req.matched === 0) {\n      lines.push(`  ${req.selector}: no matching scenario (no proof)`);\n      continue;\n    }\n    const tail = req.failing.length > 0 ? ` (${req.failing.length} failing)` : \"\";\n    lines.push(`  ${req.selector}: ${req.passed}/${req.matched} scenarios pass${tail}`);\n  }\n\n  if (report.regressionsEnforced) {\n    if (report.regressions.length === 0) {\n      lines.push(\"  regressions: 0\");\n    } else {\n      lines.push(`  regressions: ${report.regressions.length} (${report.regressions.map((r) => r.title).join(\", \")})`);\n    }\n  }\n\n  if (report.ratchet.enforced) {\n    if (report.ratchet.violations.length === 0) {\n      lines.push(\"  ratchet: clean (0 scenarios removed/weakened)\");\n    } else {\n      lines.push(`  ratchet: ${report.ratchet.violations.length} removed/weakened`);\n      for (const v of report.ratchet.violations) {\n        lines.push(`    ${v.kind}: ${v.title} (${v.detail})`);\n      }\n    }\n    for (const v of report.ratchet.advisories) {\n      lines.push(`    advisory ${v.kind}: ${v.title} (${v.detail})`);\n    }\n  }\n\n  return lines.join(\"\\n\");\n}\n","/**\n * CODEOWNERS parsing, so a failing scenario can name the team that fixes it.\n *\n * A red run that belongs to everyone belongs to nobody until someone\n * volunteers. `triage --by-owner` groups the worklist the way the repo already\n * divides responsibility, using the file every GitHub repo already has.\n *\n * Supports the common CODEOWNERS subset — leading `/`, trailing `/`,\n * `*`, `**`, and bare extension globs. Character classes, `?`, and negation are\n * not implemented; swap in a gitignore-grade matcher if a repo needs them.\n */\n\nexport interface CodeownersRule {\n  pattern: string;\n  owners: string[];\n}\n\nexport function parseCodeowners(text: string): CodeownersRule[] {\n  const rules: CodeownersRule[] = [];\n  for (const raw of text.split(\"\\n\")) {\n    const line = raw.split(\"#\")[0]!.trim();\n    if (line === \"\") continue;\n    const [pattern, ...owners] = line.split(/\\s+/);\n    if (!pattern || owners.length === 0) continue;\n    rules.push({ pattern, owners });\n  }\n  return rules;\n}\n\nfunction toRegExp(pattern: string): RegExp {\n  // A pattern with no slash (except a trailing one) matches at any depth, the\n  // way `*.md` does in gitignore; anything anchored with `/` matches from root.\n  const anchored = pattern.startsWith(\"/\");\n  const body = anchored ? pattern.slice(1) : pattern;\n  const floating = !body.replace(/\\/$/, \"\").includes(\"/\");\n\n  // `**` crosses directory boundaries, a single `*` does not. Split on the\n  // double star first so each half can be globbed without a sentinel.\n  const globbed = body\n    .replace(/[.+^${}()|[\\]\\\\]/g, \"\\\\$&\")\n    .split(\"**\")\n    .map((part) => part.replace(/\\*/g, \"[^/]*\"))\n    .join(\".*\");\n\n  // A directory pattern owns everything under it; a file pattern owns itself.\n  const tail = body.endsWith(\"/\") ? \".*\" : \"(/.*)?\";\n  return new RegExp(`^${floating ? \"(.*/)?\" : \"\"}${globbed}${tail}$`);\n}\n\n/** Owners of a path — last matching rule wins, as git resolves CODEOWNERS. */\nexport function ownersFor(rules: readonly CodeownersRule[], path: string): string[] {\n  const clean = path.replace(/^\\.\\//, \"\").replace(/^\\//, \"\");\n  let owners: string[] = [];\n  for (const rule of rules) {\n    if (toRegExp(rule.pattern).test(clean)) owners = rule.owners;\n  }\n  return owners;\n}\n","/**\n * `triage` — the discovery-phase worklist for an agent loop.\n *\n * The automation that runs on a schedule needs a ranked queue of what to work\n * on, not a full report. This emits failing scenarios, regressions first, each\n * carrying the product code it `covers` (where to send the fixer), the error,\n * and its tickets. Failures with no `covers` are flagged: the loop can't route\n * them to code, so a human or a covers annotation is needed first.\n */\n\nimport type { TestCaseResult, TestStatus } from \"executable-stories-core/types/test-result\";\nimport { failingScenarioMessage } from \"./scenario-failure\";\nimport { ownersFor, type CodeownersRule } from \"./codeowners\";\nimport { asChoice, type JevClient } from \"./jev\";\n\nexport interface TriageItem {\n  rank: number;\n  id: string;\n  scenario: string;\n  status: TestStatus;\n  /** `sourceFile:sourceLine` */\n  location: string;\n  /** Product-code paths to fix. Empty when the scenario declared no `covers`. */\n  covers: string[];\n  tickets: string[];\n  /** CODEOWNERS entries for the code this scenario covers. Empty = unclaimed. */\n  owners: string[];\n  errorMessage?: string;\n  /** Passed in the baseline, failing now. Ranked first. */\n  regressed: boolean;\n  reason: \"regression\" | \"failing\";\n  /** Jev's pick when `covers` is empty: a path the run already routes to, with its probability. */\n  suggestedCovers?: { path: string; probability: number };\n  /** Jev's read of what failed: the product, the test itself, or the environment. */\n  failureKind?: { kind: FailureKind; confidence: number };\n}\n\nexport type FailureKind = \"product\" | \"test\" | \"infra\";\n\nexport interface TriageReport {\n  total: number;\n  failing: number;\n  regressions: number;\n  /** Failing scenarios with no `covers` — the loop can't route them to code. */\n  needsCovers: number;\n  items: TriageItem[];\n}\n\nexport interface TriageArgs {\n  testCases: TestCaseResult[];\n  /** Baseline statuses by scenario id, to flag regressions and rank them first. */\n  baseline?: Map<string, TestStatus>;\n  format: \"text\" | \"json\";\n  /** Parsed CODEOWNERS. Without it every item is unowned. */\n  codeowners?: readonly CodeownersRule[];\n}\n\nexport type TriageDeps = Record<string, never>;\n\nexport function buildTriage(args: TriageArgs, _deps: TriageDeps = {}): TriageReport {\n  const { testCases, baseline, codeowners } = args;\n\n  // Route by the product code the scenario covers — that is where the fix\n  // lands. A scenario with no `covers` falls back to its own test file, which\n  // is at least in the right neighbourhood.\n  const ownersOf = (tc: TestCaseResult): string[] => {\n    if (!codeowners) return [];\n    const paths = tc.story.covers?.length ? tc.story.covers : [tc.sourceFile];\n    const found = new Set<string>();\n    for (const path of paths) {\n      for (const owner of ownersFor(codeowners, path)) found.add(owner);\n    }\n    return [...found];\n  };\n\n  const failing = testCases.filter((tc) => tc.status === \"failed\");\n\n  const ranked = failing\n    .map((tc) => {\n      const regressed = baseline?.get(tc.id) === \"passed\";\n      return {\n        tc,\n        regressed,\n        covers: tc.story.covers ?? [],\n      };\n    })\n    // Regressions first (an edit just broke a green scenario), then by location.\n    .sort((a, b) => {\n      if (a.regressed !== b.regressed) return a.regressed ? -1 : 1;\n      const la = `${a.tc.sourceFile}:${a.tc.sourceLine}`;\n      const lb = `${b.tc.sourceFile}:${b.tc.sourceLine}`;\n      return la.localeCompare(lb);\n    });\n\n  const items: TriageItem[] = ranked.map((entry, index) => ({\n    rank: index + 1,\n    id: entry.tc.id,\n    scenario: entry.tc.story.scenario,\n    status: entry.tc.status,\n    location: `${entry.tc.sourceFile}:${entry.tc.sourceLine}`,\n    covers: entry.covers,\n    tickets: (entry.tc.story.tickets ?? []).map((t) => t.id),\n    owners: ownersOf(entry.tc),\n    errorMessage: failingScenarioMessage(entry.tc),\n    regressed: entry.regressed,\n    reason: entry.regressed ? \"regression\" : \"failing\",\n  }));\n\n  return {\n    total: testCases.length,\n    failing: failing.length,\n    regressions: items.filter((i) => i.regressed).length,\n    needsCovers: items.filter((i) => i.covers.length === 0).length,\n    items,\n  };\n}\n\n/** Below this probability no path is suggested. */\nexport const TRIAGE_SUGGEST_MIN_PROBABILITY = 0.5;\n\nconst FAILURE_KIND_CRITERIA: Record<FailureKind, string> = {\n  product: \"the application code under test behaves wrongly\",\n  test: \"the scenario, assertion, fixture, or test data is wrong or stale\",\n  infra: \"environment, network, timeout, resource, or flaky-timing failure\",\n};\n\n/**\n * For each failing scenario with no `covers`, ask Jev to pick from the paths\n * this run already routes to (every declared `covers`, plus CODEOWNERS\n * patterns), and to say whether the product, the test, or the environment\n * failed. The declared-`covers` count stays as declared: a suggestion is not\n * a declaration.\n */\nexport async function enrichTriage(\n  report: TriageReport,\n  testCases: TestCaseResult[],\n  jev: JevClient,\n  codeowners?: readonly CodeownersRule[],\n): Promise<TriageReport> {\n  const candidates = new Set<string>(testCases.flatMap((tc) => tc.story.covers ?? []));\n  for (const rule of codeowners ?? []) candidates.add(rule.pattern);\n  const criteria = Object.fromEntries([...candidates].map((path) => [path, null]));\n\n  const byId = new Map(testCases.map((tc) => [tc.id, tc]));\n  const items = await Promise.all(\n    report.items.map(async (item) => {\n      if (item.covers.length > 0) return item;\n      const tc = byId.get(item.id);\n      const answers = await jev.ask(\n        {\n          scenario: item.scenario,\n          steps: tc?.story.steps.map((s) => `${s.keyword} ${s.text}`) ?? [],\n          testFile: item.location,\n          error: item.errorMessage ?? null,\n        },\n        {\n          kind: {\n            type: \"choice\",\n            instructions: \"What is most likely broken, given this failing scenario and its error?\",\n            criteria: FAILURE_KIND_CRITERIA,\n          },\n          ...(candidates.size > 0\n            ? {\n                covers: {\n                  type: \"choice\" as const,\n                  instructions: \"Which of these product paths does the fix for this failure most likely land in?\",\n                  criteria,\n                },\n              }\n            : {}),\n        },\n      );\n      const kind = asChoice(answers.kind);\n      const covers = asChoice(answers.covers);\n      const probability = covers ? (covers.probabilities[covers.choice] ?? 0) : 0;\n      return {\n        ...item,\n        ...(kind && kind.choice in FAILURE_KIND_CRITERIA\n          ? { failureKind: { kind: kind.choice as FailureKind, confidence: kind.confidence } }\n          : {}),\n        ...(covers && probability >= TRIAGE_SUGGEST_MIN_PROBABILITY\n          ? { suggestedCovers: { path: covers.choice, probability } }\n          : {}),\n      };\n    }),\n  );\n  return { ...report, items };\n}\n\nexport interface RenderTriageOptions {\n  /** Group the text worklist under each CODEOWNERS owner. */\n  byOwner?: boolean;\n}\n\nexport function renderTriage(\n  report: TriageReport,\n  format: \"text\" | \"json\",\n  options: RenderTriageOptions = {},\n): string {\n  if (format === \"json\") return JSON.stringify(report, null, 2);\n\n  if (report.items.length === 0) {\n    return \"Nothing to triage. No failing scenarios.\";\n  }\n\n  if (options.byOwner) return renderByOwner(report);\n\n  const header =\n    report.regressions > 0\n      ? `${report.items.length} items to triage (${report.regressions} regression${report.regressions === 1 ? \"\" : \"s\"})`\n      : `${report.items.length} items to triage`;\n  const lines = [header, \"\"];\n\n  for (const item of report.items) {\n    const tag = item.regressed ? \"[regression] \" : \"\";\n    lines.push(`${item.rank}. ${tag}${item.scenario}`);\n    lines.push(`   ${item.location}`);\n    if (item.errorMessage) {\n      lines.push(`   → ${item.errorMessage.split(\"\\n\")[0]}`);\n    }\n    if (item.covers.length > 0) {\n      lines.push(`   fix: ${item.covers.join(\", \")}`);\n    } else if (item.suggestedCovers) {\n      lines.push(`   fix: ${item.suggestedCovers.path}? (jev ${item.suggestedCovers.probability.toFixed(2)}, no covers declared)`);\n    } else {\n      lines.push(\"   fix: (no covers declared — add `covers` to route this to code)\");\n    }\n    if (item.failureKind) {\n      lines.push(`   kind: ${item.failureKind.kind} (jev ${item.failureKind.confidence.toFixed(2)})`);\n    }\n    if (item.tickets.length > 0) {\n      lines.push(`   ticket: ${item.tickets.join(\", \")}`);\n    }\n    if (item.owners.length > 0) {\n      lines.push(`   owner: ${item.owners.join(\", \")}`);\n    }\n    lines.push(\"\");\n  }\n\n  if (report.needsCovers > 0) {\n    lines.push(`${report.needsCovers} failing scenario(s) have no covers and can't be routed to code automatically.`);\n  }\n\n  return lines.join(\"\\n\").trimEnd();\n}\n\nconst UNOWNED = \"Unowned\";\n\n/**\n * The same worklist, split the way the repo already splits responsibility.\n * Unowned work sorts last: it needs a decision about who takes it, not a fix.\n */\nfunction renderByOwner(report: TriageReport): string {\n  const groups = new Map<string, TriageItem[]>();\n  for (const item of report.items) {\n    for (const owner of item.owners.length > 0 ? item.owners : [UNOWNED]) {\n      const bucket = groups.get(owner);\n      if (bucket) bucket.push(item);\n      else groups.set(owner, [item]);\n    }\n  }\n\n  const owners = [...groups.keys()].sort((a, b) => {\n    if (a === UNOWNED) return 1;\n    if (b === UNOWNED) return -1;\n    return a.localeCompare(b);\n  });\n\n  const lines: string[] = [\n    `${report.items.length} items to triage across ${owners.length} owner${owners.length === 1 ? \"\" : \"s\"}`,\n    \"\",\n  ];\n  for (const owner of owners) {\n    const items = groups.get(owner)!;\n    lines.push(`${owner} (${items.length})`);\n    for (const item of items) {\n      const tag = item.regressed ? \"[regression] \" : \"\";\n      lines.push(`  ${item.rank}. ${tag}${item.scenario}`);\n      lines.push(`     ${item.location}`);\n      if (item.errorMessage) {\n        lines.push(`     → ${item.errorMessage.split(\"\\n\")[0]}`);\n      }\n    }\n    lines.push(\"\");\n  }\n  return lines.join(\"\\n\").trimEnd();\n}\n","import type { RunDiffResult, ScenarioDiff } from \"../types/compare\";\n\nfunction titleFor(kind: ScenarioDiff[\"kind\"]): string {\n  switch (kind) {\n    case \"regressed\":\n      return \"Regressed\";\n    case \"fixed\":\n      return \"Fixed\";\n    case \"added\":\n      return \"Added\";\n    case \"removed\":\n      return \"Removed\";\n    case \"renamed\":\n      return \"Renamed\";\n    case \"moved\":\n      return \"Moved\";\n    case \"changed\":\n      return \"Changed\";\n    default:\n      return \"Unchanged\";\n  }\n}\n\nfunction summarizeScenario(scenario: ScenarioDiff): string {\n  const before = scenario.baseline?.status;\n  const after = scenario.current?.status;\n  const statusPart =\n    before && after\n      ? `status \\`${before}\\` -> \\`${after}\\``\n      : before\n        ? `removed from \\`${before}\\``\n        : `new \\`${after}\\``;\n  const fields =\n    scenario.changedFields.length > 0\n      ? `; changed ${scenario.changedFields.map((field) => `\\`${field}\\``).join(\", \")}`\n      : \"\";\n  return `- ${scenario.scenario} (\\`${scenario.sourceFile}:${scenario.sourceLine}\\`): ${statusPart}${fields}`;\n}\n\nfunction addSection(\n  lines: string[],\n  diff: RunDiffResult,\n  kind: ScenarioDiff[\"kind\"],\n  maxScenarios: number\n): void {\n  const scenarios = diff.scenarios.filter((scenario) => scenario.kind === kind);\n  if (scenarios.length === 0) return;\n\n  lines.push(`### ${titleFor(kind)} (${scenarios.length})`);\n  lines.push(\"\");\n  for (const scenario of scenarios.slice(0, maxScenarios)) {\n    lines.push(summarizeScenario(scenario));\n  }\n  if (scenarios.length > maxScenarios) {\n    lines.push(`- ...and ${scenarios.length - maxScenarios} more`);\n  }\n  lines.push(\"\");\n}\n\nexport function createPrCommentSummary(\n  diff: RunDiffResult,\n  maxScenarios = 10\n): string {\n  const lines: string[] = [];\n\n  lines.push(\"## Executable Stories Review Summary\");\n  lines.push(\"\");\n  lines.push(\n    `Priority signal: ${diff.summary.regressed} regressed, ${diff.summary.fixed} fixed, ${diff.summary.added} added, ${diff.summary.removed} removed, ${diff.summary.changed} changed.`\n  );\n  lines.push(\"\");\n\n  if (diff.summary.notRun > 0) {\n    lines.push(\n      `Partial run: ${diff.summary.notRun} baseline scenario(s) in files this run did not cover are excluded.`\n    );\n    lines.push(\"\");\n  }\n\n  if (diff.summary.regressed > 0) {\n    lines.push(\"> Regressions detected. Review these first.\");\n    lines.push(\"\");\n  } else if (diff.summary.fixed > 0) {\n    lines.push(\"> No regressions detected. Review fixed scenarios next.\");\n    lines.push(\"\");\n  } else {\n    lines.push(\"> No regressions or fixes detected. Remaining changes are neutral.\");\n    lines.push(\"\");\n  }\n\n  addSection(lines, diff, \"regressed\", maxScenarios);\n  addSection(lines, diff, \"fixed\", maxScenarios);\n  addSection(lines, diff, \"added\", maxScenarios);\n  addSection(lines, diff, \"removed\", maxScenarios);\n  addSection(lines, diff, \"renamed\", maxScenarios);\n  addSection(lines, diff, \"moved\", maxScenarios);\n  addSection(lines, diff, \"changed\", maxScenarios);\n\n  return lines.join(\"\\n\").trimEnd();\n}\n","/**\n * Code Diff sidecar assembly — the authoring seam for Code Diff evidence.\n *\n * Authors (normally the `explain-change` skill) never hand-write content\n * anchors. The sidecar names a file and a unique substring of one changed\n * line; assembly locates that line in the `git diff --histogram` patch and\n * builds the real content anchor from it. A match that fails to locate still\n * produces an annotation, explicitly marked `unresolved` (orphaned or\n * ambiguous), so authoring mistakes surface visibly instead of disappearing.\n */\n\nimport type { CodeDiffAnnotationInput, CodeDiffInput } from \"../types/review\";\nimport type { FileDiff } from \"../types/diff\";\nimport { createAnchor, parseUnifiedDiff } from \"./diff-anchor\";\n\n/** Hand-authored (or agent-authored) annotation entry in the sidecar file. */\nexport interface CodeDiffSidecarAnnotation {\n  /** Repo-relative path of the changed file. */\n  file: string;\n  /** Substring of exactly one changed line in the patch. */\n  match: string;\n  /** Explanatory prose (plain text — rendered verbatim). */\n  text: string;\n  label?: string;\n  scenarioIds?: string[];\n}\n\n/** The sidecar document (JSON). The patch itself is supplied separately. */\nexport interface CodeDiffSidecar {\n  title: string;\n  /** Canonical HTTPS patch URL — audit provenance only. */\n  patchUrl?: string;\n  baseLabel?: string;\n  headLabel?: string;\n  /** Ordered by concept, not Git file order. */\n  annotations: CodeDiffSidecarAnnotation[];\n}\n\n/** Locate the changed lines containing `match` in the file's hunks. */\nfunction locateMatches(\n  file: FileDiff,\n  match: string\n): Array<{ hunkIndex: number; lineIndex: number }> {\n  const out: Array<{ hunkIndex: number; lineIndex: number }> = [];\n  file.hunks.forEach((hunk, hunkIndex) => {\n    hunk.lines.forEach((line, lineIndex) => {\n      if (line.kind !== \"context\" && line.text.includes(match)) {\n        out.push({ hunkIndex, lineIndex });\n      }\n    });\n  });\n  return out;\n}\n\n/** Walk back to the start of the contiguous changed run containing `lineIndex`. */\nfunction runStart(file: FileDiff, hunkIndex: number, lineIndex: number): number {\n  const lines = file.hunks[hunkIndex].lines;\n  let start = lineIndex;\n  while (start > 0 && lines[start - 1].kind !== \"context\") start--;\n  return start;\n}\n\n/**\n * Assemble a {@link CodeDiffInput} from a sidecar and a unified patch.\n * Returns authoring warnings alongside — a located match gets a real content\n * anchor; a missed or non-unique match gets a bare anchor that resolves\n * orphaned, plus a warning saying why.\n */\nexport function assembleCodeDiff(args: {\n  sidecar: CodeDiffSidecar;\n  patch: string;\n}): { input: CodeDiffInput; warnings: string[] } {\n  const { sidecar, patch } = args;\n  const files = parseUnifiedDiff(patch);\n  const warnings: string[] = [];\n\n  if (sidecar.patchUrl !== undefined && !sidecar.patchUrl.startsWith(\"https://\")) {\n    warnings.push(\n      `patchUrl \"${sidecar.patchUrl}\" is not https: — it will render as inert text, not a link`\n    );\n  }\n\n  const annotations: CodeDiffAnnotationInput[] = sidecar.annotations.map(\n    (entry) => {\n      const base = {\n        text: entry.text,\n        label: entry.label,\n        scenarioIds: entry.scenarioIds,\n      };\n      const file = files.find(\n        (f) => f.newPath === entry.file || f.oldPath === entry.file\n      );\n      const matches = file ? locateMatches(file, entry.match) : [];\n\n      if (file && matches.length === 1) {\n        const { hunkIndex, lineIndex } = matches[0];\n        const anchor = createAnchor({\n          file,\n          hunkIndex,\n          lineIndex: runStart(file, hunkIndex, lineIndex),\n        });\n        return { ...base, anchor };\n      }\n\n      warnings.push(\n        !file\n          ? `annotation \"${entry.label ?? entry.match}\": file \"${entry.file}\" is not in the patch`\n          : matches.length === 0\n            ? `annotation \"${entry.label ?? entry.match}\": no changed line in \"${entry.file}\" contains \"${entry.match}\"`\n            : `annotation \"${entry.label ?? entry.match}\": \"${entry.match}\" matches ${matches.length} changed lines in \"${entry.file}\" — make it unique`\n      );\n      return {\n        ...base,\n        unresolved: (file && matches.length > 1 ? \"ambiguous\" : \"orphaned\") as\n          | \"ambiguous\"\n          | \"orphaned\",\n      };\n    }\n  );\n\n  return {\n    input: {\n      title: sidecar.title,\n      patch,\n      patchUrl: sidecar.patchUrl,\n      baseLabel: sidecar.baseLabel,\n      headLabel: sidecar.headLabel,\n      annotations,\n    },\n    warnings,\n  };\n}\n","/**\n * Review markdown formatter — renders a {@link ReviewResult} as a PR-comment-friendly\n * review of AI-authored changes.\n *\n * Reading order matches reviewer attention: the 🔴 uncovered-change band first\n * (what changed with no evidence), then 🟡 weak evidence, then claims grouped by\n * audience (stakeholder behaviour, then engineer detail), each showing graded\n * proof. Mirrors {@link RunDiffMarkdownFormatter}.\n */\n\nimport type {\n  ChangedFileReview,\n  CodeDiffEvidence,\n  EvidenceStrength,\n  ReviewClaim,\n  ReviewResult,\n} from \"../types/review\";\n\nexport interface ReviewMarkdownOptions {\n  title?: string;\n}\n\nconst STRENGTH_BADGE: Record<EvidenceStrength, string> = {\n  strong: \"🟢 strong\",\n  moderate: \"🟡 moderate\",\n  weak: \"🟠 weak\",\n  none: \"🔴 none\",\n};\n\nfunction statusIcon(status: ReviewClaim[\"status\"]): string {\n  switch (status) {\n    case \"passed\":\n      return \"✅\";\n    case \"failed\":\n      return \"❌\";\n    case \"skipped\":\n      return \"⊘\";\n    default:\n      return \"•\";\n  }\n}\n\nfunction escapeCell(value: string): string {\n  return value.replace(/\\|/g, \"\\\\|\").replace(/\\n/g, \" \");\n}\n\n/** First line of an intent narrative, for the at-a-glance summary. */\nfunction intentSummary(intent: string): string {\n  const firstLine = intent.split(\"\\n\").find((l) => l.trim().length > 0) ?? \"\";\n  const trimmed = firstLine.trim();\n  return trimmed.length > 200 ? `${trimmed.slice(0, 197)}…` : trimmed;\n}\n\nfunction renderTicket(ticket: { id: string; url?: string }): string {\n  return ticket.url ? `[${ticket.id}](${ticket.url})` : `\\`${ticket.id}\\``;\n}\n\nfunction renderUncoveredBand(lines: string[], files: ChangedFileReview[]): void {\n  const uncovered = files.filter((f) => f.band === \"uncovered\");\n  if (uncovered.length === 0) return;\n  lines.push(`## 🔴 Changed code with no evidence (${uncovered.length})`);\n  lines.push(\"\");\n  lines.push(\"Start here — these changed source files have no claim or test behind them.\");\n  lines.push(\"\");\n  for (const file of uncovered) {\n    lines.push(`- \\`${file.path}\\` _(${file.changeKind})_`);\n  }\n  lines.push(\"\");\n}\n\nfunction renderWeakBand(lines: string[], files: ChangedFileReview[]): void {\n  const weak = files.filter((f) => f.band === \"weak\");\n  if (weak.length === 0) return;\n  lines.push(`## 🟡 Changed code with weak evidence (${weak.length})`);\n  lines.push(\"\");\n  for (const file of weak) {\n    const covered = file.claims\n      .map((c) => `${escapeCell(c.scenario)} (${c.strength})`)\n      .join(\", \");\n    lines.push(`- \\`${file.path}\\` _(${file.changeKind})_ — only: ${covered}`);\n  }\n  lines.push(\"\");\n}\n\nfunction renderClaim(lines: string[], claim: ReviewClaim): void {\n  lines.push(`### ${statusIcon(claim.status)} ${claim.scenario}`);\n  lines.push(\"\");\n  lines.push(`- File: \\`${claim.sourceFile}:${claim.sourceLine}\\``);\n  if (claim.changeType !== \"unknown\") {\n    const inferred = claim.changeTypeConfidence === undefined ? \"\" : ` _(inferred, jev ${claim.changeTypeConfidence.toFixed(2)})_`;\n    lines.push(`- Change: \\`${claim.changeType}\\`${inferred}`);\n  }\n  const tickets = claim.testCase.story.tickets ?? [];\n  if (tickets.length > 0) {\n    lines.push(`- Tickets: ${tickets.map(renderTicket).join(\", \")}`);\n  }\n  lines.push(\n    `- Evidence: ${STRENGTH_BADGE[claim.strength]} — ${claim.strengthReasons.join(\"; \")}`\n  );\n  if (claim.coversFiles.length > 0) {\n    lines.push(\n      `- Covers: ${claim.coversFiles.map((f) => `\\`${f}\\``).join(\", \")}`\n    );\n  }\n  if (claim.intent) {\n    lines.push(`- Why: ${escapeCell(intentSummary(claim.intent))}`);\n  }\n  lines.push(\"\");\n}\n\nfunction renderAudienceSection(\n  lines: string[],\n  title: string,\n  claims: ReviewClaim[]\n): void {\n  if (claims.length === 0) return;\n  lines.push(`## ${title} (${claims.length})`);\n  lines.push(\"\");\n  for (const claim of claims) {\n    renderClaim(lines, claim);\n  }\n}\n\n/** Patches above this render as a link/notice instead of a fenced block. */\nconst MAX_PATCH_EMBED_BYTES = 64 * 1024;\n\n/**\n * A fence longer than the longest backtick run in the content, so a patch\n * containing ``` (e.g. a diff of a Markdown file) cannot close the block early.\n */\nfunction fenceFor(content: string): string {\n  const runs = content.match(/`{3,}/g);\n  const length = runs ? Math.max(...runs.map((r) => r.length)) + 1 : 3;\n  return \"`\".repeat(length);\n}\n\n/**\n * Static Code Diff fallback: comparison metadata, ordered annotations with\n * scenario references and anchor-state notices, and the patch (fenced when\n * small, linked otherwise). No pretence of an interactive viewer.\n */\nfunction renderCodeDiff(lines: string[], evidence: CodeDiffEvidence): void {\n  lines.push(`## Code diff evidence: ${evidence.title}`);\n  lines.push(\"\");\n  if (evidence.baseLabel || evidence.headLabel) {\n    lines.push(\n      `Comparing \\`${evidence.baseLabel ?? \"base\"}\\` → \\`${evidence.headLabel ?? \"head\"}\\`.`\n    );\n    lines.push(\"\");\n  }\n  if (evidence.patchUrl !== undefined) {\n    // Only https: is presented as a linkable URL; anything else stays inert code text.\n    lines.push(\n      evidence.patchUrl.startsWith(\"https://\")\n        ? `Canonical patch: ${evidence.patchUrl}`\n        : `Canonical patch: \\`${evidence.patchUrl.replace(/`/g, \"\")}\\``\n    );\n    lines.push(\"\");\n  }\n\n  evidence.annotations.forEach((annotation, i) => {\n    lines.push(`### ${annotation.label ?? `Annotation ${i + 1}`}`);\n    lines.push(\"\");\n    lines.push(annotation.text);\n    lines.push(\"\");\n    if (annotation.resolution.state === \"orphaned\") {\n      lines.push(\n        \"> ⚠️ Orphaned annotation — could not locate these lines in the current patch.\"\n      );\n      lines.push(\"\");\n    } else if (annotation.resolution.state === \"ambiguous\") {\n      lines.push(\n        \"> ⚠️ Ambiguous anchor — these lines appear in more than one place in the current patch.\"\n      );\n      lines.push(\"\");\n    } else if (annotation.resolution.file !== undefined) {\n      lines.push(`Location: \\`${annotation.resolution.file}\\``);\n      lines.push(\"\");\n    }\n    if (annotation.scenarios.length === 0) {\n      lines.push(\"_Not covered by a scenario._\");\n    } else {\n      for (const ref of annotation.scenarios) {\n        lines.push(\n          ref.resolved && ref.status\n            ? `- ${statusIcon(ref.status)} ${escapeCell(ref.scenario ?? ref.id)} (\\`${ref.id}\\`)`\n            : `- ⚠️ \\`${ref.id}\\` — unverified reference (scenario not in this run)`\n        );\n      }\n    }\n    lines.push(\"\");\n  });\n\n  if (Buffer.byteLength(evidence.patch, \"utf8\") <= MAX_PATCH_EMBED_BYTES) {\n    const fence = fenceFor(evidence.patch);\n    lines.push(\"<details><summary>Raw patch (audit)</summary>\");\n    lines.push(\"\");\n    lines.push(`${fence}diff`);\n    lines.push(evidence.patch.trimEnd());\n    lines.push(fence);\n    lines.push(\"\");\n    lines.push(\"</details>\");\n  } else {\n    lines.push(\n      `_Patch too large to embed${evidence.patchUrl ? \" — see the canonical patch link above\" : \"\"}._`\n    );\n  }\n  lines.push(\"\");\n}\n\nexport class ReviewMarkdownFormatter {\n  private title: string;\n\n  constructor(options: ReviewMarkdownOptions = {}) {\n    this.title = options.title ?? \"Evidence Review\";\n  }\n\n  format(review: ReviewResult): string {\n    const lines: string[] = [];\n    const { summary, context } = review;\n\n    lines.push(`# ${this.title}`);\n    lines.push(\"\");\n    if (context.baseRef || context.headRef) {\n      lines.push(\n        `Comparing \\`${context.baseRef ?? \"base\"}\\` → \\`${context.headRef ?? \"head\"}\\`.`\n      );\n      lines.push(\"\");\n    }\n\n    lines.push(\"## Review priority\");\n    lines.push(\"\");\n    if (summary.changedSourceFiles === 0) {\n      lines.push(\n        \"No changed source files supplied — showing claims and evidence only.\"\n      );\n    } else if (summary.uncovered > 0) {\n      lines.push(\n        `Review the ${summary.uncovered} unaccounted-for file(s) first: changed code with no evidence behind it.`\n      );\n    } else if (summary.weaklyCovered > 0) {\n      lines.push(\n        `No unaccounted-for changes. Review ${summary.weaklyCovered} weakly-covered file(s) next.`\n      );\n    } else {\n      lines.push(\"Every changed source file is backed by at least moderate evidence.\");\n    }\n    lines.push(\"\");\n\n    if (summary.changedSourceFiles > 0) {\n      lines.push(\"| 🔴 Uncovered | 🟡 Weak | 🟢 Covered | Changed files |\");\n      lines.push(\"| ---: | ---: | ---: | ---: |\");\n      lines.push(\n        `| ${summary.uncovered} | ${summary.weaklyCovered} | ${summary.covered} | ${summary.changedSourceFiles} |`\n      );\n      lines.push(\"\");\n    }\n\n    lines.push(\"| Claims | Stakeholder | Engineer | Strong | Moderate | Weak | None |\");\n    lines.push(\"| ---: | ---: | ---: | ---: | ---: | ---: | ---: |\");\n    lines.push(\n      `| ${summary.totalClaims} | ${summary.byAudience.stakeholder} | ${summary.byAudience.engineer} | ${summary.byStrength.strong} | ${summary.byStrength.moderate} | ${summary.byStrength.weak} | ${summary.byStrength.none} |`\n    );\n    lines.push(\"\");\n\n    renderUncoveredBand(lines, review.changedFiles);\n    renderWeakBand(lines, review.changedFiles);\n\n    renderAudienceSection(\n      lines,\n      \"Stakeholder behaviour\",\n      review.claims.filter((c) => c.audience === \"stakeholder\")\n    );\n    renderAudienceSection(\n      lines,\n      \"Engineer changes\",\n      review.claims.filter((c) => c.audience === \"engineer\")\n    );\n\n    for (const evidence of review.codeDiffs) {\n      renderCodeDiff(lines, evidence);\n    }\n\n    return lines.join(\"\\n\").trimEnd();\n  }\n}\n","/**\n * Review HTML formatter — the audience-segmented deep-dive artifact for an\n * Evidence Review. Standalone themed HTML (mirrors {@link RunDiffHtmlFormatter}):\n * a banded changed-files list (uncovered → weak → covered), then claim cards\n * grouped by audience with graded evidence, intent, inline screenshots, and a\n * filter toolbar. No CDN dependencies required.\n */\n\nimport type {\n  ChangedFileReview,\n  CodeDiffAnnotation,\n  CodeDiffEvidence,\n  CodeDiffScenarioRef,\n  EvidenceStrength,\n  ReviewClaim,\n  ReviewResult,\n} from \"../types/review\";\nimport type { DiffHunk, FileDiff } from \"../types/diff\";\nimport type { DocEntry, StoryStep } from \"executable-stories-core/types/story\";\nimport type { TestCaseResult } from \"executable-stories-core/types/test-result\";\nimport { REPORT_THEME_CSS } from \"./report-theme-css\";\nimport { REPORT_FAVICON_LINK } from \"executable-stories-core/utils/report-favicon\";\n\nexport interface ReviewHtmlOptions {\n  title?: string;\n  /** Enable dark mode toggle. Default: true */\n  darkMode?: boolean;\n}\n\nfunction escapeHtml(value: string): string {\n  return value\n    .replace(/&/g, \"&amp;\")\n    .replace(/</g, \"&lt;\")\n    .replace(/>/g, \"&gt;\")\n    .replace(/\"/g, \"&quot;\");\n}\n\nconst STRENGTH_LABEL: Record<EvidenceStrength, string> = {\n  strong: \"Strong\",\n  moderate: \"Moderate\",\n  weak: \"Weak\",\n  none: \"None\",\n};\n\nfunction statusIcon(status: ReviewClaim[\"status\"]): string {\n  switch (status) {\n    case \"passed\":\n      return \"✅\";\n    case \"failed\":\n      return \"❌\";\n    case \"skipped\":\n      return \"⊘\";\n    default:\n      return \"•\";\n  }\n}\n\nfunction formatStep(step: StoryStep): string {\n  return `<li><strong>${escapeHtml(step.keyword)}</strong> ${escapeHtml(step.text)}</li>`;\n}\n\nfunction inlineDoc(doc: DocEntry): string {\n  switch (doc.kind) {\n    case \"note\":\n      return escapeHtml(doc.text);\n    case \"section\":\n      return `<strong>${escapeHtml(doc.title)}</strong>: ${escapeHtml(doc.markdown)}`;\n    case \"kv\":\n      return `${escapeHtml(doc.label)}: ${escapeHtml(String(doc.value))}`;\n    case \"code\":\n      return `${escapeHtml(doc.label)}: <code>${escapeHtml(doc.content)}</code>`;\n    case \"link\":\n      return `${escapeHtml(doc.label)}: ${escapeHtml(doc.url)}`;\n    default:\n      return escapeHtml(doc.kind);\n  }\n}\n\n/** Inline screenshots: embed image attachments, list screenshot-doc paths. */\nfunction renderEvidenceArtifacts(testCase: TestCaseResult): string {\n  const parts: string[] = [];\n  for (const att of testCase.attachments) {\n    if (att.mediaType.startsWith(\"image/\") && att.contentEncoding === \"BASE64\") {\n      parts.push(\n        `<img class=\"shot\" alt=\"${escapeHtml(att.name)}\" src=\"data:${escapeHtml(att.mediaType)};base64,${att.body}\" />`\n      );\n    }\n  }\n  if ((testCase.story.otelSpans?.length ?? 0) > 0) {\n    parts.push(\n      `<p class=\"trace-note\">📡 ${testCase.story.otelSpans!.length} OTEL span(s) captured</p>`\n    );\n  }\n  return parts.length > 0 ? `<div class=\"artifacts\">${parts.join(\"\")}</div>` : \"\";\n}\n\nfunction renderTicketPills(claim: ReviewClaim): string {\n  const tickets = claim.testCase.story.tickets ?? [];\n  if (tickets.length === 0) return \"\";\n  return `<div class=\"ticket-row\">${tickets\n    .map((ticket) => {\n      const label = escapeHtml(ticket.id);\n      if (ticket.url) {\n        return `<a class=\"ticket-pill\" href=\"${escapeHtml(ticket.url)}\" target=\"_blank\" rel=\"noopener noreferrer\">${label}</a>`;\n      }\n      return `<span class=\"ticket-pill\">${label}</span>`;\n    })\n    .join(\"\")}</div>`;\n}\n\nfunction renderClaimCard(claim: ReviewClaim): string {\n  const ticketSearch = (claim.testCase.story.tickets ?? [])\n    .map((ticket) => ticket.id)\n    .join(\" \");\n  const search = escapeHtml(\n    `${claim.scenario} ${claim.sourceFile} ${claim.changeType} ${claim.audience} ${claim.strength} ${ticketSearch}`\n  ).toLowerCase();\n\n  const steps =\n    claim.testCase.story.steps.length > 0\n      ? `<ul class=\"step-list\">${claim.testCase.story.steps.map(formatStep).join(\"\")}</ul>`\n      : \"\";\n\n  const reasons = `<ul class=\"reasons\">${claim.strengthReasons\n    .map((r) => `<li>${escapeHtml(r)}</li>`)\n    .join(\"\")}</ul>`;\n\n  const intent =\n    claim.intent !== undefined\n      ? `<div class=\"intent\"><span class=\"intent-label\">Why</span> ${escapeHtml(claim.intent)}</div>`\n      : \"\";\n\n  const covers =\n    claim.coversFiles.length > 0\n      ? `<p class=\"covers\">Covers ${claim.coversFiles\n          .map((f) => `<code>${escapeHtml(f)}</code>`)\n          .join(\", \")}</p>`\n      : \"\";\n\n  const docs = (claim.testCase.story.docs ?? []).filter(\n    (d) => d.kind === \"section\" || d.kind === \"note\"\n  );\n  const extraDocs =\n    docs.length > 0 && claim.intent === undefined\n      ? `<div class=\"intent\">${docs.map(inlineDoc).join(\"<br>\")}</div>`\n      : \"\";\n\n  return `\n    <article class=\"claim-card\" id=\"claim-${escapeHtml(claim.id)}\" data-audience=\"${claim.audience}\" data-strength=\"${claim.strength}\" data-search=\"${search}\">\n      <header class=\"claim-header\">\n        <div>\n          <span class=\"strength-badge strength-${claim.strength}\">${STRENGTH_LABEL[claim.strength]}</span>\n          ${claim.changeType !== \"unknown\" ? `<span class=\"change-pill\">${escapeHtml(claim.changeType)}</span>` : \"\"}\n          <h3>${statusIcon(claim.status)} ${escapeHtml(claim.scenario)}</h3>\n          <p class=\"source\">${escapeHtml(`${claim.sourceFile}:${claim.sourceLine}`)}</p>\n          ${renderTicketPills(claim)}\n        </div>\n      </header>\n      ${intent}${extraDocs}\n      <div class=\"evidence-block\">\n        <span class=\"evidence-label\">Evidence</span>\n        ${reasons}\n      </div>\n      ${covers}\n      ${renderEvidenceArtifacts(claim.testCase)}\n      ${steps}\n    </article>`;\n}\n\nfunction renderChangedFileRow(file: ChangedFileReview): string {\n  const claims =\n    file.claims.length > 0\n      ? file.claims\n          .map((c) => `${escapeHtml(c.scenario)} <em>(${c.strength})</em>`)\n          .join(\", \")\n      : \"—\";\n  return `<tr data-band=\"${file.band}\">\n    <td><span class=\"band-dot band-${file.band}\"></span></td>\n    <td><code>${escapeHtml(file.path)}</code></td>\n    <td>${escapeHtml(file.changeKind)}</td>\n    <td>${claims}</td>\n  </tr>`;\n}\n\n/** Raw patches above this embed as a \"too large\" notice instead of inline text. */\nconst MAX_PATCH_EMBED_BYTES = 256 * 1024;\n\nfunction renderScenarioRef(ref: CodeDiffScenarioRef): string {\n  if (!ref.resolved) {\n    return `<span class=\"scenario-ref unverified\">⚠️ ${escapeHtml(ref.id)} (unverified reference)</span>`;\n  }\n  const icon = ref.status === \"passed\" ? \"✅\" : ref.status === \"failed\" ? \"❌\" : \"⊘\";\n  return `<a class=\"scenario-ref\" href=\"#claim-${escapeHtml(ref.id)}\">${icon} ${escapeHtml(ref.scenario ?? ref.id)}</a>`;\n}\n\n/** One hunk as escaped table rows; the anchored changed run gets a highlight class. */\nfunction renderDiffHunk(\n  file: FileDiff,\n  hunk: DiffHunk,\n  anchoredStart?: number,\n  anchoredCount?: number\n): string {\n  let oldLn = hunk.oldStart;\n  let newLn = hunk.newStart;\n  const rows = hunk.lines.map((line, i) => {\n    const anchored =\n      anchoredStart !== undefined &&\n      anchoredCount !== undefined &&\n      i >= anchoredStart &&\n      i < anchoredStart + anchoredCount;\n    const cls = `diff-${line.kind}${anchored ? \" diff-anchored\" : \"\"}`;\n    const o = line.kind === \"add\" ? \"\" : String(oldLn++);\n    const n = line.kind === \"del\" ? \"\" : String(newLn++);\n    const sign = line.kind === \"add\" ? \"+\" : line.kind === \"del\" ? \"-\" : \" \";\n    return `<tr class=\"${cls}\"><td class=\"diff-ln\">${o}</td><td class=\"diff-ln\">${n}</td><td class=\"diff-sign\">${sign}</td><td class=\"diff-code\">${escapeHtml(line.text)}</td></tr>`;\n  });\n  const path = file.newPath ?? file.oldPath ?? \"\";\n  return `<div class=\"diff-hunk\">\n    <div class=\"diff-file-header\"><code>${escapeHtml(path)}</code> <span class=\"subtle\">@@ -${hunk.oldStart} +${hunk.newStart} @@ ${escapeHtml(hunk.header)}</span></div>\n    <table class=\"diff-table\"><tbody>${rows.join(\"\")}</tbody></table>\n  </div>`;\n}\n\nfunction renderAnnotation(\n  evidence: CodeDiffEvidence,\n  annotation: CodeDiffAnnotation,\n  diffIndex: number,\n  index: number\n): string {\n  const scenarios =\n    annotation.scenarios.length > 0\n      ? `<div class=\"scenario-row\">${annotation.scenarios.map(renderScenarioRef).join(\"\")}</div>`\n      : `<p class=\"no-scenario\">Not covered by a scenario — implementation claim without behavioural evidence.</p>`;\n\n  const res = annotation.resolution;\n  let body: string;\n  if (res.state === \"anchored\" && res.fileIndex !== undefined && res.hunkIndex !== undefined) {\n    const file = evidence.files[res.fileIndex];\n    body = renderDiffHunk(file, file.hunks[res.hunkIndex], res.lineIndex, res.lineCount);\n  } else if (res.state === \"ambiguous\") {\n    body = `<p class=\"anchor-notice\">⚠️ Ambiguous anchor — these lines appear in more than one place in the current patch, so the annotation is not attached to any of them.</p>`;\n  } else {\n    body = `<p class=\"anchor-notice\">⚠️ Orphaned annotation — could not locate these lines in the current patch. The prose below may describe code that has since changed.</p>`;\n  }\n\n  return `<article class=\"annotation\" id=\"code-diff-${diffIndex}-a${index}\" data-anchor-state=\"${res.state}\">\n    <h4>${escapeHtml(annotation.label ?? `Annotation ${index + 1}`)}</h4>\n    <p class=\"annotation-text\">${escapeHtml(annotation.text)}</p>\n    ${scenarios}\n    ${body}\n  </article>`;\n}\n\n/** Code Diff evidence: annotations in conceptual order, then the raw patch on demand. */\nfunction renderCodeDiffSection(evidence: CodeDiffEvidence, diffIndex: number): string {\n  const comparing =\n    evidence.baseLabel || evidence.headLabel\n      ? `<p class=\"subtle\">Comparing ${escapeHtml(evidence.baseLabel ?? \"base\")} → ${escapeHtml(evidence.headLabel ?? \"head\")}</p>`\n      : \"\";\n  // Only https: renders as a link; anything else (javascript:, file:, ...) stays inert text.\n  const audit =\n    evidence.patchUrl === undefined\n      ? \"\"\n      : evidence.patchUrl.startsWith(\"https://\")\n        ? `<p class=\"subtle\">Canonical patch: <a href=\"${escapeHtml(evidence.patchUrl)}\" rel=\"noopener noreferrer\">${escapeHtml(evidence.patchUrl)}</a></p>`\n        : `<p class=\"subtle\">Canonical patch: <code>${escapeHtml(evidence.patchUrl)}</code></p>`;\n  const outline =\n    evidence.annotations.length > 1\n      ? `<ol class=\"diff-outline\">${evidence.annotations\n          .map(\n            (a, i) =>\n              `<li><a href=\"#code-diff-${diffIndex}-a${i}\">${escapeHtml(a.label ?? `Annotation ${i + 1}`)}</a></li>`\n          )\n          .join(\"\")}</ol>`\n      : \"\";\n  const rawPatch =\n    Buffer.byteLength(evidence.patch, \"utf8\") <= MAX_PATCH_EMBED_BYTES\n      ? `<details class=\"raw-patch\"><summary>Raw patch (audit)</summary><pre><code>${escapeHtml(evidence.patch)}</code></pre></details>`\n      : `<p class=\"anchor-notice\">Patch too large to embed${evidence.patchUrl ? \" — use the canonical patch link above\" : \"\"}.</p>`;\n\n  return `<section class=\"panel code-diff\" id=\"code-diff-${diffIndex}\">\n    <h2>Code diff: ${escapeHtml(evidence.title)}</h2>\n    ${comparing}\n    ${audit}\n    ${outline}\n    ${evidence.annotations.map((a, i) => renderAnnotation(evidence, a, diffIndex, i)).join(\"\\n\")}\n    ${rawPatch}\n  </section>`;\n}\n\nfunction renderAudienceSection(title: string, claims: ReviewClaim[]): string {\n  if (claims.length === 0) return \"\";\n  return `<section class=\"audience-section\">\n    <h2>${escapeHtml(title)} <span class=\"count\">${claims.length}</span></h2>\n    <div class=\"claim-list\">${claims.map(renderClaimCard).join(\"\\n\")}</div>\n  </section>`;\n}\n\nconst REVIEW_CSS = `\n  * { box-sizing: border-box; }\n  body { margin: 0; font-family: var(--font-sans, system-ui, sans-serif); background: var(--background); color: var(--foreground); }\n  main { max-width: 1100px; margin: 0 auto; padding: 32px 20px 80px; }\n  h1, h2, h3, p { margin: 0; }\n  .review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }\n  .subtle { color: var(--muted-foreground); margin-top: 6px; }\n  .theme-toggle { background: var(--secondary); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 1.1rem; color: var(--foreground); }\n  .card, .claim-card, .summary-card, .panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius, 16px); }\n  .hero-card { padding: 24px; margin-bottom: 20px; }\n  .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }\n  .summary-card { padding: 14px 16px; }\n  .summary-card strong { display: block; font-size: 1.8rem; }\n  .priority-banner { padding: 18px 20px; margin-bottom: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--destructive) 10%, transparent), var(--card)); }\n  .panel { padding: 18px; margin-bottom: 24px; }\n  table { width: 100%; border-collapse: collapse; }\n  th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }\n  th { color: var(--muted-foreground); font-weight: 600; }\n  .band-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }\n  .band-uncovered { background: var(--destructive); }\n  .band-weak { background: var(--warning, #b58900); }\n  .band-covered { background: var(--success, #2e7d32); }\n  .toolbar { position: sticky; top: 12px; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; margin-bottom: 20px; }\n  .toolbar input { flex: 1 1 240px; border: 1px solid var(--border); border-radius: 999px; padding: 10px 14px; font: inherit; background: var(--background); color: var(--foreground); }\n  .toolbar button { border: 1px solid var(--border); background: var(--secondary); border-radius: 999px; padding: 10px 14px; font: inherit; cursor: pointer; color: var(--foreground); }\n  .toolbar button.active { background: var(--foreground); color: var(--background); }\n  .audience-section { margin-bottom: 28px; }\n  .audience-section h2 { margin-bottom: 12px; }\n  .count { color: var(--muted-foreground); font-weight: 400; }\n  .claim-list { display: grid; gap: 14px; }\n  .claim-card { padding: 18px; }\n  .claim-header h3 { margin-top: 8px; }\n  .source { color: var(--muted-foreground); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.85rem; margin-top: 4px; }\n  .ticket-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }\n  .ticket-pill { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; color: var(--muted-foreground); background: var(--background); font-size: 0.78rem; text-decoration: none; }\n  .ticket-pill:hover { color: var(--foreground); border-color: var(--muted-foreground); }\n  .strength-badge, .change-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; margin-right: 6px; }\n  .change-pill { background: var(--secondary); }\n  .strength-strong { background: color-mix(in srgb, var(--success, #2e7d32) 18%, transparent); color: var(--success, #2e7d32); }\n  .strength-moderate { background: color-mix(in srgb, var(--warning, #b58900) 20%, transparent); color: var(--warning, #b58900); }\n  .strength-weak { background: color-mix(in srgb, #d2691e 20%, transparent); color: #b5530a; }\n  .strength-none { background: color-mix(in srgb, var(--destructive) 16%, transparent); color: var(--destructive); }\n  .intent { margin: 12px 0; padding: 10px 12px; border-left: 3px solid var(--border); background: color-mix(in srgb, var(--card) 60%, var(--background)); border-radius: 6px; }\n  .intent-label { font-weight: 700; margin-right: 6px; }\n  .evidence-block { margin-top: 10px; }\n  .evidence-label { font-weight: 600; color: var(--muted-foreground); }\n  .reasons { margin: 6px 0 0; padding-left: 18px; }\n  .covers { color: var(--muted-foreground); margin-top: 8px; font-size: 0.9rem; }\n  .artifacts { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }\n  .shot { max-width: 280px; max-height: 200px; border: 1px solid var(--border); border-radius: 8px; }\n  .trace-note { color: var(--muted-foreground); }\n  .step-list { margin: 12px 0 0; padding-left: 18px; color: var(--muted-foreground); }\n  .code-diff h2 { margin-bottom: 6px; }\n  .code-diff a { color: var(--foreground); }\n  .diff-outline { margin: 12px 0; padding-left: 20px; }\n  .annotation { margin: 18px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb, var(--card) 60%, var(--background)); }\n  .annotation h4 { margin: 0 0 6px; }\n  .annotation-text { margin: 0 0 10px; }\n  .scenario-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }\n  .scenario-ref { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 0.82rem; text-decoration: none; color: var(--foreground); background: var(--background); }\n  .scenario-ref.unverified { color: var(--warning, #b58900); border-color: var(--warning, #b58900); }\n  .no-scenario { color: var(--warning, #b58900); font-size: 0.9rem; margin: 0 0 10px; }\n  .anchor-notice { color: var(--warning, #b58900); background: color-mix(in srgb, var(--warning, #b58900) 10%, transparent); border-radius: 6px; padding: 8px 10px; margin: 0; }\n  .diff-hunk { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }\n  .diff-file-header { padding: 6px 10px; background: var(--secondary); border-bottom: 1px solid var(--border); font-size: 0.85rem; }\n  .diff-table { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.82rem; }\n  .diff-table td { padding: 1px 8px; border-bottom: none; }\n  .diff-code { white-space: pre-wrap; word-break: break-all; }\n  .diff-ln { color: var(--muted-foreground); text-align: right; user-select: none; width: 1%; white-space: nowrap; }\n  .diff-sign { user-select: none; width: 1%; }\n  .diff-add { background: color-mix(in srgb, var(--success, #2e7d32) 12%, transparent); }\n  .diff-del { background: color-mix(in srgb, var(--destructive) 10%, transparent); }\n  .diff-anchored .diff-code { box-shadow: inset 3px 0 0 var(--primary, #2e7d32); }\n  .raw-patch { margin-top: 16px; }\n  .raw-patch pre { overflow-x: auto; background: var(--secondary); border-radius: 8px; padding: 12px; }\n`;\n\nconst JS_THEME_TOGGLE = `\nfunction getSystemTheme() { return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; }\nfunction getEffectiveTheme() { var s = localStorage.getItem('review-theme'); return (s === 'dark' || s === 'light') ? s : getSystemTheme(); }\nfunction toggleTheme() { var n = getEffectiveTheme() === 'dark' ? 'light' : 'dark'; localStorage.setItem('review-theme', n); applyTheme(n); }\nfunction applyTheme(t) {\n  document.documentElement.setAttribute('data-theme', t);\n  var b = document.querySelector('.theme-toggle');\n  if (b) { b.textContent = t === 'dark' ? '\\\\u2600\\\\ufe0f' : '\\\\ud83c\\\\udf19'; }\n}\n`;\n\nexport class ReviewHtmlFormatter {\n  private title: string;\n  private darkMode: boolean;\n\n  constructor(options: ReviewHtmlOptions = {}) {\n    this.title = options.title ?? \"Evidence Review\";\n    this.darkMode = options.darkMode ?? true;\n  }\n\n  format(review: ReviewResult): string {\n    const { summary, context } = review;\n\n    const priority =\n      summary.changedSourceFiles === 0\n        ? \"No changed source files supplied — showing claims and evidence only.\"\n        : summary.uncovered > 0\n          ? `${summary.uncovered} changed file(s) have no evidence. Review them first.`\n          : summary.weaklyCovered > 0\n            ? `No unaccounted-for changes. ${summary.weaklyCovered} file(s) are weakly covered.`\n            : \"Every changed source file is backed by at least moderate evidence.\";\n\n    const changedFilesPanel =\n      summary.changedSourceFiles > 0\n        ? `<section class=\"panel\">\n            <h2>Changed files</h2>\n            <table>\n              <thead><tr><th></th><th>File</th><th>Change</th><th>Evidence</th></tr></thead>\n              <tbody>${review.changedFiles.map(renderChangedFileRow).join(\"\")}</tbody>\n            </table>\n          </section>`\n        : \"\";\n\n    const themeToggleHtml = this.darkMode\n      ? `<button type=\"button\" class=\"theme-toggle\" onclick=\"toggleTheme()\" aria-label=\"Toggle theme\"></button>`\n      : \"\";\n    const themeInitJs = this.darkMode\n      ? `${JS_THEME_TOGGLE}\\napplyTheme(getEffectiveTheme());`\n      : \"\";\n    const themeAttr = this.darkMode ? ' data-theme=\"light\"' : \"\";\n\n    const refsLine =\n      context.baseRef || context.headRef\n        ? `<p class=\"subtle\">Comparing ${escapeHtml(context.baseRef ?? \"base\")} → ${escapeHtml(context.headRef ?? \"head\")}</p>`\n        : \"\";\n\n    return `<!doctype html>\n<html lang=\"en\"${themeAttr}>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    ${REPORT_FAVICON_LINK}\n    <title>${escapeHtml(this.title)}</title>\n    <style>\n      ${REPORT_THEME_CSS}\n      ${REVIEW_CSS}\n    </style>\n  </head>\n  <body>\n    <main>\n      <div class=\"hero-card card\">\n        <div class=\"review-header\">\n          <h1>${escapeHtml(this.title)}</h1>\n          ${themeToggleHtml}\n        </div>\n        ${refsLine}\n      </div>\n      <section class=\"summary-grid\">\n        <div class=\"summary-card\"><strong>${summary.uncovered}</strong><span>🔴 Uncovered</span></div>\n        <div class=\"summary-card\"><strong>${summary.weaklyCovered}</strong><span>🟡 Weak</span></div>\n        <div class=\"summary-card\"><strong>${summary.covered}</strong><span>🟢 Covered</span></div>\n        <div class=\"summary-card\"><strong>${summary.totalClaims}</strong><span>Claims</span></div>\n        <div class=\"summary-card\"><strong>${summary.byStrength.strong}</strong><span>Strong</span></div>\n        <div class=\"summary-card\"><strong>${summary.byStrength.weak + summary.byStrength.none}</strong><span>Weak/None</span></div>\n      </section>\n      <section class=\"card priority-banner\">\n        <h2>Review priority</h2>\n        <p class=\"subtle\">${escapeHtml(priority)}</p>\n      </section>\n      ${changedFilesPanel}\n      <div class=\"claims-region\">\n        <section class=\"toolbar\">\n          <input type=\"search\" placeholder=\"Filter claims by scenario, file, change-type\" aria-label=\"Filter claims\" />\n          <button type=\"button\" class=\"active\" data-filter=\"all\">All</button>\n          <button type=\"button\" data-filter=\"stakeholder\">Stakeholder</button>\n          <button type=\"button\" data-filter=\"engineer\">Engineer</button>\n          <button type=\"button\" data-filter=\"weak\">Weak/None</button>\n        </section>\n        ${renderAudienceSection(\"Stakeholder behaviour\", review.claims.filter((c) => c.audience === \"stakeholder\"))}\n        ${renderAudienceSection(\"Engineer changes\", review.claims.filter((c) => c.audience === \"engineer\"))}\n      </div>\n      ${review.codeDiffs.map((d, i) => renderCodeDiffSection(d, i)).join(\"\\n\")}\n    </main>\n    <script>\n      ${themeInitJs}\n      const input = document.querySelector('input[type=\"search\"]');\n      const buttons = Array.from(document.querySelectorAll('[data-filter]'));\n      const cards = Array.from(document.querySelectorAll('.claim-card'));\n      let activeFilter = 'all';\n      function applyFilters() {\n        const query = (input.value || '').trim().toLowerCase();\n        cards.forEach((card) => {\n          const audience = card.getAttribute('data-audience');\n          const strength = card.getAttribute('data-strength');\n          const haystack = card.getAttribute('data-search') || '';\n          let matchesFilter = activeFilter === 'all'\n            || audience === activeFilter\n            || (activeFilter === 'weak' && (strength === 'weak' || strength === 'none'));\n          const matchesSearch = !query || haystack.includes(query);\n          card.style.display = matchesFilter && matchesSearch ? '' : 'none';\n        });\n      }\n      input.addEventListener('input', applyFilters);\n      buttons.forEach((button) => {\n        button.addEventListener('click', () => {\n          activeFilter = button.getAttribute('data-filter');\n          buttons.forEach((b) => b.classList.toggle('active', b === button));\n          applyFilters();\n        });\n      });\n      applyFilters();\n    </script>\n  </body>\n</html>`;\n  }\n}\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\nexport interface DeploymentEntry {\n  environment: string;\n  tag?: string;\n  sha?: string;\n  runFile: string;\n  scenarioIds: string[];\n  scenarioStatuses?: Record<string, string>;\n  timestamp: string;\n  summary: {\n    total: number;\n    passed: number;\n    failed: number;\n    skipped: number;\n    pending: number;\n  };\n}\n\nexport interface DeploymentLedger {\n  deployments: DeploymentEntry[];\n  schemaVersion: 1;\n}\n\nexport function createEmptyLedger(): DeploymentLedger {\n  return {\n    deployments: [],\n    schemaVersion: 1,\n  };\n}\n\nexport function loadLedger(ledgerPath: string): DeploymentLedger {\n  const resolved = path.resolve(ledgerPath);\n  if (!fs.existsSync(resolved)) {\n    return createEmptyLedger();\n  }\n  try {\n    const raw = JSON.parse(fs.readFileSync(resolved, \"utf8\"));\n    if (raw.schemaVersion !== 1) {\n      throw new Error(`Unsupported ledger schemaVersion: ${raw.schemaVersion}`);\n    }\n    return raw as DeploymentLedger;\n  } catch (err) {\n    const msg = err instanceof Error ? err.message : String(err);\n    throw new Error(`Failed to load deployment ledger at ${resolved}: ${msg}`, { cause: err });\n  }\n}\n\nexport function saveLedger(ledger: DeploymentLedger, ledgerPath: string): void {\n  const resolved = path.resolve(ledgerPath);\n  const dir = path.dirname(resolved);\n  fs.mkdirSync(dir, { recursive: true });\n  fs.writeFileSync(resolved, JSON.stringify(ledger, null, 2), \"utf8\");\n}\n\nexport function getLatestDeployment(\n  ledger: DeploymentLedger,\n  environment: string,\n): DeploymentEntry | undefined {\n  return [...ledger.deployments]\n    .reverse()\n    .find((d) => d.environment === environment);\n}\n","import type { TestRunResult } from \"executable-stories-core/types/test-result\";\nimport {\n  type DeploymentEntry,\n  getLatestDeployment,\n  loadLedger,\n  saveLedger,\n} from \"./ledger\";\n\nexport interface RecordDeploymentArgs {\n  run: TestRunResult;\n  environment: string;\n  tag?: string;\n  ledgerPath: string;\n  runFilePath: string;\n}\n\nexport interface RecordDeploymentResult {\n  entry: DeploymentEntry;\n  ledgerPath: string;\n}\n\nexport function recordDeployment(args: RecordDeploymentArgs): RecordDeploymentResult {\n  const ledger = loadLedger(args.ledgerPath);\n\n  const previous = getLatestDeployment(ledger, args.environment);\n\n  const entry: DeploymentEntry = {\n    environment: args.environment,\n    tag: args.tag,\n    sha: args.run.gitSha,\n    runFile: args.runFilePath,\n    scenarioIds: args.run.testCases.map((tc) => tc.id),\n    scenarioStatuses: Object.fromEntries(args.run.testCases.map((tc) => [tc.id, tc.status])),\n    timestamp: new Date(args.run.finishedAtMs).toISOString(),\n    summary: countStatuses(args.run),\n  };\n\n  ledger.deployments.push(entry);\n\n  if (previous) {\n    const previousIds = new Set(previous.scenarioIds);\n    const added = entry.scenarioIds.filter((id) => !previousIds.has(id)).length;\n    const removed = previous.scenarioIds.filter((id) => !entry.scenarioIds.includes(id)).length;\n    if (added > 0 || removed > 0) {\n      // Log drift info but don't block — informative only\n    }\n  }\n\n  saveLedger(ledger, args.ledgerPath);\n\n  return { entry, ledgerPath: args.ledgerPath };\n}\n\nexport interface DeploymentStatus {\n  environments: Record<\n    string,\n    {\n      latest: DeploymentEntry;\n      previousDeployment?: DeploymentEntry;\n    }\n  >;\n  ledgerPath: string;\n}\n\nexport function getDeploymentStatus(ledgerPath: string): DeploymentStatus {\n  const ledger = loadLedger(ledgerPath);\n  const environments: DeploymentStatus[\"environments\"] = {};\n\n  for (const entry of ledger.deployments) {\n    environments[entry.environment] = {\n      latest: entry,\n      previousDeployment: environments[entry.environment]?.latest,\n    };\n  }\n\n  return { environments, ledgerPath };\n}\n\nexport interface EnvironmentDrift {\n  environmentA: string;\n  environmentB: string;\n  onlyInA: string[];\n  onlyInB: string[];\n  inBoth: string[];\n  statusChanged: Array<{\n    id: string;\n    statusA: string;\n    statusB: string;\n  }>;\n  aEntry: DeploymentEntry;\n  bEntry: DeploymentEntry;\n}\n\nexport function getEnvironmentDrift(\n  ledgerPath: string,\n  envA: string,\n  envB: string,\n): EnvironmentDrift {\n  const ledger = loadLedger(ledgerPath);\n  const aEntry = getLatestDeployment(ledger, envA);\n  const bEntry = getLatestDeployment(ledger, envB);\n\n  if (!aEntry) {\n    throw new Error(`No deployment found for environment \"${envA}\"`);\n  }\n  if (!bEntry) {\n    throw new Error(`No deployment found for environment \"${envB}\"`);\n  }\n\n  const aIds = new Set(aEntry.scenarioIds);\n  const bIds = new Set(bEntry.scenarioIds);\n\n  const onlyInA = aEntry.scenarioIds.filter((id) => !bIds.has(id));\n  const onlyInB = bEntry.scenarioIds.filter((id) => !aIds.has(id));\n  const inBoth = aEntry.scenarioIds.filter((id) => bIds.has(id));\n  const statusChanged = inBoth\n    .map((id) => ({\n      id,\n      statusA: aEntry.scenarioStatuses?.[id] ?? \"unknown\",\n      statusB: bEntry.scenarioStatuses?.[id] ?? \"unknown\",\n    }))\n    .filter((item) => item.statusA !== item.statusB);\n\n  return { environmentA: envA, environmentB: envB, onlyInA, onlyInB, inBoth, statusChanged, aEntry, bEntry };\n}\n\nfunction countStatuses(run: TestRunResult): DeploymentEntry[\"summary\"] {\n  const summary = { total: 0, passed: 0, failed: 0, skipped: 0, pending: 0 };\n  for (const tc of run.testCases) {\n    summary.total++;\n    if (tc.status in summary) {\n      summary[tc.status as keyof typeof summary]++;\n    }\n  }\n  return summary;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,IAAAA,SAAsB;AAEtB,IAAAC,cAA4B;AAK5B,IAAAC,uBAAgC;;;AC0EzB,SAAS,mBAAmB,IAAsC;AACvE,SAAO;AAAA,IACL,IAAI,GAAG;AAAA,IACP,UAA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EzB,QAAiB,kBAAM,WAAW,EAAE,WAAW,KAAK,CAAC;AAErD,aAAW,UAAU,KAAK,SAAS;AAGjC,UAAM,MAAM,WAAW,SAAS,UAAU,WAAW,cAAc,kBAAkB;AACrF,UAAM,aAAaC,SAAa,YAAK,WAAW,GAAG,UAAU,GAAG,GAAG,EAAE,CAAC;AACtE,UAAM,UACJ,WAAW,SACP,IAAI,qBAAqB,EAAE,OAAO,KAAK,MAAM,CAAC,EAAE,OAAO,IAAI,IAC3D,WAAW,cACT,IAAI,0BAA0B,EAAE,OAAO,IAAI,IAC3C,IAAI,yBAAyB,EAAE,OAAO,KAAK,MAAM,CAAC,EAAE,OAAO,IAAI;AACvE,UAAiB,sBAAU,YAAY,SAAS,MAAM;AACtD,UAAM,KAAK,UAAU;AAAA,EACvB;AAEA,SAAO,EAAE,OAAO,KAAK;AACvB;AAkFO,SAAS,qBACd,aACA,cACA,gBACA,qBACe;AACf,QAAM,MAAc,aAAa,aAAa,cAAc,cAAc;AAC1E,aAAO,sCAAgB,KAAK,mBAAmB;AACjD;AAOO,SAAS,uBACd,aACA,gBACA,qBACe;AACf,QAAM,MAAc,eAAe,aAAa,cAAc;AAC9D,aAAO,sCAAgB,KAAK,mBAAmB;AACjD;AAOO,SAAS,2BACd,aACA,gBACA,qBACe;AACf,QAAM,MAAc,mBAAmB,aAAa,cAAc;AAClE,aAAO,sCAAgB,KAAK,mBAAmB;AACjD;","names":["path","fsPromises","import_canonicalize","text","formatSteps","formatDocs","formatStep","formatDocEntry","import_ids","text","remote","count","bucket","escapeCell","text","link","resolve","text","DEFAULT_MAX_ATTACHMENT_BYTES","PAGE_LIMIT","text","config","provider","import_story_report","import_tokens","import_canonicalize","import_ids","import_assert_never","import_ids","scenarioLine","statusMap","import_story_report","summarize","import_story_report","pad","text","import_story_report","path","fs","path","path","fs","fsPromises","import_story_report","import_assert_never","indent","import_executable_stories_core","import_assert_never","import_assertive_steps","isLocalFsPath","groupBy","indent","import_node_crypto","import_executable_stories_core","import_node_crypto","path","path","strong","path","text","heading","path","escapePipe","basename","scenarioLine","import_assert_never","import_node_crypto","text","table","import_assert_never","table","path","resolve","import_report_favicon","escapeHtml","path","import_node_path","path","testCases","count","resolve","count","import_source_file","import_assert_never","groupBy","fs","path","fs","path","fs","path","toPosix","htmlPaths","import_executable_stories_core","import_node_path","path","run","import_node_path","readFileReports","path","count","text","import_story_report","parseAdf","basicAuthHeader","parseErrorBody","fs","path","import_duration","fs","path","text","text","formatDuration","truncate","text","formatDuration","import_node_crypto","buildSummary","toCIInfo","lines","firstLine","path","path","bucket","statusIcon","escapeCell","firstLine","import_report_favicon","escapeHtml","statusIcon","formatStep","MAX_PATCH_EMBED_BYTES","path","renderAudienceSection","JS_THEME_TOGGLE","fs","path","toPosix"]}